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