diff --git a/pkgs/tools/compression/ncompress/builder.sh b/pkgs/tools/compression/ncompress/builder.sh new file mode 100644 index 000000000000..fb0824d8a28c --- /dev/null +++ b/pkgs/tools/compression/ncompress/builder.sh @@ -0,0 +1,14 @@ +source $stdenv/setup +installFlags="PREFIX=$out" + +preBuild() { + cp Makefile.def Makefile +} + +postInstall() { + rm $out/bin/uncompress* $out/bin/zcat* + ln -s compress $out/bin/uncompress + ln -s compress $out/bin/zcat +} + +genericBuild diff --git a/pkgs/tools/compression/ncompress/default.nix b/pkgs/tools/compression/ncompress/default.nix new file mode 100644 index 000000000000..33edf9bb84ed --- /dev/null +++ b/pkgs/tools/compression/ncompress/default.nix @@ -0,0 +1,18 @@ +{stdenv, fetchurl}: + +stdenv.mkDerivation { + name = "ncompress-4.2.4"; + + builder = ./builder.sh; + + patches = [ ./makefile.patch ]; + + src = fetchurl { + url = mirror://sourceforge/project/ncompress/ncompress%20%28bugfixes%29/ncompress-4.2.4.2/ncompress-4.2.4.2.tar.gz; + sha256 = "38158c792b769fe23c74f8d3ea0e27569a9b1d21b53a4faf8acbb1ac03743221"; + }; + + meta = { + homepage = http://sourceforge.net/projects/ncompress/files/ncompress%20%28bugfixes%29/ncompress-4.2.4.2/ncompress-4.2.4.2.tar.gz/download; + }; +} diff --git a/pkgs/tools/compression/ncompress/makefile.patch b/pkgs/tools/compression/ncompress/makefile.patch new file mode 100644 index 000000000000..49aa4e65c768 --- /dev/null +++ b/pkgs/tools/compression/ncompress/makefile.patch @@ -0,0 +1,31 @@ +diff -Naur ncompress-4.2.4.2.orig/Makefile.def ncompress-4.2.4.2/Makefile.def +--- ncompress-4.2.4.2.orig/Makefile.def 2007-09-06 22:28:42.000000000 -0500 ++++ ncompress-4.2.4.2/Makefile.def 2009-08-18 12:30:53.000000000 -0500 +@@ -3,14 +3,16 @@ + # C complier + #CC=cc + ++PREFIX=/usr/local ++ + # Install prefix + DESTDIR= + + # Install directory for binarys +-BINDIR=/usr/local/bin ++BINDIR=$(PREFIX)/bin + + # Install directory for manual +-MANDIR=/usr/local/man/man1 ++MANDIR=$(PREFIX)/man/man1 + + # compiler options: + # options is a collection of: +@@ -31,7 +33,7 @@ + # -DDEF_ERRNO=1 Define error (not defined in errno.h). + # -DMAXSEG_64K=1 -BITS=16 Support segment processsor like 80286. + # +-options= $(CFLAGS) $(CPPFLAGS) -DDIRENT=1 -DUSERMEM=800000 -DREGISTERS=3 ++options= $(CFLAGS) $(CPPFLAGS) -DDIRENT=1 -DUSERMEM=800000 -DREGISTERS=3 -DNOFUNCDEF=1 + + # libary options + LBOPT= $(LDFLAGS) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f44dc0a0ac0f..ee520acddfc1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -442,6 +442,10 @@ let inherit fetchurl stdenv; }; + ncompress = import ../tools/compression/ncompress { + inherit fetchurl stdenv; + }; + bzip2 = useFromStdenv "bzip2" (import ../tools/compression/bzip2 { inherit fetchurl stdenv;