summary refs log tree commit diff
path: root/pkgs/development/python-modules/pillow/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/pillow/default.nix')
-rw-r--r--pkgs/development/python-modules/pillow/default.nix15
1 files changed, 12 insertions, 3 deletions
diff --git a/pkgs/development/python-modules/pillow/default.nix b/pkgs/development/python-modules/pillow/default.nix
index 034748255277..e9a0acac1cba 100644
--- a/pkgs/development/python-modules/pillow/default.nix
+++ b/pkgs/development/python-modules/pillow/default.nix
@@ -6,12 +6,12 @@
 }:
 buildPythonPackage rec {
   pname = "Pillow";
-  version = "5.0.0";
+  version = "5.1.0";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "12f29d6c23424f704c66b5b68c02fe0b571504459605cfe36ab8158359b0e1bb";
+    sha256 = "cee9bc75bff455d317b6947081df0824a8f118de2786dc3d74a3503fd631f4ef";
   };
 
   doCheck = !stdenv.isDarwin && !isPyPy;
@@ -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"
   ''