2018-10-26 03:04:53 +01:00
|
|
|
{ stdenv
|
|
|
|
, buildPythonPackage
|
2020-02-09 22:14:01 +00:00
|
|
|
, isPy3k
|
2019-01-11 10:16:36 +00:00
|
|
|
, fetchFromGitHub
|
2020-02-10 22:45:12 +00:00
|
|
|
, fetchpatch
|
2019-01-11 10:16:36 +00:00
|
|
|
, substituteAll
|
|
|
|
, xmlsec
|
|
|
|
, cryptography, defusedxml, future, pyopenssl, dateutil, pytz, requests, six
|
|
|
|
, mock, pyasn1, pymongo, pytest, responses
|
2018-10-26 03:04:53 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pysaml2";
|
2020-02-09 22:14:01 +00:00
|
|
|
version = "5.0.0";
|
|
|
|
|
|
|
|
disabled = !isPy3k;
|
2019-01-11 10:16:36 +00:00
|
|
|
|
|
|
|
# No tests in PyPI tarball
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "IdentityPython";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2020-02-09 22:14:01 +00:00
|
|
|
sha256 = "0hwhxz45h8l1b0615hf855z7valfcmm0nb7k31bcj84v68zp5rjs";
|
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-10 22:45:12 +00:00
|
|
|
# remove on next release
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-test-dates.patch";
|
|
|
|
url = "https://github.com/IdentityPython/pysaml2/commit/1d97d2d26f63e42611558fdd0e439bb8a7496a27.patch";
|
|
|
|
sha256 = "0r6d6hkk6z9yw7aqnsnylii516ysmdsc8dghwmgnwvw6cm7l388p";
|
|
|
|
})
|
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
|
|
|
|
'';
|
|
|
|
|
2019-01-11 10:16:36 +00:00
|
|
|
propagatedBuildInputs = [ cryptography defusedxml future pyopenssl dateutil pytz requests six ];
|
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 \
|
|
|
|
and not test_load_external"
|
|
|
|
'';
|
2018-10-26 03:04:53 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = "https://github.com/rohe/pysaml2";
|
|
|
|
description = "Python implementation of SAML Version 2 Standard";
|
|
|
|
license = licenses.asl20;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|