summary refs log tree commit diff
path: root/gnu/packages/build-tools.scm
diff options
context:
space:
mode:
authorVivien Kraus <vivien@planete-kraus.eu>2023-03-14 09:58:34 +0100
committerLudovic Courtès <ludo@gnu.org>2023-03-17 23:20:35 +0100
commit25cad456397b120f59b1779960f67423cdc00635 (patch)
tree7c1baa3ab3bd78b10ff803a9cae7f5fb17fd7791 /gnu/packages/build-tools.scm
parent2135f69dc0c0e70caf3fca0688ae831ab6bcaa65 (diff)
downloadguix-25cad456397b120f59b1779960f67423cdc00635.tar.gz
gnu: gnulib: Restore shebangs.
* gnu/packages/build-tools.scm (gnulib)[arguments]: Add
'restore-shebangs' phase.
[inputs, native-inputs]: Add bash-minimal.
[phase let-autogen-execute-gnulib-tool]: Specify a shell to execute
gnulib-tool from autogen.sh.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu/packages/build-tools.scm')
-rw-r--r--gnu/packages/build-tools.scm21
1 files changed, 17 insertions, 4 deletions
diff --git a/gnu/packages/build-tools.scm b/gnu/packages/build-tools.scm
index 28ab77bbb4..91805e1f84 100644
--- a/gnu/packages/build-tools.scm
+++ b/gnu/packages/build-tools.scm
@@ -973,12 +973,25 @@ Makefiles, JSON Compilation Database, and experimentally Ninja.")
                    ("NormalizationTest.txt" . "uninorm")
                    ("auxiliary/GraphemeBreakTest.txt" . "unigbrk")
                    ("auxiliary/WordBreakTest.txt" . "uniwbrk")))
-                (delete-file "gen-uni-tables")))))))
-    (inputs ;; Shebangs for some auxiliary build files.
-     (list python perl clisp))
+                (delete-file "gen-uni-tables"))))
+          (add-after 'install 'restore-shebangs
+            (lambda _
+              (substitute* (find-files
+                            (string-append #$output "/src/gnulib")
+                            (lambda (fname stat)
+                              (and (not (string-suffix? "/lib/javaversion.class" fname))
+                                   (not (string-suffix? ".mo" fname)))))
+                (("^#! ?(.*)/bin/sh" _ prefix)
+                 "#!/bin/sh")
+                (("^#! ?(.*)/bin/python3" _ prefix)
+                 "#!/usr/bin/env python3")
+                (("^#! ?(.*)/bin/([a-zA-Z0-9-]+)" _ prefix program)
+                 (string-append "#!/usr/bin/" program))))))))
+    (inputs
+     (list bash-minimal))                         ;shebang for gnulib-tool
     (native-inputs
      (list
-      python perl clisp
+      bash-minimal python perl clisp
       ;; Unicode data:
       ucd-next
       ;; Programs for the tests: