nixpkgs/pkgs/development/python-modules/ldap.nix

42 lines
1.3 KiB
Nix
Raw Normal View History

{ lib, writeText, buildPythonPackage, isPy3k, fetchPypi
2017-01-13 16:21:37 +01:00
, openldap, cyrus_sasl, openssl }:
buildPythonPackage rec {
pname = "python-ldap";
2017-06-01 18:11:37 +02:00
version = "2.4.39";
name = "${pname}-${version}";
2017-01-13 16:21:37 +01:00
disabled = isPy3k;
src = fetchPypi {
inherit pname version;
2017-06-01 18:11:37 +02:00
sha256 = "3fb75108d27e8091de80dffa2ba3bf45c7a3bdc357e2959006aed52fa58bb2f3";
2017-01-13 16:21:37 +01:00
};
# Needed by tests to setup a mockup ldap server.
preCheck = ''
export BIN="${openldap}/bin"
export SBIN="${openldap}/bin"
export SLAPD="${openldap}/libexec/slapd"
export 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 16:21:37 +01:00
NIX_CFLAGS_COMPILE = "-I${cyrus_sasl.dev}/include/sasl";
propagatedBuildInputs = [openldap cyrus_sasl openssl];
}