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