guix-commits
[Top][All Lists]
Advanced

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

28/48: system: hurd: Create system profile for guix development.


From: guix-commits
Subject: 28/48: system: hurd: Create system profile for guix development.
Date: Sun, 19 Apr 2020 10:22:14 -0400 (EDT)

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

commit 750529549b7f427055da66e64e7ca5dab08f5d21
Author: Jan (janneke) Nieuwenhuizen <address@hidden>
AuthorDate: Fri Apr 17 07:51:14 2020 +0200

    system: hurd: Create system profile for guix development.
    
    Doing
    
        guix build -f gnu/system/hurd.scm
    
    now produces a VM with a system profile that includes the minimal 
requirements
    to do guix development from git.
    
    * gnu/system/hurd.scm (%hurd-os-development): New variable that includes
    git-minimal and guix build dependencies.
    (cross-hurd-image): Add new keyword parameter `os'; use it instead of global
    %hurd-os and use %base-packages/hurd via os.
    Return thunk for development.
---
 gnu/system/hurd.scm | 42 +++++++++++++++++++++++++++++++++++++-----
 1 file changed, 37 insertions(+), 5 deletions(-)

diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm
index 1bf8066..5b03cdd 100644
--- a/gnu/system/hurd.scm
+++ b/gnu/system/hurd.scm
@@ -19,20 +19,30 @@
 
 (define-module (gnu system hurd)
   #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-26)
+  #:use-module (ice-9 match)
+  #:use-module (guix build-system gnu)
   #:use-module (guix gexp)
+  #:use-module (guix packages)
   #:use-module (guix profiles)
   #:use-module (guix utils)
   #:use-module (gnu bootloader grub)
   #:use-module (gnu packages admin)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
+  #:use-module (gnu packages commencement)
+  #:use-module (gnu packages compression)
   #:use-module (gnu packages cross-base)
   #:use-module (gnu packages file)
+  #:use-module (gnu packages gawk)
+  #:use-module (gnu packages gcc)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages guile-xyz)
   #:use-module (gnu packages hurd)
   #:use-module (gnu packages less)
+  #:use-module (gnu packages m4)
   #:use-module (gnu packages ssh)
+  #:use-module (gnu packages version-control)
   #:use-module (gnu services)
   #:use-module (gnu services base)
   #:use-module (gnu services hurd)
@@ -108,6 +118,25 @@
     (pam-services '())
     (setuid-programs '())))
 
+(define (input->packages input)
+  "Return the list of packages in INPUT."
+  (match input
+    ((label (and (? package?) package) . output)
+     (list package))
+    (_ '())))
+
+(define %hurd-os-development
+  (operating-system
+    (inherit %hurd-os)
+    (packages
+     (append
+      (list git-minimal)
+      (append-map input->packages
+                  (fold alist-delete (package-direct-inputs guix)
+                        '("graphviz" "po4a")))
+      (list gawk diffutils gnu-make m4 tar xz)
+      %base-packages/hurd))))
+
 (define operating-system-accounts
   (@@ (gnu system) operating-system-accounts))
 
@@ -206,7 +235,7 @@ fi\n")))
     (scheme-file "shepherd.conf" config)))
 
 
-(define* (cross-hurd-image #:key (hurd hurd) (gnumach gnumach))
+(define* (cross-hurd-image #:key (hurd hurd) (gnumach gnumach) (os %hurd-os))
   "Return a cross-built GNU/Hurd image."
 
   (define (cross-built thing)
@@ -222,7 +251,7 @@ fi\n")))
 
   (define system-profile
     (map-manifest-entries cross-built-entry
-                          (packages->manifest %base-packages/hurd)))
+                          (packages->manifest (operating-system-packages os))))
 
   (define grub.cfg
     (let ((hurd (cross-built hurd))
@@ -277,15 +306,15 @@ sshd:x:2:2:sshd:/var/empty:/bin/no-sh
   ;; XXX This still gives 64bit .go files
   ;; (define shepherd.conf
   ;;   (with-parameters ((%current-target-system "i586-pc-gnu"))
-  ;;     (shepherd-configuration-file (hurd-shepherd-services %hurd-os))))
+  ;;     (shepherd-configuration-file (hurd-shepherd-services os))))
 
   (define shepherd.conf
     (with-parameters ((%current-target-system "i586-pc-gnu"))
-      (hurd-shepherd-configuration-file (hurd-shepherd-services %hurd-os))))
+      (hurd-shepherd-configuration-file (hurd-shepherd-services os))))
 
   (define boot-activation
     (with-parameters ((%current-target-system "i586-pc-gnu"))
-      (operating-system-activation-script %hurd-os)))
+      (operating-system-activation-script os)))
 
   (define hurd-directives
     `((directory "/servers")
@@ -369,3 +398,6 @@ sshd:x:2:2:sshd:/var/empty:/bin/no-sh
 
 ;; Return this thunk so one can type "guix build -f gnu/system/hurd.scm".
 cross-hurd-image
+
+;; Return the development thunk so "guix build -f gnu/system/hurd.scm"
+(lambda _ (cross-hurd-image #:os %hurd-os-development))



reply via email to

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