From 7cee2ad598c1c4437b6f578cd75722853784d2b1 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Mon, 20 Mar 2023 14:22:44 +0100 Subject: [PATCH] hplip: fix broken/hardcoded paths in .desktop files --- pkgs/misc/drivers/hplip/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/misc/drivers/hplip/default.nix b/pkgs/misc/drivers/hplip/default.nix index a300ff2ae6349..3b87a0ac12b1b 100644 --- a/pkgs/misc/drivers/hplip/default.nix +++ b/pkgs/misc/drivers/hplip/default.nix @@ -127,6 +127,9 @@ python3Packages.buildPythonApplication { -e s,/usr/bin/gs,${ghostscript}/bin/gs,g \ -e s,/usr/share/cups/fonts,${ghostscript}/share/ghostscript/fonts,g \ -e "s,ExecStart=/usr/bin/python /usr/bin/hp-config_usb_printer,ExecStart=$out/bin/hp-config_usb_printer,g" \ + -e s,Exec=/usr/bin/hp-uiscan,Exec=hp-uiscan,g \ + -e s,Icon=/usr/share/icons/Humanity/devices/48/printer.svg,Icon=printer,g \ + -e s,Icon=@abs_datadir@/hplip/data/images/128x128/hp_logo.png,Icon=hp_logo,g \ {} + echo 'AUTOMAKE_OPTIONS = foreign' >> Makefile.am @@ -180,7 +183,13 @@ python3Packages.buildPythonApplication { # Running `hp-diagnose_plugin -g` can be used to diagnose # issues with plugins. # - postInstall = lib.optionalString withPlugin '' + postInstall = '' + for resolution in 16x16 32x32 64x64 128x128 256x256; do + mkdir -p $out/share/icons/hicolor/$resolution/apps + ln -s $out/share/hplip/data/images/$resolution/hp_logo.png \ + $out/share/icons/hicolor/$resolution/apps/hp_logo.png + done + '' + lib.optionalString withPlugin '' sh ${plugin} --noexec --keep cd plugin_tmp