about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2016-02-26 17:14:21 +0300
committerNikolay Amiantov <ab@fmap.me>2016-02-26 18:27:41 +0300
commitd9c10d6f56ab07c9387efe74a6202c19bb744f6c (patch)
treededb275af5f4462d4223417ab6d22af343585862
parent66febbdfa79b228e188cd2580a98e9240018dcc5 (diff)
downloadnixlib-d9c10d6f56ab07c9387efe74a6202c19bb744f6c.tar
nixlib-d9c10d6f56ab07c9387efe74a6202c19bb744f6c.tar.gz
nixlib-d9c10d6f56ab07c9387efe74a6202c19bb744f6c.tar.bz2
nixlib-d9c10d6f56ab07c9387efe74a6202c19bb744f6c.tar.lz
nixlib-d9c10d6f56ab07c9387efe74a6202c19bb744f6c.tar.xz
nixlib-d9c10d6f56ab07c9387efe74a6202c19bb744f6c.tar.zst
nixlib-d9c10d6f56ab07c9387efe74a6202c19bb744f6c.zip
gutenprint: fix cups and gimp paths
Also disable GIMP support by default to reduce closure
-rw-r--r--pkgs/misc/drivers/gutenprint/default.nix20
1 files changed, 15 insertions, 5 deletions
diff --git a/pkgs/misc/drivers/gutenprint/default.nix b/pkgs/misc/drivers/gutenprint/default.nix
index 5be7f5ecff4d..e53ddf7143b3 100644
--- a/pkgs/misc/drivers/gutenprint/default.nix
+++ b/pkgs/misc/drivers/gutenprint/default.nix
@@ -1,7 +1,7 @@
 # this package was called gimp-print in the past
 { stdenv, lib, fetchurl, pkgconfig
 , ijs, makeWrapper
-, gimp2Support ? true, gimp
+, gimp2Support ? false, gimp
 , cupsSupport ? true, cups, libusb, perl
 }:
 
@@ -23,15 +23,25 @@ stdenv.mkDerivation rec {
     "--disable-static-genppd" # should be harmless on NixOS
   ];
 
+  # FIXME: hacky because we modify generated configure, but I haven't found a better way.
+  # makeFlags doesn't change this everywhere (e.g. in cups-genppdupdate).
+  preConfigure = lib.optionalString cupsSupport ''
+    sed -i \
+      -e "s,cups_conf_datadir=.*,cups_conf_datadir=\"$out/share/cups\",g" \
+      -e "s,cups_conf_serverbin=.*,cups_conf_serverbin=\"$out/lib/cups\",g" \
+      -e "s,cups_conf_serverroot=.*,cups_conf_serverroot=\"$out/etc/cups\",g" \
+      configure
+  '' + lib.optionalString gimp2Support ''
+    sed -i \
+      -e "s,gimp2_plug_indir=.*,gimp2_plug_indir=\"$out/lib/gimp/${gimp.majorVersion}\",g" \
+      configure
+  '';
+
   enableParallelBuilding = true;
 
   # Testing is very, very long.
   # doCheck = true;
 
-  installFlags =
-    lib.optionals cupsSupport [ "cups_conf_datadir=$(out)/share/cups" "cups_conf_serverbin=$(out)/lib/cups" "cups_conf_serverroot=$(out)/etc/cups" ]
-    ++ lib.optionals gimp2Support [ "gimp2_plug_indir=$(out)/${gimp.name}-plugins" ];
-
   meta = with stdenv.lib; {
     description = "Ghostscript and cups printer drivers";
     homepage = http://sourceforge.net/projects/gimp-print/;