2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, buildPythonPackage
|
2020-09-25 04:45:31 +00:00
|
|
|
, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, six
|
|
|
|
, decorator
|
|
|
|
, nose
|
|
|
|
, krb5Full
|
2021-03-12 07:09:13 +00:00
|
|
|
, GSS
|
2020-04-24 23:36:52 +00:00
|
|
|
, parameterized
|
|
|
|
, shouldbe
|
|
|
|
, cython
|
|
|
|
, python
|
|
|
|
, k5test
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "gssapi";
|
2021-12-26 17:43:05 +00:00
|
|
|
version = "1.7.2";
|
2020-09-25 04:45:31 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pythongssapi";
|
|
|
|
repo = "python-${pname}";
|
|
|
|
rev = "v${version}";
|
2021-12-26 17:43:05 +00:00
|
|
|
sha256 = "1xdcnm66b07m7chf04pp58p3khvy547hns1fw1xffd4n51kl42pp";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# It's used to locate headers
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
2021-04-08 16:26:57 +00:00
|
|
|
--replace 'get_output(f"{kc} gssapi --prefix")' '"${lib.getDev krb5Full}"'
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cython
|
|
|
|
krb5Full
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
decorator
|
|
|
|
six
|
2020-09-25 04:45:31 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
2021-03-12 07:09:13 +00:00
|
|
|
GSS
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
k5test
|
|
|
|
nose
|
|
|
|
parameterized
|
|
|
|
shouldbe
|
|
|
|
six
|
|
|
|
];
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
doCheck = pythonOlder "3.8" # `shouldbe` not available
|
|
|
|
&& !stdenv.isDarwin; # many failures on darwin
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
# skip tests which fail possibly due to be an upstream issue (see
|
|
|
|
# https://github.com/pythongssapi/python-gssapi/issues/220)
|
2020-04-24 23:36:52 +00:00
|
|
|
checkPhase = ''
|
2020-09-25 04:45:31 +00:00
|
|
|
# some tests don't respond to being disabled through nosetests -x
|
|
|
|
echo $'\ndel CredsTestCase.test_add_with_impersonate' >> gssapi/tests/test_high_level.py
|
|
|
|
echo $'\ndel TestBaseUtilities.test_acquire_creds_impersonate_name' >> gssapi/tests/test_raw.py
|
|
|
|
echo $'\ndel TestBaseUtilities.test_add_cred_impersonate_name' >> gssapi/tests/test_raw.py
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
export PYTHONPATH="$out/${python.sitePackages}:$PYTHONPATH"
|
2022-02-10 20:34:41 +00:00
|
|
|
nosetests -e 'ext_test_\d.*'
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
2020-09-25 04:45:31 +00:00
|
|
|
pythonImportsCheck = [ "gssapi" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://pypi.python.org/pypi/gssapi";
|
|
|
|
description = "Python GSSAPI Wrapper";
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|