summary refs log tree commit diff
path: root/pkgs/development/python-modules/ldap
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2017-11-05 10:45:54 +0100
committerFrederik Rietdijk <fridh@fridh.nl>2017-11-05 10:45:54 +0100
commit07eeeb36008b63c8edfc75fce79beb028cd5c1e4 (patch)
tree815bfac4b5ee67fc223ea785e965c2680bac4db0 /pkgs/development/python-modules/ldap
parent37d5539aeb10973aba9c84f5214625c85e9c39b4 (diff)
downloadnixlib-07eeeb36008b63c8edfc75fce79beb028cd5c1e4.tar
nixlib-07eeeb36008b63c8edfc75fce79beb028cd5c1e4.tar.gz
nixlib-07eeeb36008b63c8edfc75fce79beb028cd5c1e4.tar.bz2
nixlib-07eeeb36008b63c8edfc75fce79beb028cd5c1e4.tar.lz
nixlib-07eeeb36008b63c8edfc75fce79beb028cd5c1e4.tar.xz
nixlib-07eeeb36008b63c8edfc75fce79beb028cd5c1e4.tar.zst
nixlib-07eeeb36008b63c8edfc75fce79beb028cd5c1e4.zip
Python: move expressions in python-modules to their own folders
Diffstat (limited to 'pkgs/development/python-modules/ldap')
-rw-r--r--pkgs/development/python-modules/ldap/default.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/ldap/default.nix b/pkgs/development/python-modules/ldap/default.nix
new file mode 100644
index 000000000000..635308f37607
--- /dev/null
+++ b/pkgs/development/python-modules/ldap/default.nix
@@ -0,0 +1,48 @@
+{ lib, writeText, buildPythonPackage, isPy3k, fetchPypi
+, openldap, cyrus_sasl, openssl, pytest }:
+
+buildPythonPackage rec {
+  pname = "python-ldap";
+  version = "2.4.45";
+  name = "${pname}-${version}";
+  disabled = isPy3k;
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "824fde180a53772e23edc031c4dd64ac1af4a3eade78f00d9d510937d562f64e";
+  };
+
+  buildInputs = [ 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"
+
+    # AssertionError: expected errno=107, got 57 -> nix sandbox related ?
+    py.test -k 'not TestLdapCExtension and \
+                not Test01_SimpleLDAPObject and \
+                not Test02_ReconnectLDAPObject' Tests/*.py
+  '';
+
+  patches = lib.singleton (writeText "avoid-syslog.diff" ''
+    diff a/Lib/slapdtest.py b/Lib/slapdtest.py
+    --- a/Lib/slapdtest.py
+    +++ b/Lib/slapdtest.py
+    @@ -60,7 +60,8 @@ def combined_logger(
+                 pass
+         # for writing to syslog
+         new_logger = logging.getLogger(log_name)
+    -    if sys_log_format:
+    +    # /dev/log does not exist in nix build environment.
+    +    if False:
+             my_syslog_formatter = logging.Formatter(
+                 fmt=' '.join((log_name, sys_log_format)))
+             my_syslog_handler = logging.handlers.SysLogHandler(
+  '');
+
+  NIX_CFLAGS_COMPILE = "-I${cyrus_sasl.dev}/include/sasl";
+  propagatedBuildInputs = [openldap cyrus_sasl openssl];
+}