Added transfig, opefully the ugliest package of this world

svn path=/nixpkgs/trunk/; revision=5751
This commit is contained in:
Martin Bravenboer 2006-07-17 20:35:02 +00:00
parent 512ba2d502
commit bb3cfbe2a3
5 changed files with 178 additions and 0 deletions

View File

@ -0,0 +1,43 @@
source $stdenv/setup
patchPhase=patchPhase
patchPhase() {
for i in $patches; do
header "applying patch $i" 3
patch -p0 < $i || fail
stopNest
done
configureImakefiles "s:__PREFIX_PNG:$libpng:"
configureImakefiles "s:__PREFIX:$out:"
}
configureImakefiles() {
local sedcmd=$1
sed "${sedcmd}" fig2dev/Imakefile > tmpsed
cp tmpsed fig2dev/Imakefile
sed "${sedcmd}" fig2dev/dev/Imakefile > tmpsed
cp tmpsed fig2dev/dev/Imakefile
sed "${sedcmd}" transfig/Imakefile > tmpsed
cp tmpsed transfig/Imakefile
}
buildPhase=buildPhase
buildPhase() {
xmkmf
make Makefiles
make
}
preInstall=preInstall
preInstall() {
ensureDir $out
ensureDir $out/lib
}
genericBuild

View File

@ -0,0 +1,40 @@
{stdenv, fetchurl, zlib, libjpeg, libpng, imake}:
stdenv.mkDerivation rec {
name = "transfig-3.2.4";
builder = ./builder.sh;
src = fetchurl {
url = ftp://ftp.tex.ac.uk/pub/archive/graphics/transfig/transfig.3.2.4.tar.gz;
md5 = "742de0f7a3cae74d247bbd0c70dd9dd7";
};
buildInputs = [zlib libjpeg libpng imake];
inherit libpng;
patches = [prefixPatch1 prefixPatch2 prefixPatch3 varargsPatch gensvgPatch];
prefixPatch1 =
./patch-fig2dev-dev-Imakefile;
prefixPatch2 =
./patch-fig2dev-Imakefile;
prefixPatch3 =
fetchurl {
url = "http://www.darwinports.org/darwinports/dports/print/transfig/files/patch-transfig-Imakefile";
md5 = "1cfe0df7d3448f6ff914a7a2d85e6f50";
};
varargsPatch =
fetchurl {
url = "http://www.darwinports.org/darwinports/dports/print/transfig/files/patch-fig2dev-fig2dev.h";
md5 = "da3cd4f9bee619818c890c5692f042c1";
};
gensvgPatch =
fetchurl {
url = "http://www.darwinports.org/darwinports/dports/print/transfig/files/patch-fig2dev-dev-gensvg.c";
md5 = "66a97cbfc313be48183beeeb950e2c86";
};
}

View File

@ -0,0 +1,75 @@
--- fig2dev/Imakefile.orig Thu Mar 25 22:39:10 2004
+++ fig2dev/Imakefile Thu Mar 25 22:41:01 2004
@@ -16,17 +16,23 @@
XCOMM party to do so, with the only requirement being that this copyright
XCOMM notice remain intact.
+BINDIR = __PREFIX/bin
+DESTDIR = __DESTROOT
+MKDIRHIER = mkdirhier
+MANDIR = __PREFIX/share/man/$(MANSUFFIX)
+INSTALLFLAGS = -c
+
XCOMM ******
XCOMM You should point XFIGLIBDIR to the same directory you did when you compiled
XCOMM and installed xfig.
-XFIGLIBDIR = /usr/local/lib/X11/xfig
+XFIGLIBDIR = __PREFIX/lib/xfig
XCOMM ******
XCOMM If your system has the strerror() function (doesn't have sys_errlist) then
XCOMM comment out NEED_STRERROR with an XCOMM comment.
-NEED_STRERROR = -DNEED_STRERROR
+XCOMM NEED_STRERROR = -DNEED_STRERROR
XCOMM The following probably only applies to Windows 9x/NT:
XCOMM If your system can open files in text and binary modes and has the
@@ -39,7 +45,7 @@
XCOMM inline functions. With the "INLINE" keyword, you should notice that
XCOMM the display will be a bit faster in complex figures
-XCOMM USEINLINE = -DUSE_INLINE
+USEINLINE = -DUSE_INLINE
XCOMM ****************
XCOMM Change RGB if necessary, to point to your rgb.txt color database
@@ -60,8 +66,8 @@
XCOMM are in different places
#ifdef USEPNG
-PNGLIBDIR = $(USRLIBDIR)
-PNGINC = -I/usr/include/X11
+PNGLIBDIR = __PREFIX_PNG/lib
+PNGINC = -I__PREFIX_PNG/include
#endif
XCOMM ****************
@@ -73,7 +79,7 @@
XCOMM Change XPMINC if necessary to point to the include file for xpm (xpm.h)
XCOMM
-XCOMM #define USEXPM
+XCOMM #define USEXPM
#ifdef USEXPM
XPMLIBDIR = $(USRLIBDIR)
@@ -126,7 +132,7 @@
#ifdef I18N
I18N_DEFS = -DI18N
-FIG2DEV_LIBDIR = /usr/local/lib/fig2dev
+FIG2DEV_LIBDIR = __PREFIX/lib/fig2dev
I18N_DEV_DEFS = $(I18N_DEFS) -DFIG2DEV_LIBDIR=\\\"$(FIG2DEV_LIBDIR)\\\"
install::
@@ -177,7 +183,7 @@
IMAKE_DEFINES = $(DUSEPNG) $(DUSEXPM)
-DEVDEFINES = $(DUSEPNG) $(DUSEXPM) $(XPMINC) $(DDNFSS) $(DDA4) \
+DEVDEFINES = $(DUSEPNG) $(DUSEXPM) $(PNGINC) $(XPMINC) $(DDNFSS) $(DDA4) \
$(DDLATEX2E_GRAPHICS) $(DDEPSFIG) $(DDIBMGEC) $(DDDVIPS) $(I18N_DEV_DEFS)
#define IHaveSubdirs

View File

@ -0,0 +1,15 @@
--- fig2dev/dev/Imakefile.orig Thu Mar 25 22:47:18 2004
+++ fig2dev/dev/Imakefile Thu Mar 25 22:47:51 2004
@@ -18,6 +18,12 @@
XCOMM party to do so, with the only requirement being that this copyright
XCOMM notice remain intact.
+BINDIR = __PREFIX/bin
+USRLIBDIR = __PREFIX/lib
+DESTDIR = __DESTROOT
+MKDIRHIER = mkdirhier
+MANDIR = __PREFIX/share/man/$(MANSUFFIX)
+
INCLUDES = -I.. -I../..
#ifdef USE_PNG

View File

@ -314,6 +314,11 @@ rec {
inherit fetchurl stdenv pkgconfig libexif popt;
};
transfig = (import ../tools/graphics/transfig) {
inherit fetchurl stdenv libpng libjpeg zlib;
inherit (xlibs) imake;
};
hevea = (import ../tools/typesetting/hevea) {
inherit fetchurl stdenv ocaml;
};