nixpkgs/pkgs/development/python-modules/pycairo/default.nix

36 lines
951 B
Nix
Raw Normal View History

{ lib, fetchFromGitHub, python, buildPythonPackage, pytest, pkgconfig, cairo, xlibsWrapper, isPyPy }:
buildPythonPackage rec {
pname = "pycairo";
2018-04-06 23:53:34 +00:00
version = "1.16.3";
disabled = isPyPy;
src = fetchFromGitHub {
owner = "pygobject";
repo = "pycairo";
rev = "v${version}";
2018-04-06 23:53:34 +00:00
sha256 = "0clk6wrfls3fa1xrn844762qfaw6gs4ivwkrfysidbzmlbxhpngl";
};
2018-04-06 23:53:34 +00: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
'';
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ python cairo xlibsWrapper ];
checkInputs = [ pytest ];
2015-11-08 07:21:58 +00:00
2016-08-31 09:01:16 +00:00
meta.platforms = lib.platforms.linux ++ lib.platforms.darwin;
}