From ab0a29d5256cde822dc0db9cf7ecfcb5f5fa6184 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 1 Jan 2021 06:47:22 +0100 Subject: [PATCH] python3Packages.pillow: Add libxcb support --- pkgs/development/python-modules/pillow/default.nix | 2 +- pkgs/development/python-modules/pillow/generic.nix | 4 ++++ pkgs/top-level/python-packages.nix | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pillow/default.nix b/pkgs/development/python-modules/pillow/default.nix index 516ac71c30a7..051e6ab8c6fd 100644 --- a/pkgs/development/python-modules/pillow/default.nix +++ b/pkgs/development/python-modules/pillow/default.nix @@ -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 { diff --git a/pkgs/development/python-modules/pillow/generic.nix b/pkgs/development/python-modules/pillow/generic.nix index fe149f7f80ff..42e709ca4cf4 100644 --- a/pkgs/development/python-modules/pillow/generic.nix +++ b/pkgs/development/python-modules/pillow/generic.nix @@ -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 \ diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8ef5aaf07c44..4090fb12efae 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -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 {