From 607be851e4ad39f724ac182053513c7ba3169d70 Mon Sep 17 00:00:00 2001 From: Artturin Date: Wed, 30 Jun 2021 23:16:37 +0300 Subject: [PATCH 1/2] hplip: hardcode ppdc path to fix #44230 the ppdc: Warning - overlapping filename can be ignored https://bugs.launchpad.net/hplip/+bug/1756967 (cherry picked from commit 46c7445c34fbd71118b217593b906e3e9df3caa2) --- pkgs/misc/drivers/hplip/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/misc/drivers/hplip/default.nix b/pkgs/misc/drivers/hplip/default.nix index 98a67a75f0b..0decad90ae3 100644 --- a/pkgs/misc/drivers/hplip/default.nix +++ b/pkgs/misc/drivers/hplip/default.nix @@ -102,6 +102,10 @@ python3Packages.buildPythonApplication { ]; prePatch = '' + # https://github.com/NixOS/nixpkgs/issues/44230 + substituteInPlace createPPD.sh \ + --replace ppdc "${cups}/bin/ppdc" + # HPLIP hardcodes absolute paths everywhere. Nuke from orbit. find . -type f -exec sed -i \ -e s,/etc/hp,$out/etc/hp,g \ From 91469eef74c940acb2c164eb9d7dbec67015cb04 Mon Sep 17 00:00:00 2001 From: Artturin Date: Thu, 1 Jul 2021 00:37:24 +0300 Subject: [PATCH 2/2] hplip: add -n to gzip to improve reproducibility (cherry picked from commit 1422563f54681f3ea3805fa1b8f3571f20dd7e19) --- pkgs/misc/drivers/hplip/default.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/misc/drivers/hplip/default.nix b/pkgs/misc/drivers/hplip/default.nix index 0decad90ae3..c8566bfc07a 100644 --- a/pkgs/misc/drivers/hplip/default.nix +++ b/pkgs/misc/drivers/hplip/default.nix @@ -101,10 +101,11 @@ python3Packages.buildPythonApplication { ./hplip-3.20.11-nixos-cups-ppd-search-path.patch ]; - prePatch = '' + postPatch = '' # https://github.com/NixOS/nixpkgs/issues/44230 substituteInPlace createPPD.sh \ - --replace ppdc "${cups}/bin/ppdc" + --replace ppdc "${cups}/bin/ppdc" \ + --replace "gzip -c" "gzip -cn" # HPLIP hardcodes absolute paths everywhere. Nuke from orbit. find . -type f -exec sed -i \ @@ -153,6 +154,12 @@ python3Packages.buildPythonApplication { export CUPS_DATADIR="${cups}/share/cups" ''; + postConfigure = '' + # don't save timestamp, in order to improve reproducibility + substituteInPlace Makefile \ + --replace "GZIP_ENV = --best" "GZIP_ENV = --best -n" + ''; + enableParallelBuilding = true; #