at 18.03-beta 1.6 kB view raw
1{ lib, writeText, buildPythonPackage, isPy3k, fetchPypi 2, openldap, cyrus_sasl, openssl, pytest, pyasn1 }: 3 4buildPythonPackage rec { 5 pname = "python-ldap"; 6 version = "2.5.2"; 7 name = "${pname}-${version}"; 8 disabled = isPy3k; 9 10 src = fetchPypi { 11 inherit pname version; 12 sha256 = "b8c134dfedaef0e6ff4a4b94277708dcadb758b448905a83b8946df077356ed2"; 13 }; 14 15 checkInputs = [ pytest pyasn1 ]; 16 17 checkPhase = '' 18 # Needed by tests to setup a mockup ldap server. 19 export BIN="${openldap}/bin" 20 export SBIN="${openldap}/bin" 21 export SLAPD="${openldap}/libexec/slapd" 22 export SCHEMA="${openldap}/etc/schema" 23 24 # AssertionError: expected errno=107, got 57 -> nix sandbox related ? 25 py.test -k 'not TestLdapCExtension and \ 26 not Test01_SimpleLDAPObject and \ 27 not Test02_ReconnectLDAPObject' Tests/*.py 28 ''; 29 30 patches = lib.singleton (writeText "avoid-syslog.diff" '' 31 diff a/Lib/slapdtest.py b/Lib/slapdtest.py 32 --- a/Lib/slapdtest.py 33 +++ b/Lib/slapdtest.py 34 @@ -60,7 +60,8 @@ def combined_logger( 35 pass 36 # for writing to syslog 37 new_logger = logging.getLogger(log_name) 38 - if sys_log_format: 39 + # /dev/log does not exist in nix build environment. 40 + if False: 41 my_syslog_formatter = logging.Formatter( 42 fmt=' '.join((log_name, sys_log_format))) 43 my_syslog_handler = logging.handlers.SysLogHandler( 44 ''); 45 46 NIX_CFLAGS_COMPILE = "-I${cyrus_sasl.dev}/include/sasl"; 47 propagatedBuildInputs = [openldap cyrus_sasl openssl]; 48}