From 2ae4f06e4ff222af93ba9dfbe1a461687b308b96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sat, 17 Jul 2021 10:17:55 +0200 Subject: [PATCH] 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. --- pkgs/misc/drivers/hplip/default.nix | 55 ++++++++++++++--------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/pkgs/misc/drivers/hplip/default.nix b/pkgs/misc/drivers/hplip/default.nix index c8566bfc07a..f33ca502438 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"} - " + 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" + ; - 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 ""' 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"; - # Prevent 'ppdc: Unable to find include file ""' 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" - ''; + 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