about summary refs log tree commit diff
path: root/pkgs/applications/editors/mg
diff options
context:
space:
mode:
authorZef Hemel <zef@zef.me>2013-07-30 15:53:00 +0200
committerBjørn Forsman <bjorn.forsman@gmail.com>2013-07-30 20:24:28 +0200
commitb92b8dce05d90554accad3b1a19add327b9d314b (patch)
tree3a626f5b235f9c0a99b925428c1adebc7bf3841b /pkgs/applications/editors/mg
parentf3a17b04e630336a0e86af98ae0328797b554312 (diff)
downloadnixlib-b92b8dce05d90554accad3b1a19add327b9d314b.tar
nixlib-b92b8dce05d90554accad3b1a19add327b9d314b.tar.gz
nixlib-b92b8dce05d90554accad3b1a19add327b9d314b.tar.bz2
nixlib-b92b8dce05d90554accad3b1a19add327b9d314b.tar.lz
nixlib-b92b8dce05d90554accad3b1a19add327b9d314b.tar.xz
nixlib-b92b8dce05d90554accad3b1a19add327b9d314b.tar.zst
nixlib-b92b8dce05d90554accad3b1a19add327b9d314b.zip
MicroGNUEmacs, a.k.a. MG
Diffstat (limited to 'pkgs/applications/editors/mg')
-rw-r--r--pkgs/applications/editors/mg/configure.patch35
-rw-r--r--pkgs/applications/editors/mg/default.nix30
2 files changed, 65 insertions, 0 deletions
diff --git a/pkgs/applications/editors/mg/configure.patch b/pkgs/applications/editors/mg/configure.patch
new file mode 100644
index 000000000000..11105299eb4b
--- /dev/null
+++ b/pkgs/applications/editors/mg/configure.patch
@@ -0,0 +1,35 @@
+--- configure.old	2013-07-30 19:42:51.000000000 +0200
++++ configure	2013-07-30 19:47:26.000000000 +0200
+@@ -163,31 +163,7 @@
+     echo 'Fails.'
+ fi
+ 
+-
+-if [ ! -r /usr/include/term.h ]; then
+-    note 'term.h'
+-    if [ -r /usr/include/ncurses/term.h ]; then
+-	echo "Found in /usr/include/ncurses"
+-	extraflags="$extraflags -I/usr/include/ncurses"
+-    else
+-	for i in pkg local; do
+-	    if [ -r /usr/$i/include/term.h ]; then
+-		echo "Found in /usr/$i/include"
+-		extralibs="$extralibs -L/usr/$i/lib"
+-		extraflags="$extraflags -I/usr/$i/include"
+-		break
+-	    else
+-		false
+-	    fi
+-	done ||
+-	{
+-	    echo 'Not found!' >&2
+-	    echo 'Do you have the ncurses devel package installed?' >&2
+-	    echo 'If you know where term.h is, please email the author!' >&2
+-	    exit 1
+-	}
+-    fi
+-fi
++extraflags="$extraflags $NIX_CFLAGS_COMPILE"
+ 
+ note 'base and dirname'
+ if gcc_defines "__GLIBC__" || gcc_defines "__CYGWIN__" ; then
diff --git a/pkgs/applications/editors/mg/default.nix b/pkgs/applications/editors/mg/default.nix
new file mode 100644
index 000000000000..ce69b5c0b5ae
--- /dev/null
+++ b/pkgs/applications/editors/mg/default.nix
@@ -0,0 +1,30 @@
+{ fetchurl, stdenv, ncurses }:
+stdenv.mkDerivation rec {
+  name = "mg-20110905";
+
+  src = fetchurl {
+    url = http://homepage.boetes.org/software/mg/mg-20110905.tar.gz;
+    sha256 = "0ac2c7wy5kkcflm7cmiqm5xhb5c4yfw3i33iln8civ1yd9z7vlqw";
+  };
+
+  dontAddPrefix = true;
+
+  patches = [ ./configure.patch ];
+  patchFlags = "-p0";
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp mg $out/bin
+    mkdir -p $out/share/man/man1
+    cp mg.1 $out/share/man/man1
+  '';
+
+  buildInputs = [ ncurses ];
+
+  meta = {
+    homepage = http://homepage.boetes.org/software/mg/;
+    description = "mg is Micro GNU/emacs, this is a portable version of the mg maintained by the OpenBSD team.";
+    license = "public domain";
+    platforms = stdenv.lib.platforms.all;
+  };
+}