1 # this package was called gimp-print in the past
2 { stdenv, lib, fetchurl, makeWrapper, pkg-config
4 , gimp2Support ? false, gimp
5 , cupsSupport ? true, cups, libusb1, perl
8 stdenv.mkDerivation rec {
13 url = "mirror://sourceforge/gimp-print/gutenprint-${version}.tar.bz2";
14 sha256 = "0s0b14hjwvbxksq7af5v8z9g2rfqv9jdmxd9d81m57f5mh6rad0p";
18 nativeBuildInputs = [ makeWrapper pkg-config ]
19 ++ lib.optionals cupsSupport [ cups perl ]; # for cups-config
22 ++ lib.optionals gimp2Support [ gimp.gtk gimp ]
23 ++ lib.optionals cupsSupport [ cups libusb1 perl ];
25 configureFlags = lib.optionals cupsSupport [
26 "--disable-static-genppd" # should be harmless on NixOS
29 # FIXME: hacky because we modify generated configure, but I haven't found a better way.
30 # makeFlags doesn't change this everywhere (e.g. in cups-genppdupdate).
31 preConfigure = lib.optionalString cupsSupport ''
33 -e "s,cups_conf_datadir=.*,cups_conf_datadir=\"$out/share/cups\",g" \
34 -e "s,cups_conf_serverbin=.*,cups_conf_serverbin=\"$out/lib/cups\",g" \
35 -e "s,cups_conf_serverroot=.*,cups_conf_serverroot=\"$out/etc/cups\",g" \
37 '' + lib.optionalString gimp2Support ''
39 -e "s,gimp2_plug_indir=.*,gimp2_plug_indir=\"$out/lib/gimp/${gimp.majorVersion}\",g" \
43 enableParallelBuilding = true;
45 # Testing is very, very long.
49 description = "Ghostscript and cups printer drivers";
50 homepage = "https://sourceforge.net/projects/gimp-print/";
51 license = licenses.gpl2Plus;
52 platforms = platforms.linux;