Subject: [bug#76581] [PATCH 0/2] Age: Fix interaction with age.el, add manpages.

From: Sharlatan Hellseher <[email-masked]>
Date: Wed, 26 Feb 2025 17:08:35 +0000

Hi Nicolas,

Thanks for the patches!

--8<---------------cut here---------------start------------->8---
+        (base32 "183iqzmdwk4b35vxrdg2gdzd4277yr5bgbgl9brqv3w1dap5v4pm"))
+       (modules '((guix build utils)))
+       (snippet
+        #~(begin
+            (substitute* '("cmd/age/age.go"
+                           "cmd/age-keygen/keygen.go")
+              (("var Version string")
+               (format #f "var Version = ~s" #$version))
+              ;; We can as well not require runtime/debug now,
+              ;; since it's only used to get the version.
+              (("\"runtime/debug\"")
+               "")
+              (("buildInfo, ok := debug\\.ReadBuildInfo\\(\\); ok")
+               "false")
+              (("buildInfo\\.Main\\.Version")
+               ""))))))
--8<---------------cut here---------------end--------------->8---
This may be simplified with #:build-flags, see examples in golang-*

> <...> "-ldflags=-X main.Version=" #$version <...>

When you update the "library" package, you may keep all fields from
[arguments] with something like this:

--8<---------------cut here---------------start------------->8---
(define-public gops
  (package
    (inherit go-github-com-google-gops)
    (name "gops")
    (arguments
     (substitute-keyword-arguments
         (package-arguments go-github-com-google-gops)
       ((#:tests? _ #t) #f)
       ((#:install-source? _ #t) #f)
       ((#:skip-build? _ #t) #f)))
    (native-inputs (package-propagated-inputs go-github-com-google-gops))
    (propagated-inputs '())
    (inputs '())))
--8<---------------cut here---------------end--------------->8---
So the idea is to run tests and apply modifications on the "library"
side and just adjust #:import-path on final command(s)

I'm happy to review v2!

---
Oleg