guix-commits
[Top][All Lists]
Advanced

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

branch master updated: gnu: qemu-minimal: Only build for the host's arch


From: guix-commits
Subject: branch master updated: gnu: qemu-minimal: Only build for the host's architecture.
Date: Thu, 14 May 2020 10:29:09 -0400

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

efraim pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 355892e  gnu: qemu-minimal: Only build for the host's architecture.
355892e is described below

commit 355892e1c28ea844099113536da7cc781ca1bec2
Author: Efraim Flashner <address@hidden>
AuthorDate: Sun May 3 11:00:44 2020 +0300

    gnu: qemu-minimal: Only build for the host's architecture.
    
    * gnu/packages/virtualization.scm (qemu-minimal)[arguments]: Adjust
    configure-flags so that each architecture only builds for its native
    architectures.
    [synopsis]: Adjust to clarify it's only for the host's architecture.
---
 gnu/packages/virtualization.scm | 41 +++++++++++++++++++++++++++++++++++------
 1 file changed, 35 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 18b0992..371104c 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2020 Ludovic Courtès 
<address@hidden>
 ;;; Copyright © 2015, 2016, 2017, 2018 Mark H Weaver <address@hidden>
-;;; Copyright © 2016, 2017, 2018. 2019 Efraim Flashner <address@hidden>
+;;; Copyright © 2016, 2017, 2018. 2019, 2020 Efraim Flashner <address@hidden>
 ;;; Copyright © 2016, 2017 Ricardo Wurmus <address@hidden>
 ;;; Copyright © 2017 Alex Vong <address@hidden>
 ;;; Copyright © 2017 Andy Patterson <address@hidden>
@@ -101,7 +101,8 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix utils)
-  #:use-module (srfi srfi-1))
+  #:use-module (srfi srfi-1)
+  #:use-module (ice-9 match))
 
 (define (qemu-patch commit file-name sha256)
   "Return an origin for COMMIT."
@@ -302,15 +303,43 @@ server and embedded PowerPC, and S390 guests.")
                              '("mips64el-linux" "i586-gnu")))))
 
 (define-public qemu-minimal
-  ;; QEMU without GUI support.
+  ;; QEMU without GUI support, only supporting the host's architecture
   (package (inherit qemu)
     (name "qemu-minimal")
-    (synopsis "Machine emulator and virtualizer (without GUI)")
+    (synopsis
+     "Machine emulator and virtualizer (without GUI) for the host 
architecture")
     (arguments
      (substitute-keyword-arguments (package-arguments qemu)
        ((#:configure-flags _ '(list))
-        ;; Restrict to the targets supported by Guix.
-        
''("--target-list=i386-softmmu,x86_64-softmmu,mips64el-softmmu,arm-softmmu,aarch64-softmmu"))))
+        ;; Restrict to the host's architecture.
+        (let ((arch (car (string-split (or (%current-target-system)
+                                           (%current-system))
+                                       #\-))))
+          (cond ((string=? arch "i686")
+                 '(list "--target-list=i386-softmmu"))
+                ((string-prefix? "x86_64" arch)
+                 '(list "--target-list=i386-softmmu,x86_64-softmmu"))
+                ((string-prefix? "mips64" arch)
+                 '(list (string-append 
"--target-list=mips-softmmu,mipsel-softmmu,"
+                                       "mips64-softmmu,mips64el-softmmu")))
+                ((string-prefix? "mips" arch)
+                 '(list "--target-list=mips-softmmu,mipsel-softmmu"))
+                ((string-prefix? "aarch64" arch)
+                 '(list "--target-list=arm-softmmu,aarch64-softmmu"))
+                ((string-prefix? "arm" arch)
+                 '(list "--target-list=arm-softmmu"))
+                ((string-prefix? "alpha" arch)
+                 '(list "--target-list=alpha-softmmu"))
+                ((string-prefix? "powerpc64" arch)
+                 '(list "--target-list=ppc-softmmu,ppc64-softmmu"))
+                ((string-prefix? "powerpc" arch)
+                 '(list "--target-list=ppc-softmmu"))
+                ((string-prefix? "s390" arch)
+                 '(list "--target-list=s390x-softmmu"))
+                ((string-prefix? "riscv" arch)
+                 '(list "--target-list=riscv32-softmmu,riscv64-softmmu"))
+                (else   ; An empty list actually builds all the targets.
+                  ''()))))))
 
     ;; Remove dependencies on optional libraries, notably GUI libraries.
     (native-inputs (fold alist-delete (package-native-inputs qemu)



reply via email to

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