1{ lib
2, pythonOlder
3, fetchFromGitHub
4, meson
5, ninja
6, buildPythonPackage
7, pytestCheckHook
8, pkg-config
9, cairo
10, python
11}:
12
13buildPythonPackage rec {
14 pname = "pycairo";
15 version = "1.20.1";
16
17 disabled = pythonOlder "3.6";
18
19 format = "other";
20
21 src = fetchFromGitHub {
22 owner = "pygobject";
23 repo = "pycairo";
24 rev = "v${version}";
25 sha256 = "09aisph7ycgb4xi2xglvrn59i3cyqms8jbb876cl9763g7yqbcr6";
26 };
27
28 nativeBuildInputs = [
29 meson
30 ninja
31 pkg-config
32 ];
33
34 buildInputs = [
35 cairo
36 ];
37
38 checkInputs = [
39 pytestCheckHook
40 ];
41
42 mesonFlags = [
43 # This is only used for figuring out what version of Python is in
44 # use, and related stuff like figuring out what the install prefix
45 # should be, but it does need to be able to execute Python code.
46 "-Dpython=${python.pythonForBuild.interpreter}"
47 ];
48
49 meta = with lib; {
50 description = "Python 3 bindings for cairo";
51 homepage = "https://pycairo.readthedocs.io/";
52 license = with licenses; [ lgpl21Only mpl11 ];
53 platforms = lib.platforms.linux ++ lib.platforms.darwin;
54 };
55}