Subject: [bug#63527] [PATCH v4 5/8] gnu: hurd: Add rumpkernel.

From: Janneke Nieuwenhuizen <[email-masked]>
Date: Thu, 18 May 2023 11:39:00 +0200

* gnu/packages/hurd.scm (hurd)[inputs]: Add rumpkernel.
[arguments]: Rename `prepare-dde' phase to 'prepare-addons'.  Add "rumpdisk"
directory.  Add --enable-static-progs=... option to #:configure-flags.
---
 gnu/packages/hurd.scm | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index c7ea86b266..aaa9863a10 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -356,7 +356,7 @@ (define-public hurd
     (arguments
      `(#:phases
        (modify-phases %standard-phases
-         (add-after 'unpack 'prepare-dde
+         (add-after 'unpack 'prepare-addons
            (lambda* (#:key native-inputs inputs #:allow-other-keys)
              ;; First we import the things we want from dde.
              (for-each make-file-writable (find-files "."))
@@ -370,7 +370,10 @@ (define-public hurd
              ;; Makefile. libdde_linux26 is built later in its own phase.
              (substitute* "Makefile"
                (("libbpf ")
-                "libbpf libmachdevdde libddekit"))))
+                "libbpf libmachdevdde libddekit rumpdisk"))
+             (substitute* "rumpdisk/Makefile"
+               (("rumpdev_ahcisata" all)
+                (string-append all " rumpdev_ata")))))
          (add-after 'unpack 'find-tirpc
            (lambda* (#:key inputs #:allow-other-keys)
              (for-each (lambda (var)
@@ -533,6 +536,7 @@ (define-public hurd
        #:configure-flags
        ,#~(list (string-append "LDFLAGS=-Wl,-rpath="
                                #$output "/lib")
+                "--enable-static-progs=ext2fs,iso9660fs,rumpdisk,pci-arbiter,acpi"
                 "--disable-ncursesw"
                 "--without-libbz2"
                 "--without-libz"
@@ -541,7 +545,11 @@ (define-public hurd
                 ;; clnt_create
                 "ac_func_search_save_LIBS=-ltirpc"
                 "ac_cv_search_clnt_create=false"
-                "CFLAGS=-fcommon")))
+                "CFLAGS=-fcommon")
+       #:make-flags
+         (list (string-append "RUMPPATH="
+                              (assoc-ref %build-inputs "rumpkernel")
+                              "/lib"))))
     (build-system gnu-build-system)
     (inputs
      `(("libgcrypt" ,libgcrypt)                  ;for /hurd/random
@@ -557,7 +565,8 @@ (define-public hurd
        ("coreutils" ,coreutils)
        ("sed" ,sed)
        ("grep" ,grep)
-       ("util-linux" ,util-linux)))
+       ("util-linux" ,util-linux)
+       ("rumpkernel" ,rumpkernel)))
     (native-inputs
      `(("autoconf" ,autoconf)
        ("automake" ,automake)
-- 
2.39.2