2014-09-25 01:47:44 +04:00
|
|
|
{ lib, stdenv, fetchurl, pkgconfig, libjpeg, libpng, flex, zlib, perl, libxml2
|
|
|
|
, makeWrapper, libtiff
|
|
|
|
, enableX11 ? false, libX11 }:
|
2009-02-26 01:44:08 +03:00
|
|
|
|
2014-09-25 01:47:44 +04:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "netpbm-10.66.00";
|
2009-02-26 01:44:08 +03:00
|
|
|
|
2014-09-25 01:47:44 +04:00
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://gentoo/distfiles/${name}.tar.xz";
|
|
|
|
sha256 = "1z33pxdir92m7jlvp5c2q44gxwj7jyf8skiqkr71kgirw4w4zsbz";
|
2009-02-26 01:44:08 +03:00
|
|
|
};
|
|
|
|
|
2013-12-25 14:08:19 +04:00
|
|
|
postPatch = /* CVE-2005-2471, from Arch */ ''
|
|
|
|
substituteInPlace converter/other/pstopnm.c \
|
|
|
|
--replace '"-DSAFER"' '"-DPARANOIDSAFER"'
|
|
|
|
'';
|
|
|
|
|
2013-03-09 17:59:06 +04:00
|
|
|
NIX_CFLAGS_COMPILE = "-fPIC"; # Gentoo adds this on every platform
|
2009-04-15 12:24:37 +04:00
|
|
|
|
2014-09-25 01:47:44 +04:00
|
|
|
buildInputs =
|
|
|
|
[ pkgconfig flex zlib perl libpng libjpeg libxml2 makeWrapper libtiff ]
|
|
|
|
++ lib.optional enableX11 libX11;
|
2009-02-26 01:44:08 +03:00
|
|
|
|
2013-07-19 21:42:11 +04:00
|
|
|
configurePhase = ''
|
|
|
|
cp config.mk.in config.mk
|
2014-09-25 01:47:44 +04:00
|
|
|
echo "STATICLIB_TOO = n" >> config.mk
|
2013-07-19 21:42:11 +04:00
|
|
|
substituteInPlace "config.mk" \
|
2016-01-24 10:29:42 +03:00
|
|
|
--replace "TIFFLIB = NONE" "TIFFLIB = ${libtiff.out}/lib/libtiff.so" \
|
2016-04-16 20:39:17 +03:00
|
|
|
--replace "TIFFHDR_DIR =" "TIFFHDR_DIR = ${libtiff.dev}/include"
|
2013-07-19 21:42:11 +04:00
|
|
|
'';
|
2009-02-26 01:44:08 +03:00
|
|
|
|
2010-01-14 00:16:12 +03:00
|
|
|
preBuild = ''
|
2013-07-19 21:42:11 +04:00
|
|
|
export LDFLAGS="-lz"
|
2010-01-14 00:16:12 +03: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 13:12:03 +04:00
|
|
|
touch lib/standardppmdfont.c
|
2010-01-14 00:16:12 +03:00
|
|
|
'';
|
2010-01-14 00:14:10 +03:00
|
|
|
|
2016-02-28 14:59:17 +03:00
|
|
|
enableParallelBuilding = false;
|
2013-07-23 13:12:03 +04:00
|
|
|
|
2009-02-26 01:44:08 +03:00
|
|
|
installPhase = ''
|
2014-09-25 01:47:44 +04:00
|
|
|
make package pkgdir=$out
|
|
|
|
|
|
|
|
rm -rf $out/link $out/*_template $out/{pkginfo,README,VERSION} $out/man/web
|
|
|
|
|
|
|
|
mkdir -p $out/share/netpbm
|
|
|
|
mv $out/misc $out/share/netpbm/
|
2010-01-14 00:16:12 +03: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-26 01:44:08 +03:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://netpbm.sourceforge.net/;
|
|
|
|
description = "Toolkit for manipulation of graphic images";
|
|
|
|
license = "GPL,free";
|
2013-07-19 22:48:26 +04:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2009-02-26 01:44:08 +03:00
|
|
|
};
|
|
|
|
}
|