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

From: Nicolas Graves <[email-masked]>
Date: Wed, 26 Feb 2025 10:35:32 +0100

Hi Oleg,

For some reason, it doesn't seem to work with the following changes. Am
I missing something ?

Nicolas

* gnu/packages/golang-crypto.scm (go-filippo-io-age)[source]: Add
snippet to hardcode the version.
---
 gnu/packages/golang-crypto.scm | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/golang-crypto.scm b/gnu/packages/golang-crypto.scm
index b1a114dd80..32bf4e401d 100644
--- a/gnu/packages/golang-crypto.scm
+++ b/gnu/packages/golang-crypto.scm
@@ -14,7 +14,7 @@
 ;;; Copyright © 2021 Vagrant Cascadian <[email-masked]>
 ;;; Copyright © 2022 (unmatched-parenthesis <[email-masked]>
 ;;; Copyright © 2022 Tobias Geerinckx-Rice <[email-masked]>
-;;; Copyright © 2022, 2023 Nicolas Graves <[email-masked]>
+;;; Copyright © 2022, 2023, 2025 Nicolas Graves <[email-masked]>
 ;;; Copyright © 2023 Benjamin <[email-masked]>
 ;;; Copyright © 2023 Clément Lassieur <[email-masked]>
 ;;; Copyright © 2023 Felix Lechner <[email-masked]>
@@ -139,6 +139,9 @@ (define-public go-filippo-io-age
     (build-system go-build-system)
     (arguments
      (list
+      #:build-flags
+      #~(list (string-append "-ldflags=-X main.version="
+                             #$(package-version this-package)))
       #:embed-files #~(list "armor.*" "header_crlf" "hmac_.*" "scrypt.*"
                             "stanza_.*" "stream_.*" "version_unsupported"
                             "x25519.*" "x25519_.*")
@@ -2567,6 +2570,9 @@ (define-public age
     (name "age")
     (arguments
      (list
+      #:build-flags
+      #~(list (string-append "-ldflags=-X main.version="
+                             #$(package-version this-package)))
       #:install-source? #f
       #:import-path "filippo.io/age/cmd/age"
       #:unpack-path "filippo.io/age"
@@ -2590,9 +2596,13 @@ (define-public age-keygen
     (inherit go-filippo-io-age)
     (name "age-keygen")
     (arguments
-     `(#:import-path "filippo.io/age/cmd/age-keygen"
-       #:unpack-path "filippo.io/age"
-       #:install-source? #f))))
+     (list
+      #:build-flags
+      #~(list (string-append "-ldflags=-X main.version="
+                             #$(package-version this-package)))
+      #:import-path "filippo.io/age/cmd/age-keygen"
+      #:unpack-path "filippo.io/age"
+      #:install-source? #f))))
 
 (define-public go-jwker
   (package/inherit go-github-com-jphastings-jwker
-- 
2.48.1

-- 
Best regards,
Nicolas Graves