2010-01-13 22:16:12 +01:00
|
|
|
{stdenv, fetchsvn, libjpeg, libpng, flex, zlib, perl, libxml2, makeWrapper }:
|
2009-02-25 23:44:08 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2010-04-06 15:24:46 +02:00
|
|
|
name = "netpbm-advanced-1177";
|
2009-02-25 23:44:08 +01:00
|
|
|
|
|
|
|
src = fetchsvn {
|
|
|
|
url = https://netpbm.svn.sourceforge.net/svnroot/netpbm/advanced;
|
2010-04-06 15:24:46 +02:00
|
|
|
rev = 1177;
|
|
|
|
sha256 = "d8893599fcb7839025e7fbe24120928b4bbcd70f0e1034a21d91885c40a5c39f";
|
2009-02-25 23:44:08 +01:00
|
|
|
};
|
|
|
|
|
2009-04-15 10:24:37 +02:00
|
|
|
NIX_CFLAGS_COMPILE = if stdenv.system == "x86_64-linux" then "-fPIC" else "";
|
|
|
|
|
2010-01-13 22:16:12 +01:00
|
|
|
buildInputs = [ flex zlib perl libpng libjpeg libxml2 makeWrapper ];
|
2009-02-25 23:44:08 +01:00
|
|
|
|
|
|
|
configurePhase = "cp config.mk.in config.mk";
|
|
|
|
|
2010-01-13 22:16:12 +01:00
|
|
|
preBuild = ''
|
|
|
|
export LDFLAGS=-lz
|
|
|
|
substituteInPlace "pm_config.in.h" \
|
|
|
|
--subst-var-by "rgbPath1" "$out/lib/rgb.txt" \
|
|
|
|
--subst-var-by "rgbPath2" "/var/empty/rgb.txt" \
|
|
|
|
--subst-var-by "rgbPath3" "/var/empty/rgb.txt"
|
|
|
|
'';
|
2010-01-13 22:14:10 +01:00
|
|
|
|
2009-02-25 23:44:08 +01:00
|
|
|
installPhase = ''
|
|
|
|
make package pkgdir=$PWD/netpbmpkg
|
|
|
|
# Pass answers to the script questions
|
|
|
|
./installnetpbm << EOF
|
|
|
|
$PWD/netpbmpkg
|
|
|
|
$out
|
|
|
|
Y
|
|
|
|
$out/bin
|
|
|
|
$out/lib
|
|
|
|
N
|
|
|
|
$out/lib
|
|
|
|
$out/lib
|
|
|
|
$out/include
|
|
|
|
$out/man
|
|
|
|
N
|
|
|
|
EOF
|
2010-01-13 22:16:12 +01:00
|
|
|
|
|
|
|
# wrap any scripts that expect other programs in the package to be in their PATH
|
|
|
|
for prog in ppmquant; do
|
|
|
|
wrapProgram "$out/bin/$prog" --prefix PATH : "$out/bin"
|
|
|
|
done
|
2009-02-25 23:44:08 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://netpbm.sourceforge.net/;
|
|
|
|
description = "Toolkit for manipulation of graphic images";
|
|
|
|
license = "GPL,free";
|
|
|
|
};
|
|
|
|
}
|