1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 poetry-core,
7 openldap,
8 pytestCheckHook,
9}:
10
11buildPythonPackage rec {
12 pname = "slapd";
13 version = "0.1.6";
14 pyproject = true;
15
16 disabled = pythonOlder "3.8";
17
18 # Pypi tarball doesn't include tests/
19 src = fetchFromGitHub {
20 owner = "python-ldap";
21 repo = "python-slapd";
22 tag = version;
23 hash = "sha256-xXIKC8xDJ3Q6yV1BL5Io0PkLqVbFRbbkB0QSXQGHMNg=";
24 };
25
26 build-system = [ poetry-core ];
27
28 nativeCheckInputs = [ pytestCheckHook ];
29
30 preCheck = ''
31 # Needed by tests to setup a mockup ldap server
32 export BIN="${openldap}/bin"
33 export SBIN="${openldap}/bin"
34 export SLAPD="${openldap}/libexec/slapd"
35 export SCHEMA="${openldap}/etc/schema"
36 '';
37
38 pythonImportsCheck = [ "slapd" ];
39
40 meta = with lib; {
41 description = "Controls a slapd process in a pythonic way";
42 homepage = "https://github.com/python-ldap/python-slapd";
43 changelog = "https://github.com/python-ldap/python-slapd/blob/${src.tag}/CHANGES.rst";
44 license = licenses.mit;
45 maintainers = with maintainers; [ erictapen ];
46 };
47
48}