1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5
6 # build-system
7 hatchling,
8
9 # native dependencies
10 knot-dns,
11}:
12
13buildPythonPackage rec {
14 pname = "libknot";
15 version = "3.5.0";
16 pyproject = true;
17
18 src = fetchPypi {
19 inherit pname version;
20 hash = "sha256-8sWO70le3qmhNiU4xEEM3IOrrc20+WT2Y2UBSPBEFkk=";
21 };
22
23 postPatch = ''
24 substituteInPlace libknot/__init__.py \
25 --replace "libknot%s.dylib" "${lib.getLib knot-dns}/lib/libknot%s.dylib" \
26 --replace "libknot.so%s" "${lib.getLib knot-dns}/lib/libknot.so%s"
27 '';
28
29 build-system = [ hatchling ];
30
31 pythonImportsCheck = [ "libknot" ];
32
33 meta = with lib; {
34 description = "Python bindings for libknot";
35 homepage = "https://gitlab.nic.cz/knot/knot-dns/-/tree/master/python/libknot";
36 license = licenses.gpl3Only;
37 maintainers = with maintainers; [ hexa ];
38 };
39}