[arch-commits] Commit in qemu/trunk (PKGBUILD build-most-modules-statically-hack.diff)

Anatol Pomozov anatolik at archlinux.org
Mon Feb 8 21:21:00 UTC 2021


    Date: Monday, February 8, 2021 @ 21:20:59
  Author: anatolik
Revision: 407703

FS#69582 Workaround qemu/lxd issue with building the qemu modules statically

The patch comes from Debian folks.

See also https://bugs.launchpad.net/qemu/+bug/1910696

Added:
  qemu/trunk/build-most-modules-statically-hack.diff
Modified:
  qemu/trunk/PKGBUILD

-----------------------------------------+
 PKGBUILD                                |    9 ++++++
 build-most-modules-statically-hack.diff |   40 ++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+), 1 deletion(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-02-08 20:43:34 UTC (rev 407702)
+++ PKGBUILD	2021-02-08 21:20:59 UTC (rev 407703)
@@ -6,7 +6,7 @@
          qemu-block-{iscsi,rbd,gluster} qemu-guest-agent)
 pkgdesc="A generic and open source machine emulator and virtualizer"
 pkgver=5.2.0
-pkgrel=2
+pkgrel=3
 arch=(x86_64)
 license=(GPL2 LGPL2.1)
 url="https://wiki.qemu.org/"
@@ -16,10 +16,12 @@
 depends=(virglrenderer sdl2 vte3 libpulse libjack.so brltty "${_headlessdeps[@]}")
 makedepends=(spice-protocol python ceph libiscsi glusterfs python-sphinx xfsprogs ninja)
 source=(https://download.qemu.org/qemu-$pkgver.tar.xz{,.sig}
+        build-most-modules-statically-hack.diff
         qemu-guest-agent.service
         65-kvm.rules)
 sha512sums=('bddd633ce111471ebc651e03080251515178808556b49a308a724909e55dac0be0cc0c79c536ac12d239678ae94c60100dc124be9b9d9538340c03a2f27177f3'
             'SKIP'
+            '8721068fb968dbae62ceff71aa46eb4c2452c7fde95b87396b439f2f927ea84d2ee2c512264a9f28a5ccaf3096aacce052cebf209aaffd62a201b5bafb512002'
             '269c0f0bacbd06a3d817fde02dce26c99d9f55c9e3b74bb710bd7e5cdde7a66b904d2eb794c8a605bf9305e4e3dee261a6e7d4ec9d9134144754914039f176e4'
             'bdf05f99407491e27a03aaf845b7cc8acfa2e0e59968236f10ffc905e5e3d5e8569df496fd71c887da2b5b8d1902494520c7da2d3a8258f7fd93a881dd610c99')
 validpgpkeys=('CEACC9E15534EBABB82D3FA03353C9CEF108B584') # Michael Roth <flukshun at gmail.com>
@@ -32,6 +34,11 @@
 prepare() {
   mkdir build-{full,headless}
   mkdir -p extra-arch-{full,headless}/usr/{bin,share/qemu}
+
+  cd qemu-$pkgver
+  # https://bugs.launchpad.net/qemu/+bug/1910696
+  # the patch comes from https://salsa.debian.org/qemu-team/qemu/-/blob/master/debian/patches/build-most-modules-statically-hack.diff
+  patch -p1 < ../build-most-modules-statically-hack.diff
 }
 
 build() {

Added: build-most-modules-statically-hack.diff
===================================================================
--- build-most-modules-statically-hack.diff	                        (rev 0)
+++ build-most-modules-statically-hack.diff	2021-02-08 21:20:59 UTC (rev 407703)
@@ -0,0 +1,40 @@
+From: Michael Tokarev <mjt at tls.msk.ru>
+Subject: build most modules statically (hack)
+
+This hack makes the build procedure to build most modules statically,
+except block and gui modules which goes into their own packages.
+The rest are built into the executables directly in order to make
+qemu-system-common package (where all other modules goes) to be
+more-or-less version-independent.
+
+There's little reason to build these as modules or to ship them in
+separate packages.
+
+diff --git a/meson.build b/meson.build
+index e3386196ba..a28f7d10f1 100644
+--- a/meson.build
++++ b/meson.build
+@@ -1587,13 +1587,19 @@ softmmu_mods = []
+ foreach d, list : modules
+   foreach m, module_ss : list
+     if enable_modules and targetos != 'windows'
+-      module_ss = module_ss.apply(config_all, strict: false)
+-      sl = static_library(d + '-' + m, [genh, module_ss.sources()],
+-                          dependencies: [modulecommon, module_ss.dependencies()], pic: true)
++      module_dn = module_ss.apply(config_all, strict: false)
++      sl = static_library(d + '-' + m, [genh, module_dn.sources()],
++                          dependencies: [modulecommon, module_dn.dependencies()], pic: true)
+       if d == 'block'
+         block_mods += sl
+       else
+-        softmmu_mods += sl
++        # we only build 2 non-block modules as modules: it is the gui part
++        if d + '-' + m in [ 'ui-gtk', 'ui-sdl', 'audio-pa' ]
++          softmmu_mods += sl
++        else
++          warning('Compiling module statically: ' + d + '-' + m)
++          softmmu_ss.add_all(module_ss)
++        endif
+       endif
+     else
+       if d == 'block'



More information about the arch-commits mailing list