about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorRobert Schütz <nix@dotlambda.de>2023-11-05 18:11:55 -0800
committerGitHub <noreply@github.com>2023-11-05 18:11:55 -0800
commit0d93ec62e06faec6c52331a8a87bd5721b38ce14 (patch)
treee3f256ba3bb99c66bf6f93eafba15c07fde35c71 /pkgs
parenteb5caed9e18e2a91ec891597766eddffce5670bb (diff)
parent12cc200d4383e8ca1b3e7f5c66edcbaedbd2739d (diff)
Merge pull request #265752 from al3xtjames/img2pdf-icc-path
python311Packages.img2pdf: fix evaluation on darwin
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/python-modules/img2pdf/default-icc-profile.patch2
-rw-r--r--pkgs/development/python-modules/img2pdf/default.nix11
2 files changed, 11 insertions, 2 deletions
diff --git a/pkgs/development/python-modules/img2pdf/default-icc-profile.patch b/pkgs/development/python-modules/img2pdf/default-icc-profile.patch
index bf5e1e408614d..139eafd63ced7 100644
--- a/pkgs/development/python-modules/img2pdf/default-icc-profile.patch
+++ b/pkgs/development/python-modules/img2pdf/default-icc-profile.patch
@@ -14,7 +14,7 @@ index 036232b..d2e7829 100755
 -        if os.path.exists(profile):
 -            return profile
 -    return "/usr/share/color/icc/sRGB.icc"
-+    return "@colord@/share/color/icc/colord/sRGB.icc"
++    return "@srgbProfile@"
  
  
  def get_main_parser():
diff --git a/pkgs/development/python-modules/img2pdf/default.nix b/pkgs/development/python-modules/img2pdf/default.nix
index 06183b3d53489..a94681ada0f14 100644
--- a/pkgs/development/python-modules/img2pdf/default.nix
+++ b/pkgs/development/python-modules/img2pdf/default.nix
@@ -38,7 +38,10 @@ buildPythonPackage rec {
   patches = [
     (substituteAll {
       src = ./default-icc-profile.patch;
-      inherit colord;
+      srgbProfile = if stdenv.isDarwin then
+        "/System/Library/ColorSync/Profiles/sRGB Profile.icc"
+      else
+        "${colord}/share/color/icc/colord/sRGB.icc";
     })
     (fetchpatch {
       # https://gitlab.mister-muffin.de/josch/img2pdf/issues/178
@@ -57,6 +60,12 @@ buildPythonPackage rec {
     pillow
   ];
 
+  # FIXME: Only add "sRGB Profile.icc" to __impureHostDeps once
+  # https://github.com/NixOS/nix/issues/9301 is fixed.
+  __impureHostDeps = lib.optionals stdenv.isDarwin [
+    "/System/Library/ColorSync/Profiles"
+  ];
+
   nativeCheckInputs = [
     exiftool
     ghostscript