2020-11-06 00:33:48 +00:00
|
|
|
{ lib
|
2021-04-26 19:14:03 +00:00
|
|
|
, pythonOlder
|
2020-11-06 00:33:48 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, buildPythonPackage
|
|
|
|
, pytestCheckHook
|
|
|
|
, pkg-config
|
|
|
|
, cairo
|
2022-10-30 15:09:59 +00:00
|
|
|
, libxcrypt
|
2021-04-26 19:14:03 +00:00
|
|
|
, python
|
2020-11-06 00:33:48 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pycairo";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "1.23.0";
|
2021-04-26 19:14:03 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
format = "other";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pygobject";
|
|
|
|
repo = "pycairo";
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-01-20 10:41:00 +00:00
|
|
|
sha256 = "sha256-tkyVTJUdL2pBpBUpWsiDPKnd5OV88w3TdEOMxMc+hPM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
meson
|
|
|
|
ninja
|
2020-11-06 00:33:48 +00:00
|
|
|
pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
cairo
|
2022-10-30 15:09:59 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.9") [
|
|
|
|
libxcrypt
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2020-11-06 00:33:48 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-06 00:33:48 +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.
|
|
|
|
"-Dpython=${python.pythonForBuild.interpreter}"
|
2020-11-06 00:33:48 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2021-04-26 19:14:03 +00:00
|
|
|
description = "Python 3 bindings for cairo";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://pycairo.readthedocs.io/";
|
2020-11-06 00:33:48 +00:00
|
|
|
license = with licenses; [ lgpl21Only mpl11 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = lib.platforms.linux ++ lib.platforms.darwin;
|
|
|
|
};
|
|
|
|
}
|