2017-05-29 09:32:07 +00:00
|
|
|
{ lib, writeText, buildPythonPackage, isPy3k, fetchPypi
|
2017-01-13 15:21:37 +00:00
|
|
|
, openldap, cyrus_sasl, openssl }:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2017-05-27 09:25:35 +00:00
|
|
|
pname = "python-ldap";
|
2017-05-27 12:24:47 +00:00
|
|
|
version = "2.4.38";
|
2017-05-27 09:25:35 +00:00
|
|
|
name = "${pname}-${version}";
|
2017-01-13 15:21:37 +00:00
|
|
|
disabled = isPy3k;
|
|
|
|
|
2017-05-29 01:05:56 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2017-05-27 12:24:47 +00:00
|
|
|
sha256 = "88bab69e519dd8bd83becbe36bd141c174b0fe309e84936cf1bae685b31be779";
|
2017-01-13 15:21:37 +00:00
|
|
|
};
|
|
|
|
|
2017-05-29 09:32:07 +00:00
|
|
|
# Needed by tests to setup a mockup ldap server.
|
|
|
|
BIN = "${openldap}/bin";
|
|
|
|
SBIN = "${openldap}/bin";
|
|
|
|
SLAPD = "${openldap}/libexec/slapd";
|
|
|
|
SCHEMA = "${openldap}/etc/schema";
|
|
|
|
|
|
|
|
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];
|
|
|
|
}
|