efraim pushed a commit to branch wip-ppc
in repository guix.

commit a9bca2ecfdf289e41180b86844ecf5e36668085a
Author: Efraim Flashner <[email protected]>
AuthorDate: Sun May 3 11:00:44 2020 +0300

    gnu: Add qemu-self.
    
    * gnu/packages/virtualization.scm (qemu-self): New variable.
---
 gnu/packages/virtualization.scm | 31 +++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 15cdc1c..def7608 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 
<[email protected]>
 ;;; Copyright © 2015, 2016, 2017, 2018 Mark H Weaver <[email protected]>
-;;; Copyright © 2016, 2017, 2018. 2019 Efraim Flashner <[email protected]>
+;;; Copyright © 2016, 2017, 2018. 2019, 2020 Efraim Flashner 
<[email protected]>
 ;;; Copyright © 2016, 2017 Ricardo Wurmus <[email protected]>
 ;;; Copyright © 2017 Alex Vong <[email protected]>
 ;;; Copyright © 2017 Andy Patterson <[email protected]>
@@ -100,7 +100,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."
@@ -312,6 +313,32 @@ server and embedded PowerPC, and S390 guests.")
                   '("libusb" "mesa" "sdl2" "spice" "virglrenderer" "gtk+"
                     "usbredir" "libdrm" "libepoxy" "pulseaudio" "vde2")))))
 
+(define-public qemu-self
+  ;; QEMU without GUI support, only supporting the host's architecture
+  (package (inherit qemu-minimal)
+    (name "qemu-self")
+    (synopsis "Machine emulator and virtualizer (without GUI) for the host 
architecture")
+    (arguments
+     (substitute-keyword-arguments (package-arguments qemu)
+       ((#:configure-flags _ '(list))
+        ;; Restrict to the host's architecture.
+        `(,@(match (or (%current-system)
+                       (%current-target-system))
+             ("x86-64-linux"
+              ''("--target-list=i386-softmmu,x86_64-softmmu"))
+             ((or "i686-linux" "i586-gnu")
+              ''("--target-list=i386-softmmu"))
+             ("mips64el-linux"
+              ''("--target-list=mips64el-softmmu"))
+             ("aarch64-linux"
+              ''("--target-list=arm-softmmu,aarch64-softmmu"))
+             ("armhf-linux"
+              ''("--target-list=arm-softmmu"))
+             ("powerpc-linux"
+              ''("--target-list=ppc-softmmu"))
+             (_
+              
''("--target-list=i386-softmmu,x86_64-softmmu,mips64el-softmmu,arm-softmmu,aarch64-softmmu,ppc-softmmu")))))))))
+
 (define-public libosinfo
   (package
     (name "libosinfo")

Reply via email to