2017-11-25 15:41:57 +00:00
|
|
|
{ lib, fetchFromGitHub, python, buildPythonPackage, pytest, pkgconfig, cairo, xlibsWrapper, isPyPy }:
|
2007-05-13 21:49:13 +01:00
|
|
|
|
2017-11-25 15:41:57 +00:00
|
|
|
buildPythonPackage rec {
|
2017-05-27 10:25:35 +01:00
|
|
|
pname = "pycairo";
|
2018-04-07 00:53:34 +01:00
|
|
|
version = "1.16.3";
|
2017-04-01 03:50:06 +01:00
|
|
|
|
2017-11-25 15:41:57 +00:00
|
|
|
disabled = isPyPy;
|
2007-05-13 21:49:13 +01:00
|
|
|
|
2017-11-25 15:41:57 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pygobject";
|
|
|
|
repo = "pycairo";
|
|
|
|
rev = "v${version}";
|
2018-04-07 00:53:34 +01:00
|
|
|
sha256 = "0clk6wrfls3fa1xrn844762qfaw6gs4ivwkrfysidbzmlbxhpngl";
|
2017-11-25 15:41:57 +00:00
|
|
|
};
|
|
|
|
|
2018-04-07 00:53:34 +01:00
|
|
|
# We need to create the pkgconfig file but it cannot be installed as a wheel since wheels
|
|
|
|
# are supposed to be relocatable and do not support --prefix option
|
|
|
|
buildPhase = ''
|
|
|
|
${python.interpreter} setup.py build
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
${python.interpreter} setup.py install --skip-build --prefix="$out" --optimize=1
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
${python.interpreter} setup.py test
|
2017-11-25 15:41:57 +00:00
|
|
|
'';
|
2016-04-26 22:28:39 +01:00
|
|
|
|
2017-09-05 22:26:13 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
buildInputs = [ python cairo xlibsWrapper ];
|
2017-11-25 15:41:57 +00:00
|
|
|
checkInputs = [ pytest ];
|
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
|
|
|
}
|