1{ buildPythonPackage
2, fetchFromGitHub
3, fetchpatch
4, lib
5, poetry-core
6, netaddr
7, six
8, unittestCheckHook
9}:
10
11buildPythonPackage rec {
12 pname = "pyrad";
13 version = "2.4";
14 format = "pyproject";
15
16 src = fetchFromGitHub {
17 owner = "pyradius";
18 repo = pname;
19 rev = version;
20 hash = "sha256-oqgkE0xG/8cmLeRZdGoHkaHbjtByeJwzBJwEdxH8oNY=";
21 };
22
23 patches = [
24 (fetchpatch {
25 # Migrate to poetry-core
26 url = "https://github.com/pyradius/pyrad/commit/a4b70067dd6269e14a2f9530d820390a8a454231.patch";
27 hash = "sha256-1We9wrVY3Or3GLIKK6hZvEjVYv6JOaahgP9zOMvgErE=";
28 })
29 ];
30
31 nativeBuildInputs = [
32 poetry-core
33 ];
34
35 propagatedBuildInputs = [
36 netaddr
37 six
38 ];
39
40 preCheck = ''
41 substituteInPlace tests/testServer.py \
42 --replace "def testBind(self):" "def dontTestBind(self):" \
43 --replace "def testBindv6(self):" "def dontTestBindv6(self):"
44 '';
45
46 nativeCheckInputs = [
47 unittestCheckHook
48 ];
49
50 pythonImportsCheck = [
51 "pyrad"
52 ];
53
54 meta = with lib; {
55 description = "Python RADIUS Implementation";
56 homepage = "https://github.com/pyradius/pyrad";
57 license = licenses.bsd3;
58 maintainers = with maintainers; [ globin ];
59 };
60}