about summary refs log tree commit diff
path: root/pkgs/misc/drivers
diff options
context:
space:
mode:
authorVladimír Čunát <v@cunat.cz>2021-07-17 10:17:55 +0200
committerVladimír Čunát <v@cunat.cz>2021-07-17 10:22:19 +0200
commit2ae4f06e4ff222af93ba9dfbe1a461687b308b96 (patch)
tree71ace87d260a1b1a2d9eed67adaa109d81437e8e /pkgs/misc/drivers
parentee007cdc3599fa7d81abb1b23878c4457481f1cf (diff)
hplip: replace preConfigure with a nicer approach
The newlines were a problem at *this* moment:
https://github.com/NixOS/nixpkgs/commit/c335a18e#commitcomment-53611461
but let's make the hplip expression nicer regardless of how that ends.
Diffstat (limited to 'pkgs/misc/drivers')
-rw-r--r--pkgs/misc/drivers/hplip/default.nix59
1 files changed, 29 insertions, 30 deletions
diff --git a/pkgs/misc/drivers/hplip/default.nix b/pkgs/misc/drivers/hplip/default.nix
index c8566bfc07a9f..f33ca5024383f 100644
--- a/pkgs/misc/drivers/hplip/default.nix
+++ b/pkgs/misc/drivers/hplip/default.nix
@@ -123,36 +123,35 @@ python3Packages.buildPythonApplication {
       {} +
   '';
 
-  preConfigure = ''
-    export configureFlags="$configureFlags
-      --with-hpppddir=$out/share/cups/model/HP
-      --with-cupsfilterdir=$out/lib/cups/filter
-      --with-cupsbackenddir=$out/lib/cups/backend
-      --with-icondir=$out/share/applications
-      --with-systraydir=$out/xdg/autostart
-      --with-mimedir=$out/etc/cups
-      --enable-policykit
-      ${lib.optionalString withStaticPPDInstall "--enable-cups-ppd-install"}
-      --disable-qt4
-      ${lib.optionalString withQt5 "--enable-qt5"}
-    "
-
-    export makeFlags="
-      halpredir=$out/share/hal/fdi/preprobe/10osvendor
-      rulesdir=$out/etc/udev/rules.d
-      policykit_dir=$out/share/polkit-1/actions
-      policykit_dbus_etcdir=$out/etc/dbus-1/system.d
-      policykit_dbus_sharedir=$out/share/dbus-1/system-services
-      hplip_confdir=$out/etc/hp
-      hplip_statedir=$out/var/lib/hp
-    "
-
-    # Prevent 'ppdc: Unable to find include file "<font.defs>"' which prevent
-    # generation of '*.ppd' files.
-    # This seems to be a 'ppdc' issue when the tool is run in a hermetic sandbox.
-    # Could not find how to fix the problem in 'ppdc' so this is a workaround.
-    export CUPS_DATADIR="${cups}/share/cups"
-  '';
+  configureFlags = let out = placeholder "out"; in [
+    "--with-hpppddir=${out}/share/cups/model/HP"
+    "--with-cupsfilterdir=${out}/lib/cups/filter"
+    "--with-cupsbackenddir=${out}/lib/cups/backend"
+    "--with-icondir=${out}/share/applications"
+    "--with-systraydir=${out}/xdg/autostart"
+    "--with-mimedir=${out}/etc/cups"
+    "--enable-policykit"
+    "--disable-qt4"
+  ]
+    ++ lib.optional withStaticPPDInstall "--enable-cups-ppd-install"
+    ++ lib.optional withQt5 "--enable-qt5"
+    ;
+
+  # Prevent 'ppdc: Unable to find include file "<font.defs>"' which prevent
+  # generation of '*.ppd' files.
+  # This seems to be a 'ppdc' issue when the tool is run in a hermetic sandbox.
+  # Could not find how to fix the problem in 'ppdc' so this is a workaround.
+  CUPS_DATADIR = "${cups}/share/cups";
+
+  makeFlags = let out = placeholder "out"; in [
+    "halpredir=${out}/share/hal/fdi/preprobe/10osvendor"
+    "rulesdir=${out}/etc/udev/rules.d"
+    "policykit_dir=${out}/share/polkit-1/actions"
+    "policykit_dbus_etcdir=${out}/etc/dbus-1/system.d"
+    "policykit_dbus_sharedir=${out}/share/dbus-1/system-services"
+    "hplip_confdir=${out}/etc/hp"
+    "hplip_statedir=${out}/var/lib/hp"
+  ];
 
   postConfigure = ''
     # don't save timestamp, in order to improve reproducibility