python3Packages.pillow: Add libxcb support

This commit is contained in:
Sandro Jäckel 2021-01-01 06:47:22 +01:00
parent 63e1b20c16
commit ab0a29d525
No known key found for this signature in database
GPG key ID: 3AF5A43A3EECC2E5
3 changed files with 6 additions and 2 deletions

View file

@ -1,6 +1,6 @@
{ lib, stdenv, buildPythonPackage, fetchPypi, isPyPy, isPy3k
, olefile, freetype, libjpeg, zlib, libtiff, libwebp, tcl, lcms2, tk, libX11
, openjpeg, libimagequant, pyroma, numpy, pytestCheckHook
, libxcb, openjpeg, libimagequant, pyroma, numpy, pytestCheckHook
}@args:
import ./generic.nix (rec {

View file

@ -29,6 +29,7 @@ buildPythonPackage rec {
checkInputs = [ pytestCheckHook pyroma numpy ];
buildInputs = [ freetype libjpeg openjpeg libimagequant zlib libtiff libwebp tcl lcms2 ]
++ lib.optionals (lib.versionAtLeast version "7.1.0") [ libxcb ]
++ lib.optionals (isPyPy) [ tk libX11 ];
# NOTE: we use LCMS_ROOT as WEBP root since there is not other setting for webp.
@ -56,6 +57,9 @@ buildPythonPackage rec {
s|self\.disable_platform_guessing = None|self.disable_platform_guessing = True|g ;'
export LDFLAGS="$LDFLAGS -L${libwebp}/lib"
export CFLAGS="$CFLAGS -I${libwebp}/include"
'' + lib.optionalString (lib.versionAtLeast version "7.1.0") ''
export LDFLAGS="$LDFLAGS -L${libxcb}/lib"
export CFLAGS="$CFLAGS -I${libxcb.dev}/include"
'' + lib.optionalString stdenv.isDarwin ''
# Remove impurities
substituteInPlace setup.py \

View file

@ -4846,7 +4846,7 @@ in {
else
callPackage ../development/python-modules/pillow {
inherit (pkgs) freetype libjpeg zlib libtiff libwebp tcl lcms2 tk;
inherit (pkgs.xorg) libX11;
inherit (pkgs.xorg) libX11 libxcb;
};
pillow-simd = callPackage ../development/python-modules/pillow-simd {