nixpkgs/pkgs/development/python-modules/pycapnp/default.nix
Sefa Eyeoglu ce113a1be5
Revert "python3Packages.pycapnp: backport patch for py314 compat"
This reverts commit 9518afa893.

Patch already included in 2.2.3 which causes applying the patch to fail
2026-06-25 11:25:23 -04:00

70 lines
1.7 KiB
Nix

{
lib,
buildPythonPackage,
replaceVars,
fetchFromGitHub,
setuptools,
wheel,
capnproto,
cython,
pkgconfig,
pytest-asyncio,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "pycapnp";
version = "2.2.3";
pyproject = true;
src = fetchFromGitHub {
owner = "capnproto";
repo = "pycapnp";
tag = "v${version}";
hash = "sha256-WM0DR1lTlgsKpTU8QlquL0RhrqPU/cUQav6p8EP7x9o=";
};
patches = [
# pycapnp hardcodes /usr/include and /usr/local/include as the paths to search
# for capnproto's built-in schemas in; replace them with the path to our copy of
# capnproto.
#
# Theoretically, this mechanism could also be used to load capnproto schemas
# exposed by other packages (e.g. capnproto-java), which we could support using
# a setup hook; but in practice nobody seems to use this mechanism for anything
# other than the builtin schemas (based on quick GitHub code search), so I don't
# think it's worthwhile.
(replaceVars ./include-paths.patch { inherit capnproto; })
];
build-system = [
setuptools
wheel
cython
pkgconfig
];
buildInputs = [ capnproto ];
nativeCheckInputs = [
pytest-asyncio
pytestCheckHook
];
__darwinAllowLocalNetworking = true;
# https://github.com/NixOS/nixpkgs/issues/255262
preCheck = ''
enabledTestPaths=$PWD/test
pushd "$out"
'';
postCheck = ''
popd
'';
meta = {
description = "Cython wrapping of the C++ Cap'n Proto library";
homepage = "https://capnproto.github.io/pycapnp/";
changelog = "https://github.com/capnproto/pycapnp/blob/${src.tag}/CHANGELOG.md";
license = lib.licenses.bsd2;
maintainers = with lib.maintainers; [ Liamolucko ];
};
}