2022-04-27 09:35:20 +00:00
|
|
|
{ buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, lib
|
|
|
|
, poetry-core
|
|
|
|
, netaddr
|
|
|
|
, six
|
|
|
|
, python
|
|
|
|
}:
|
2020-05-15 21:57:56 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyrad";
|
2021-08-27 14:25:00 +00:00
|
|
|
version = "2.4";
|
2022-04-27 09:35:20 +00:00
|
|
|
format = "pyproject";
|
2020-05-15 21:57:56 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pyradius";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-08-27 14:25:00 +00:00
|
|
|
sha256 = "sha256-oqgkE0xG/8cmLeRZdGoHkaHbjtByeJwzBJwEdxH8oNY=";
|
2020-05-15 21:57:56 +00:00
|
|
|
};
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
# Migrate to poetry-core
|
|
|
|
url = "https://github.com/pyradius/pyrad/commit/a4b70067dd6269e14a2f9530d820390a8a454231.patch";
|
|
|
|
hash = "sha256-1We9wrVY3Or3GLIKK6hZvEjVYv6JOaahgP9zOMvgErE=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
netaddr
|
|
|
|
six
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
substituteInPlace tests/testServer.py \
|
|
|
|
--replace "def testBind(self):" "def dontTestBind(self):" \
|
|
|
|
--replace "def testBindv6(self):" "def dontTestBindv6(self):"
|
|
|
|
'';
|
2020-05-15 21:57:56 +00:00
|
|
|
|
|
|
|
checkPhase = ''
|
2022-04-27 09:35:20 +00:00
|
|
|
runHook preCheck
|
|
|
|
${python.interpreter} -m unittest discover
|
|
|
|
runHook postCheck
|
2020-05-15 21:57:56 +00:00
|
|
|
'';
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"pyrad"
|
|
|
|
];
|
2021-08-27 14:25:00 +00:00
|
|
|
|
2020-05-15 21:57:56 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Python RADIUS Implementation";
|
2022-04-27 09:35:20 +00:00
|
|
|
homepage = "https://github.com/pyradius/pyrad";
|
2021-08-27 14:25:00 +00:00
|
|
|
license = licenses.bsd3;
|
2022-04-27 09:35:20 +00:00
|
|
|
maintainers = with maintainers; [ globin ];
|
2020-05-15 21:57:56 +00:00
|
|
|
};
|
|
|
|
}
|