2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
stdenv,
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
pythonOlder,
|
|
|
|
fetchFromGitHub,
|
|
|
|
|
|
|
|
# build-system
|
|
|
|
cython,
|
|
|
|
krb5,
|
|
|
|
setuptools,
|
|
|
|
|
|
|
|
# dependencies
|
|
|
|
decorator,
|
|
|
|
|
|
|
|
# native dependencies
|
|
|
|
GSS,
|
|
|
|
|
|
|
|
# tests
|
|
|
|
parameterized,
|
|
|
|
k5test,
|
|
|
|
pytestCheckHook,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "gssapi";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "1.8.3";
|
2024-06-05 15:53:02 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
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}";
|
2023-01-20 10:41:00 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-H1JfdvxJvX5dmC9aTqIOkjAqFEL44KoUXEhoYj2uRY8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
2022-12-17 10:02:37 +00:00
|
|
|
--replace 'get_output(f"{kc} gssapi --prefix")' '"${lib.getDev krb5}"'
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
env = lib.optionalAttrs (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) {
|
|
|
|
GSSAPI_SUPPORT_DETECT = "false";
|
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
build-system = [
|
2020-04-24 23:36:52 +00:00
|
|
|
cython
|
2022-12-17 10:02:37 +00:00
|
|
|
krb5
|
2024-06-05 15:53:02 +00:00
|
|
|
setuptools
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
dependencies = [ decorator ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ GSS ];
|
|
|
|
|
|
|
|
# k5test is marked as broken on darwin
|
|
|
|
doCheck = !stdenv.isDarwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2020-04-24 23:36:52 +00:00
|
|
|
k5test
|
|
|
|
parameterized
|
2024-06-05 15:53:02 +00:00
|
|
|
pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
preCheck = ''
|
|
|
|
mv gssapi/tests $TMPDIR/
|
|
|
|
pushd $TMPDIR
|
|
|
|
'';
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
postCheck = ''
|
|
|
|
popd
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
2024-06-05 15:53:02 +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;
|
|
|
|
};
|
|
|
|
}
|