summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2018-03-05 23:18:05 +0000
committerGitHub <noreply@github.com>2018-03-05 23:18:05 +0000
commit7aad357cadba39d069dc2a306d19ffdb955d0470 (patch)
tree6a45b7a27644643885b735840268eec99d5490fd /pkgs/development
parentf5f71c08cdbf1f66b654a1321460b6a7d771c26a (diff)
parent8ad2cb1d0cc9af530a3b1fa0f914359136f48d32 (diff)
downloadnixlib-7aad357cadba39d069dc2a306d19ffdb955d0470.tar
nixlib-7aad357cadba39d069dc2a306d19ffdb955d0470.tar.gz
nixlib-7aad357cadba39d069dc2a306d19ffdb955d0470.tar.bz2
nixlib-7aad357cadba39d069dc2a306d19ffdb955d0470.tar.lz
nixlib-7aad357cadba39d069dc2a306d19ffdb955d0470.tar.xz
nixlib-7aad357cadba39d069dc2a306d19ffdb955d0470.tar.zst
nixlib-7aad357cadba39d069dc2a306d19ffdb955d0470.zip
Merge pull request #36323 from andrew-d/adunham/fix-pillow
pillow: Fix build on non-NixOS systems
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/python-modules/pillow/default.nix11
1 files changed, 10 insertions, 1 deletions
diff --git a/pkgs/development/python-modules/pillow/default.nix b/pkgs/development/python-modules/pillow/default.nix
index 034748255277..cb6008ea9a2b 100644
--- a/pkgs/development/python-modules/pillow/default.nix
+++ b/pkgs/development/python-modules/pillow/default.nix
@@ -31,6 +31,14 @@ buildPythonPackage rec {
     ++ stdenv.lib.optionals (isPyPy) [ tk libX11 ];
 
   # NOTE: we use LCMS_ROOT as WEBP root since there is not other setting for webp.
+  # NOTE: The Pillow install script will, by default, add paths like /usr/lib
+  # and /usr/include to the search paths. This can break things when building
+  # on a non-NixOS system that has some libraries installed that are not
+  # installed in Nix (for example, Arch Linux has jpeg2000 but Nix doesn't
+  # build Pillow with this support). We patch the `disable_platform_guessing`
+  # setting here, instead of passing the `--disable-platform-guessing`
+  # command-line option, since the command-line option doesn't work when we run
+  # tests.
   preConfigure = let
     libinclude' = pkg: ''"${pkg.out}/lib", "${pkg.out}/include"'';
     libinclude = pkg: ''"${pkg.out}/lib", "${pkg.dev}/include"'';
@@ -41,7 +49,8 @@ buildPythonPackage rec {
             s|^ZLIB_ROOT =.*$|ZLIB_ROOT = ${libinclude zlib}|g ;
             s|^LCMS_ROOT =.*$|LCMS_ROOT = ${libinclude lcms2}|g ;
             s|^TIFF_ROOT =.*$|TIFF_ROOT = ${libinclude libtiff}|g ;
-            s|^TCL_ROOT=.*$|TCL_ROOT = ${libinclude' tcl}|g ;'
+            s|^TCL_ROOT=.*$|TCL_ROOT = ${libinclude' tcl}|g ;
+            s|self\.disable_platform_guessing = None|self.disable_platform_guessing = True|g ;'
     export LDFLAGS="-L${libwebp}/lib"
     export CFLAGS="-I${libwebp}/include"
   ''