janneke pushed a commit to branch hurd-team
in repository guix.

commit 8ca8daebd48a85f670679748174ca16c461dce7c
Author: Janneke Nieuwenhuizen <[email protected]>
AuthorDate: Mon Nov 11 13:28:58 2024 +0100

    gnu: gettext: Fix cross-build shebangs.
    
    This fixes running autopoint from a cross-built gettext[-minimal].
    
    * gnu/packages/gettext.scm (gettext-minimal): When cross-building, add stage
    "patch-cross-shebangs".
    
    Change-Id: I5029a3be0b5cee3c173de66d8f0b027b02c3bc47
---
 gnu/packages/gettext.scm | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/gettext.scm b/gnu/packages/gettext.scm
index cabe4f3be9..7862c296bd 100644
--- a/gnu/packages/gettext.scm
+++ b/gnu/packages/gettext.scm
@@ -9,7 +9,7 @@
 ;;; Copyright © 2017 Eric Bavier <[email protected]>
 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <[email protected]>
 ;;; Copyright © 2019 Miguel <[email protected]>
-;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <[email protected]>
+;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen <[email protected]>
 ;;; Copyright © 2020 EuAndreh <[email protected]>
 ;;; Copyright © 2022, 2024 gemmaro <[email protected]>
 ;;; Copyright © 2023 Maxim Cournoyer [email protected]>
@@ -130,7 +130,19 @@
                                    ((" test-tls\\$\\(EXEEXT\\) ") " ")))
                               '())
 
-                       #t)))))
+                       #t))))
+          #$@(if (%current-target-system)
+                 #~((add-after 'install 'patch-cross-shebangs
+                      (lambda _
+                        (let ((path (list (string-append #$bash-minimal 
"/bin"))))
+                          (define (patch-cross-shebang file)
+                            (patch-shebang file path))
+                          (with-directory-excursion
+                              (string-append #$output "/bin")
+                            (for-each
+                             patch-cross-shebang
+                             '("autopoint" "gettext.sh" "gettextize")))))))
+                 '()))
 
        ;; When tests fail, we want to know the details.
        #:make-flags #~'("VERBOSE=yes")))

Reply via email to