about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/ldap/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/ldap/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/ldap/default.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/ldap/default.nix b/nixpkgs/pkgs/development/python-modules/ldap/default.nix
new file mode 100644
index 000000000000..8f5cd7e7e881
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/ldap/default.nix
@@ -0,0 +1,37 @@
+{ buildPythonPackage, fetchPypi
+, pyasn1, pyasn1-modules, pytest
+, openldap, cyrus_sasl, stdenv }:
+
+buildPythonPackage rec {
+  pname = "python-ldap";
+  version = "3.2.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "13nvrhp85yr0jyxixcjj012iw8l9wynxxlykm9j3alss6waln73x";
+  };
+
+  propagatedBuildInputs = [ pyasn1 pyasn1-modules ];
+
+  buildInputs = [ openldap cyrus_sasl ];
+
+  checkInputs = [ pytest ];
+
+  checkPhase = ''
+    # 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"
+
+    py.test
+  '';
+
+  doCheck = !stdenv.isDarwin;
+
+  meta = with stdenv.lib; {
+    description = "Python modules for implementing LDAP clients";
+    homepage = https://www.python-ldap.org/;
+    license = licenses.psfl;
+  };
+}