diff --git a/pkgs/development/python-modules/django-mailman3/default.nix b/pkgs/development/python-modules/django-mailman3/default.nix index 6d47d5a9ed89..467867a3cead 100644 --- a/pkgs/development/python-modules/django-mailman3/default.nix +++ b/pkgs/development/python-modules/django-mailman3/default.nix @@ -2,6 +2,7 @@ lib, buildPythonPackage, fetchPypi, + fetchpatch, # build-system pdm-backend, @@ -30,6 +31,18 @@ buildPythonPackage rec { hash = "sha256-+ZFrJpy5xdW6Yde/XEvxoAN8+TSQdiI0PfjZ7bHG0Rs="; }; + patches = [ + (fetchpatch { + name = "django-5.2.patch"; + url = "https://gitlab.com/mailman/django-mailman3/-/commit/465c1ffc77556bb8a80a678f53a40f16b9766cc6.patch"; + excludes = [ + ".gitlab-ci.yml" + "README.rst" + ]; + hash = "sha256-gSFczuNLlMclqixOu6ElS0BewUTGyhP6RXtE/waLzyo="; + }) + ]; + pythonRelaxDeps = [ "django-allauth" ]; build-system = [ pdm-backend ]; @@ -65,6 +78,6 @@ buildPythonPackage rec { license = lib.licenses.gpl3Plus; maintainers = with lib.maintainers; [ qyliss ]; broken = - lib.versionAtLeast django-allauth.version "65.0.0" || lib.versionAtLeast django.version "5.1"; + lib.versionAtLeast django-allauth.version "65.0.0" || lib.versionAtLeast django.version "5.3"; }; } diff --git a/pkgs/servers/mail/mailman/default.nix b/pkgs/servers/mail/mailman/default.nix index 290bb4e1a1e0..3295bdbb68d6 100644 --- a/pkgs/servers/mail/mailman/default.nix +++ b/pkgs/servers/mail/mailman/default.nix @@ -1,7 +1,7 @@ { newScope, lib, - python312, + python3, }: let @@ -13,7 +13,7 @@ let { callPackage = newScope self; - python3 = callPackage ./python.nix { python3 = python312; }; + python3 = callPackage ./python.nix { inherit python3; }; hyperkitty = callPackage ./hyperkitty.nix { }; diff --git a/pkgs/servers/mail/mailman/hyperkitty.nix b/pkgs/servers/mail/mailman/hyperkitty.nix index 083e200e6505..6d2b8780f135 100644 --- a/pkgs/servers/mail/mailman/hyperkitty.nix +++ b/pkgs/servers/mail/mailman/hyperkitty.nix @@ -30,8 +30,19 @@ buildPythonPackage rec { url = "https://gitlab.com/mailman/hyperkitty/-/commit/6c3d402dc0981e545081a3baf13db7e491356e75.patch"; hash = "sha256-ep9cFZe9/sIfIP80pLBOMYkJKWvNT7DRqg80DQSdRFw="; }) + # Fix test with Django 5.2 + (fetchpatch { + url = "https://gitlab.com/mailman/hyperkitty/-/commit/e815be11752ac6a3e839b155f0c43808619c56b0.patch"; + hash = "sha256-fsJyNsh3l5iR9WgsiEsHlptkN+nlWoop0m2STyucDEc="; + }) ]; + prePatch = '' + # Upstream: https://gitlab.com/mailman/hyperkitty/-/commit/b8b7536c2cb7380ec55ed62140617cff8ae36b1d + substituteInPlace pyproject.toml \ + --replace-fail '"django>=4.2,<5.1"' '"django>=4.2,<5.3"' + ''; + build-system = [ pdm-backend ]; diff --git a/pkgs/servers/mail/mailman/python.nix b/pkgs/servers/mail/mailman/python.nix index c8fd7159f717..9a1b7b094413 100644 --- a/pkgs/servers/mail/mailman/python.nix +++ b/pkgs/servers/mail/mailman/python.nix @@ -26,8 +26,7 @@ lib.fix ( [1] 72a14ea563a3f5bf85db659349a533fe75a8b0ce [2] f931bc81d63f5cfda55ac73d754c87b3fd63b291 */ - # https://gitlab.com/mailman/hyperkitty/-/merge_requests/681 - django = super.django_4; + django = super.django_5; django-allauth = super.django-allauth.overrideAttrs ( new: diff --git a/pkgs/servers/mail/mailman/web.nix b/pkgs/servers/mail/mailman/web.nix index 5a928a8f22a3..1a2b363c7cd7 100644 --- a/pkgs/servers/mail/mailman/web.nix +++ b/pkgs/servers/mail/mailman/web.nix @@ -2,6 +2,7 @@ lib, python3, fetchPypi, + fetchpatch, sassc, hyperkitty, postorius, @@ -20,6 +21,15 @@ buildPythonPackage rec { hash = "sha256-3wnduej6xMQzrjGhGXQznfJud/Uoy3BDduukRJeahL8="; }; + patches = [ + (fetchpatch { + name = "django-5.2.patch"; + url = "https://gitlab.com/mailman/mailman-web/-/commit/bf3eae03ba6ed416ff58e63ea30dd4b95f310e46.patch"; + includes = [ "pyproject.toml" ]; + hash = "sha256-NcXFXYJe3ve4qAGzOVZv9hBx4MTwxRtIYp1GRD1g0qw="; + }) + ]; + postPatch = '' # Upstream seems to mostly target installing on top of existing # distributions, and uses a path appropriate for that, but we are