Subject: bug#31254: closed (Re: [bug#31254] gnu: qemu: Build with Python 3 and SDL 2. (+ GTK 3 frontend) v3)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 26 Apr 2018 10:55:03 +0000

Your bug report

#31254: gnu: qemu: Build with Python 3 and SDL 2. (+ GTK 3 frontend)

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
31254: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=31254
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#31254] gnu: qemu: Build with Python 3 and SDL 2. (+ GTK 3 frontend) v3
From: Rutger Helling <[email-masked]>
To: Marius Bakke <[email-masked]>
Cc: [email-masked]
Date: Thu, 26 Apr 2018 12:54:40 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

I pushed the patches. Thanks again for the help!

On Thu, 26 Apr 2018 12:22:54 +0200
Marius Bakke <[email-masked]> wrote:

> Rutger Helling <[email-masked]> writes:
> 
> > Thanks again! I've made the changes, so here's another set of
> > patches. Note that the second patch is unchanged, just rebased.  
> 
> Excellent.  Both patches LGTM.  Thanks!

Subject: gnu: qemu: Build with Python 3 and SDL 2. (+ GTK 3 frontend)
From: Rutger Helling <[email-masked]>
To: [email-masked]
Date: Wed, 25 Apr 2018 08:33:46 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hey Guix,

I saw QEMU was just updated to 2.12. I noticed a few things in the
release notes, namely:
* QEMU can now be built with Python 3.
* Support for SDL 1.2 is considered deprecated and will be removed
  entirely in a future release.

As a result, the first patch builds QEMU with Python 3 and SDL 2.

The second patch is optional and adds the GTK 3 frontend, which IMO
is a nice alternative to the SDL frontend.
This does increase the size of QEMU a bit. OTOH it seems unlikely that
most people who use QEMU don't already have GTK 3 installed in some
form.
From 2f1626d4526fee5e7a2836d811c96cc2c823ce71 Mon Sep 17 00:00:00 2001
From: Rutger Helling <[email-masked]>
Date: Wed, 25 Apr 2018 08:13:44 +0200
Subject: [PATCH 1/2] gnu: qemu: Build with Python 3 and SDL 2.

* gnu/packages/virtualization.scm (qemu)[arguments]: Add configure-flag to build
with Python 3.
[inputs]: Use sdl2 instead of sdl.
[native-inputs]: Use python instead of python@2.
* gnu/packages/virtualization.scm (qemu-minimal)[native-inputs]: Remove python
from inherited packages and use python@2 instead.
[inputs]: Remove sdl2 instead of sdl from inherited packages.
---
 gnu/packages/virtualization.scm | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 86f4d7136..46b136e31 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -5,7 +5,7 @@
 ;;; Copyright © 2016, 2017 Ricardo Wurmus <[email-masked]>
 ;;; Copyright © 2017 Alex Vong <[email-masked]>
 ;;; Copyright © 2017 Andy Patterson <[email-masked]>
-;;; Copyright © 2017 Rutger Helling <[email-masked]>
+;;; Copyright © 2017, 2018 Rutger Helling <[email-masked]>
 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <[email-masked]>
 ;;; Copyright © 2018 Danny Milosavljevic <[email-masked]>
 ;;; Copyright © 2018 Sou Bunnbu <[email-masked]>
@@ -101,6 +101,11 @@
        ;; boot_sector_test: assertion failed (signature == SIGNATURE): (0x00000000 == 0x0000dead)
        #:parallel-tests? #f
        #:configure-flags (list "--enable-usb-redir" "--enable-opengl"
+                               ;; Remove below once Python 3 becomes the default
+                               ;; 'python' binary.
+                               (string-append "--python="
+                                              (assoc-ref %build-inputs "python")
+                                              "/bin/python3")
                                (string-append "--smbd="
                                               (assoc-ref %outputs "out")
                                               "/libexec/samba-wrapper")
@@ -187,7 +192,7 @@ exec smbd $@")))
        ;; ("pciutils" ,pciutils)
        ("pixman" ,pixman)
        ("pulseaudio" ,pulseaudio)
-       ("sdl" ,sdl)
+       ("sdl2" ,sdl2)
        ("spice" ,spice)
        ("usbredir" ,usbredir)
        ("util-linux" ,util-linux)
@@ -197,7 +202,7 @@ exec smbd $@")))
     (native-inputs `(("glib:bin" ,glib "bin") ; gtester, etc.
                      ("perl" ,perl)
                      ("pkg-config" ,pkg-config)
-                     ("python" ,python-2) ; incompatible with Python 3 according to error message
+                     ("python" ,python)
                      ("texinfo" ,texinfo)))
     (home-page "https://www.qemu.org")
     (synopsis "Machine emulator and virtualizer")
@@ -231,9 +236,13 @@ server and embedded PowerPC, and S390 guests.")
         ;; Restrict to the targets supported by Guix.
         ''("--target-list=i386-softmmu,x86_64-softmmu,mips64el-softmmu,arm-softmmu,aarch64-softmmu"))))
 
+    ;; qemu-minimal-2.10 needs Python 2. Remove below once no longer necessary.
+    (native-inputs `(("python-2" ,python-2)
+                     ,@(fold alist-delete (package-native-inputs qemu)
+                             '("python"))))
     ;; Remove dependencies on optional libraries, notably GUI libraries.
     (inputs (fold alist-delete (package-inputs qemu)
-                  '("libusb" "mesa" "sdl" "spice" "virglrenderer"
+                  '("libusb" "mesa" "sdl2" "spice" "virglrenderer"
                     "usbredir" "libdrm" "libepoxy" "pulseaudio")))))
 
 (define-public libosinfo
-- 
2.17.0

From a0cc0f8f5632374567ee760d629d80703ec0f41e Mon Sep 17 00:00:00 2001
From: Rutger Helling <[email-masked]>
Date: Wed, 25 Apr 2018 08:14:33 +0200
Subject: [PATCH 2/2] gnu: qemu: Enable GTK 3 frontend.

* gnu/packages/virtualization.scm (qemu)[inputs]: Add "gettext", "gtk+" to
inputs.
* gnu/packages/virtualization.scm (qemu-minimal)[inputs]: Remove "gettext",
"gtk+" from inherited inputs.
---
 gnu/packages/virtualization.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 46b136e31..3b8e698a8 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -39,6 +39,7 @@
   #:use-module (gnu packages docbook)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages fontutils)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
@@ -177,7 +178,9 @@ exec smbd $@")))
     (inputs                                       ; TODO: Add optional inputs.
      `(("alsa-lib" ,alsa-lib)
        ("attr" ,attr)
+       ("gettext" ,gettext-minimal)
        ("glib" ,glib)
+       ("gtk+" ,gtk+)
        ("libaio" ,libaio)
        ("libattr" ,attr)
        ("libcap" ,libcap)           ; virtfs support requires libcap & libattr
@@ -242,8 +245,8 @@ server and embedded PowerPC, and S390 guests.")
                              '("python"))))
     ;; Remove dependencies on optional libraries, notably GUI libraries.
     (inputs (fold alist-delete (package-inputs qemu)
-                  '("libusb" "mesa" "sdl2" "spice" "virglrenderer"
-                    "usbredir" "libdrm" "libepoxy" "pulseaudio")))))
+                  '("libusb" "mesa" "sdl2" "spice" "virglrenderer" "gettext"
+                    "gtk+" "usbredir" "libdrm" "libepoxy" "pulseaudio")))))
 
 (define-public libosinfo
   (package
-- 
2.17.0