From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41446) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBKSr-0005zk-WA for guix-patches@gnu.org; Wed, 25 Apr 2018 09:28:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fBKSo-0003DX-On for guix-patches@gnu.org; Wed, 25 Apr 2018 09:28:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:59194) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fBKSo-0003D9-EX for guix-patches@gnu.org; Wed, 25 Apr 2018 09:28:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fBKSn-00041n-Vm for guix-patches@gnu.org; Wed, 25 Apr 2018 09:28:02 -0400 Subject: [bug#31254] gnu: qemu: Build with Python 3 and SDL 2. (+ GTK 3 frontend) v2 Resent-Message-ID: Date: Wed, 25 Apr 2018 15:26:42 +0200 From: Rutger Helling Message-ID: <20180425152642.2a361ae5@mykolab.com> In-Reply-To: <87lgdb8rf2.fsf@fastmail.com> References: <20180425083346.29a434e9@mykolab.com> <87lgdb8rf2.fsf@fastmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/NijL.PgtTpHVQ8F50nK5OwC"; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Marius Bakke Cc: 31254@debbugs.gnu.org --Sig_/NijL.PgtTpHVQ8F50nK5OwC Content-Type: multipart/mixed; boundary="MP_/.zgSgxYJOnt95_+u946KaNq" --MP_/.zgSgxYJOnt95_+u946KaNq Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hello Marius,=20 Thanks for the review! I've taken your suggestions into account and updated the patches. I don't think it's possible to seperate the GTK3 frontend, since it's just a parameter you pass to the qemu* binaries (-display gtk instead of -display sdl). =46rom my understanding if you have both GTK3 and SDL2 enabled it defaults to GTK3. We can remove the SDL2 frontend if there are no objections (and probably sdl from the --audio-drv-list). I just figured it'd be nicer to enable both to give users maximum flexibility. On Wed, 25 Apr 2018 13:19:13 +0200 Marius Bakke wrote: > Hello! >=20 > Rutger Helling writes: >=20 > > 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. =20 >=20 > Thanks for looking after this. I didn't realize it was using SDL1! >=20 > > 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. =20 >=20 > Using `guix size`, stock qemu is ~916MiB, and adding gtk+ brings it to > ~1131MiB. I'm not familiar with the GTK+ frontend, would it make > sense to add it in a separate output? >=20 > Alternatively, could we replace the SDL frontend with it? >=20 > > From 2f1626d4526fee5e7a2836d811c96cc2c823ce71 Mon Sep 17 00:00:00 > > 2001 From: Rutger Helling > > 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. =20 >=20 > [...] >=20 > > @@ -101,6 +101,11 @@ > > ;; boot_sector_test: assertion failed (signature =3D=3D > > SIGNATURE): (0x00000000 =3D=3D 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=3D" > > + (assoc-ref > > %build-inputs "python") > > + "/bin/python3") =20 >=20 > Note: You can use the 'python-wrapper' package, which has python3 as > "/bin/python". Then this won't be necessary. >=20 > > (string-append "--smbd=3D" > > (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=3Di386-softmmu,x86_64-softmmu,mips64el-softm= mu,arm-softmmu,aarch64-softmmu")))) > > =20 > > + ;; 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")))) =20 >=20 > It's better to do this in the actual Qemu 2.10 package instead of > arbitrarily using a different Python version in "qemu-minimal" IMO. >=20 > Perhaps we should move "qemu@2.10" from (gnu packages bootloaders) > into here and make this change in that package. WDYT? Ideally as a > public "hidden-package" so it's not visible to end users. >=20 > Can you try it? >=20 > [...] >=20 > > From a0cc0f8f5632374567ee760d629d80703ec0f41e Mon Sep 17 00:00:00 > > 2001 From: Rutger Helling > > 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. =20 >=20 > 'gettext' should probably be a native-input. That said I wonder if > the GTK frontend should be a separate output due to the ~21% size > increase, but no strong opinion. --MP_/.zgSgxYJOnt95_+u946KaNq Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-gnu-qemu-Build-with-Python-3-and-SDL2-support.patch =46rom e1b40133c8aedf84090fbd4292af2b53eb22d669 Mon Sep 17 00:00:00 2001 From: Rutger Helling Date: Wed, 25 Apr 2018 14:59:11 +0200 Subject: [PATCH 1/2] gnu: qemu: Build with Python 3 and SDL2 support. * gnu/packages/bootloaders.scm (qemu-minimal-2.10): Remove variable. * gnu/packages/virtualization.scm (qemu)[inputs]: Use sdl2 instead of sdl. [native-inputs]: Use python instead of python@2. Add python-wrapper. * gnu/packages/virtualization.scm (qemu-minimal)[inputs]: Remove sdl2 inste= ad of sdl from inherited packages. * gnu/packages/virtualization.scm (qemu-minimal-2.10): Add variable. [native-inputs]: Remove python from inherited packages and use python@2 ins= tead. --- gnu/packages/bootloaders.scm | 16 ---------------- gnu/packages/virtualization.scm | 30 ++++++++++++++++++++++++++---- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index 281bb98fa..4350ff3a5 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -72,22 +72,6 @@ (base32 "0p2vhnc18cnbmb39vq4m7hzv4mhnm2l0a2s7gx3ar277fwng3hys")))) =20 -;; The GRUB test suite fails with later versions of Qemu, so we -;; keep it at 2.10 for now. See -;; . -;; TODO: When grub no longer needs this version, move to gnu/packages/debu= g.scm. -(define qemu-minimal-2.10 - (package - (inherit qemu-minimal) - (version "2.10.2") - (source (origin - (method url-fetch) - (uri (string-append "https://download.qemu.org/qemu-" - version ".tar.xz")) - (sha256 - (base32 - "17w21spvaxaidi2am5lpsln8yjpyp2zi3s3gc6nsxj5arlgamzgw"))))= )) - (define-public grub (package (name "grub") diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.= scm index 86f4d7136..36bdc8f95 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -5,7 +5,7 @@ ;;; Copyright =C2=A9 2016, 2017 Ricardo Wurmus ;;; Copyright =C2=A9 2017 Alex Vong ;;; Copyright =C2=A9 2017 Andy Patterson -;;; Copyright =C2=A9 2017 Rutger Helling +;;; Copyright =C2=A9 2017, 2018 Rutger Helling ;;; Copyright =C2=A9 2017, 2018 Tobias Geerinckx-Rice ;;; Copyright =C2=A9 2018 Danny Milosavljevic ;;; Copyright =C2=A9 2018 Sou Bunnbu @@ -187,7 +187,7 @@ exec smbd $@"))) ;; ("pciutils" ,pciutils) ("pixman" ,pixman) ("pulseaudio" ,pulseaudio) - ("sdl" ,sdl) + ("sdl2" ,sdl2) ("spice" ,spice) ("usbredir" ,usbredir) ("util-linux" ,util-linux) @@ -197,7 +197,8 @@ exec smbd $@"))) (native-inputs `(("glib:bin" ,glib "bin") ; gtester, etc. ("perl" ,perl) ("pkg-config" ,pkg-config) - ("python" ,python-2) ; incompatible with Python 3 acc= ording to error message + ("python" ,python) + ("python-wrapper" ,python-wrapper) ("texinfo" ,texinfo))) (home-page "https://www.qemu.org") (synopsis "Machine emulator and virtualizer") @@ -233,9 +234,30 @@ server and embedded PowerPC, and S390 guests.") =20 ;; 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"))))) =20 +;; The GRUB test suite fails with later versions of Qemu, so we +;; keep it at 2.10 for now. See +;; . +;; TODO: When grub no longer needs this version, move to gnu/packages/debu= g.scm. +(define-public qemu-minimal-2.10 + (hidden-package + (package + (inherit qemu-minimal) + (version "2.10.2") + (source (origin + (method url-fetch) + (uri (string-append "https://download.qemu.org/qemu-" + version ".tar.xz")) + (sha256 + (base32 + "17w21spvaxaidi2am5lpsln8yjpyp2zi3s3gc6nsxj5arlgamzgw")))) + ;; qemu-minimal-2.10 needs Python 2. Remove below once no longer neces= sary. + (native-inputs `(("python-2" ,python-2) + ,@(fold alist-delete (package-native-inputs qemu) + '("python"))))))) + (define-public libosinfo (package (name "libosinfo") --=20 2.17.0 --MP_/.zgSgxYJOnt95_+u946KaNq Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0002-gnu-qemu-Enable-GTK3-frontend.patch =46rom edea64c09dc1e0f391e860478dcf99f4d0d1a6d2 Mon Sep 17 00:00:00 2001 From: Rutger Helling Date: Wed, 25 Apr 2018 15:03:29 +0200 Subject: [PATCH 2/2] gnu: qemu: Enable GTK3 frontend. * gnu/packages/virtualization.scm (qemu)[native-inputs]: Add "gettext" to n= ative-inputs. [inputs]: Add "gtk+" to inputs. * gnu/packages/virtualization.scm (qemu-minimal)[native-inputs]: Remove "ge= ttext" from inherited inputs. [inputs]: Remove "gtk+" from inherited inputs. --- gnu/packages/virtualization.scm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.= scm index 36bdc8f95..a12debe52 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) @@ -173,6 +174,7 @@ exec smbd $@"))) `(("alsa-lib" ,alsa-lib) ("attr" ,attr) ("glib" ,glib) + ("gtk+" ,gtk+) ("libaio" ,libaio) ("libattr" ,attr) ("libcap" ,libcap) ; virtfs support requires libcap & lib= attr @@ -194,7 +196,8 @@ exec smbd $@"))) ;; ("vde2" ,vde2) ("virglrenderer" ,virglrenderer) ("zlib" ,zlib))) - (native-inputs `(("glib:bin" ,glib "bin") ; gtester, etc. + (native-inputs `(("gettext" ,gettext-minimal) + ("glib:bin" ,glib "bin") ; gtester, etc. ("perl" ,perl) ("pkg-config" ,pkg-config) ("python" ,python) @@ -233,8 +236,10 @@ server and embedded PowerPC, and S390 guests.") ''("--target-list=3Di386-softmmu,x86_64-softmmu,mips64el-softmmu,a= rm-softmmu,aarch64-softmmu")))) =20 ;; Remove dependencies on optional libraries, notably GUI libraries. + (native-inputs (fold alist-delete (package-native-inputs qemu) + '("gettext"))) (inputs (fold alist-delete (package-inputs qemu) - '("libusb" "mesa" "sdl2" "spice" "virglrenderer" + '("libusb" "mesa" "sdl2" "spice" "virglrenderer" "gtk+" "usbredir" "libdrm" "libepoxy" "pulseaudio"))))) =20 ;; The GRUB test suite fails with later versions of Qemu, so we --=20 2.17.0 --MP_/.zgSgxYJOnt95_+u946KaNq-- --Sig_/NijL.PgtTpHVQ8F50nK5OwC Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEAVThuRzJ2e93ZI3n86cn20T8yjYFAlrgghIACgkQ86cn20T8 yjb29Qf+PojmeC3Z2zYx0qfoaOwr2tkOizYCa6LA8hkCLKWvCEH9xl0zsWCUsZFX x52sHY9PusKx8BKmqQYZnuCvfwJY8vPQCSEqTQOHjNgfuhROGyotoLAvvLl8XqXx BqXqQ2ceISHNB6hyeTv6cLOgBjE2vlC5OOa92EW/2W+o1SAICiHsJoDWH8LG4x3q iO/XO28UecnuCVwc6qrkuVvXmzA0K7LYzvE/xV1cxG22TU8oEA/rHePBTJMKd5Kv YNkJPLqRL1zcYdd6IC5sz1Ou/7ALqscYaTaybGQ7dvPGPUTCp6kqDeXB6hCxjrzl L60Pf5EWQX2e8V4prINnbNAG1J/xHw== =JSfi -----END PGP SIGNATURE----- --Sig_/NijL.PgtTpHVQ8F50nK5OwC--