2017-04-01 03:50:06 +01:00
|
|
|
{ lib, fetchurl, fetchpatch, python, buildPythonPackage, pkgconfig, cairo, xlibsWrapper, isPyPy, isPy35, isPy36, isPy3k }:
|
2007-05-13 21:49:13 +01:00
|
|
|
|
2017-04-01 03:50:06 +01:00
|
|
|
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 {
|
2017-05-27 10:25:35 +01:00
|
|
|
pname = "pycairo";
|
2014-02-14 15:32:12 +00:00
|
|
|
version = "1.10.0";
|
2017-05-27 10:25:35 +01:00
|
|
|
name = "${pname}-${version}";
|
2017-03-21 12:01:17 +00:00
|
|
|
format = "other";
|
2017-04-01 03:50:06 +01:00
|
|
|
|
2016-10-17 15:12:22 +01:00
|
|
|
src = if isPy3k
|
2014-02-14 15:32:12 +00:00
|
|
|
then fetchurl {
|
|
|
|
url = "http://cairographics.org/releases/pycairo-${version}.tar.bz2";
|
|
|
|
sha256 = "1gjkf8x6hyx1skq3hhwcbvwifxvrf9qxis5vx8x5igmmgs70g94s";
|
|
|
|
}
|
|
|
|
else fetchurl {
|
|
|
|
url = "http://cairographics.org/releases/py2cairo-${version}.tar.bz2";
|
|
|
|
sha256 = "0cblk919wh6w0pgb45zf48xwxykfif16qk264yga7h9fdkq3j16k";
|
|
|
|
};
|
2007-05-13 21:49:13 +01:00
|
|
|
|
2017-04-01 03:50:06 +01:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = http://www.linuxfromscratch.org/patches/blfs/svn/pycairo-1.10.0-waf_unpack-1.patch;
|
|
|
|
sha256 = "1bmrhq2nmhx4l5glvyi59r0hc7w5m56kz41frx7v3dcp8f91p7xd";
|
|
|
|
})
|
|
|
|
];
|
2016-04-26 22:28:39 +01:00
|
|
|
|
2015-09-15 10:13:22 +01:00
|
|
|
buildInputs = [ python pkgconfig cairo xlibsWrapper ];
|
2014-05-20 11:42:39 +01:00
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
(
|
|
|
|
cd $(${python.executable} waf unpack)
|
|
|
|
patch -p1 < ${patch_waf}
|
2017-04-01 03:50:06 +01:00
|
|
|
${lib.optionalString (isPy35 || isPy36) "patch -p1 < ${patch_waf-py3_5}"}
|
2014-05-20 11:42:39 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
${python.executable} waf configure --prefix=$out
|
2014-02-14 15:32:12 +00:00
|
|
|
'';
|
|
|
|
buildPhase = "${python.executable} waf";
|
|
|
|
installPhase = "${python.executable} waf install";
|
2015-11-08 07:21:58 +00:00
|
|
|
|
2016-08-31 10:01:16 +01:00
|
|
|
meta.platforms = lib.platforms.linux ++ lib.platforms.darwin;
|
2007-05-13 21:49:13 +01:00
|
|
|
}
|