Subject: [bug#63145] [PATCH 1/3] gnu: maven-*-*: Fix - add missing shebang to the sisu.sh.

From: Rostislav Svoboda <[email-masked]>
Date: Fri, 28 Apr 2023 15:13:10 +0200

* gnu/packages/maven.scm
  - maven-settings-builder
  - maven-model-builder
  - maven-resolver-provider
  - maven-core-bootstrap
  - maven-embedder
  The sisu.sh script must have a shebang on the first line, otherwise an
  'In execvp of ...: Exec format error' is indicated.
---
 gnu/packages/maven.scm | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/gnu/packages/maven.scm b/gnu/packages/maven.scm
index fc3a63c263..a3122bfa32 100644
--- a/gnu/packages/maven.scm
+++ b/gnu/packages/maven.scm
@@ -1365,6 +1365,9 @@ (define-public maven-settings-builder
        #:test-dir "maven-settings-builder/src/test"
        #:phases
        (modify-phases %standard-phases
+         (add-before 'patch-source-shebangs 'add-missing-shebang
+           (lambda _
+             (invoke "sed" "-i" "1s;^;#!/bin/sh\\n\\n;" "./sisu.sh")))
          (add-before 'build 'generate-sisu-named
            (lambda _
              (mkdir-p "build/classes/META-INF/sisu")
@@ -1396,6 +1399,9 @@ (define-public maven-model-builder
        #:test-dir "src/test"
        #:phases
        (modify-phases %standard-phases
+         (add-before 'patch-source-shebangs 'add-missing-shebang
+           (lambda _
+             (invoke "sed" "-i" "1s;^;#!/bin/sh\\n\\n;" "./sisu.sh")))
          (add-before 'configure 'chdir
            (lambda _
              ;; Required for tests that rely on the package's default
@@ -1501,6 +1507,9 @@ (define-public maven-resolver-provider
        #:tests? #f; dependency loop on maven-core (@Component RepositorySystem)
        #:phases
        (modify-phases %standard-phases
+         (add-before 'patch-source-shebangs 'add-missing-shebang
+           (lambda _
+             (invoke "sed" "-i" "1s;^;#!/bin/sh\\n\\n;" "./sisu.sh")))
          (add-before 'build 'generate-sisu-named
            (lambda _
              (mkdir-p "build/classes/META-INF/sisu")
@@ -1591,6 +1600,9 @@ (define-public maven-core-bootstrap
          #:tests? #f
          #:phases
          (modify-phases %standard-phases
+           (add-before 'patch-source-shebangs 'add-missing-shebang
+             (lambda _
+               (invoke "sed" "-i" "1s;^;#!/bin/sh\\n\\n;" "./sisu.sh")))
            (add-before 'configure 'chdir
              (lambda _
                ;; Required for generating components.xml in maven-core
@@ -1822,6 +1834,9 @@ (define-public maven-embedder
        #:jdk ,icedtea-8
        #:phases
        (modify-phases %standard-phases
+         (add-before 'patch-source-shebangs 'add-missing-shebang
+           (lambda _
+             (invoke "sed" "-i" "1s;^;#!/bin/sh\\n\\n;" "./sisu.sh")))
          (add-before 'build 'generate-sisu-named
            (lambda _
              (mkdir-p "build/classes/META-INF/sisu")
-- 
2.39.2