From a63603685a5aaa42c1c552baac158edb39cee23f Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 25 Nov 2017 16:41:57 +0100 Subject: [PATCH] =?UTF-8?q?pythonPackages.pycairo:=201.10.0=20=E2=86=92=20?= =?UTF-8?q?1.15.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../python-modules/pycairo/default.nix | 56 ++++++------------- .../python-modules/pycairo/waf-py3_5.patch | 10 ---- 2 files changed, 17 insertions(+), 49 deletions(-) delete mode 100644 pkgs/development/python-modules/pycairo/waf-py3_5.patch diff --git a/pkgs/development/python-modules/pycairo/default.nix b/pkgs/development/python-modules/pycairo/default.nix index b4366ab791f9..39c06bff3bf7 100644 --- a/pkgs/development/python-modules/pycairo/default.nix +++ b/pkgs/development/python-modules/pycairo/default.nix @@ -1,50 +1,28 @@ -{ lib, fetchurl, fetchpatch, python, buildPythonPackage, pkgconfig, cairo, xlibsWrapper, isPyPy, isPy35, isPy36, isPy3k }: +{ lib, fetchFromGitHub, python, buildPythonPackage, pytest, pkgconfig, cairo, xlibsWrapper, isPyPy }: -if (isPyPy) then throw "pycairo not supported for interpreter ${python.executable}" else let - - patch_waf = fetchpatch { - url = http://www.linuxfromscratch.org/patches/blfs/8.0/pycairo-1.10.0-waf_python_3_4-1.patch; - sha256 = "0xfl1i9dips2nykyg91f5h5r3xpk2hp1js1gq5z0hwjr0in55id4"; - }; - patch_waf-py3_5 = ./waf-py3_5.patch; - -in buildPythonPackage rec { +buildPythonPackage rec { pname = "pycairo"; - version = "1.10.0"; + version = "1.15.4"; name = "${pname}-${version}"; - format = "other"; - src = if isPy3k - 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"; - }; + disabled = isPyPy; - patches = [ - (fetchpatch { - url = http://www.linuxfromscratch.org/patches/blfs/8.0/pycairo-1.10.0-waf_unpack-1.patch; - sha256 = "1bmrhq2nmhx4l5glvyi59r0hc7w5m56kz41frx7v3dcp8f91p7xd"; - }) - ]; + src = fetchFromGitHub { + owner = "pygobject"; + repo = "pycairo"; + rev = "v${version}"; + sha256 = "02vzmfxx8nl6dbwzc911wcj7hqspgqz6v9xmq6579vwfla0vaglv"; + }; + + postPatch = '' + # we are unable to pass --prefix to bdist_wheel + # see https://github.com/NixOS/nixpkgs/pull/32034#discussion_r153285955 + substituteInPlace setup.py --replace '"prefix": self.install_base' "'prefix': '$out'" + ''; nativeBuildInputs = [ pkgconfig ]; buildInputs = [ python cairo xlibsWrapper ]; - - configurePhase = '' - ( - cd $(${python.executable} waf unpack) - patch -p1 < ${patch_waf} - ${lib.optionalString (isPy35 || isPy36) "patch -p1 < ${patch_waf-py3_5}"} - ) - - ${python.executable} waf configure --prefix=$out - ''; - buildPhase = "${python.executable} waf"; - installPhase = "${python.executable} waf install"; + checkInputs = [ pytest ]; meta.platforms = lib.platforms.linux ++ lib.platforms.darwin; } diff --git a/pkgs/development/python-modules/pycairo/waf-py3_5.patch b/pkgs/development/python-modules/pycairo/waf-py3_5.patch deleted file mode 100644 index dcfdbea2fbdc..000000000000 --- a/pkgs/development/python-modules/pycairo/waf-py3_5.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/waflib/Build.py -+++ b/waflib/Build.py -@@ -151,6 +151,7 @@ class BuildContext(Context.Context): - f.close() - self.init_dirs() - def store(self): -+ return - data={} - for x in SAVED_ATTRS: - data[x]=getattr(self,x)