diff mbox series

[bug#71923,3/4] gnu: buildah: Fix build.

Message ID ad36d90cc677c7e66d7426c24f6e9e4d4bc54a3d.1720024272.git.jean@foundation.xyz
State New
Headers show
Series gnu: gvisor-tap-vsock, buildah, podman build fix. | expand

Commit Message

Jean-Pierre De Jesus DIAZ July 3, 2024, 4:36 p.m. UTC
* gnu/packages/containers.scm (buildah)<arguments>: Remove
'remove-go-references phase, add 'patch-buildflags phase and remove
imported modules.

Change-Id: Id89ea5c90ba8064484eec460efdfa592c974adca
---
 gnu/packages/containers.scm | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/gnu/packages/containers.scm b/gnu/packages/containers.scm
index 38af5cb3fb..1b7032ca82 100644
--- a/gnu/packages/containers.scm
+++ b/gnu/packages/containers.scm
@@ -617,9 +617,6 @@  (define-public buildah
                              #$go-github-com-go-md2man "/bin/go-md2man"))
       #:tests? #f                  ; /sys/fs/cgroup not set up in guix sandbox
       #:test-target "test-unit"
-      #:imported-modules
-      (source-module-closure `(,@%gnu-build-system-modules
-                               (guix build go-build-system)))
       #:phases
       #~(modify-phases %standard-phases
           (delete 'configure)
@@ -631,6 +628,12 @@  (define-public buildah
               ;; Make <4.4 causing CC not to be propagated into $(shell ...)
               ;; calls.  Can be removed once we update to >4.3.
               (setenv "CC" #$(cc-for-target))))
+          ;; Add -trimpath to build flags to avoid keeping references to go
+          ;; packages.
+          (add-after 'set-env 'patch-buildflags
+            (lambda _
+              (substitute* "Makefile"
+                (("BUILDFLAGS :=") "BUILDFLAGS := -trimpath "))))
           (replace 'check
             (lambda* (#:key tests? #:allow-other-keys)
               (when tests?
@@ -658,8 +661,6 @@  (define-public buildah
                    ,(string-append #$gcc            "/bin") ; cpp
                    ,(string-append #$passt          "/bin")
                    "/run/setuid-programs")))))
-          (add-after 'install 'remove-go-references
-            (@@ (guix build go-build-system) remove-go-references))
           (add-after 'install 'install-completions
             (lambda _
               (invoke "make" "install.completions"