2023-11-16 04:20:00 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
|
|
|
|
# build-system
|
|
|
|
, hatchling
|
|
|
|
|
|
|
|
# native dependencies
|
|
|
|
, knot-dns
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "libknot";
|
2024-02-07 01:22:34 +00:00
|
|
|
version = "3.3.4";
|
2023-11-16 04:20:00 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-02-07 01:22:34 +00:00
|
|
|
hash = "sha256-KRxc34lqOGuYJM2mUsYrjfiVCQNBxcQyO30wPLf17+Q=";
|
2023-11-16 04:20:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace libknot/__init__.py \
|
|
|
|
--replace "libknot%s.dylib" "${lib.getLib knot-dns}/lib/libknot%s.dylib" \
|
|
|
|
--replace "libknot.so%s" "${lib.getLib knot-dns}/lib/libknot.so%s"
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
hatchling
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"libknot"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python bindings for libknot";
|
|
|
|
homepage = "https://gitlab.nic.cz/knot/knot-dns/-/tree/master/python/libknot";
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ hexa ];
|
|
|
|
mainProgram = "libknot";
|
|
|
|
};
|
|
|
|
}
|