@@ -1,33 +1,40 @@
1−{ stdenv, fetchurl, python2 }:
2−
3−stdenv.mkDerivation rec {
4− name = "mailman-${version}";
5− version = "2.1.29";
6−
7− src = fetchurl {
8− url = "mirror://gnu/mailman/${name}.tgz";
9− sha256 = "0b0dpwf6ap260791c7lg2vpw30llf19hymbf2hja3s016rqp5243";
1+{ stdenv, buildPythonPackage, fetchPypi, alembic, aiosmtpd, dnspython
2+, flufl_bounce, flufl_i18n, flufl_lock, lazr_config, lazr_delegates, passlib
3+, requests, zope_configuration, click, falcon, importlib-resources
4+, zope_component
5+}:
6+
7+buildPythonPackage rec {
8+ pname = "mailman";
9+ version = "3.2.2";
10+
11+ src = fetchPypi {
12+ inherit pname version;
13+ sha256 = "09s9p5pb8gff6zblwidyq830yfgcvv50p5drdaxj1qpy8w46lvc6";
1014 };
1115
12− buildInputs = [ python2 python2.pkgs.dnspython ];
13−
14− patches = [ ./fix-var-prefix.patch ];
15−
16− configureFlags = [
17− "--without-permcheck"
18− "--with-cgi-ext=.cgi"
19− "--with-var-prefix=/var/lib/mailman"
16+ propagatedBuildInputs = [
17+ alembic aiosmtpd click dnspython falcon flufl_bounce flufl_i18n flufl_lock
18+ importlib-resources lazr_config passlib requests zope_configuration
19+ zope_component
2020 ];
2121
22− installTargets = "doinstall"; # Leave out the 'update' target that's implied by 'install'.
23−
24− makeFlags = [ "DIRSETGID=:" ];
22+ # Mailman assumes that those scripts in $out/bin are Python scripts. Wrapping
23+ # them in shell code breaks this assumption. The proper way to use mailman is
24+ # to create a specialized python interpreter:
25+ #
26+ # python37.withPackages (ps: [ps.mailman])
27+ #
28+ # This gives a properly wrapped 'mailman' command plus an interpreter that
29+ # has all the necessary search paths to execute unwrapped 'master' and
30+ # 'runner' scripts. The setup is a little tricky, but fortunately NixOS is
31+ # about to get a OS module that takes care of those details.
32+ dontWrapPythonPrograms = true;
2533
2634 meta = {
2735 homepage = https://www.gnu.org/software/mailman/;
28− description = "Free software for managing electronic mail discussion and e-newsletter lists";
29− license = stdenv.lib.licenses.gpl2Plus;
30− platforms = stdenv.lib.platforms.linux;
31− maintainers = [ stdenv.lib.maintainers.peti ];
36+ description = "Free software for managing electronic mail discussion and newsletter lists";
37+ license = stdenv.lib.licenses.gpl3Plus;
38+ maintainers = with stdenv.lib.maintainers; [ peti ];
3239 };
3340}