1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-15 17:25:11 +00:00
nixpkgs/pkgs/development/python-modules/ldap/default.nix

49 lines
1.5 KiB
Nix
Raw Normal View History

{ lib, writeText, buildPythonPackage, isPy3k, fetchPypi
2017-12-30 11:24:09 +00:00
, openldap, cyrus_sasl, openssl, pytest, pyasn1 }:
2017-01-13 15:21:37 +00:00
buildPythonPackage rec {
pname = "python-ldap";
2018-04-04 19:10:29 +01:00
version = "3.0.0";
name = "${pname}-${version}";
2017-01-13 15:21:37 +00:00
disabled = isPy3k;
src = fetchPypi {
inherit pname version;
2018-04-04 19:10:29 +01:00
sha256 = "86746b912a2cd37a54b06c694f021b0c8556d4caeab75ef50435ada152e2fbe1";
2017-01-13 15:21:37 +00:00
};
2017-12-30 11:24:09 +00:00
checkInputs = [ pytest pyasn1 ];
2017-08-29 09:14:53 +01:00
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"
2017-08-29 09:14:53 +01: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
'';
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 15:21:37 +00:00
NIX_CFLAGS_COMPILE = "-I${cyrus_sasl.dev}/include/sasl";
propagatedBuildInputs = [openldap cyrus_sasl openssl];
}