1{
2 lib,
3 python3,
4 fetchurl,
5 nixosTests,
6 fetchpatch,
7}:
8
9with python3.pkgs;
10
11buildPythonPackage rec {
12 pname = "hyperkitty";
13 version = "1.3.12";
14 pyproject = true;
15
16 disabled = pythonOlder "3.10";
17
18 src = fetchurl {
19 url = "https://gitlab.com/mailman/hyperkitty/-/releases/${version}/downloads/hyperkitty-${version}.tar.gz";
20 hash = "sha256-3rWCk37FvJ6pwdXYa/t2pNpCm2Dh/qb9aWTnxmfPFh0=";
21 };
22
23 patches = [
24 # Fix test with mistune >= 3.1
25 (fetchpatch {
26 url = "https://gitlab.com/mailman/hyperkitty/-/commit/2d69f420c603356a639a6b6243e1059a0089b7eb.patch";
27 hash = "sha256-zo+dK8DFMkHlMrOVSUtelhAq+cxJE4gLG00LvuAlWKA=";
28 })
29 # Fix test with python 3.13
30 # https://gitlab.com/mailman/hyperkitty/-/merge_requests/657
31 (fetchpatch {
32 url = "https://gitlab.com/mailman/hyperkitty/-/commit/6c3d402dc0981e545081a3baf13db7e491356e75.patch";
33 hash = "sha256-ep9cFZe9/sIfIP80pLBOMYkJKWvNT7DRqg80DQSdRFw=";
34 })
35 ];
36
37 build-system = [
38 pdm-backend
39 ];
40
41 dependencies = [
42 django
43 django-gravatar2
44 django-haystack
45 django-mailman3
46 django-q2
47 django-compressor
48 django-extensions
49 djangorestframework
50 flufl-lock
51 mistune
52 networkx
53 psycopg2
54 python-dateutil
55 robot-detection
56 ];
57
58 # Some of these are optional runtime dependencies that are not
59 # listed as dependencies in pyproject.toml. To use these, they
60 # should be dependencies of the Django Python environment, but not
61 # of HyperKitty so they're not included for people who don't need
62 # them.
63 nativeCheckInputs = [
64 beautifulsoup4
65 elastic-transport
66 elasticsearch
67 mock
68 whoosh
69 ]
70 ++ beautifulsoup4.optional-dependencies.lxml;
71
72 checkPhase = ''
73 cd $NIX_BUILD_TOP/$sourceRoot
74 PYTHONPATH=.:$PYTHONPATH python example_project/manage.py test \
75 --settings=hyperkitty.tests.settings_test hyperkitty
76 '';
77
78 passthru.tests = { inherit (nixosTests) mailman; };
79
80 meta = {
81 changelog = "https://docs.mailman3.org/projects/hyperkitty/en/latest/news.html";
82 homepage = "https://www.gnu.org/software/mailman/";
83 description = "Archiver for GNU Mailman v3";
84 license = lib.licenses.gpl3;
85 platforms = lib.platforms.linux;
86 maintainers = with lib.maintainers; [ qyliss ];
87 };
88}