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
|
|
|
|
, darwin
|
|
|
|
, parameterized
|
|
|
|
, shouldbe
|
|
|
|
, cython
|
|
|
|
, python
|
|
|
|
, k5test
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "gssapi";
|
2020-11-24 20:58:05 +00:00
|
|
|
version = "1.6.10";
|
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}";
|
2020-11-24 20:58:05 +00:00
|
|
|
sha256 = "11w8z9ik6zzv3pw3319mz91cgbfkgx0mffxbapqnhilzij2jad4q";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# It's used to locate headers
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "get_output('krb5-config gssapi --prefix')" "'${lib.getDev krb5Full}'"
|
|
|
|
'';
|
|
|
|
|
|
|
|
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 [
|
|
|
|
darwin.apple_sdk.frameworks.GSS
|
|
|
|
];
|
|
|
|
|
|
|
|
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"
|
2020-09-25 04:45:31 +00:00
|
|
|
${python.interpreter} setup.py 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;
|
|
|
|
};
|
|
|
|
}
|