Gentoo Archives: gentoo-commits

From: Matthias Maier <tamiko@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/qemu/, app-emulation/qemu/files/
Date: Sun, 19 Aug 2018 17:49:42
Message-Id: 1534700242.55679e9cfb47c803931db687f2e3f510d66d91d1.tamiko@gentoo
1 commit: 55679e9cfb47c803931db687f2e3f510d66d91d1
2 Author: Matthias Maier <tamiko <AT> gentoo <DOT> org>
3 AuthorDate: Sun Aug 19 17:37:22 2018 +0000
4 Commit: Matthias Maier <tamiko <AT> gentoo <DOT> org>
5 CommitDate: Sun Aug 19 17:37:22 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=55679e9c
7
8 app-emulation/qemu: drop version 2.11.*
9
10 Bug: https://bugs.gentoo.org/663502
11 Package-Manager: Portage-2.3.47, Repoman-2.3.10
12
13 app-emulation/qemu/Manifest | 2 -
14 .../qemu/files/qemu-2.11.0-glibc-2.27.patch | 54 --
15 app-emulation/qemu/qemu-2.11.1-r2.ebuild | 805 ---------------------
16 3 files changed, 861 deletions(-)
17
18 diff --git a/app-emulation/qemu/Manifest b/app-emulation/qemu/Manifest
19 index 8534038d8e8..0146a02dfc3 100644
20 --- a/app-emulation/qemu/Manifest
21 +++ b/app-emulation/qemu/Manifest
22 @@ -1,5 +1,3 @@
23 -DIST qemu-2.11.1-patches-r1.tar.xz 2064 BLAKE2B 533c916b01c014bcfa6c733b76aa6da1f12cdf5f0d4ae33136453705a8aca9fdfeef998747cfdc72d19e08fa40ea97e2fd4c21412c030af314605059282f49ef SHA512 12de7b4777ec98871d0786291534f61b37534feef64b556caeab72e020ff14d61fe19d24cb151ebfdb912df2a7ba72c0d882566b368d88d02c9f1354c2adae4a
24 -DIST qemu-2.11.1.tar.bz2 32819412 BLAKE2B 6b6d4e7b8dcf33aeedb0b33bad267da07ad17c2eeeb5fbd2c038d760bc03224e55ba0f03eb248c62bc0e8636c2c660ea76b367eaea96bee16388053f82c8b8a9 SHA512 1b692bbdfc3dc785738c7192aa2a3f9cf53d9f5bf3b3f49fa8692050dc50f7056c8a4d1b527d48ffb2a674a0fd3a46d87addd1eaaa758f35eec1ab5adfe32354
25 DIST qemu-2.12.0-patches-r5.tar.xz 5536 BLAKE2B 751a0fd7a6dd2433542dbfc8a1c9726fb612270b5a526e2e67729478b0f9b45689e23a70e077fb6b3b9cee115ff48d5334b16aba39efb79eff16baae3e1d349e SHA512 5c735632a3ca7ae7fbd9619b01683917749c02e7cdba85564fb157ef8d382ec999c1e1577eb00d4248a26c0f0ab9cb5af6355ca7fc68bcba054ffcca1947eebc
26 DIST qemu-2.12.0.tar.bz2 41196232 BLAKE2B f258e570558249ea647c3571908f90b8bacdcef9a1814009b98571cf0e96406194d44aa041fd0a97c9b673f39a9eaae8d873824745509778a6784cd85f8398b0 SHA512 91d829f44c431e4c1cd335f3efea5afff9da62d832b0296a92417463ea0826d09ce226c2ea8ac167fe7b99b6bb976c7cb1357aaf17735ee57af6602161e46346
27 DIST qemu-2.12.1-patches-r1.tar.xz 3648 BLAKE2B 07908004d0b56e60274cb59d4163770290d8fa6e31646e7d96db08427a219638ac53bdd988c9557471b95321a72982d740a29778d843652274a126737a0a6c00 SHA512 1c7768c14a8e168053f0322554214ba59932a9fa23c982b06dbb1b8fdcfc280ae1d97b20244600f357485bfbcb9ad8bd7968787550c8a4e5e243ac8502eff05e
28
29 diff --git a/app-emulation/qemu/files/qemu-2.11.0-glibc-2.27.patch b/app-emulation/qemu/files/qemu-2.11.0-glibc-2.27.patch
30 deleted file mode 100644
31 index 1562bb3c64a..00000000000
32 --- a/app-emulation/qemu/files/qemu-2.11.0-glibc-2.27.patch
33 +++ /dev/null
34 @@ -1,54 +0,0 @@
35 -From 75e5b70e6b5dcc4f2219992d7cffa462aa406af0 Mon Sep 17 00:00:00 2001
36 -From: Paolo Bonzini <pbonzini@××××××.com>
37 -Date: Tue, 28 Nov 2017 11:51:27 +0100
38 -Subject: [PATCH] memfd: fix configure test
39 -MIME-Version: 1.0
40 -Content-Type: text/plain; charset=UTF-8
41 -Content-Transfer-Encoding: 8bit
42 -
43 -Recent glibc added memfd_create in sys/mman.h. This conflicts with
44 -the definition in util/memfd.c:
45 -
46 - /builddir/build/BUILD/qemu-2.11.0-rc1/util/memfd.c:40:12: error: static declaration of memfd_create follows non-static declaration
47 -
48 -Fix the configure test, and remove the sys/memfd.h inclusion since the
49 -file actually does not exist---it is a typo in the memfd_create(2) man
50 -page.
51 -
52 -Cc: Marc-André Lureau <marcandre.lureau@××××××.com>
53 -Signed-off-by: Paolo Bonzini <pbonzini@××××××.com>
54 ----
55 - configure | 2 +-
56 - util/memfd.c | 4 +---
57 - 2 files changed, 2 insertions(+), 4 deletions(-)
58 -
59 -diff --git a/configure b/configure
60 -index 9c8aa5a98b..99ccc1725a 100755
61 ---- a/configure
62 -+++ b/configure
63 -@@ -3923,7 +3923,7 @@ fi
64 - # check if memfd is supported
65 - memfd=no
66 - cat > $TMPC << EOF
67 --#include <sys/memfd.h>
68 -+#include <sys/mman.h>
69 -
70 - int main(void)
71 - {
72 -diff --git a/util/memfd.c b/util/memfd.c
73 -index 4571d1aba8..412e94a405 100644
74 ---- a/util/memfd.c
75 -+++ b/util/memfd.c
76 -@@ -31,9 +31,7 @@
77 -
78 - #include "qemu/memfd.h"
79 -
80 --#ifdef CONFIG_MEMFD
81 --#include <sys/memfd.h>
82 --#elif defined CONFIG_LINUX
83 -+#if defined CONFIG_LINUX && !defined CONFIG_MEMFD
84 - #include <sys/syscall.h>
85 - #include <asm/unistd.h>
86 -
87 ---
88 -2.11.0
89
90 diff --git a/app-emulation/qemu/qemu-2.11.1-r2.ebuild b/app-emulation/qemu/qemu-2.11.1-r2.ebuild
91 deleted file mode 100644
92 index 0c0f70a126a..00000000000
93 --- a/app-emulation/qemu/qemu-2.11.1-r2.ebuild
94 +++ /dev/null
95 @@ -1,805 +0,0 @@
96 -# Copyright 1999-2018 Gentoo Foundation
97 -# Distributed under the terms of the GNU General Public License v2
98 -
99 -EAPI="6"
100 -
101 -PYTHON_COMPAT=( python2_7 )
102 -PYTHON_REQ_USE="ncurses,readline"
103 -
104 -PLOCALES="bg de_DE fr_FR hu it tr zh_CN"
105 -
106 -FIRMWARE_ABI_VERSION="2.9.0-r52"
107 -
108 -inherit eutils flag-o-matic linux-info toolchain-funcs multilib python-r1 \
109 - user udev fcaps readme.gentoo-r1 pax-utils l10n versionator
110 -
111 -if [[ ${PV} = *9999* ]]; then
112 - EGIT_REPO_URI="git://git.qemu.org/qemu.git"
113 - inherit git-r3
114 - SRC_URI=""
115 -else
116 - SRC_URI="http://wiki.qemu-project.org/download/${P}.tar.bz2"
117 - KEYWORDS="amd64 ~arm64 ~ppc ~ppc64 x86 ~x86-fbsd"
118 -
119 - # Gentoo specific patchsets:
120 - SRC_URI+=" https://dev.gentoo.org/~tamiko/distfiles/${P}-patches-r1.tar.xz"
121 -fi
122 -
123 -DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools"
124 -HOMEPAGE="http://www.qemu.org http://www.linux-kvm.org"
125 -
126 -LICENSE="GPL-2 LGPL-2 BSD-2"
127 -SLOT="0"
128 -IUSE="accessibility +aio alsa bluetooth bzip2 +caps +curl debug +fdt
129 - glusterfs gnutls gtk gtk2 infiniband iscsi +jpeg kernel_linux
130 - kernel_FreeBSD lzo ncurses nfs nls numa opengl +pin-upstream-blobs +png
131 - pulseaudio python rbd sasl +seccomp sdl sdl2 selinux smartcard snappy
132 - spice ssh static static-user systemtap tci test usb usbredir vde
133 - +vhost-net virgl virtfs +vnc vte xattr xen xfs"
134 -
135 -COMMON_TARGETS="aarch64 alpha arm cris i386 m68k microblaze microblazeel
136 - mips mips64 mips64el mipsel nios2 or1k ppc ppc64 s390x sh4 sh4eb sparc
137 - sparc64 x86_64"
138 -IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS}
139 - lm32 moxie ppcemb tricore unicore32 xtensa xtensaeb"
140 -IUSE_USER_TARGETS="${COMMON_TARGETS}
141 - armeb hppa mipsn32 mipsn32el ppc64abi32 ppc64le sparc32plus tilegx"
142 -
143 -use_softmmu_targets=$(printf ' qemu_softmmu_targets_%s' ${IUSE_SOFTMMU_TARGETS})
144 -use_user_targets=$(printf ' qemu_user_targets_%s' ${IUSE_USER_TARGETS})
145 -IUSE+=" ${use_softmmu_targets} ${use_user_targets}"
146 -
147 -# Allow no targets to be built so that people can get a tools-only build.
148 -# Block USE flag configurations known to not work.
149 -REQUIRED_USE="${PYTHON_REQUIRED_USE}
150 - gtk2? ( gtk )
151 - qemu_softmmu_targets_arm? ( fdt )
152 - qemu_softmmu_targets_microblaze? ( fdt )
153 - qemu_softmmu_targets_mips64el? ( fdt )
154 - qemu_softmmu_targets_ppc? ( fdt )
155 - qemu_softmmu_targets_ppc64? ( fdt )
156 - sdl2? ( sdl )
157 - static? ( static-user !alsa !bluetooth !gtk !gtk2 !opengl !pulseaudio !snappy )
158 - virtfs? ( xattr )
159 - vte? ( gtk )"
160 -
161 -# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...)
162 -# and user/softmmu targets (qemu-*, qemu-system-*).
163 -#
164 -# Yep, you need both libcap and libcap-ng since virtfs only uses libcap.
165 -#
166 -# The attr lib isn't always linked in (although the USE flag is always
167 -# respected). This is because qemu supports using the C library's API
168 -# when available rather than always using the extranl library.
169 -ALL_DEPEND="
170 - >=dev-libs/glib-2.0[static-libs(+)]
171 - sys-libs/zlib[static-libs(+)]
172 - python? ( ${PYTHON_DEPS} )
173 - systemtap? ( dev-util/systemtap )
174 - xattr? ( sys-apps/attr[static-libs(+)] )"
175 -
176 -# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...)
177 -# softmmu targets (qemu-system-*).
178 -SOFTMMU_TOOLS_DEPEND="
179 - >=x11-libs/pixman-0.28.0[static-libs(+)]
180 - accessibility? (
181 - app-accessibility/brltty[api]
182 - app-accessibility/brltty[static-libs(+)]
183 - )
184 - aio? ( dev-libs/libaio[static-libs(+)] )
185 - alsa? ( >=media-libs/alsa-lib-1.0.13 )
186 - bluetooth? ( net-wireless/bluez )
187 - bzip2? ( app-arch/bzip2[static-libs(+)] )
188 - caps? ( sys-libs/libcap-ng[static-libs(+)] )
189 - curl? ( >=net-misc/curl-7.15.4[static-libs(+)] )
190 - fdt? ( >=sys-apps/dtc-1.4.2[static-libs(+)] )
191 - glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] )
192 - gnutls? (
193 - dev-libs/nettle:=[static-libs(+)]
194 - >=net-libs/gnutls-3.0:=[static-libs(+)]
195 - )
196 - gtk? (
197 - gtk2? (
198 - x11-libs/gtk+:2
199 - vte? ( x11-libs/vte:0 )
200 - )
201 - !gtk2? (
202 - x11-libs/gtk+:3
203 - vte? ( x11-libs/vte:2.91 )
204 - )
205 - )
206 - infiniband? ( sys-fabric/librdmacm:=[static-libs(+)] )
207 - iscsi? ( net-libs/libiscsi )
208 - jpeg? ( virtual/jpeg:0=[static-libs(+)] )
209 - lzo? ( dev-libs/lzo:2[static-libs(+)] )
210 - ncurses? (
211 - sys-libs/ncurses:0=[unicode]
212 - sys-libs/ncurses:0=[static-libs(+)]
213 - )
214 - nfs? ( >=net-fs/libnfs-1.9.3:=[static-libs(+)] )
215 - numa? ( sys-process/numactl[static-libs(+)] )
216 - opengl? (
217 - virtual/opengl
218 - media-libs/libepoxy[static-libs(+)]
219 - media-libs/mesa[static-libs(+)]
220 - media-libs/mesa[egl,gbm]
221 - )
222 - png? ( media-libs/libpng:0=[static-libs(+)] )
223 - pulseaudio? ( media-sound/pulseaudio )
224 - rbd? ( sys-cluster/ceph[static-libs(+)] )
225 - sasl? ( dev-libs/cyrus-sasl[static-libs(+)] )
226 - sdl? (
227 - !sdl2? (
228 - media-libs/libsdl[X]
229 - >=media-libs/libsdl-1.2.11[static-libs(+)]
230 - )
231 - sdl2? (
232 - media-libs/libsdl2[X]
233 - media-libs/libsdl2[static-libs(+)]
234 - )
235 - )
236 - seccomp? ( >=sys-libs/libseccomp-2.1.0[static-libs(+)] )
237 - smartcard? ( >=app-emulation/libcacard-2.5.0[static-libs(+)] )
238 - snappy? ( app-arch/snappy:= )
239 - spice? (
240 - >=app-emulation/spice-protocol-0.12.3
241 - >=app-emulation/spice-0.12.0[static-libs(+)]
242 - )
243 - ssh? ( >=net-libs/libssh2-1.2.8[static-libs(+)] )
244 - usb? ( >=virtual/libusb-1-r2[static-libs(+)] )
245 - usbredir? ( >=sys-apps/usbredir-0.6[static-libs(+)] )
246 - vde? ( net-misc/vde[static-libs(+)] )
247 - virgl? ( media-libs/virglrenderer[static-libs(+)] )
248 - virtfs? ( sys-libs/libcap )
249 - xen? ( app-emulation/xen-tools:= )
250 - xfs? ( sys-fs/xfsprogs[static-libs(+)] )"
251 -
252 -X86_FIRMWARE_DEPEND="
253 - pin-upstream-blobs? (
254 - ~sys-firmware/edk2-ovmf-2017_pre20170505[binary]
255 - ~sys-firmware/ipxe-1.0.0_p20160620
256 - ~sys-firmware/seabios-1.10.2[binary,seavgabios]
257 - ~sys-firmware/sgabios-0.1_pre8
258 - )
259 - !pin-upstream-blobs? (
260 - sys-firmware/edk2-ovmf
261 - sys-firmware/ipxe
262 - >=sys-firmware/seabios-1.10.2[seavgabios]
263 - sys-firmware/sgabios
264 - )"
265 -PPC64_FIRMWARE_DEPEND="
266 - pin-upstream-blobs? (
267 - ~sys-firmware/seabios-1.10.2[binary,seavgabios]
268 - )
269 - !pin-upstream-blobs? (
270 - >=sys-firmware/seabios-1.10.2[seavgabios]
271 - )
272 -"
273 -
274 -CDEPEND="
275 - !static? (
276 - ${ALL_DEPEND//\[static-libs(+)]}
277 - ${SOFTMMU_TOOLS_DEPEND//\[static-libs(+)]}
278 - )
279 - qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} )
280 - qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} )
281 - qemu_softmmu_targets_ppc64? ( ${PPC64_FIRMWARE_DEPEND} )
282 -"
283 -DEPEND="${CDEPEND}
284 - dev-lang/perl
285 - =dev-lang/python-2*
286 - sys-apps/texinfo
287 - virtual/pkgconfig
288 - kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 )
289 - gtk? ( nls? ( sys-devel/gettext ) )
290 - static? (
291 - ${ALL_DEPEND}
292 - ${SOFTMMU_TOOLS_DEPEND}
293 - )
294 - static-user? ( ${ALL_DEPEND} )
295 - test? (
296 - dev-libs/glib[utils]
297 - sys-devel/bc
298 - )"
299 -RDEPEND="${CDEPEND}
300 - selinux? ( sec-policy/selinux-qemu )"
301 -
302 -PATCHES=(
303 - "${FILESDIR}"/${PN}-2.5.0-cflags.patch
304 - "${FILESDIR}"/${PN}-2.5.0-sysmacros.patch
305 - "${FILESDIR}"/${PN}-2.11.0-glibc-2.27.patch
306 - "${WORKDIR}"/patches
307 -)
308 -
309 -STRIP_MASK="/usr/share/qemu/palcode-clipper"
310 -
311 -QA_PREBUILT="
312 - usr/share/qemu/openbios-ppc
313 - usr/share/qemu/openbios-sparc64
314 - usr/share/qemu/openbios-sparc32
315 - usr/share/qemu/palcode-clipper
316 - usr/share/qemu/s390-ccw.img
317 - usr/share/qemu/s390-netboot.img
318 - usr/share/qemu/u-boot.e500"
319 -
320 -QA_WX_LOAD="usr/bin/qemu-i386
321 - usr/bin/qemu-x86_64
322 - usr/bin/qemu-alpha
323 - usr/bin/qemu-arm
324 - usr/bin/qemu-cris
325 - usr/bin/qemu-m68k
326 - usr/bin/qemu-microblaze
327 - usr/bin/qemu-microblazeel
328 - usr/bin/qemu-mips
329 - usr/bin/qemu-mipsel
330 - usr/bin/qemu-or1k
331 - usr/bin/qemu-ppc
332 - usr/bin/qemu-ppc64
333 - usr/bin/qemu-ppc64abi32
334 - usr/bin/qemu-sh4
335 - usr/bin/qemu-sh4eb
336 - usr/bin/qemu-sparc
337 - usr/bin/qemu-sparc64
338 - usr/bin/qemu-armeb
339 - usr/bin/qemu-sparc32plus
340 - usr/bin/qemu-s390x
341 - usr/bin/qemu-unicore32"
342 -
343 -DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure you have the
344 -kernel module loaded before running kvm. The easiest way to ensure that the
345 -kernel module is loaded is to load it on boot.
346 - For AMD CPUs the module is called 'kvm-amd'.
347 - For Intel CPUs the module is called 'kvm-intel'.
348 -Please review /etc/conf.d/modules for how to load these.
349 -
350 -Make sure your user is in the 'kvm' group. Just run
351 - $ gpasswd -a <USER> kvm
352 -then have <USER> re-login.
353 -
354 -For brand new installs, the default permissions on /dev/kvm might not let
355 -you access it. You can tell udev to reset ownership/perms:
356 - $ udevadm trigger -c add /dev/kvm
357 -
358 -If you want to register binfmt handlers for qemu user targets:
359 -For openrc:
360 - # rc-update add qemu-binfmt
361 -For systemd:
362 - # ln -s /usr/share/qemu/binfmt.d/qemu.conf /etc/binfmt.d/qemu.conf"
363 -
364 -pkg_pretend() {
365 - if use kernel_linux && kernel_is lt 2 6 25; then
366 - eerror "This version of KVM requres a host kernel of 2.6.25 or higher."
367 - elif use kernel_linux; then
368 - if ! linux_config_exists; then
369 - eerror "Unable to check your kernel for KVM support"
370 - else
371 - CONFIG_CHECK="~KVM ~TUN ~BRIDGE"
372 - ERROR_KVM="You must enable KVM in your kernel to continue"
373 - ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in"
374 - ERROR_KVM_AMD+=" your kernel configuration."
375 - ERROR_KVM_INTEL="If you have an Intel CPU, you must enable"
376 - ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration."
377 - ERROR_TUN="You will need the Universal TUN/TAP driver compiled"
378 - ERROR_TUN+=" into your kernel or loaded as a module to use the"
379 - ERROR_TUN+=" virtual network device if using -net tap."
380 - ERROR_BRIDGE="You will also need support for 802.1d"
381 - ERROR_BRIDGE+=" Ethernet Bridging for some network configurations."
382 - use vhost-net && CONFIG_CHECK+=" ~VHOST_NET"
383 - ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net"
384 - ERROR_VHOST_NET+=" support"
385 -
386 - if use amd64 || use x86 || use amd64-linux || use x86-linux; then
387 - if grep -q AuthenticAMD /proc/cpuinfo; then
388 - CONFIG_CHECK+=" ~KVM_AMD"
389 - elif grep -q GenuineIntel /proc/cpuinfo; then
390 - CONFIG_CHECK+=" ~KVM_INTEL"
391 - fi
392 - fi
393 -
394 - use python && CONFIG_CHECK+=" ~DEBUG_FS"
395 - ERROR_DEBUG_FS="debugFS support required for kvm_stat"
396 -
397 - # Now do the actual checks setup above
398 - check_extra_config
399 - fi
400 - fi
401 -
402 - if grep -qs '/usr/bin/qemu-kvm' "${EROOT}"/etc/libvirt/qemu/*.xml; then
403 - eerror "The kvm/qemu-kvm wrappers no longer exist, but your libvirt"
404 - eerror "instances are still pointing to it. Please update your"
405 - eerror "configs in /etc/libvirt/qemu/ to use the -enable-kvm flag"
406 - eerror "and the right system binary (e.g. qemu-system-x86_64)."
407 - die "update your virt configs to not use qemu-kvm"
408 - fi
409 -}
410 -
411 -pkg_setup() {
412 - enewgroup kvm 78
413 -}
414 -
415 -# Sanity check to make sure target lists are kept up-to-date.
416 -check_targets() {
417 - local var=$1 mak=$2
418 - local detected sorted
419 -
420 - pushd "${S}"/default-configs >/dev/null || die
421 -
422 - # Force C locale until glibc is updated. #564936
423 - detected=$(echo $(printf '%s\n' *-${mak}.mak | sed "s:-${mak}.mak::" | LC_COLLATE=C sort -u))
424 - sorted=$(echo $(printf '%s\n' ${!var} | LC_COLLATE=C sort -u))
425 - if [[ ${sorted} != "${detected}" ]] ; then
426 - eerror "The ebuild needs to be kept in sync."
427 - eerror "${var}: ${sorted}"
428 - eerror "$(printf '%-*s' ${#var} configure): ${detected}"
429 - die "sync ${var} to the list of targets"
430 - fi
431 -
432 - popd >/dev/null
433 -}
434 -
435 -handle_locales() {
436 - # Make sure locale list is kept up-to-date.
437 - local detected sorted
438 - detected=$(echo $(cd po && printf '%s\n' *.po | grep -v messages.po | sed 's:.po$::' | sort -u))
439 - sorted=$(echo $(printf '%s\n' ${PLOCALES} | sort -u))
440 - if [[ ${sorted} != "${detected}" ]] ; then
441 - eerror "The ebuild needs to be kept in sync."
442 - eerror "PLOCALES: ${sorted}"
443 - eerror " po/*.po: ${detected}"
444 - die "sync PLOCALES"
445 - fi
446 -
447 - # Deal with selective install of locales.
448 - if use nls ; then
449 - # Delete locales the user does not want. #577814
450 - rm_loc() { rm po/$1.po || die; }
451 - l10n_for_each_disabled_locale_do rm_loc
452 - else
453 - # Cheap hack to disable gettext .mo generation.
454 - rm -f po/*.po
455 - fi
456 -}
457 -
458 -src_prepare() {
459 - check_targets IUSE_SOFTMMU_TARGETS softmmu
460 - check_targets IUSE_USER_TARGETS linux-user
461 -
462 - # Alter target makefiles to accept CFLAGS set via flag-o
463 - sed -i -r \
464 - -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \
465 - Makefile Makefile.target || die
466 -
467 - default
468 -
469 - # Fix ld and objcopy being called directly
470 - tc-export AR LD OBJCOPY
471 -
472 - # Verbose builds
473 - MAKEOPTS+=" V=1"
474 -
475 - # Run after we've applied all patches.
476 - handle_locales
477 -
478 - # Remove bundled copy of libfdt
479 - rm -r dtc || die
480 -}
481 -
482 -##
483 -# configures qemu based on the build directory and the build type
484 -# we are using.
485 -#
486 -qemu_src_configure() {
487 - debug-print-function ${FUNCNAME} "$@"
488 -
489 - local buildtype=$1
490 - local builddir="${S}/${buildtype}-build"
491 -
492 - mkdir "${builddir}"
493 -
494 - local conf_opts=(
495 - --prefix=/usr
496 - --sysconfdir=/etc
497 - --libdir=/usr/$(get_libdir)
498 - --docdir=/usr/share/doc/${PF}/html
499 - --disable-bsd-user
500 - --disable-guest-agent
501 - --disable-strip
502 - --disable-werror
503 - # We support gnutls/nettle for crypto operations. It is possible
504 - # to use gcrypt when gnutls/nettle are disabled (but not when they
505 - # are enabled), but it's not really worth the hassle. Disable it
506 - # all the time to avoid automatically detecting it. #568856
507 - --disable-gcrypt
508 - --python="${PYTHON}"
509 - --cc="$(tc-getCC)"
510 - --cxx="$(tc-getCXX)"
511 - --host-cc="$(tc-getBUILD_CC)"
512 - $(use_enable debug debug-info)
513 - $(use_enable debug debug-tcg)
514 - --enable-docs
515 - $(use_enable tci tcg-interpreter)
516 - $(use_enable xattr attr)
517 - )
518 -
519 - # Disable options not used by user targets. This simplifies building
520 - # static user targets (USE=static-user) considerably.
521 - conf_notuser() {
522 - if [[ ${buildtype} == "user" ]] ; then
523 - echo "--disable-${2:-$1}"
524 - else
525 - use_enable "$@"
526 - fi
527 - }
528 - conf_opts+=(
529 - $(conf_notuser accessibility brlapi)
530 - $(conf_notuser aio linux-aio)
531 - $(conf_notuser bzip2)
532 - $(conf_notuser bluetooth bluez)
533 - $(conf_notuser caps cap-ng)
534 - $(conf_notuser curl)
535 - $(conf_notuser fdt)
536 - $(conf_notuser glusterfs)
537 - $(conf_notuser gnutls)
538 - $(conf_notuser gnutls nettle)
539 - $(conf_notuser gtk)
540 - $(conf_notuser infiniband rdma)
541 - $(conf_notuser iscsi libiscsi)
542 - $(conf_notuser jpeg vnc-jpeg)
543 - $(conf_notuser kernel_linux kvm)
544 - $(conf_notuser lzo)
545 - $(conf_notuser ncurses curses)
546 - $(conf_notuser nfs libnfs)
547 - $(conf_notuser numa)
548 - $(conf_notuser opengl)
549 - $(conf_notuser png vnc-png)
550 - $(conf_notuser rbd)
551 - $(conf_notuser sasl vnc-sasl)
552 - $(conf_notuser sdl)
553 - $(conf_notuser seccomp)
554 - $(conf_notuser smartcard)
555 - $(conf_notuser snappy)
556 - $(conf_notuser spice)
557 - $(conf_notuser ssh libssh2)
558 - $(conf_notuser usb libusb)
559 - $(conf_notuser usbredir usb-redir)
560 - $(conf_notuser vde)
561 - $(conf_notuser vhost-net)
562 - $(conf_notuser virgl virglrenderer)
563 - $(conf_notuser virtfs)
564 - $(conf_notuser vnc)
565 - $(conf_notuser vte)
566 - $(conf_notuser xen)
567 - $(conf_notuser xen xen-pci-passthrough)
568 - $(conf_notuser xfs xfsctl)
569 - )
570 -
571 - if [[ ! ${buildtype} == "user" ]] ; then
572 - # audio options
573 - local audio_opts="oss"
574 - use alsa && audio_opts="alsa,${audio_opts}"
575 - use sdl && audio_opts="sdl,${audio_opts}"
576 - use pulseaudio && audio_opts="pa,${audio_opts}"
577 - conf_opts+=(
578 - --audio-drv-list="${audio_opts}"
579 - )
580 - use gtk && conf_opts+=( --with-gtkabi=$(usex gtk2 2.0 3.0) )
581 - use sdl && conf_opts+=( --with-sdlabi=$(usex sdl2 2.0 1.2) )
582 - fi
583 -
584 - case ${buildtype} in
585 - user)
586 - conf_opts+=(
587 - --enable-linux-user
588 - --disable-system
589 - --disable-blobs
590 - --disable-tools
591 - )
592 - local static_flag="static-user"
593 - ;;
594 - softmmu)
595 - conf_opts+=(
596 - --disable-linux-user
597 - --enable-system
598 - --disable-tools
599 - )
600 - local static_flag="static"
601 - ;;
602 - tools)
603 - conf_opts+=(
604 - --disable-linux-user
605 - --disable-system
606 - --disable-blobs
607 - --enable-tools
608 - )
609 - local static_flag="static"
610 - ;;
611 - esac
612 -
613 - local targets="${buildtype}_targets"
614 - [[ -n ${targets} ]] && conf_opts+=( --target-list="${!targets}" )
615 -
616 - # Add support for SystemTAP
617 - use systemtap && conf_opts+=( --enable-trace-backend=dtrace )
618 -
619 - # We always want to attempt to build with PIE support as it results
620 - # in a more secure binary. But it doesn't work with static or if
621 - # the current GCC doesn't have PIE support.
622 - if use ${static_flag}; then
623 - conf_opts+=( --static --disable-pie )
624 - else
625 - tc-enables-pie && conf_opts+=( --enable-pie )
626 - fi
627 -
628 - #bug #647570
629 - conf_opts+=( --disable-capstone )
630 -
631 - echo "../configure ${conf_opts[*]}"
632 - cd "${builddir}"
633 - ../configure "${conf_opts[@]}" || die "configure failed"
634 -
635 - # FreeBSD's kernel does not support QEMU assigning/grabbing
636 - # host USB devices yet
637 - use kernel_FreeBSD && \
638 - sed -i -E -e "s|^(HOST_USB=)bsd|\1stub|" "${S}"/config-host.mak
639 -}
640 -
641 -src_configure() {
642 - local target
643 -
644 - python_setup
645 -
646 - softmmu_targets= softmmu_bins=()
647 - user_targets= user_bins=()
648 -
649 - for target in ${IUSE_SOFTMMU_TARGETS} ; do
650 - if use "qemu_softmmu_targets_${target}"; then
651 - softmmu_targets+=",${target}-softmmu"
652 - softmmu_bins+=( "qemu-system-${target}" )
653 - fi
654 - done
655 -
656 - for target in ${IUSE_USER_TARGETS} ; do
657 - if use "qemu_user_targets_${target}"; then
658 - user_targets+=",${target}-linux-user"
659 - user_bins+=( "qemu-${target}" )
660 - fi
661 - done
662 -
663 - softmmu_targets=${softmmu_targets#,}
664 - user_targets=${user_targets#,}
665 -
666 - [[ -n ${softmmu_targets} ]] && qemu_src_configure "softmmu"
667 - [[ -n ${user_targets} ]] && qemu_src_configure "user"
668 - qemu_src_configure "tools"
669 -}
670 -
671 -src_compile() {
672 - if [[ -n ${user_targets} ]]; then
673 - cd "${S}/user-build"
674 - default
675 - fi
676 -
677 - if [[ -n ${softmmu_targets} ]]; then
678 - cd "${S}/softmmu-build"
679 - default
680 - fi
681 -
682 - cd "${S}/tools-build"
683 - default
684 -}
685 -
686 -src_test() {
687 - if [[ -n ${softmmu_targets} ]]; then
688 - cd "${S}/softmmu-build"
689 - pax-mark m */qemu-system-* #515550
690 - emake -j1 check
691 - emake -j1 check-report.html
692 - fi
693 -}
694 -
695 -qemu_python_install() {
696 - python_domodule "${S}/scripts/qmp/qmp.py"
697 -
698 - python_doscript "${S}/scripts/kvm/vmxcap"
699 - python_doscript "${S}/scripts/qmp/qmp-shell"
700 - python_doscript "${S}/scripts/qmp/qemu-ga-client"
701 -}
702 -
703 -# Generate binfmt support files.
704 -# - /etc/init.d/qemu-binfmt script which registers the user handlers (openrc)
705 -# - /usr/share/qemu/binfmt.d/qemu.conf (for use with systemd-binfmt)
706 -generate_initd() {
707 - local out="${T}/qemu-binfmt"
708 - local out_systemd="${T}/qemu.conf"
709 - local d="${T}/binfmt.d"
710 -
711 - einfo "Generating qemu binfmt scripts and configuration files"
712 -
713 - # Generate the debian fragments first.
714 - mkdir -p "${d}"
715 - "${S}"/scripts/qemu-binfmt-conf.sh \
716 - --debian \
717 - --exportdir "${d}" \
718 - --qemu-path "${EPREFIX}/usr/bin" \
719 - || die
720 - # Then turn the fragments into a shell script we can source.
721 - sed -E -i \
722 - -e 's:^([^ ]+) (.*)$:\1="\2":' \
723 - "${d}"/* || die
724 -
725 - # Generate the init.d script by assembling the fragments from above.
726 - local f qcpu package interpreter magic mask
727 - cat "${FILESDIR}"/qemu-binfmt.initd.head >"${out}" || die
728 - for f in "${d}"/qemu-* ; do
729 - source "${f}"
730 -
731 - # Normalize the cpu logic like we do in the init.d for the native cpu.
732 - qcpu=${package#qemu-}
733 - case ${qcpu} in
734 - arm*) qcpu="arm";;
735 - mips*) qcpu="mips";;
736 - ppc*) qcpu="ppc";;
737 - s390*) qcpu="s390";;
738 - sh*) qcpu="sh";;
739 - sparc*) qcpu="sparc";;
740 - esac
741 -
742 - cat <<EOF >>"${out}"
743 - if [ "\${cpu}" != "${qcpu}" -a -x "${interpreter}" ] ; then
744 - echo ':${package}:M::${magic}:${mask}:${interpreter}:'"\${QEMU_BINFMT_FLAGS}" >/proc/sys/fs/binfmt_misc/register
745 - fi
746 -EOF
747 -
748 - echo ":${package}:M::${magic}:${mask}:${interpreter}:OC" >>"${out_systemd}"
749 -
750 - done
751 - cat "${FILESDIR}"/qemu-binfmt.initd.tail >>"${out}" || die
752 -}
753 -
754 -src_install() {
755 - if [[ -n ${user_targets} ]]; then
756 - cd "${S}/user-build"
757 - emake DESTDIR="${ED}" install
758 -
759 - # Install binfmt handler init script for user targets.
760 - generate_initd
761 - doinitd "${T}/qemu-binfmt"
762 -
763 - # Install binfmt/qemu.conf.
764 - insinto "/usr/share/qemu/binfmt.d"
765 - doins "${T}/qemu.conf"
766 - fi
767 -
768 - if [[ -n ${softmmu_targets} ]]; then
769 - cd "${S}/softmmu-build"
770 - emake DESTDIR="${ED}" install
771 -
772 - # This might not exist if the test failed. #512010
773 - [[ -e check-report.html ]] && dohtml check-report.html
774 -
775 - if use kernel_linux; then
776 - udev_newrules "${FILESDIR}"/65-kvm.rules-r1 65-kvm.rules
777 - fi
778 -
779 - if use python; then
780 - python_foreach_impl qemu_python_install
781 - fi
782 - fi
783 -
784 - cd "${S}/tools-build"
785 - emake DESTDIR="${ED}" install
786 -
787 - # Disable mprotect on the qemu binaries as they use JITs to be fast #459348
788 - pushd "${ED}"/usr/bin >/dev/null
789 - pax-mark mr "${softmmu_bins[@]}" "${user_bins[@]}" # bug 575594
790 - popd >/dev/null
791 -
792 - # Install config file example for qemu-bridge-helper
793 - insinto "/etc/qemu"
794 - doins "${FILESDIR}/bridge.conf"
795 -
796 - cd "${S}"
797 - dodoc Changelog MAINTAINERS docs/specs/pci-ids.txt
798 - newdoc pc-bios/README README.pc-bios
799 -
800 - if [[ -n ${softmmu_targets} ]]; then
801 - # Remove SeaBIOS since we're using the SeaBIOS packaged one
802 - rm "${ED}/usr/share/qemu/bios.bin"
803 - rm "${ED}/usr/share/qemu/bios-256k.bin"
804 - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
805 - dosym ../seabios/bios.bin /usr/share/qemu/bios.bin
806 - dosym ../seabios/bios-256k.bin /usr/share/qemu/bios-256k.bin
807 - fi
808 -
809 - # Remove vgabios since we're using the seavgabios packaged one
810 - rm "${ED}/usr/share/qemu/vgabios.bin"
811 - rm "${ED}/usr/share/qemu/vgabios-cirrus.bin"
812 - rm "${ED}/usr/share/qemu/vgabios-qxl.bin"
813 - rm "${ED}/usr/share/qemu/vgabios-stdvga.bin"
814 - rm "${ED}/usr/share/qemu/vgabios-virtio.bin"
815 - rm "${ED}/usr/share/qemu/vgabios-vmware.bin"
816 - # PPC64 loads vgabios-stdvga
817 - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386 || use qemu_softmmu_targets_ppc64; then
818 - dosym ../seavgabios/vgabios-isavga.bin /usr/share/qemu/vgabios.bin
819 - dosym ../seavgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin
820 - dosym ../seavgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin
821 - dosym ../seavgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin
822 - dosym ../seavgabios/vgabios-virtio.bin /usr/share/qemu/vgabios-virtio.bin
823 - dosym ../seavgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin
824 - fi
825 -
826 - # Remove sgabios since we're using the sgabios packaged one
827 - rm "${ED}/usr/share/qemu/sgabios.bin"
828 - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
829 - dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin
830 - fi
831 -
832 - # Remove iPXE since we're using the iPXE packaged one
833 - rm "${ED}"/usr/share/qemu/pxe-*.rom
834 - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
835 - dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom
836 - dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom
837 - dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom
838 - dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom
839 - dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom
840 - dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom
841 - fi
842 - fi
843 -
844 - DISABLE_AUTOFORMATTING=true
845 - readme.gentoo_create_doc
846 -}
847 -
848 -firmware_abi_change() {
849 - local pv
850 - for pv in ${REPLACING_VERSIONS}; do
851 - if ! version_is_at_least ${FIRMWARE_ABI_VERSION} ${pv}; then
852 - return 0
853 - fi
854 - done
855 - return 1
856 -}
857 -
858 -pkg_postinst() {
859 - if [[ -n ${softmmu_targets} ]] && use kernel_linux; then
860 - udev_reload
861 - fi
862 -
863 - fcaps cap_net_admin /usr/libexec/qemu-bridge-helper
864 -
865 - DISABLE_AUTOFORMATTING=true
866 - readme.gentoo_print_elog
867 -
868 - if use pin-upstream-blobs && firmware_abi_change; then
869 - ewarn "This version of qemu pins new versions of firmware blobs:"
870 - ewarn " $(best_version sys-firmware/edk2-ovmf)"
871 - ewarn " $(best_version sys-firmware/ipxe)"
872 - ewarn " $(best_version sys-firmware/seabios)"
873 - ewarn " $(best_version sys-firmware/sgabios)"
874 - ewarn "This might break resume of hibernated guests (started with a different"
875 - ewarn "firmware version) and live migration to/from qemu versions with different"
876 - ewarn "firmware. Please (cold) restart all running guests. For functional"
877 - ewarn "guest migration ensure that all"
878 - ewarn "hosts run at least"
879 - ewarn " app-emulation/qemu-${FIRMWARE_ABI_VERSION}."
880 - fi
881 -}
882 -
883 -pkg_info() {
884 - echo "Using:"
885 - echo " $(best_version app-emulation/spice-protocol)"
886 - echo " $(best_version sys-firmware/edk2-ovmf)"
887 - if has_version 'sys-firmware/edk2-ovmf[binary]'; then
888 - echo " USE=binary"
889 - else
890 - echo " USE=''"
891 - fi
892 - echo " $(best_version sys-firmware/ipxe)"
893 - echo " $(best_version sys-firmware/seabios)"
894 - if has_version 'sys-firmware/seabios[binary]'; then
895 - echo " USE=binary"
896 - else
897 - echo " USE=''"
898 - fi
899 - echo " $(best_version sys-firmware/sgabios)"
900 -}