2024-05-15 15:35:15 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pythonAtLeast,
|
|
|
|
pythonOlder,
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
# build-system
|
|
|
|
setuptools,
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
# native dependencies
|
|
|
|
openldap,
|
|
|
|
cyrus_sasl,
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
# dependencies
|
|
|
|
pyasn1,
|
|
|
|
pyasn1-modules,
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
# tests
|
|
|
|
pytestCheckHook,
|
2022-09-30 11:47:45 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "python-ldap";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "3.4.4";
|
|
|
|
pyproject = true;
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
disabled = pythonOlder "3.6" || pythonAtLeast "3.12"; # requires distutils
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2024-01-02 11:29:13 +00:00
|
|
|
owner = "python-ldap";
|
|
|
|
repo = "python-ldap";
|
2022-09-30 11:47:45 +00:00
|
|
|
rev = "refs/tags/python-ldap-${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-v1cWoRGxbvvFnHqnwoIfmiQQcxfaA8Bf3+M5bE5PtuU=";
|
2022-09-30 11:47:45 +00:00
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
build-system = [ setuptools ];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
buildInputs = [
|
|
|
|
openldap
|
|
|
|
cyrus_sasl
|
|
|
|
];
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
dependencies = [
|
2022-09-30 11:47:45 +00:00
|
|
|
pyasn1
|
|
|
|
pyasn1-modules
|
|
|
|
];
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
# Needed by tests to setup a mockup ldap server.
|
|
|
|
export BIN="${openldap}/bin"
|
|
|
|
export SBIN="${openldap}/bin"
|
|
|
|
export SLAPD="${openldap}/libexec/slapd"
|
|
|
|
export SCHEMA="${openldap}/etc/schema"
|
|
|
|
'';
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
disabledTests = [
|
|
|
|
# https://github.com/python-ldap/python-ldap/issues/501
|
|
|
|
"test_tls_ext_noca"
|
|
|
|
];
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-01-02 11:29:13 +00:00
|
|
|
changelog = "https://github.com/python-ldap/python-ldap/releases/tag/python-ldap-${version}";
|
2022-09-30 11:47:45 +00:00
|
|
|
description = "Python modules for implementing LDAP clients";
|
2024-01-02 11:29:13 +00:00
|
|
|
downloadPage = "https://github.com/python-ldap/python-ldap";
|
2022-09-30 11:47:45 +00:00
|
|
|
homepage = "https://www.python-ldap.org/";
|
|
|
|
license = licenses.psfl;
|
|
|
|
};
|
|
|
|
}
|