pycairo: fix build with Python 3.6

Apply the same patch as for Python 3.5 so that this builds correctly.
Addresses #24501.
This commit is contained in:
Vaibhav Sagar 2017-04-01 09:50:06 +07:00 committed by Frederik Rietdijk
parent da8201e7c3
commit d9b36c36c5

View File

@ -1,9 +1,18 @@
{ lib, fetchurl, fetchpatch, python, buildPythonPackage, pkgconfig, cairo, xlibsWrapper, isPyPy, isPy35, isPy3k }:
{ lib, fetchurl, fetchpatch, python, buildPythonPackage, pkgconfig, cairo, xlibsWrapper, isPyPy, isPy35, isPy36, isPy3k }:
if (isPyPy) then throw "pycairo not supported for interpreter ${python.executable}" else buildPythonPackage rec {
if (isPyPy) then throw "pycairo not supported for interpreter ${python.executable}" else let
patch_waf = fetchpatch {
url = http://www.linuxfromscratch.org/patches/blfs/svn/pycairo-1.10.0-waf_python_3_4-1.patch;
sha256 = "0xfl1i9dips2nykyg91f5h5r3xpk2hp1js1gq5z0hwjr0in55id4";
};
patch_waf-py3_5 = ./waf-py3_5.patch;
in buildPythonPackage rec {
version = "1.10.0";
name = "pycairo-${version}";
format = "other";
src = if isPy3k
then fetchurl {
url = "http://cairographics.org/releases/pycairo-${version}.tar.bz2";
@ -14,26 +23,20 @@ if (isPyPy) then throw "pycairo not supported for interpreter ${python.executabl
sha256 = "0cblk919wh6w0pgb45zf48xwxykfif16qk264yga7h9fdkq3j16k";
};
patches = [(fetchpatch {
url = http://www.linuxfromscratch.org/patches/blfs/svn/pycairo-1.10.0-waf_unpack-1.patch;
sha256 = "1bmrhq2nmhx4l5glvyi59r0hc7w5m56kz41frx7v3dcp8f91p7xd";
})];
patch_waf = fetchpatch {
url = http://www.linuxfromscratch.org/patches/blfs/svn/pycairo-1.10.0-waf_python_3_4-1.patch;
sha256 = "0xfl1i9dips2nykyg91f5h5r3xpk2hp1js1gq5z0hwjr0in55id4";
};
patch_waf-py3_5 = ./waf-py3_5.patch;
patches = [
(fetchpatch {
url = http://www.linuxfromscratch.org/patches/blfs/svn/pycairo-1.10.0-waf_unpack-1.patch;
sha256 = "1bmrhq2nmhx4l5glvyi59r0hc7w5m56kz41frx7v3dcp8f91p7xd";
})
];
buildInputs = [ python pkgconfig cairo xlibsWrapper ];
configurePhase = ''
(
cd $(${python.executable} waf unpack)
pwd
patch -p1 < ${patch_waf}
${lib.optionalString isPy35 "patch -p1 < ${patch_waf-py3_5}"}
${lib.optionalString (isPy35 || isPy36) "patch -p1 < ${patch_waf-py3_5}"}
)
${python.executable} waf configure --prefix=$out