diff options
author | Katharina Fey <kookie@spacekookie.de> | 2019-10-05 12:43:18 +0000 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2019-10-05 12:44:52 +0000 |
commit | cf85056ba64caf3267d43255ef4a1243e9c8ee3b (patch) | |
tree | 3051519e9c8275b870aac43f80af875715c9d124 /nixpkgs/pkgs/development/python-modules/pysaml2 | |
parent | 1148b1d122bc03e9a3665856c9b7bb96bd4e3994 (diff) | |
parent | 2436c27541b2f52deea3a4c1691216a02152e729 (diff) |
Add 'nixpkgs/' from commit '2436c27541b2f52deea3a4c1691216a02152e729'
git-subtree-dir: nixpkgs
git-subtree-mainline: 1148b1d122bc03e9a3665856c9b7bb96bd4e3994
git-subtree-split: 2436c27541b2f52deea3a4c1691216a02152e729
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/pysaml2')
-rw-r--r-- | nixpkgs/pkgs/development/python-modules/pysaml2/default.nix | 46 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/python-modules/pysaml2/hardcode-xmlsec1-path.patch | 39 |
2 files changed, 85 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/pysaml2/default.nix b/nixpkgs/pkgs/development/python-modules/pysaml2/default.nix new file mode 100644 index 00000000000..1528623aa0e --- /dev/null +++ b/nixpkgs/pkgs/development/python-modules/pysaml2/default.nix @@ -0,0 +1,46 @@ +{ stdenv +, buildPythonPackage +, fetchFromGitHub +, substituteAll +, xmlsec +, cryptography, defusedxml, future, pyopenssl, dateutil, pytz, requests, six +, mock, pyasn1, pymongo, pytest, responses +}: + +buildPythonPackage rec { + pname = "pysaml2"; + version = "4.8.0"; + + # No tests in PyPI tarball + src = fetchFromGitHub { + owner = "IdentityPython"; + repo = pname; + rev = "v${version}"; + sha256 = "1nnmk7apg169bawqi06jbx3p0x4sq12kszzl7k6j39273hqq5ii4"; + }; + + patches = [ + (substituteAll { + src = ./hardcode-xmlsec1-path.patch; + inherit xmlsec; + }) + ]; + + propagatedBuildInputs = [ cryptography defusedxml future pyopenssl dateutil pytz requests six ]; + + checkInputs = [ mock pyasn1 pymongo pytest responses ]; + + # 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" + ''; + + meta = with stdenv.lib; { + homepage = "https://github.com/rohe/pysaml2"; + description = "Python implementation of SAML Version 2 Standard"; + license = licenses.asl20; + }; + +} diff --git a/nixpkgs/pkgs/development/python-modules/pysaml2/hardcode-xmlsec1-path.patch b/nixpkgs/pkgs/development/python-modules/pysaml2/hardcode-xmlsec1-path.patch new file mode 100644 index 00000000000..d984c55a8a7 --- /dev/null +++ b/nixpkgs/pkgs/development/python-modules/pysaml2/hardcode-xmlsec1-path.patch @@ -0,0 +1,39 @@ +diff --git a/src/saml2/sigver.py b/src/saml2/sigver.py +index 59fe2dee..0c24fbcc 100644 +--- a/src/saml2/sigver.py ++++ b/src/saml2/sigver.py +@@ -165,33 +165,7 @@ def get_xmlsec_binary(paths=None): + :return: full name of the xmlsec1 binary found. If no binaries are + found then an exception is raised. + """ +- if os.name == 'posix': +- bin_name = ['xmlsec1'] +- elif os.name == 'nt': +- bin_name = ['xmlsec.exe', 'xmlsec1.exe'] +- else: # Default !? +- bin_name = ['xmlsec1'] +- +- if paths: +- for bname in bin_name: +- for path in paths: +- fil = os.path.join(path, bname) +- try: +- if os.lstat(fil): +- return fil +- except OSError: +- pass +- +- for path in os.environ['PATH'].split(os.pathsep): +- for bname in bin_name: +- fil = os.path.join(path, bname) +- try: +- if os.lstat(fil): +- return fil +- except OSError: +- pass +- +- raise SigverError('Cannot find {binary}'.format(binary=bin_name)) ++ return '@xmlsec@/bin/xmlsec1' + + + def _get_xmlsec_cryptobackend(path=None, search_paths=None): |