2006-07-17 20:35:02 +00:00
|
|
|
{stdenv, fetchurl, zlib, libjpeg, libpng, imake}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "transfig-3.2.4";
|
|
|
|
src = fetchurl {
|
2007-08-24 12:32:36 +00:00
|
|
|
url = ftp://ftp.tex.ac.uk/pub/archive/graphics/transfig/transfig.3.2.4.tar.gz;
|
2014-10-12 14:13:21 +00:00
|
|
|
sha256 = "0429snhp5acbz61pvblwlrwv8nxr6gf12p37f9xxwrkqv4ir7dd4";
|
2006-07-17 20:35:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [zlib libjpeg libpng imake];
|
|
|
|
|
2017-09-21 22:23:39 +00:00
|
|
|
patches = [
|
|
|
|
./patch-fig2dev-dev-Imakefile
|
|
|
|
./patch-fig2dev-Imakefile
|
|
|
|
./patch-transfig-Imakefile
|
|
|
|
./patch-fig2dev-fig2dev.h
|
|
|
|
./patch-fig2dev-dev-gensvg.c
|
|
|
|
];
|
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
runHook prePatch
|
|
|
|
|
|
|
|
configureImakefiles() {
|
|
|
|
local sedcmd=$1
|
|
|
|
|
|
|
|
sed "$sedcmd" fig2dev/Imakefile > tmpsed
|
|
|
|
cp tmpsed fig2dev/Imakefile
|
2015-12-23 01:59:47 +00:00
|
|
|
|
2017-09-21 22:23:39 +00:00
|
|
|
sed "$sedcmd" fig2dev/dev/Imakefile > tmpsed
|
|
|
|
cp tmpsed fig2dev/dev/Imakefile
|
2006-07-17 20:35:02 +00:00
|
|
|
|
2017-09-21 22:23:39 +00:00
|
|
|
sed "$sedcmd" transfig/Imakefile > tmpsed
|
|
|
|
cp tmpsed transfig/Imakefile
|
|
|
|
}
|
2006-07-17 20:35:02 +00:00
|
|
|
|
2017-09-21 22:23:39 +00:00
|
|
|
for i in $patches; do
|
|
|
|
header "applying patch $i" 3
|
|
|
|
patch -p0 < $i
|
|
|
|
stopNest
|
|
|
|
done
|
2006-07-17 20:35:02 +00:00
|
|
|
|
2017-09-21 22:23:39 +00:00
|
|
|
configureImakefiles "s:__PREFIX_PNG:${libpng}:"
|
|
|
|
configureImakefiles "s:__PREFIX:$out:"
|
2006-07-17 20:35:02 +00:00
|
|
|
|
2017-09-21 22:23:39 +00:00
|
|
|
runHook postPatch
|
|
|
|
'';
|
2006-07-17 20:35:02 +00:00
|
|
|
|
2017-09-21 22:23:39 +00:00
|
|
|
preBuild = ''
|
|
|
|
xmkmf
|
|
|
|
make Makefiles
|
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = [ "CC=cc" ];
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
mkdir -p $out
|
|
|
|
mkdir -p $out/lib
|
|
|
|
'';
|
|
|
|
|
|
|
|
hardeningDisable = [ "format" ];
|
2016-08-02 16:06:29 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
platforms = stdenv.lib.platforms.unix;
|
|
|
|
};
|
2006-07-17 20:35:02 +00:00
|
|
|
}
|