~ruther/guix-local

9a7b842ebb2f03b19e9b145e7d8a5751e1517dab — Sharlatan Hellseher 1 year, 8 months ago d0c2dc4
gnu: aerc: Improve package style.

* gnu/packages/mail.scm (aerc): Rewrite with THIS-PACKAGE-INPUT and
FORMAT to improve the flow and refresh the style.
[phases] {install}: Respespect GOFLAGS from the go-build-system, apply
CC-FOR-TARGET

Change-Id: I52aac55f10909f800f3a43e59443691b2b576d80
1 files changed, 16 insertions(+), 11 deletions(-)

M gnu/packages/mail.scm
M gnu/packages/mail.scm => gnu/packages/mail.scm +16 -11
@@ 60,6 60,7 @@
;;; Copyright © 2024 Zheng Junjie <873216071@qq.com>
;;; Copyright © 2024 Ashish SHUKLA <ashish.is@lostca.se>
;;; Copyright © 2025 Tanguy Le Carrour <tanguy@bioneland.org>
;;; Copyright © 2025 Sharlatan Hellseher <sharlatanus@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;


@@ 5101,33 5102,37 @@ remote SMTP server.")
                       ;; Patch all occurrences to "sh" with absolute path to
                       ;; the shell available in Guix.
                       (("\"sh\"")
                        (string-append
                         "\"" (search-input-file inputs "bin/sh")
                         "\"")))
                     (let ((zoxide (search-input-file inputs "bin/zoxide")))
                        (format #f "~s" (which "sh"))))
                     (let ((zoxide #$(this-package-input "zoxide")))
                       (when zoxide
                         (substitute* "commands/z.go"
                           (("\"zoxide\"")
                            (string-append "\"" zoxide "\"")))))
                            (format #f "~s"
                                    (string-append zoxide "/bin/zoxide"))))))
                     (substitute* (list "lib/crypto/gpg/gpg.go"
                                        "lib/crypto/gpg/gpg_test.go"
                                        "lib/crypto/gpg/gpgbin/keys.go"
                                        "lib/crypto/gpg/gpgbin/gpgbin.go")
                       (("\"gpg\"")
                        (string-append
                         "\"" (search-input-file inputs "bin/gpg")
                         "\""))
                        (format #f "~s"
                                (string-append #$(this-package-input "gnupg")
                                               "/bin/gpg")))
                       (("strings\\.Contains\\(stderr\\.String\\(\\), .*\\)")
                        "strings.Contains(stderr.String(), \"gpg\")")))))
               (add-after 'build 'doc
                 (lambda* (#:key import-path build-flags #:allow-other-keys)
                   (invoke "make" "doc" "-C"
                           (string-append "src/" import-path))))
               ;; XXX: This phase does the build and overwrites
               ;; go-build-system's build one.
               (replace 'install
                 (lambda* (#:key import-path build-flags #:allow-other-keys)
                   (invoke "make" "CC=gcc" "GOFLAGS=-tags=notmuch" "install" "-C"
                           (string-append "src/" import-path)
                           (string-append "PREFIX=" #$output)))))))
                   (invoke "make"
                           (string-append "CC=" #$(cc-for-target))
                           (string-append "GOFLAGS=-tags=notmuch " (getenv "GOFLAGS"))
                           (string-append "PREFIX=" #$output)
                           "install" "-C"
                           (string-append "src/" import-path)))))))
    (inputs
     (append
      (list gnupg