diff --git a/pkgs/development/python-modules/flufl/bounce.nix b/pkgs/development/python-modules/flufl/bounce.nix new file mode 100644 index 000000000000..0a2e8dff1b73 --- /dev/null +++ b/pkgs/development/python-modules/flufl/bounce.nix @@ -0,0 +1,14 @@ +{ buildPythonPackage, fetchPypi, atpublic, zope_interface, nose2 }: + +buildPythonPackage rec { + pname = "flufl.bounce"; + version = "3.0"; + + buildInputs = [ nose2 ]; + propagatedBuildInputs = [ atpublic zope_interface ]; + + src = fetchPypi { + inherit pname version; + sha256 = "0k5kjqa3x6gvwwxyzb2vwi1g1i6asm1zw5fivylxz3d583y4kid2"; + }; +} diff --git a/pkgs/development/python-modules/flufl/i18n.nix b/pkgs/development/python-modules/flufl/i18n.nix new file mode 100644 index 000000000000..6e8d77bf4f81 --- /dev/null +++ b/pkgs/development/python-modules/flufl/i18n.nix @@ -0,0 +1,13 @@ +{ buildPythonPackage, fetchPypi, atpublic }: + +buildPythonPackage rec { + pname = "flufl.i18n"; + version = "2.0.2"; + + propagatedBuildInputs = [ atpublic ]; + + src = fetchPypi { + inherit pname version; + sha256 = "1csgds59nx0ann9v2alqr69lakp1cnc1ikmbgn96l6n23js7c2ah"; + }; +} diff --git a/pkgs/development/python-modules/flufl/lock.nix b/pkgs/development/python-modules/flufl/lock.nix new file mode 100644 index 000000000000..1be5d9a7c4c2 --- /dev/null +++ b/pkgs/development/python-modules/flufl/lock.nix @@ -0,0 +1,13 @@ +{ buildPythonPackage, fetchPypi, atpublic }: + +buildPythonPackage rec { + pname = "flufl.lock"; + version = "3.2"; + + propagatedBuildInputs = [ atpublic ]; + + src = fetchPypi { + inherit pname version; + sha256 = "0nzzd6l30ff6cwsrlrb94xzfja4wkyrqv3ydc6cz0hdbr766mmm8"; + }; +} diff --git a/pkgs/development/python-modules/lazr/config.nix b/pkgs/development/python-modules/lazr/config.nix new file mode 100644 index 000000000000..759c9689bc93 --- /dev/null +++ b/pkgs/development/python-modules/lazr/config.nix @@ -0,0 +1,13 @@ +{ buildPythonPackage, fetchPypi, lazr_delegates }: + +buildPythonPackage rec { + pname = "lazr.config"; + version = "2.2.1"; + + propagatedBuildInputs = [ lazr_delegates ]; + + src = fetchPypi { + inherit pname version; + sha256 = "1s7pyvlq06qjrkaw9r6nc290lb095n25ybzgavvy51ygpxkgqxwn"; + }; +} diff --git a/pkgs/development/python-modules/lazr/delegates.nix b/pkgs/development/python-modules/lazr/delegates.nix new file mode 100644 index 000000000000..40e2e47d517d --- /dev/null +++ b/pkgs/development/python-modules/lazr/delegates.nix @@ -0,0 +1,15 @@ +{ buildPythonPackage, fetchPypi, nose, zope_interface }: + +buildPythonPackage rec { + pname = "lazr.delegates"; + version = "2.0.4"; + + propagatedBuildInputs = [ nose zope_interface ]; + + doCheck = false; # cannot import name 'ClassType' from 'types' + + src = fetchPypi { + inherit pname version; + sha256 = "1rdnl85j9ayp8n85l0ciip621j9dcziz5qnmv2m7krgwgcn31vfx"; + }; +} diff --git a/pkgs/servers/mail/mailman/default.nix b/pkgs/servers/mail/mailman/default.nix index 91445afa97df..e3cd393c3c33 100644 --- a/pkgs/servers/mail/mailman/default.nix +++ b/pkgs/servers/mail/mailman/default.nix @@ -1,33 +1,40 @@ -{ stdenv, fetchurl, python2 }: +{ stdenv, buildPythonPackage, fetchPypi, alembic, aiosmtpd, dnspython +, flufl_bounce, flufl_i18n, flufl_lock, lazr_config, lazr_delegates, passlib +, requests, zope_configuration, click, falcon, importlib-resources +, zope_component +}: -stdenv.mkDerivation rec { - name = "mailman-${version}"; - version = "2.1.29"; +buildPythonPackage rec { + pname = "mailman"; + version = "3.2.2"; - src = fetchurl { - url = "mirror://gnu/mailman/${name}.tgz"; - sha256 = "0b0dpwf6ap260791c7lg2vpw30llf19hymbf2hja3s016rqp5243"; + src = fetchPypi { + inherit pname version; + sha256 = "09s9p5pb8gff6zblwidyq830yfgcvv50p5drdaxj1qpy8w46lvc6"; }; - buildInputs = [ python2 python2.pkgs.dnspython ]; - - patches = [ ./fix-var-prefix.patch ]; - - configureFlags = [ - "--without-permcheck" - "--with-cgi-ext=.cgi" - "--with-var-prefix=/var/lib/mailman" + propagatedBuildInputs = [ + alembic aiosmtpd click dnspython falcon flufl_bounce flufl_i18n flufl_lock + importlib-resources lazr_config passlib requests zope_configuration + zope_component ]; - installTargets = "doinstall"; # Leave out the 'update' target that's implied by 'install'. - - makeFlags = [ "DIRSETGID=:" ]; + # Mailman assumes that those scripts in $out/bin are Python scripts. Wrapping + # them in shell code breaks this assumption. The proper way to use mailman is + # to create a specialized python interpreter: + # + # python37.withPackages (ps: [ps.mailman]) + # + # This gives a properly wrapped 'mailman' command plus an interpreter that + # has all the necessary search paths to execute unwrapped 'master' and + # 'runner' scripts. The setup is a little tricky, but fortunately NixOS is + # about to get a OS module that takes care of those details. + dontWrapPythonPrograms = true; meta = { homepage = https://www.gnu.org/software/mailman/; - description = "Free software for managing electronic mail discussion and e-newsletter lists"; - license = stdenv.lib.licenses.gpl2Plus; - platforms = stdenv.lib.platforms.linux; - maintainers = [ stdenv.lib.maintainers.peti ]; + description = "Free software for managing electronic mail discussion and newsletter lists"; + license = stdenv.lib.licenses.gpl3Plus; + maintainers = with stdenv.lib.maintainers; [ peti ]; }; } diff --git a/pkgs/servers/mail/mailman/fix-var-prefix.patch b/pkgs/servers/mail/mailman/fix-var-prefix.patch deleted file mode 100644 index 9bb735ecbed7..000000000000 --- a/pkgs/servers/mail/mailman/fix-var-prefix.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff -ubr mailman-2.1.16-orig/contrib/redhat_fhs.patch mailman-2.1.16/contrib/redhat_fhs.patch ---- mailman-2.1.16-orig/contrib/redhat_fhs.patch 2013-10-21 14:55:48.797631434 +0200 -+++ mailman-2.1.16/contrib/redhat_fhs.patch 2013-10-21 14:56:42.534310378 +0200 -@@ -197,7 +197,7 @@ - + else true; \ - + fi; \ - + done -- chmod o-r $(DESTDIR)$(var_prefix)/archives/private -+ chmod o-r $(prefix)$(var_prefix)/archives/private - @for d in $(ARCH_INDEP_DIRS); \ - do \ - Only in mailman-2.1.5.FHS: Makefile.in~ -diff -ubr mailman-2.1.16-orig/Makefile.in mailman-2.1.16/Makefile.in ---- mailman-2.1.16-orig/Makefile.in 2013-10-21 14:55:48.798631519 +0200 -+++ mailman-2.1.16/Makefile.in 2013-10-21 14:56:42.562313220 +0200 -@@ -87,7 +87,7 @@ - @echo "Creating architecture independent directories..." - @for d in $(VAR_DIRS); \ - do \ -- dir=$(DESTDIR)$(var_prefix)/$$d; \ -+ dir=$(prefix)$(var_prefix)/$$d; \ - if test ! -d $$dir; then \ - echo "Creating directory hierarchy $$dir"; \ - $(srcdir)/mkinstalldirs $$dir; \ -@@ -96,7 +96,7 @@ - else true; \ - fi; \ - done -- chmod o-r $(DESTDIR)$(var_prefix)/archives/private -+ chmod o-r $(prefix)$(var_prefix)/archives/private - @for d in $(ARCH_INDEP_DIRS); \ - do \ - dir=$(DESTDIR)$(prefix)/$$d; \ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9b01b7a6bff4..c819d1e893f5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14669,8 +14669,6 @@ in labelImg = callPackage ../applications/science/machine-learning/labelimg { }; - mailman = callPackage ../servers/mail/mailman { }; - mailman-rss = callPackage ../development/python-modules/mailman-rss { }; mattermost = callPackage ../servers/mattermost { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c61bab85fa77..e77d3aecea25 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -583,6 +583,12 @@ in { firetv = callPackage ../development/python-modules/firetv { }; + flufl_bounce = callPackage ../development/python-modules/flufl/bounce.nix { }; + + flufl_i18n = callPackage ../development/python-modules/flufl/i18n.nix { }; + + flufl_lock = callPackage ../development/python-modules/flufl/lock.nix { }; + foxdot = callPackage ../development/python-modules/foxdot { }; fsspec = callPackage ../development/python-modules/fsspec { }; @@ -685,6 +691,10 @@ in { langdetect = callPackage ../development/python-modules/langdetect { }; + lazr_config = callPackage ../development/python-modules/lazr/config.nix { }; + + lazr_delegates = callPackage ../development/python-modules/lazr/delegates.nix { }; + libmr = callPackage ../development/python-modules/libmr { }; limitlessled = callPackage ../development/python-modules/limitlessled { }; @@ -701,6 +711,8 @@ in { mail-parser = callPackage ../development/python-modules/mail-parser { }; + mailman = disabledIf (!isPy3k) (callPackage ../servers/mail/mailman { }); + manhole = callPackage ../development/python-modules/manhole { }; markerlib = callPackage ../development/python-modules/markerlib { };