2014-09-10 15:21:45 +00:00
|
|
|
{ stdenv, fetchurl, fetchpatch, python, pkgconfig, cairo, x11, isPyPy }:
|
2007-05-13 20:49:13 +00:00
|
|
|
|
2015-02-25 08:22:42 +00:00
|
|
|
if isPyPy then throw "pycairo not supported for interpreter ${python.executable}" else stdenv.mkDerivation rec {
|
2014-02-14 15:32:12 +00:00
|
|
|
version = "1.10.0";
|
|
|
|
name = "pycairo-${version}";
|
|
|
|
src = if python.is_py3k or false
|
|
|
|
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 20:49:13 +00:00
|
|
|
|
2014-05-20 10:42:39 +00:00
|
|
|
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";
|
|
|
|
};
|
|
|
|
|
2013-01-11 14:23:44 +00:00
|
|
|
buildInputs = [ python pkgconfig cairo x11 ];
|
2014-05-20 10:42:39 +00:00
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
(
|
|
|
|
cd $(${python.executable} waf unpack)
|
|
|
|
pwd
|
|
|
|
patch -p1 < ${patch_waf}
|
|
|
|
)
|
|
|
|
|
|
|
|
${python.executable} waf configure --prefix=$out
|
2014-02-14 15:32:12 +00:00
|
|
|
'';
|
|
|
|
buildPhase = "${python.executable} waf";
|
|
|
|
installPhase = "${python.executable} waf install";
|
2007-05-13 20:49:13 +00:00
|
|
|
}
|