Added transfig, opefully the ugliest package of this world

svn path=/nixpkgs/trunk/; revision=5751

+178
+43
pkgs/tools/graphics/transfig/builder.sh
··· 1 + source $stdenv/setup 2 + 3 + patchPhase=patchPhase 4 + patchPhase() { 5 + for i in $patches; do 6 + header "applying patch $i" 3 7 + patch -p0 < $i || fail 8 + stopNest 9 + done 10 + 11 + configureImakefiles "s:__PREFIX_PNG:$libpng:" 12 + configureImakefiles "s:__PREFIX:$out:" 13 + } 14 + 15 + configureImakefiles() { 16 + local sedcmd=$1 17 + 18 + sed "${sedcmd}" fig2dev/Imakefile > tmpsed 19 + cp tmpsed fig2dev/Imakefile 20 + 21 + sed "${sedcmd}" fig2dev/dev/Imakefile > tmpsed 22 + cp tmpsed fig2dev/dev/Imakefile 23 + 24 + sed "${sedcmd}" transfig/Imakefile > tmpsed 25 + cp tmpsed transfig/Imakefile 26 + } 27 + 28 + buildPhase=buildPhase 29 + buildPhase() { 30 + xmkmf 31 + make Makefiles 32 + make 33 + } 34 + 35 + preInstall=preInstall 36 + preInstall() { 37 + ensureDir $out 38 + ensureDir $out/lib 39 + } 40 + 41 + genericBuild 42 + 43 +
+40
pkgs/tools/graphics/transfig/default.nix
··· 1 + {stdenv, fetchurl, zlib, libjpeg, libpng, imake}: 2 + 3 + stdenv.mkDerivation rec { 4 + name = "transfig-3.2.4"; 5 + builder = ./builder.sh; 6 + src = fetchurl { 7 + url = ftp://ftp.tex.ac.uk/pub/archive/graphics/transfig/transfig.3.2.4.tar.gz; 8 + md5 = "742de0f7a3cae74d247bbd0c70dd9dd7"; 9 + }; 10 + 11 + buildInputs = [zlib libjpeg libpng imake]; 12 + inherit libpng; 13 + 14 + patches = [prefixPatch1 prefixPatch2 prefixPatch3 varargsPatch gensvgPatch]; 15 + 16 + prefixPatch1 = 17 + ./patch-fig2dev-dev-Imakefile; 18 + 19 + prefixPatch2 = 20 + ./patch-fig2dev-Imakefile; 21 + 22 + prefixPatch3 = 23 + fetchurl { 24 + url = "http://www.darwinports.org/darwinports/dports/print/transfig/files/patch-transfig-Imakefile"; 25 + md5 = "1cfe0df7d3448f6ff914a7a2d85e6f50"; 26 + }; 27 + 28 + varargsPatch = 29 + fetchurl { 30 + url = "http://www.darwinports.org/darwinports/dports/print/transfig/files/patch-fig2dev-fig2dev.h"; 31 + md5 = "da3cd4f9bee619818c890c5692f042c1"; 32 + }; 33 + 34 + gensvgPatch = 35 + fetchurl { 36 + url = "http://www.darwinports.org/darwinports/dports/print/transfig/files/patch-fig2dev-dev-gensvg.c"; 37 + md5 = "66a97cbfc313be48183beeeb950e2c86"; 38 + }; 39 + 40 + }
+75
pkgs/tools/graphics/transfig/patch-fig2dev-Imakefile
··· 1 + --- fig2dev/Imakefile.orig Thu Mar 25 22:39:10 2004 2 + +++ fig2dev/Imakefile Thu Mar 25 22:41:01 2004 3 + @@ -16,17 +16,23 @@ 4 + XCOMM party to do so, with the only requirement being that this copyright 5 + XCOMM notice remain intact. 6 + 7 + +BINDIR = __PREFIX/bin 8 + +DESTDIR = __DESTROOT 9 + +MKDIRHIER = mkdirhier 10 + +MANDIR = __PREFIX/share/man/$(MANSUFFIX) 11 + +INSTALLFLAGS = -c 12 + + 13 + XCOMM ****** 14 + XCOMM You should point XFIGLIBDIR to the same directory you did when you compiled 15 + XCOMM and installed xfig. 16 + 17 + -XFIGLIBDIR = /usr/local/lib/X11/xfig 18 + +XFIGLIBDIR = __PREFIX/lib/xfig 19 + 20 + XCOMM ****** 21 + XCOMM If your system has the strerror() function (doesn't have sys_errlist) then 22 + XCOMM comment out NEED_STRERROR with an XCOMM comment. 23 + 24 + -NEED_STRERROR = -DNEED_STRERROR 25 + +XCOMM NEED_STRERROR = -DNEED_STRERROR 26 + 27 + XCOMM The following probably only applies to Windows 9x/NT: 28 + XCOMM If your system can open files in text and binary modes and has the 29 + @@ -39,7 +45,7 @@ 30 + XCOMM inline functions. With the "INLINE" keyword, you should notice that 31 + XCOMM the display will be a bit faster in complex figures 32 + 33 + -XCOMM USEINLINE = -DUSE_INLINE 34 + +USEINLINE = -DUSE_INLINE 35 + 36 + XCOMM **************** 37 + XCOMM Change RGB if necessary, to point to your rgb.txt color database 38 + @@ -60,8 +66,8 @@ 39 + XCOMM are in different places 40 + 41 + #ifdef USEPNG 42 + -PNGLIBDIR = $(USRLIBDIR) 43 + -PNGINC = -I/usr/include/X11 44 + +PNGLIBDIR = __PREFIX_PNG/lib 45 + +PNGINC = -I__PREFIX_PNG/include 46 + #endif 47 + 48 + XCOMM **************** 49 + @@ -73,7 +79,7 @@ 50 + XCOMM Change XPMINC if necessary to point to the include file for xpm (xpm.h) 51 + XCOMM 52 + 53 + -XCOMM #define USEXPM 54 + +XCOMM #define USEXPM 55 + 56 + #ifdef USEXPM 57 + XPMLIBDIR = $(USRLIBDIR) 58 + @@ -126,7 +132,7 @@ 59 + 60 + #ifdef I18N 61 + I18N_DEFS = -DI18N 62 + -FIG2DEV_LIBDIR = /usr/local/lib/fig2dev 63 + +FIG2DEV_LIBDIR = __PREFIX/lib/fig2dev 64 + I18N_DEV_DEFS = $(I18N_DEFS) -DFIG2DEV_LIBDIR=\\\"$(FIG2DEV_LIBDIR)\\\" 65 + 66 + install:: 67 + @@ -177,7 +183,7 @@ 68 + 69 + IMAKE_DEFINES = $(DUSEPNG) $(DUSEXPM) 70 + 71 + -DEVDEFINES = $(DUSEPNG) $(DUSEXPM) $(XPMINC) $(DDNFSS) $(DDA4) \ 72 + +DEVDEFINES = $(DUSEPNG) $(DUSEXPM) $(PNGINC) $(XPMINC) $(DDNFSS) $(DDA4) \ 73 + $(DDLATEX2E_GRAPHICS) $(DDEPSFIG) $(DDIBMGEC) $(DDDVIPS) $(I18N_DEV_DEFS) 74 + 75 + #define IHaveSubdirs
+15
pkgs/tools/graphics/transfig/patch-fig2dev-dev-Imakefile
··· 1 + --- fig2dev/dev/Imakefile.orig Thu Mar 25 22:47:18 2004 2 + +++ fig2dev/dev/Imakefile Thu Mar 25 22:47:51 2004 3 + @@ -18,6 +18,12 @@ 4 + XCOMM party to do so, with the only requirement being that this copyright 5 + XCOMM notice remain intact. 6 + 7 + +BINDIR = __PREFIX/bin 8 + +USRLIBDIR = __PREFIX/lib 9 + +DESTDIR = __DESTROOT 10 + +MKDIRHIER = mkdirhier 11 + +MANDIR = __PREFIX/share/man/$(MANSUFFIX) 12 + + 13 + INCLUDES = -I.. -I../.. 14 + 15 + #ifdef USE_PNG
+5
pkgs/top-level/all-packages.nix
··· 314 314 inherit fetchurl stdenv pkgconfig libexif popt; 315 315 }; 316 316 317 + transfig = (import ../tools/graphics/transfig) { 318 + inherit fetchurl stdenv libpng libjpeg zlib; 319 + inherit (xlibs) imake; 320 + }; 321 + 317 322 hevea = (import ../tools/typesetting/hevea) { 318 323 inherit fetchurl stdenv ocaml; 319 324 };