guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch wip-hurd-vm updated: gnu: hurd: Ensure startup scripts refer to t


From: guix-commits
Subject: branch wip-hurd-vm updated: gnu: hurd: Ensure startup scripts refer to the right programs.
Date: Sat, 04 Apr 2020 20:05:18 -0400

This is an automated email from the git hooks/post-receive script.

civodul pushed a commit to branch wip-hurd-vm
in repository guix.

The following commit(s) were added to refs/heads/wip-hurd-vm by this push:
     new 85be704  gnu: hurd: Ensure startup scripts refer to the right programs.
85be704 is described below

commit 85be70404d3309ac2b34be7452aacbae8b5fef5f
Author: Ludovic Courtès <address@hidden>
AuthorDate: Sun Apr 5 01:49:37 2020 +0200

    gnu: hurd: Ensure startup scripts refer to the right programs.
    
    * gnu/packages/hurd.scm (hurd)[arguments]: In 'set-file-names' phase,
    patch startup.c, init.c, and daemons/runsystem/*.  Add
    'patch-libexec-shebangs' phase.
    [inputs]: Add BASH-MINIMAL, SED, and GREP.
---
 gnu/packages/hurd.scm | 35 +++++++++++++++++++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 8f08717..2663e6e 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -34,6 +34,7 @@
   #:use-module (gnu packages bison)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages base)
+  #:use-module (gnu packages bash)
   #:use-module (gnu packages texinfo)
   #:use-module (guix git-download)
   #:export (hurd-system?
@@ -347,10 +348,35 @@ boot, since this cannot be done from GNU/Linux."
              #t))
          (add-before 'build 'set-file-names
            (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let ((out (assoc-ref outputs "out")))
+             (let* ((out  (assoc-ref outputs "out"))
+                    (bash (assoc-ref inputs "bash-minimal"))
+                    (sed  (assoc-ref inputs "sed"))
+                    (grep (assoc-ref inputs "grep")))
                (substitute* '("daemons/runttys.c" "daemons/getty.c")
                  (("/bin/login")
                   (string-append out "/bin/login")))
+               (substitute* '("startup/startup.c" "init/init.c")
+                 (("/libexec/")
+                  (string-append out "/libexec/")))
+
+               (substitute* '("daemons/runsystem.sh"
+                              "daemons/runsystem.hurd.sh")
+                 (("^PATH=.*")
+                  (string-append "PATH=" out "/bin:"
+                                 sed "/bin:" grep "/bin\n"))
+                 (("^SHELL=.*")
+                  (string-append "SHELL=" bash "/bin/bash\n")))
+               #t)))
+         (add-after 'patch-shebangs 'patch-libexec-shebangs
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             ;; XXX: Since the 'patch-shebangs' phase doesn't traverse
+             ;; /libexec, do it here.
+             (let* ((out  (assoc-ref outputs "out"))
+                    (bash (assoc-ref inputs "bash-minimal"))
+                    (path (list (string-append bash "/bin"))))
+               (for-each (lambda (file)
+                           (patch-shebang file path))
+                         (find-files (string-append out "/libexec")))
                #t)))
          (add-after 'install 'install-rc-file
            (lambda* (#:key inputs outputs #:allow-other-keys)
@@ -371,7 +397,12 @@ boot, since this cannot be done from GNU/Linux."
     (build-system gnu-build-system)
     (inputs
      `(("glibc-hurd-headers" ,glibc/hurd-headers)
-       ("hurd-rc" ,(hurd-rc-script))))
+       ("hurd-rc" ,(hurd-rc-script))
+
+       ;; Tools for the /libexec/* scripts.
+       ("bash-minimal" ,bash-minimal)
+       ("sed" ,sed)
+       ("grep" ,grep)))
     (native-inputs
      `(("autoconf" ,autoconf)
        ("automake" ,automake)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]