Archived
1
0
Fork 0

gnu: public-inbox: Some packaging fixes

The file ‘script/public-inbox-compact’ doesn't call ‘xapian-compact’ directly
anymore, so the substitution in the ‘qualify-paths’ phase doesn't do anything.

Now there's a reference to ‘xapian-compact’ in ‘lib/PublicInbox/Xapcmd.pm’,
so substitute the path there.

And move xapian from native-inputs to inputs and use its input path in the
substitution, since ‘xapian-compact’ is called during normal execution of
public-inbox.

Also add ‘bash-minimal’ to the package's inputs, since it uses ‘wrap-program’.

Finally, take the opportunity to change build phases to not return #t
unconditionally, since that isn't necessary anymore.

* gnu/packages/mail.scm (public-inbox)[arguments]<#:phases>: Don't return #t
from each phase.
{qualify-paths}: Substitute ‘xapian-compact’ path in the correct file.  Use
‘search-input-file’ rather than ‘which’ to find it.
[native-inputs]: Move ‘xapian’ from here ...
[inputs]: ... to here. Add ‘bash-minimal’.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Thiago Jung Bauermann 2022-05-15 19:02:28 -03:00 committed by Ludovic Courtès
parent 47792b9b56
commit c017acec34
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -46,6 +46,7 @@
;;; Copyright © 2021 Philip McGrath <philip@philipmcgrath.com> ;;; Copyright © 2021 Philip McGrath <philip@philipmcgrath.com>
;;; Copyright © 2022 Andrew Tropin <andrew@trop.in> ;;; Copyright © 2022 Andrew Tropin <andrew@trop.in>
;;; Copyright © 2022 Justin Veilleux <terramorpha@cock.li> ;;; Copyright © 2022 Justin Veilleux <terramorpha@cock.li>
;;; Copyright © 2022 Thiago Jung Bauermann <bauermann@kolabnow.com>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -4084,12 +4085,12 @@ Git and exports them in maildir format or to an MDA through a pipe.")
'(#:phases '(#:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(add-before 'configure 'qualify-paths (add-before 'configure 'qualify-paths
(lambda _ (lambda* (#:key inputs #:allow-other-keys)
;; Use absolute paths for 'xapian-compact'. ;; Use absolute paths for 'xapian-compact'.
(let ((xapian-compact (which "xapian-compact"))) (substitute* "lib/PublicInbox/Xapcmd.pm"
(substitute* "script/public-inbox-compact" (("'xapian-compact'")
(("xapian-compact") xapian-compact))) (format #f "'~a'" (search-input-file inputs
#t)) "/bin/xapian-compact"))))))
(add-before 'check 'pre-check (add-before 'check 'pre-check
(lambda _ (lambda _
(substitute* "t/spawn.t" (substitute* "t/spawn.t"
@ -4100,8 +4101,7 @@ Git and exports them in maildir format or to an MDA through a pipe.")
;; XXX: This test fails due to zombie process is not reaped by ;; XXX: This test fails due to zombie process is not reaped by
;; the builder. ;; the builder.
(substitute* "t/httpd-unix.t" (substitute* "t/httpd-unix.t"
(("^SKIP: \\{") "SKIP: { skip('Guix');")) (("^SKIP: \\{") "SKIP: { skip('Guix');"))))
#t))
(add-after 'install 'wrap-programs (add-after 'install 'wrap-programs
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))) (let ((out (assoc-ref outputs "out")))
@ -4116,14 +4116,13 @@ Git and exports them in maildir format or to an MDA through a pipe.")
;; perl module. ;; perl module.
`("PATH" ":" prefix `("PATH" ":" prefix
(,(dirname (search-input-file inputs "/bin/git")))))) (,(dirname (search-input-file inputs "/bin/git"))))))
(find-files (string-append out "/bin")))) (find-files (string-append out "/bin")))))))))
#t)))))
(native-inputs (native-inputs
(list xapian (list ;; For testing.
;; For testing.
lsof openssl)) lsof openssl))
(inputs (inputs
(list git (list bash-minimal
git
perl-dbd-sqlite perl-dbd-sqlite
perl-dbi perl-dbi
perl-email-address-xs perl-email-address-xs
@ -4145,7 +4144,8 @@ Git and exports them in maildir format or to an MDA through a pipe.")
;; ("highlight" ,highlight) ;; ("highlight" ,highlight)
;; For testing. ;; For testing.
perl-ipc-run perl-ipc-run
perl-xml-feed)) perl-xml-feed
xapian))
(home-page "https://public-inbox.org/README.html") (home-page "https://public-inbox.org/README.html")
(synopsis "Archive mailing lists in Git repositories") (synopsis "Archive mailing lists in Git repositories")
(description (description