2017-05-29 11:32:07 +02:00
|
|
|
{ lib, writeText, buildPythonPackage, isPy3k, fetchPypi
|
2017-12-30 12:24:09 +01:00
|
|
|
, openldap, cyrus_sasl, openssl, pytest, pyasn1 }:
|
2017-01-13 16:21:37 +01:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2017-05-27 11:25:35 +02:00
|
|
|
pname = "python-ldap";
|
2017-12-30 12:24:09 +01:00
|
|
|
version = "2.5.2";
|
2017-05-27 11:25:35 +02:00
|
|
|
name = "${pname}-${version}";
|
2017-01-13 16:21:37 +01:00
|
|
|
disabled = isPy3k;
|
|
|
|
|
2017-05-29 03:05:56 +02:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2017-12-30 12:24:09 +01:00
|
|
|
sha256 = "b8c134dfedaef0e6ff4a4b94277708dcadb758b448905a83b8946df077356ed2";
|
2017-01-13 16:21:37 +01:00
|
|
|
};
|
|
|
|
|
2017-12-30 12:24:09 +01:00
|
|
|
checkInputs = [ pytest pyasn1 ];
|
2017-08-29 10:14:53 +02:00
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
# Needed by tests to setup a mockup ldap server.
|
2017-06-01 01:30:29 +02:00
|
|
|
export BIN="${openldap}/bin"
|
|
|
|
export SBIN="${openldap}/bin"
|
|
|
|
export SLAPD="${openldap}/libexec/slapd"
|
|
|
|
export SCHEMA="${openldap}/etc/schema"
|
2017-08-29 10:14:53 +02:00
|
|
|
|
|
|
|
# AssertionError: expected errno=107, got 57 -> nix sandbox related ?
|
|
|
|
py.test -k 'not TestLdapCExtension and \
|
|
|
|
not Test01_SimpleLDAPObject and \
|
|
|
|
not Test02_ReconnectLDAPObject' Tests/*.py
|
2017-06-01 01:30:29 +02:00
|
|
|
'';
|
2017-05-29 11:32:07 +02:00
|
|
|
|
|
|
|
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(
|
|
|
|
'');
|
|
|
|
|
2017-01-13 16:21:37 +01:00
|
|
|
NIX_CFLAGS_COMPILE = "-I${cyrus_sasl.dev}/include/sasl";
|
|
|
|
propagatedBuildInputs = [openldap cyrus_sasl openssl];
|
|
|
|
}
|