1{ lib, fetchFromGitHub, meson, ninja, buildPythonPackage, pytest, pkgconfig, cairo, xlibsWrapper, isPy33, isPy3k }:
2
3buildPythonPackage rec {
4 pname = "pycairo";
5 version = "1.18.0";
6
7 format = "other";
8
9 disabled = isPy33;
10
11 src = fetchFromGitHub {
12 owner = "pygobject";
13 repo = "pycairo";
14 rev = "v${version}";
15 sha256 = "0k266cf477j74v7mv0d4jxaq3wx8b7qa85qgh68cn094gzaasqd9";
16 };
17
18 nativeBuildInputs = [
19 meson
20 ninja
21 pkgconfig
22 ];
23
24 buildInputs = [
25 cairo
26 xlibsWrapper
27 ];
28
29 checkInputs = [ pytest ];
30
31 mesonFlags = [ "-Dpython=${if isPy3k then "python3" else "python"}" ];
32
33 meta = with lib; {
34 description = "Python 2/3 bindings for cairo";
35 homepage = https://pycairo.readthedocs.io/;
36 license = with licenses; [ lgpl2 mpl11 ];
37 platforms = lib.platforms.linux ++ lib.platforms.darwin;
38 };
39}