gutenprint: fix cups and gimp paths

Also disable GIMP support by default to reduce closure

+15 -5
+15 -5
pkgs/misc/drivers/gutenprint/default.nix
··· 1 1 # this package was called gimp-print in the past 2 2 { stdenv, lib, fetchurl, pkgconfig 3 3 , ijs, makeWrapper 4 - , gimp2Support ? true, gimp 4 + , gimp2Support ? false, gimp 5 5 , cupsSupport ? true, cups, libusb, perl 6 6 }: 7 7 ··· 23 23 "--disable-static-genppd" # should be harmless on NixOS 24 24 ]; 25 25 26 + # FIXME: hacky because we modify generated configure, but I haven't found a better way. 27 + # makeFlags doesn't change this everywhere (e.g. in cups-genppdupdate). 28 + preConfigure = lib.optionalString cupsSupport '' 29 + sed -i \ 30 + -e "s,cups_conf_datadir=.*,cups_conf_datadir=\"$out/share/cups\",g" \ 31 + -e "s,cups_conf_serverbin=.*,cups_conf_serverbin=\"$out/lib/cups\",g" \ 32 + -e "s,cups_conf_serverroot=.*,cups_conf_serverroot=\"$out/etc/cups\",g" \ 33 + configure 34 + '' + lib.optionalString gimp2Support '' 35 + sed -i \ 36 + -e "s,gimp2_plug_indir=.*,gimp2_plug_indir=\"$out/lib/gimp/${gimp.majorVersion}\",g" \ 37 + configure 38 + ''; 39 + 26 40 enableParallelBuilding = true; 27 41 28 42 # Testing is very, very long. 29 43 # doCheck = true; 30 - 31 - installFlags = 32 - lib.optionals cupsSupport [ "cups_conf_datadir=$(out)/share/cups" "cups_conf_serverbin=$(out)/lib/cups" "cups_conf_serverroot=$(out)/etc/cups" ] 33 - ++ lib.optionals gimp2Support [ "gimp2_plug_indir=$(out)/${gimp.name}-plugins" ]; 34 44 35 45 meta = with stdenv.lib; { 36 46 description = "Ghostscript and cups printer drivers";