From 248e44e7f42312c92b23d2bc3d10a80a5bb2eadf Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Sat, 4 Apr 2020 10:32:22 +0200 Subject: [PATCH 2/3] gnu: hurd: Have scripts use store file names. * gnu/packages/hurd.scm (hurd)[inputs]: Add bash-minimal, coreutils, sed. [arguments]: Use them in new `use-store-file-names' stage. --- gnu/packages/hurd.scm | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm index 8f087172de..09b09b6397 100644 --- a/gnu/packages/hurd.scm +++ b/gnu/packages/hurd.scm @@ -30,6 +30,7 @@ #:use-module (guix build-system gnu) #:use-module (guix build-system trivial) #:use-module (gnu packages autotools) + #:use-module (gnu packages bash) #:use-module (gnu packages flex) #:use-module (gnu packages bison) #:use-module (gnu packages perl) @@ -361,6 +362,36 @@ boot, since this cannot be done from GNU/Linux." (copy-file rc file) (substitute* file (("@HURD@") out)) + #t))) + (add-after 'install 'use-store-file-names + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bash (assoc-ref inputs "bash")) + (coreutils (assoc-ref inputs "coreutils")) + (sed (assoc-ref inputs "sed"))) + (substitute* (list (string-append out "/libexec/runsystem") + (string-append out "/libexec/runsystem.hurd") ; Hmm? + (string-append out "/sbin/MAKEDEV") + (string-append out "/bin/fakeroot") + (string-append out "/bin/remap") + (string-append out "/bin/sush")) + ;; huh, why are shebangs using the build system's bash? + (("^#!.*/bash") (string-append "#! " bash "/bin/bash")) + (("^#!.*/sh") (string-append "#! " bash "/bin/bash")) + (("=/libexec") (string-append "=" out "/libexec")) + (("^SHELL=/bin/sh") + (string-append "SHELL=" bash "/bin/bash")) + (("^PATH=") + (string-append "PATH=" out "/bin" + ":" out "/sbin" + ":" coreutils "/bin" + ":" sed "/bin" + ":/run/current-system/profile/bin" + ":/run/current-system/profile/sbin")) + ) + (substitute* (string-append out "/bin/sush") + (("-/bin/fmt") (string-append "-/" coreutils "/bin/fmt")) + (("-/bin/login") (string-append "-/" coreutils "/bin/legin"))) #t)))) #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib") @@ -370,8 +401,11 @@ boot, since this cannot be done from GNU/Linux." "--without-parted"))) (build-system gnu-build-system) (inputs - `(("glibc-hurd-headers" ,glibc/hurd-headers) - ("hurd-rc" ,(hurd-rc-script)))) + `(("bash" ,bash-minimal) + ("coreutils" ,coreutils) + ("glibc-hurd-headers" ,glibc/hurd-headers) + ("hurd-rc" ,(hurd-rc-script)) + ("sed" ,sed))) (native-inputs `(("autoconf" ,autoconf) ("automake" ,automake) -- 2.26.0