2021-04-26 19:14:03 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
2024-01-02 11:29:13 +00:00
|
|
|
, fetchpatch
|
2021-04-26 19:14:03 +00:00
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, buildPythonPackage
|
2022-04-15 01:41:22 +00:00
|
|
|
, pytest
|
2021-04-26 19:14:03 +00:00
|
|
|
, pkg-config
|
|
|
|
, cairo
|
|
|
|
, python
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pycairo";
|
|
|
|
version = "1.18.2";
|
|
|
|
|
|
|
|
format = "other";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pygobject";
|
|
|
|
repo = "pycairo";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "142145a2whvlk92jijrbf3i2bqrzmspwpysj0bfypw0krzi0aa6j";
|
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/pygobject/pycairo/commit/678edd94d8a6dfb5d51f9c3549e6ee8c90a73744.patch";
|
|
|
|
sha256 = "sha256-HmP69tUGYxZvJ/M9FJHwHTCjb9Kf4aWRyMT4wSymrT0=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-04-26 19:14:03 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
cairo
|
|
|
|
];
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
# HACK: Don't use the pytestCheckHook because PYTHONPATH
|
|
|
|
# will be added by the Python setuptook breaking meson.
|
|
|
|
checkPhase = ''
|
|
|
|
${pytest}/bin/pytest
|
|
|
|
'';
|
2021-04-26 19:14:03 +00:00
|
|
|
|
|
|
|
mesonFlags = [
|
2021-12-06 16:07:01 +00:00
|
|
|
# This is only used for figuring out what version of Python is in
|
|
|
|
# use, and related stuff like figuring out what the install prefix
|
|
|
|
# should be, but it does need to be able to execute Python code.
|
2023-11-16 04:20:00 +00:00
|
|
|
"-Dpython=${python.pythonOnBuildForHost.interpreter}"
|
2021-04-26 19:14:03 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python 2 bindings for cairo";
|
|
|
|
homepage = "https://pycairo.readthedocs.io/";
|
|
|
|
license = with licenses; [ lgpl21Only mpl11 ];
|
|
|
|
platforms = lib.platforms.linux ++ lib.platforms.darwin;
|
|
|
|
};
|
|
|
|
}
|