diff --git a/pkgs/tools/graphics/netpbm/default.nix b/pkgs/tools/graphics/netpbm/default.nix index 2af863e37bc7..df65325b98d9 100644 --- a/pkgs/tools/graphics/netpbm/default.nix +++ b/pkgs/tools/graphics/netpbm/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchsvn, pkgconfig, libjpeg, libpng, flex, zlib, perl, libxml2, makeWrapper, libX11 }: +{stdenv, fetchsvn, pkgconfig, libjpeg, libpng, flex, zlib, perl, libxml2, makeWrapper, libX11, libtiff }: let rev = 1742; in stdenv.mkDerivation { @@ -12,12 +12,19 @@ stdenv.mkDerivation { NIX_CFLAGS_COMPILE = "-fPIC"; # Gentoo adds this on every platform - buildInputs = [ pkgconfig flex zlib perl libpng libjpeg libxml2 makeWrapper libX11 ]; + buildInputs = [ pkgconfig flex zlib perl libpng libjpeg libxml2 makeWrapper libX11 libtiff ]; - configurePhase = "cp config.mk.in config.mk"; + 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" + ''; preBuild = '' - export LDFLAGS=-lz + export LDFLAGS="-lz" substituteInPlace "pm_config.in.h" \ --subst-var-by "rgbPath1" "$out/lib/rgb.txt" \ --subst-var-by "rgbPath2" "/var/empty/rgb.txt" \