2017-11-25 16:41:57 +01:00
|
|
|
{ lib, fetchFromGitHub, python, buildPythonPackage, pytest, pkgconfig, cairo, xlibsWrapper, isPyPy }:
|
2007-05-13 22:49:13 +02:00
|
|
|
|
2017-11-25 16:41:57 +01:00
|
|
|
buildPythonPackage rec {
|
2017-05-27 11:25:35 +02:00
|
|
|
pname = "pycairo";
|
2017-11-25 16:41:57 +01:00
|
|
|
version = "1.15.4";
|
2017-05-27 11:25:35 +02:00
|
|
|
name = "${pname}-${version}";
|
2017-04-01 04:50:06 +02:00
|
|
|
|
2017-11-25 16:41:57 +01:00
|
|
|
disabled = isPyPy;
|
2007-05-13 22:49:13 +02:00
|
|
|
|
2017-11-25 16:41:57 +01:00
|
|
|
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'"
|
|
|
|
'';
|
2016-04-26 23:28:39 +02:00
|
|
|
|
2017-09-05 23:26:13 +02:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
buildInputs = [ python cairo xlibsWrapper ];
|
2017-11-25 16:41:57 +01:00
|
|
|
checkInputs = [ pytest ];
|
2015-11-08 08:21:58 +01:00
|
|
|
|
2016-08-31 11:01:16 +02:00
|
|
|
meta.platforms = lib.platforms.linux ++ lib.platforms.darwin;
|
2007-05-13 22:49:13 +02:00
|
|
|
}
|