2021-01-25 08:26:54 +00:00
|
|
|
{ lib
|
2018-10-26 03:04:53 +01:00
|
|
|
, buildPythonPackage
|
2020-02-09 22:14:01 +00:00
|
|
|
, isPy3k
|
2019-01-11 10:16:36 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, substituteAll
|
|
|
|
, xmlsec
|
2021-01-31 21:05:14 +00:00
|
|
|
, cryptography, defusedxml, pyopenssl, dateutil, pytz, requests, six
|
|
|
|
, mock, pyasn1, pymongo, pytest, responses, xmlschema, importlib-resources
|
2018-10-26 03:04:53 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pysaml2";
|
2021-01-31 21:05:14 +00:00
|
|
|
version = "6.5.1";
|
2020-02-09 22:14:01 +00:00
|
|
|
|
|
|
|
disabled = !isPy3k;
|
2019-01-11 10:16:36 +00:00
|
|
|
|
|
|
|
# No tests in PyPI tarball
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "IdentityPython";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-01-31 21:05:14 +00:00
|
|
|
sha256 = "1gh74csjk6af23agyigk4id79s4li1xnkmbpp73aqyvlly2kd0b7";
|
2018-10-26 03:04:53 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
2019-01-11 10:16:36 +00:00
|
|
|
(substituteAll {
|
|
|
|
src = ./hardcode-xmlsec1-path.patch;
|
|
|
|
inherit xmlsec;
|
2018-10-26 03:04:53 +01:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-02-23 13:44:46 +00:00
|
|
|
postPatch = ''
|
|
|
|
# fix failing tests on systems with 32bit time_t
|
|
|
|
sed -i 's/2999\(-.*T\)/2029\1/g' tests/*.xml
|
|
|
|
'';
|
|
|
|
|
2021-01-31 21:05:14 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
cryptography
|
|
|
|
dateutil
|
|
|
|
defusedxml
|
|
|
|
importlib-resources
|
|
|
|
pyopenssl
|
|
|
|
pytz
|
|
|
|
requests
|
|
|
|
six
|
|
|
|
xmlschema
|
|
|
|
];
|
2018-10-26 03:04:53 +01:00
|
|
|
|
2019-01-11 10:16:36 +00:00
|
|
|
checkInputs = [ mock pyasn1 pymongo pytest responses ];
|
2018-10-26 03:04:53 +01:00
|
|
|
|
2019-01-11 10:16:36 +00:00
|
|
|
# Disabled tests try to access the network
|
|
|
|
checkPhase = ''
|
|
|
|
py.test -k "not test_load_extern_incommon \
|
|
|
|
and not test_load_remote_encoding \
|
2020-10-31 12:21:26 +00:00
|
|
|
and not test_load_external \
|
|
|
|
and not test_conf_syslog"
|
2019-01-11 10:16:36 +00:00
|
|
|
'';
|
2018-10-26 03:04:53 +01:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-10-26 03:04:53 +01:00
|
|
|
homepage = "https://github.com/rohe/pysaml2";
|
|
|
|
description = "Python implementation of SAML Version 2 Standard";
|
|
|
|
license = licenses.asl20;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|