2013-07-23 09:12:03 +00:00
|
|
|
{ stdenv, fetchsvn, pkgconfig, libjpeg, libpng, flex, zlib, perl, libxml2, makeWrapper, libX11, libtiff }:
|
2009-02-25 22:44:08 +00:00
|
|
|
|
2013-03-09 13:59:06 +00:00
|
|
|
let rev = 1742; in
|
2009-02-25 22:44:08 +00:00
|
|
|
stdenv.mkDerivation {
|
2013-03-09 13:59:06 +00:00
|
|
|
name = "netpbm-advanced-${toString rev}";
|
2009-02-25 22:44:08 +00:00
|
|
|
|
|
|
|
src = fetchsvn {
|
|
|
|
url = https://netpbm.svn.sourceforge.net/svnroot/netpbm/advanced;
|
2013-03-09 13:59:06 +00:00
|
|
|
inherit rev;
|
|
|
|
sha256 = "0csx6g0ci66nx1a6z0a9dkpfp66mdvcpp5r7g6zrx4jp18r9hzb2";
|
2009-02-25 22:44:08 +00:00
|
|
|
};
|
|
|
|
|
2013-03-09 13:59:06 +00:00
|
|
|
NIX_CFLAGS_COMPILE = "-fPIC"; # Gentoo adds this on every platform
|
2009-04-15 08:24:37 +00:00
|
|
|
|
2013-07-19 17:42:11 +00:00
|
|
|
buildInputs = [ pkgconfig flex zlib perl libpng libjpeg libxml2 makeWrapper libX11 libtiff ];
|
2009-02-25 22:44:08 +00:00
|
|
|
|
2013-07-19 17:42:11 +00:00
|
|
|
configurePhase = ''
|
|
|
|
cp config.mk.in config.mk
|
|
|
|
substituteInPlace "config.mk" \
|
|
|
|
--replace "TIFFLIB = NONE" "TIFFLIB = ${libtiff}/lib/libtiff.so" \
|
|
|
|
--replace "TIFFHDR_DIR =" "TIFFHDR_DIR = ${libtiff}/include" \
|
|
|
|
--replace "TIFFLIB_NEEDS_JPEG = Y" "TIFFLIB_NEEDS_JPEG = N" \
|
|
|
|
--replace "TIFFLIB_NEEDS_Z = Y" "TIFFLIB_NEEDS_Z = N"
|
|
|
|
'';
|
2009-02-25 22:44:08 +00:00
|
|
|
|
2010-01-13 21:16:12 +00:00
|
|
|
preBuild = ''
|
2013-07-19 17:42:11 +00:00
|
|
|
export LDFLAGS="-lz"
|
2010-01-13 21:16:12 +00:00
|
|
|
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"
|
2013-07-23 09:12:03 +00:00
|
|
|
touch lib/standardppmdfont.c
|
2010-01-13 21:16:12 +00:00
|
|
|
'';
|
2010-01-13 21:14:10 +00:00
|
|
|
|
2013-07-23 09:12:03 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2009-02-25 22:44:08 +00: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 21:16:12 +00: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 22:44:08 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://netpbm.sourceforge.net/;
|
|
|
|
description = "Toolkit for manipulation of graphic images";
|
|
|
|
license = "GPL,free";
|
2013-07-19 18:48:26 +00:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2009-02-25 22:44:08 +00:00
|
|
|
};
|
|
|
|
}
|