nixpkgs/pkgs/development/python-modules/pycairo/default.nix
Guillaume Girol 33afbf39f6 treewide: switch to nativeCheckInputs
checkInputs used to be added to nativeBuildInputs. Now we have
nativeCheckInputs to do that instead. Doing this treewide change allows
to keep hashes identical to before the introduction of
nativeCheckInputs.
2023-01-21 12:00:00 +00:00

59 lines
1.1 KiB
Nix

{ lib
, pythonOlder
, fetchFromGitHub
, meson
, ninja
, buildPythonPackage
, pytestCheckHook
, pkg-config
, cairo
, libxcrypt
, python
}:
buildPythonPackage rec {
pname = "pycairo";
version = "1.23.0";
disabled = pythonOlder "3.6";
format = "other";
src = fetchFromGitHub {
owner = "pygobject";
repo = "pycairo";
rev = "refs/tags/v${version}";
sha256 = "sha256-tkyVTJUdL2pBpBUpWsiDPKnd5OV88w3TdEOMxMc+hPM=";
};
nativeBuildInputs = [
meson
ninja
pkg-config
];
buildInputs = [
cairo
] ++ lib.optionals (pythonOlder "3.9") [
libxcrypt
];
nativeCheckInputs = [
pytestCheckHook
];
mesonFlags = [
# 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}"
];
meta = with lib; {
description = "Python 3 bindings for cairo";
homepage = "https://pycairo.readthedocs.io/";
license = with licenses; [ lgpl21Only mpl11 ];
platforms = lib.platforms.linux ++ lib.platforms.darwin;
};
}