diff options
4 files changed, 35 insertions, 69 deletions
diff --git a/nixpkgs/pkgs/servers/mail/public-inbox/default.nix b/nixpkgs/pkgs/servers/mail/public-inbox/default.nix index 5edd841bc4d7..8773a210c7e0 100644 --- a/nixpkgs/pkgs/servers/mail/public-inbox/default.nix +++ b/nixpkgs/pkgs/servers/mail/public-inbox/default.nix @@ -1,6 +1,6 @@ -{ buildPerlPackage, lib, fetchurl, fetchpatch, makeWrapper -, DBDSQLite, EmailMIME, IOSocketSSL, IPCRun, Plack, PlackMiddlewareReverseProxy -, SearchXapian, TimeDate, URI +{ buildPerlPackage, lib, fetchurl, makeWrapper +, DBDSQLite, EmailMIME, IOSocketSSL, IPCRun, MailIMAPClient, ParseRecDescent +, Plack, PlackMiddlewareReverseProxy, SearchXapian, TimeDate, URI , git, highlight, openssl, sqlite, xapian }: @@ -24,20 +24,13 @@ in buildPerlPackage rec { pname = "public-inbox"; - version = "1.5.0"; + version = "1.6.1"; src = fetchurl { url = "https://public-inbox.org/public-inbox.git/snapshot/public-inbox-${version}.tar.gz"; - sha256 = "11fvgcs4vj4jbvwij3fh3jilvmaz0qzv09jcbhxb2hkpzdymzywk"; + sha256 = "0mr8f8qv15l0lx94im9084lmsw1qh8lzyb7mj1s5yhpw48k25709"; }; - patches = [ - (fetchpatch { - url = "https://80x24.org/public-inbox.git/patch/?id=5c4874309c4dd7aa8b9acd6bb97bd512360ab08a"; - sha256 = "0mh2qh8hxsqnsxqr42mkcz3sppnj1s6y28fl19x251phq3xx2c4q"; - }) - ]; - outputs = [ "out" "devdoc" "sa_config" ]; postConfigure = '' @@ -48,8 +41,8 @@ buildPerlPackage rec { nativeBuildInputs = [ makeWrapper ]; buildInputs = [ - DBDSQLite IOSocketSSL IPCRun Plack PlackMiddlewareReverseProxy SearchXapian - TimeDate URI highlight + DBDSQLite IOSocketSSL IPCRun MailIMAPClient ParseRecDescent Plack + PlackMiddlewareReverseProxy SearchXapian TimeDate URI highlight ]; checkInputs = [ EmailMIME git openssl sqlite xapian ]; @@ -60,7 +53,7 @@ buildPerlPackage rec { installTargets = [ "install" ]; postInstall = '' for prog in $out/bin/*; do - wrapProgram $prog --prefix PATH : ${lib.makeBinPath [ git ]} + wrapProgram $prog --prefix PATH : ${lib.makeBinPath [ git xapian ]} done mv sa_config $sa_config diff --git a/overlays/patches/public-inbox/0001-view-don-t-show-page-if-no-links-follow-it.patch b/overlays/patches/public-inbox/0001-view-don-t-show-page-if-no-links-follow-it.patch index 911273da1371..866974532a85 100644 --- a/overlays/patches/public-inbox/0001-view-don-t-show-page-if-no-links-follow-it.patch +++ b/overlays/patches/public-inbox/0001-view-don-t-show-page-if-no-links-follow-it.patch @@ -1,4 +1,4 @@ -From e330a3b56e43e4415e0aeede4052050ef8ae8b23 Mon Sep 17 00:00:00 2001 +From 7678ad7f23347a40125055702bfa357a12260ff6 Mon Sep 17 00:00:00 2001 From: Alyssa Ross <hi@alyssa.is> Date: Thu, 16 Jan 2020 18:08:33 +0000 Subject: [PATCH 1/2] view: don't show `page:' if no links follow it @@ -8,12 +8,12 @@ Subject: [PATCH 1/2] view: don't show `page:' if no links follow it 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm -index b6d7acaf..689bc4a1 100644 +index 1d5119cd..78998113 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm -@@ -1122,7 +1122,9 @@ sub pagination_footer ($$) { - $next = $next ? "$next " : ' '; - $prev .= qq! <a\nhref='$latest'>latest</a>!; +@@ -1179,7 +1179,9 @@ sub pagination_footer ($$) { + $next = $next ? "$next | " : ' | '; + $prev .= qq[ | <a\nhref="$latest">latest</a>]; } - "<hr><pre>page: $next$prev</pre>"; + if ($prev || $next) { @@ -21,7 +21,7 @@ index b6d7acaf..689bc4a1 100644 + } } - sub index_nav { # callback for WwwStream + sub paginate_recent ($$) { -- 2.30.0 diff --git a/overlays/patches/public-inbox/0002-wwwstream-make-source-info-configurable.patch b/overlays/patches/public-inbox/0002-wwwstream-make-source-info-configurable.patch index 3814058c9fc0..d7d40c82996d 100644 --- a/overlays/patches/public-inbox/0002-wwwstream-make-source-info-configurable.patch +++ b/overlays/patches/public-inbox/0002-wwwstream-make-source-info-configurable.patch @@ -1,19 +1,19 @@ -From 9f671548a468aa4b0ea6c490db0617b132903661 Mon Sep 17 00:00:00 2001 +From 49ae6aacb43963af273e6011a6d9191caa3c7846 Mon Sep 17 00:00:00 2001 From: Alyssa Ross <hi@alyssa.is> Date: Fri, 17 Jan 2020 15:21:42 +0000 Subject: [PATCH 2/2] wwwstream: make source info configurable --- Documentation/public-inbox-config.pod | 6 ++++++ - lib/PublicInbox/WwwListing.pm | 9 +++++---- - lib/PublicInbox/WwwStream.pm | 28 +++++++++++++++++++++++---- - 3 files changed, 35 insertions(+), 8 deletions(-) + lib/PublicInbox/WwwListing.pm | 2 +- + lib/PublicInbox/WwwStream.pm | 27 +++++++++++++++++++++++---- + 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/Documentation/public-inbox-config.pod b/Documentation/public-inbox-config.pod -index 4c9994dc..45e73af5 100644 +index 2d845f16..d04b14ad 100644 --- a/Documentation/public-inbox-config.pod +++ b/Documentation/public-inbox-config.pod -@@ -186,6 +186,12 @@ and the path may be "/dev/null" or any empty file. +@@ -178,6 +178,12 @@ and the path may be "/dev/null" or any empty file. Multiple files may be specified and will be included in the order specified. @@ -27,45 +27,24 @@ index 4c9994dc..45e73af5 100644 This may be set to C<none> to disable the use of SpamAssassin diff --git a/lib/PublicInbox/WwwListing.pm b/lib/PublicInbox/WwwListing.pm -index fcf17d96..b991c2ea 100644 +index bda2761c..5438bfe4 100644 --- a/lib/PublicInbox/WwwListing.pm +++ b/lib/PublicInbox/WwwListing.pm -@@ -103,8 +103,8 @@ sub ibx_entry { - $tmp; - } - --sub html ($$) { -- my ($env, $list) = @_; -+sub html ($$$) { -+ my ($pi_config, $env, $list) = @_; - my $title = 'public-inbox'; - my $out = ''; - my $code = 404; -@@ -122,7 +122,8 @@ sub html ($$) { - $out = '<pre>'.$l->to_html($tmp).'</pre><hr>'; - } - $out = "<html><head><title>$title</title></head><body>" . $out; -- $out .= '<pre>'. PublicInbox::WwwStream::code_footer($env) . -+ $out .= '<pre>' . -+ PublicInbox::WwwStream::code_footer($pi_config, $env) . - '</pre></body></html>'; - - my $h = [ 'Content-Type', 'text/html; charset=UTF-8' ]; -@@ -237,7 +238,7 @@ sub call { - js($env, $list); - } else { # / - my $list = $self->{www_cb}->($self, $env, 'www'); -- html($env, $list); -+ html($self->{pi_config}, $env, $list); +@@ -99,7 +99,7 @@ sub psgi_triple { + $gzf->zmore('no inboxes, yet'); } - } - + my $out = $gzf->zflush('</pre><hr><pre>'. +- PublicInbox::WwwStream::code_footer($ctx->{env}) . ++ PublicInbox::WwwStream::code_footer($ctx->{pi_config}, $ctx->{env}) . + '</pre></body></html>'); + $h->[3] = bytes::length($out); + [ $code, $h, [ $out ] ]; diff --git a/lib/PublicInbox/WwwStream.pm b/lib/PublicInbox/WwwStream.pm -index 915a71ba..a71ef6e1 100644 +index 638f4e27..2af8e900 100644 --- a/lib/PublicInbox/WwwStream.pm +++ b/lib/PublicInbox/WwwStream.pm -@@ -79,10 +79,30 @@ sub _html_top ($) { - '</head><body>'. $top . (delete($ctx->{-html_tip}) // ''); +@@ -96,10 +96,29 @@ EOF + @ret; # may be empty } -sub code_footer ($) { @@ -85,9 +64,8 @@ index 915a71ba..a71ef6e1 100644 + <$fh>; +} + -+sub code_footer { ++sub code_footer ($$) { + my ($pi_config, $env) = @_; -+ my $u = prurl($env, $CODE_URL); - qq(AGPL code for this site: git clone <a\nhref="$u">$u</a>) + my $default_info = qq(git clone <a\n href="$u">$u</a>); @@ -98,10 +76,10 @@ index 915a71ba..a71ef6e1 100644 } sub _html_end { -@@ -154,7 +174,7 @@ EOF - '<hr><pre>'.join("\n\n", +@@ -174,7 +193,7 @@ EOF $desc, $urls, + coderepos($ctx), - code_footer($ctx->{env}) + code_footer($ctx->{www}->{pi_config}, $ctx->{env}) ).'</pre></body></html>'; diff --git a/overlays/patches/public-inbox/default.nix b/overlays/patches/public-inbox/default.nix index 7f61e99484b8..7c354ec8b17b 100644 --- a/overlays/patches/public-inbox/default.nix +++ b/overlays/patches/public-inbox/default.nix @@ -2,11 +2,6 @@ public-inbox.overrideAttrs ({ patches ? [], ... }: { patches = patches ++ [ - (fetchpatch { - url = "https://80x24.org/public-inbox.git/patch/?id=41ecd08ee60daa495de3a2fc2c0296dc9cc9a0b3"; - sha256 = "1skn2ncr9g6k78fiscwkqisg4k0pv133sf4pyzryn3ahb09i1yqn"; - }) - ./0001-view-don-t-show-page-if-no-links-follow-it.patch ./0002-wwwstream-make-source-info-configurable.patch ]; |