diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2018-05-24 10:14:10 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2018-05-24 10:33:57 +0000 |
commit | edade0363debe66984fdaa695f008fa670eeeea8 (patch) | |
tree | f6f08d346c56526814137ccf1bf8b610e0508d96 /main | |
parent | 321a72ae9b473e699193d590236781aff03f1623 (diff) | |
download | aports-edade0363debe66984fdaa695f008fa670eeeea8.tar.bz2 aports-edade0363debe66984fdaa695f008fa670eeeea8.tar.xz |
main/qemu: build drivers as modules
Build GTK and SDL user interfaces drivers, audio drivers and block
drivers as modules and ship them in their subpackages. This is so we
dont need make a special build for GTK.
Backport patch to avoid link in libX11 to main binary.
Also separate out ivshmem tools to its own subpackage.
Diffstat (limited to 'main')
-rw-r--r-- | main/qemu/0001-ui-add-x_keymap.o-to-modules.patch | 65 | ||||
-rw-r--r-- | main/qemu/APKBUILD | 163 | ||||
-rw-r--r-- | main/qemu/lm32-need-x11.patch | 11 |
3 files changed, 163 insertions, 76 deletions
diff --git a/main/qemu/0001-ui-add-x_keymap.o-to-modules.patch b/main/qemu/0001-ui-add-x_keymap.o-to-modules.patch new file mode 100644 index 0000000000..de69365316 --- /dev/null +++ b/main/qemu/0001-ui-add-x_keymap.o-to-modules.patch @@ -0,0 +1,65 @@ +From 68898bc82bcb0e697ed03c2405321033ba7feaf7 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini <pbonzini@redhat.com> +Date: Thu, 17 May 2018 14:39:42 +0200 +Subject: [PATCH] ui: add x_keymap.o to modules + +x_keymap.o is common to the SDL and GTK+ modules, and it causes the +QEMU binary to link to the X11 libraries. Add it separately to the +modules to keep the main QEMU binary smaller. + +Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> +Message-id: 1526560782-18732-1-git-send-email-pbonzini@redhat.com + +[ kraxel: fix lm32 target build (milkymist-tmu2) ] + +Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> +--- + hw/display/Makefile.objs | 2 ++ + ui/Makefile.objs | 11 +++++++---- + 2 files changed, 9 insertions(+), 4 deletions(-) + +diff --git a/hw/display/Makefile.objs b/hw/display/Makefile.objs +index 3c7c75b94d..11321e466b 100644 +--- a/hw/display/Makefile.objs ++++ b/hw/display/Makefile.objs +@@ -20,6 +20,8 @@ common-obj-$(CONFIG_MILKYMIST) += milkymist-vgafb.o + common-obj-$(CONFIG_ZAURUS) += tc6393xb.o + + common-obj-$(CONFIG_MILKYMIST_TMU2) += milkymist-tmu2.o ++milkymist-tmu2.o-cflags := $(X11_CFLAGS) ++milkymist-tmu2.o-libs := $(X11_LIBS) + + obj-$(CONFIG_OMAP) += omap_dss.o + obj-$(CONFIG_OMAP) += omap_lcdc.o +diff --git a/ui/Makefile.objs b/ui/Makefile.objs +index cc784346cb..00f6976c30 100644 +--- a/ui/Makefile.objs ++++ b/ui/Makefile.objs +@@ -15,10 +15,6 @@ common-obj-$(CONFIG_COCOA) += cocoa.o + common-obj-$(CONFIG_VNC) += $(vnc-obj-y) + common-obj-$(call lnot,$(CONFIG_VNC)) += vnc-stubs.o + +-common-obj-$(CONFIG_X11) += x_keymap.o +-x_keymap.o-cflags := $(X11_CFLAGS) +-x_keymap.o-libs := $(X11_LIBS) +- + # ui-sdl module + common-obj-$(CONFIG_SDL) += sdl.mo + ifeq ($(CONFIG_SDLABI),1.2) +@@ -46,6 +42,13 @@ gtk.mo-objs += gtk-gl-area.o + endif + endif + ++ifeq ($(CONFIG_X11),y) ++sdl.mo-objs += x_keymap.o ++gtk.mo-objs += x_keymap.o ++x_keymap.o-cflags := $(X11_CFLAGS) ++x_keymap.o-libs := $(X11_LIBS) ++endif ++ + common-obj-$(CONFIG_CURSES) += curses.mo + curses.mo-objs := curses.o + curses.mo-cflags := $(CURSES_CFLAGS) +-- +2.17.0 + diff --git a/main/qemu/APKBUILD b/main/qemu/APKBUILD index f09182dd0b..63f69ed5ff 100644 --- a/main/qemu/APKBUILD +++ b/main/qemu/APKBUILD @@ -4,7 +4,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=qemu pkgver=2.12.0 -pkgrel=1 +pkgrel=2 pkgdesc="QEMU is a generic machine emulator and virtualizer" url="http://qemu.org/" arch="all" @@ -27,16 +27,19 @@ makedepends=" libseccomp-dev libssh2-dev libusb-dev + libxml2-dev linux-headers lzo-dev ncurses-dev paxmark + sdl2-dev snappy-dev spice-dev texinfo usbredir-dev util-linux-dev vde2-dev + vte3-dev xfsprogs-dev zlib-dev " @@ -46,7 +49,8 @@ install="$pkgname.pre-install $pkgname.post-install" # strip fails on .img files # some tests does not run on our builders options="suid !strip !check" -subpackages="$pkgname-doc $pkgname-lang $pkgname-guest-agent:guest" +subpackages="$pkgname-doc $pkgname-lang $pkgname-guest-agent:guest + ivshmem-tools:_ivshmem" _subsystems=" aarch64 @@ -121,15 +125,22 @@ for _sub in $_subsystems; do subpackages="$subpackages $pkgname-$_sub:_subsys" done -case "$CARCH" in - x86) _arch=i386 ;; - x86_64) _arch=x86_64 ;; - *) _arch="" ;; -esac -if [ -n "$_arch" ]; then - subpackages="$subpackages $pkgname-gtk" - gtk() { _subsys system-$_arch-gtk; } -fi +_modules=" + audio-alsa + audio-oss + audio-sdl + block-curl + block-dmg-bz2 + block-nfs + block-ssh + ui-curses + ui-gtk + ui-sdl + " +for _mod in $_modules; do + subpackages="$subpackages $pkgname-$_mod:_module" +done +subpackages="$subpackages qemu-modules:_all_modules" subpackages="$subpackages $pkgname-img" # -img must be declared the last @@ -145,7 +156,7 @@ source="http://wiki.qemu-project.org/download/$pkgname-$pkgver.tar.xz 0001-linux-user-fix-build-with-musl-on-ppc64le.patch fix-sockios-header.patch test-crypto-ivgen-skip-essiv.patch - lm32-need-x11.patch + 0001-ui-add-x_keymap.o-to-modules.patch $pkgname-guest-agent.confd $pkgname-guest-agent.initd @@ -199,67 +210,70 @@ _compile_common() { --disable-debug-info \ --disable-bsd-user \ --disable-werror \ - --disable-sdl \ --disable-xen \ + --enable-kvm \ --enable-seccomp \ --cc="${CC:-gcc}" \ "$@" make ARFLAGS="rc" } -_compile_system() { - _compile_common \ - --audio-drv-list=oss,alsa \ - --enable-kvm \ - --enable-vde \ - --enable-virtfs \ - --enable-curl \ - --enable-cap-ng \ - --enable-linux-aio \ - --enable-usb-redir \ - --enable-libssh2 \ - --enable-vhost-net \ - --enable-snappy \ - --enable-tpm \ - --enable-libnfs \ - --enable-lzo \ - --enable-docs \ - --enable-curses \ - --enable-pie \ - --disable-linux-user \ - "$@" -} - build() { mkdir -p "$builddir"/build \ - "$builddir"/build-user \ - "$builddir"/build-gtk + "$builddir"/build-static - cd "$builddir"/build-user + cd "$builddir"/build-static _compile_common \ --enable-linux-user \ --disable-system \ - --static + --static \ + --disable-sdl \ + --disable-gtk \ + --disable-spice \ + --disable-tools \ + --disable-guest-agent \ + --disable-guest-agent-msi \ + --disable-curses \ + --disable-curl \ + --disable-gnutls \ + --disable-gcrypt \ + --disable-nettle \ + --disable-cap-ng \ + --disable-brlapi \ + --disable-mpath \ + --disable-libnfs \ + --disable-capstone cd "$builddir"/build - _compile_system \ + _compile_common \ + --disable-linux-user \ + --audio-drv-list=oss,alsa,sdl \ + --enable-cap-ng \ + --enable-curl \ + --enable-curses \ + --enable-docs \ + --enable-gtk \ + --enable-guest-agent \ + --enable-libnfs \ + --enable-libssh2 \ + --enable-linux-aio \ + --enable-lzo \ + --enable-modules \ + --enable-pie \ + --enable-sdl \ + --enable-snappy \ + --enable-spice \ + --enable-tpm \ + --enable-usb-redir \ + --enable-vde \ + --enable-vhost-net \ + --enable-virtfs \ --enable-vnc \ - --enable-vnc-png \ --enable-vnc-jpeg \ - --enable-spice \ - --enable-guest-agent \ - --disable-gtk - - if [ -n "$_arch" ]; then - cd "$builddir"/build-gtk - _compile_system \ - --enable-gtk \ - --with-gtkabi=3.0 \ - --disable-vnc \ - --disable-spice \ - --disable-guest-agent \ - --target-list="$_arch-softmmu" - fi + --enable-vnc-png \ + --with-gtkabi=3.0 \ + --with-sdlabi=2.0 \ + --tls-priority=@QEMU,SYSTEM } check() { @@ -270,7 +284,7 @@ check() { } package() { - cd "$builddir"/build-user + cd "$builddir"/build-static make DESTDIR="$pkgdir" install cd "$builddir"/build @@ -288,12 +302,6 @@ package() { chmod 04710 "$pkgdir"/usr/lib/qemu/qemu-bridge-helper chgrp qemu "$pkgdir"/usr/lib/qemu/qemu-bridge-helper - if [ -n "$_arch" ]; then - cd "$builddir"/build-gtk - install $_arch-softmmu/qemu-system-$_arch \ - "$pkgdir"/usr/bin/qemu-system-$_arch-gtk - fi - # Do not install HTML docs. rm "$pkgdir"/usr/share/doc/qemu/*.html } @@ -311,6 +319,12 @@ _subsys() { mv "$pkgdir"/usr/bin/qemu-$name "$subpkgdir"/usr/bin/ } +_ivshmem() { + pkgdesc="Client and server for QEMU ivshmem device" + mkdir -p "$subpkgdir"/usr/bin + mv "$pkgdir"/usr/bin/ivshmem-* "$subpkgdir"/usr/bin/ +} + img() { pkgdesc="QEMU command line tool for manipulating disk images" depends="" @@ -326,7 +340,7 @@ img() { # and check that we done have new systems that belongs in # subpackage. local path= retval=0 - for path in "$pkgdir"/usr/bin/qemu-system-*; do + for path in "$pkgdir"/usr/bin/qemu-system-* "$pkgdir"/usr/lib/qemu/*.so; do if [ -r "$path" ]; then error "Please create a subpackage for ${path##*/}" retval=1 @@ -349,6 +363,25 @@ guest() { "$subpkgdir"/etc/conf.d/$pkgname-guest-agent } +_module() { + local _mod=${subpkgname#qemu-} + local _class=${_mod%%-*} + local _m=${_mod#*-} + pkgdesc="Qemu $_m $_class module" + mkdir -p "$subpkgdir"/usr/lib/qemu + mv "$pkgdir"/usr/lib/qemu/$_mod.so \ + "$subpkgdir"/usr/lib/qemu/ +} + +_all_modules() { + pkgdesc="Meta package for all qemu modules" + local _i + for _i in $_modules; do + depends="$depends $_i" + done + mkdir -p "$subpkgdir" +} + sha512sums="dda057c52cf5fe460b029448049266ace061d21fb5f1cf71a6a37f67b3b7fc3350f6712bf22803fc38fa91f0bd438896ba01b5817b3b94ba9b6925aeaae053b7 qemu-2.12.0.tar.xz 405008589cad1c8b609eca004d520bf944366e8525f85a19fc6e283c95b84b6c2429822ba064675823ab69f1406a57377266a65021623d1cd581e7db000134fd 0001-elfload-load-PIE-executables-to-right-address.patch ec84b27648c01c6e58781295dcd0c2ff8e5a635f9836ef50c1da5d0ed125db1afc4cb5b01cb97606d6dd8f417acba93e1560d9a32ca29161a4bb730b302440ea 0006-linux-user-signal.c-define-__SIGRTMIN-MAX-for-non-GN.patch @@ -361,7 +394,7 @@ fd178f2913639a0c33199b3880cb17536961f2b3ff171c12b27f4be6bca032d6b88fd16302d09c69 d8933df9484158c2b4888254e62117d78f8ed7c18527b249419f39c2b2ab1afa148010884b40661f8965f1ef3105580fceffdfddbb2c9221dc1c62066722ba65 0001-linux-user-fix-build-with-musl-on-ppc64le.patch 39590476a4ebd7c1e79a4f0451b24c75b1817a2a83abaa1f71bb60b225d772152f0af8f3e51ff65645e378c536ffa6ff551dade52884d03a14b7c6a19c5c97d4 fix-sockios-header.patch 8b8db136f78bd26b5da171effa9e11016ec2bc3e2fc8107228b5543b47aa370978ed883794aa4f917f334e284a5b49e82070e1da2d31d49301195b6713a48eff test-crypto-ivgen-skip-essiv.patch -2c42571c51d14cdb67d238d2290e0fc9ce07413aa2b09a20ac86b94ee9f437deacc70d7f7c38cb4893ecb30f9e3ee53b207c6b6efbe72c427efec90f61739810 lm32-need-x11.patch +e052ece28af1e7a81828322999b6f1ff5c030c717a897fe80ea04d5ba7f9d477786d91cfbf2eb3444c46b1bc8d3b72a771c26c819bc3ecfd216dd02b6567796e 0001-ui-add-x_keymap.o-to-modules.patch d90c034cae3f9097466854ed1a9f32ab4b02089fcdf7320e8f4da13b2b1ff65067233f48809911485e4431d7ec1a22448b934121bc9522a2dc489009e87e2b1f qemu-guest-agent.confd 1cd24c2444c5935a763c501af2b0da31635aad9cf62e55416d6477fcec153cddbe7de205d99616def11b085e0dd366ba22463d2270f831d884edbc307c7864a6 qemu-guest-agent.initd 9b7a89b20fcf737832cb7b4d5dc7d8301dd88169cbe5339eda69fbb51c2e537d8cb9ec7cf37600899e734209e63410d50d0821bce97e401421db39c294d97be2 80-kvm.rules diff --git a/main/qemu/lm32-need-x11.patch b/main/qemu/lm32-need-x11.patch deleted file mode 100644 index 456843c60b..0000000000 --- a/main/qemu/lm32-need-x11.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- qemu-2.12.0/configure.orig -+++ qemu-2.12.0/configure -@@ -6086,7 +6086,7 @@ - echo "CONFIG_STAMP=_$( (echo $qemu_version; echo $pkgversion; cat $0) | $shacmd - | cut -f1 -d\ )" >> $config_host_mak - echo "CONFIG_MODULES=y" >> $config_host_mak - fi --if test "$have_x11" = "yes" -a "$need_x11" = "yes"; then -+if test "$have_x11" = "yes"; then - echo "CONFIG_X11=y" >> $config_host_mak - echo "X11_CFLAGS=$x11_cflags" >> $config_host_mak - echo "X11_LIBS=$x11_libs" >> $config_host_mak |