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/
Date: Sun, 02 Apr 2017 02:26:28
Message-Id: 1491099937.8e6a5f44a3119c14be5245fec2e4ee2528c573bc.tamiko@gentoo
1 commit: 8e6a5f44a3119c14be5245fec2e4ee2528c573bc
2 Author: Matthias Maier <tamiko <AT> gentoo <DOT> org>
3 AuthorDate: Sun Apr 2 02:25:20 2017 +0000
4 Commit: Matthias Maier <tamiko <AT> gentoo <DOT> org>
5 CommitDate: Sun Apr 2 02:25:37 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e6a5f44
7
8 app-emulation/qemu: drop vulnerable, bug #606088
9
10 Package-Manager: Portage-2.3.3, Repoman-2.3.2
11
12 app-emulation/qemu/metadata.xml | 1 -
13 app-emulation/qemu/qemu-2.8.0-r3.ebuild | 699 --------------------------------
14 2 files changed, 700 deletions(-)
15
16 diff --git a/app-emulation/qemu/metadata.xml b/app-emulation/qemu/metadata.xml
17 index 9a8a1a335b7..3fe0408cc40 100644
18 --- a/app-emulation/qemu/metadata.xml
19 +++ b/app-emulation/qemu/metadata.xml
20 @@ -32,7 +32,6 @@
21 <flag name="sdl2">Use libsdl2 instead of libsdl</flag>
22 <flag name="spice">Enable Spice protocol support via <pkg>app-emulation/spice</pkg></flag>
23 <flag name="ssh">Enable SSH based block device support via <pkg>net-libs/libssh2</pkg></flag>
24 - <flag name="static-softmmu">Build the Software MMU (system) targets as static binaries</flag>
25 <flag name="static-user">Build the User targets as static binaries</flag>
26 <flag name="static">Build the User and Software MMU (system) targets as well as tools as static binaries</flag>
27 <flag name="snappy">Enable support for snappy compression</flag>
28
29 diff --git a/app-emulation/qemu/qemu-2.8.0-r3.ebuild b/app-emulation/qemu/qemu-2.8.0-r3.ebuild
30 deleted file mode 100644
31 index c1aa5245a6d..00000000000
32 --- a/app-emulation/qemu/qemu-2.8.0-r3.ebuild
33 +++ /dev/null
34 @@ -1,699 +0,0 @@
35 -# Copyright 1999-2017 Gentoo Foundation
36 -# Distributed under the terms of the GNU General Public License v2
37 -
38 -EAPI="5"
39 -
40 -PYTHON_COMPAT=( python2_7 )
41 -PYTHON_REQ_USE="ncurses,readline"
42 -
43 -PLOCALES="bg de_DE fr_FR hu it tr zh_CN"
44 -
45 -inherit eutils flag-o-matic linux-info toolchain-funcs multilib python-r1 \
46 - user udev fcaps readme.gentoo-r1 pax-utils l10n
47 -
48 -if [[ ${PV} = *9999* ]]; then
49 - EGIT_REPO_URI="git://git.qemu.org/qemu.git"
50 - inherit git-2
51 - SRC_URI=""
52 -else
53 - SRC_URI="http://wiki.qemu-project.org/download/${P}.tar.bz2"
54 - KEYWORDS="amd64 ~arm64 ~ppc ~ppc64 x86 ~x86-fbsd"
55 -fi
56 -
57 -DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools"
58 -HOMEPAGE="http://www.qemu.org http://www.linux-kvm.org"
59 -
60 -LICENSE="GPL-2 LGPL-2 BSD-2"
61 -SLOT="0"
62 -IUSE="accessibility +aio alsa bluetooth bzip2 +caps +curl debug +fdt glusterfs \
63 -gnutls gtk gtk2 infiniband iscsi +jpeg \
64 -kernel_linux kernel_FreeBSD lzo ncurses nfs nls numa opengl +pin-upstream-blobs
65 -+png pulseaudio python \
66 -rbd sasl +seccomp sdl sdl2 selinux smartcard snappy spice ssh static static-softmmu
67 -static-user systemtap tci test +threads usb usbredir vde +vhost-net \
68 -virgl virtfs +vnc vte xattr xen xfs"
69 -
70 -COMMON_TARGETS="aarch64 alpha arm cris i386 m68k microblaze microblazeel mips
71 -mips64 mips64el mipsel or32 ppc ppc64 s390x sh4 sh4eb sparc sparc64
72 -x86_64"
73 -IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} lm32 moxie ppcemb tricore unicore32 xtensa xtensaeb"
74 -IUSE_USER_TARGETS="${COMMON_TARGETS} armeb mipsn32 mipsn32el ppc64abi32 ppc64le sparc32plus tilegx"
75 -
76 -use_softmmu_targets=$(printf ' qemu_softmmu_targets_%s' ${IUSE_SOFTMMU_TARGETS})
77 -use_user_targets=$(printf ' qemu_user_targets_%s' ${IUSE_USER_TARGETS})
78 -IUSE+=" ${use_softmmu_targets} ${use_user_targets}"
79 -
80 -# Allow no targets to be built so that people can get a tools-only build.
81 -# Block USE flag configurations known to not work.
82 -REQUIRED_USE="${PYTHON_REQUIRED_USE}
83 - gtk2? ( gtk )
84 - qemu_softmmu_targets_arm? ( fdt )
85 - qemu_softmmu_targets_microblaze? ( fdt )
86 - qemu_softmmu_targets_ppc? ( fdt )
87 - qemu_softmmu_targets_ppc64? ( fdt )
88 - sdl2? ( sdl )
89 - static? ( static-softmmu static-user )
90 - static-softmmu? ( !alsa !pulseaudio !bluetooth !opengl !gtk !gtk2 )
91 - virtfs? ( xattr )
92 - vte? ( gtk )"
93 -
94 -# Yep, you need both libcap and libcap-ng since virtfs only uses libcap.
95 -#
96 -# The attr lib isn't always linked in (although the USE flag is always
97 -# respected). This is because qemu supports using the C library's API
98 -# when available rather than always using the extranl library.
99 -#
100 -# Older versions of gnutls are supported, but it's simpler to just require
101 -# the latest versions. This is also why we require nettle.
102 -#
103 -# TODO: Split out tools deps into another var. e.g. bzip2 is only used by
104 -# system binaries and tools, not user binaries.
105 -COMMON_LIB_DEPEND=">=dev-libs/glib-2.0[static-libs(+)]
106 - sys-libs/zlib[static-libs(+)]
107 - bzip2? ( app-arch/bzip2[static-libs(+)] )
108 - xattr? ( sys-apps/attr[static-libs(+)] )"
109 -SOFTMMU_LIB_DEPEND="${COMMON_LIB_DEPEND}
110 - >=x11-libs/pixman-0.28.0[static-libs(+)]
111 - accessibility? ( app-accessibility/brltty[static-libs(+)] )
112 - aio? ( dev-libs/libaio[static-libs(+)] )
113 - alsa? ( >=media-libs/alsa-lib-1.0.13 )
114 - bluetooth? ( net-wireless/bluez )
115 - caps? ( sys-libs/libcap-ng[static-libs(+)] )
116 - curl? ( >=net-misc/curl-7.15.4[static-libs(+)] )
117 - fdt? ( >=sys-apps/dtc-1.4.0[static-libs(+)] )
118 - glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] )
119 - gnutls? (
120 - dev-libs/nettle:=[static-libs(+)]
121 - >=net-libs/gnutls-3.0:=[static-libs(+)]
122 - )
123 - gtk? (
124 - gtk2? (
125 - x11-libs/gtk+:2
126 - vte? ( x11-libs/vte:0 )
127 - )
128 - !gtk2? (
129 - x11-libs/gtk+:3
130 - vte? ( x11-libs/vte:2.91 )
131 - )
132 - )
133 - infiniband? ( sys-fabric/librdmacm:=[static-libs(+)] )
134 - iscsi? ( net-libs/libiscsi )
135 - jpeg? ( virtual/jpeg:0=[static-libs(+)] )
136 - lzo? ( dev-libs/lzo:2[static-libs(+)] )
137 - ncurses? (
138 - sys-libs/ncurses:0=[unicode]
139 - sys-libs/ncurses:0=[static-libs(+)]
140 - )
141 - nfs? ( >=net-fs/libnfs-1.9.3[static-libs(+)] )
142 - numa? ( sys-process/numactl[static-libs(+)] )
143 - opengl? (
144 - virtual/opengl
145 - media-libs/libepoxy[static-libs(+)]
146 - media-libs/mesa[static-libs(+)]
147 - media-libs/mesa[egl,gbm]
148 - )
149 - png? ( media-libs/libpng:0=[static-libs(+)] )
150 - pulseaudio? ( media-sound/pulseaudio )
151 - rbd? ( sys-cluster/ceph[static-libs(+)] )
152 - sasl? ( dev-libs/cyrus-sasl[static-libs(+)] )
153 - sdl? (
154 - !sdl2? (
155 - media-libs/libsdl[X]
156 - >=media-libs/libsdl-1.2.11[static-libs(+)]
157 - )
158 - sdl2? (
159 - media-libs/libsdl2[X]
160 - media-libs/libsdl2[static-libs(+)]
161 - )
162 - )
163 - seccomp? ( >=sys-libs/libseccomp-2.1.0[static-libs(+)] )
164 - smartcard? ( >=app-emulation/libcacard-2.5.0[static-libs(+)] )
165 - snappy? ( app-arch/snappy[static-libs(+)] )
166 - spice? (
167 - >=app-emulation/spice-protocol-0.12.3
168 - >=app-emulation/spice-0.12.0[static-libs(+)]
169 - )
170 - ssh? ( >=net-libs/libssh2-1.2.8[static-libs(+)] )
171 - usb? ( >=virtual/libusb-1-r2[static-libs(+)] )
172 - usbredir? ( >=sys-apps/usbredir-0.6[static-libs(+)] )
173 - vde? ( net-misc/vde[static-libs(+)] )
174 - virgl? ( media-libs/virglrenderer[static-libs(+)] )
175 - virtfs? ( sys-libs/libcap )
176 - xfs? ( sys-fs/xfsprogs[static-libs(+)] )"
177 -USER_LIB_DEPEND="${COMMON_LIB_DEPEND}"
178 -X86_FIRMWARE_DEPEND="
179 - >=sys-firmware/ipxe-1.0.0_p20130624
180 - pin-upstream-blobs? (
181 - ~sys-firmware/seabios-1.10.1
182 - ~sys-firmware/sgabios-0.1_pre8
183 - ~sys-firmware/vgabios-0.7a
184 - )
185 - !pin-upstream-blobs? (
186 - sys-firmware/seabios
187 - sys-firmware/sgabios
188 - sys-firmware/vgabios
189 - )"
190 -CDEPEND="
191 - !static-softmmu? ( $(printf "%s? ( ${SOFTMMU_LIB_DEPEND//\[static-libs(+)]} ) " ${use_softmmu_targets}) )
192 - !static-user? ( $(printf "%s? ( ${USER_LIB_DEPEND//\[static-libs(+)]} ) " ${use_user_targets}) )
193 - qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} )
194 - qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} )
195 - python? ( ${PYTHON_DEPS} )
196 - systemtap? ( dev-util/systemtap )
197 - xen? ( app-emulation/xen-tools:= )"
198 -DEPEND="${CDEPEND}
199 - dev-lang/perl
200 - =dev-lang/python-2*
201 - sys-apps/texinfo
202 - virtual/pkgconfig
203 - kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 )
204 - gtk? ( nls? ( sys-devel/gettext ) )
205 - static-softmmu? ( $(printf "%s? ( ${SOFTMMU_LIB_DEPEND} ) " ${use_softmmu_targets}) )
206 - static-user? ( $(printf "%s? ( ${USER_LIB_DEPEND} ) " ${use_user_targets}) )
207 - test? (
208 - dev-libs/glib[utils]
209 - sys-devel/bc
210 - )"
211 -RDEPEND="${CDEPEND}
212 - selinux? ( sec-policy/selinux-qemu )
213 -"
214 -
215 -STRIP_MASK="/usr/share/qemu/palcode-clipper"
216 -
217 -QA_PREBUILT="
218 - usr/share/qemu/openbios-ppc
219 - usr/share/qemu/openbios-sparc64
220 - usr/share/qemu/openbios-sparc32
221 - usr/share/qemu/palcode-clipper
222 - usr/share/qemu/s390-ccw.img
223 - usr/share/qemu/u-boot.e500
224 -"
225 -
226 -QA_WX_LOAD="usr/bin/qemu-i386
227 - usr/bin/qemu-x86_64
228 - usr/bin/qemu-alpha
229 - usr/bin/qemu-arm
230 - usr/bin/qemu-cris
231 - usr/bin/qemu-m68k
232 - usr/bin/qemu-microblaze
233 - usr/bin/qemu-microblazeel
234 - usr/bin/qemu-mips
235 - usr/bin/qemu-mipsel
236 - usr/bin/qemu-or32
237 - usr/bin/qemu-ppc
238 - usr/bin/qemu-ppc64
239 - usr/bin/qemu-ppc64abi32
240 - usr/bin/qemu-sh4
241 - usr/bin/qemu-sh4eb
242 - usr/bin/qemu-sparc
243 - usr/bin/qemu-sparc64
244 - usr/bin/qemu-armeb
245 - usr/bin/qemu-sparc32plus
246 - usr/bin/qemu-s390x
247 - usr/bin/qemu-unicore32"
248 -
249 -DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure
250 -you have the kernel module loaded before running kvm. The easiest way to
251 -ensure that the kernel module is loaded is to load it on boot.\n
252 -For AMD CPUs the module is called 'kvm-amd'.\n
253 -For Intel CPUs the module is called 'kvm-intel'.\n
254 -Please review /etc/conf.d/modules for how to load these.\n\n
255 -Make sure your user is in the 'kvm' group\n
256 -Just run 'gpasswd -a <USER> kvm', then have <USER> re-login.\n\n
257 -For brand new installs, the default permissions on /dev/kvm might not let you
258 -access it. You can tell udev to reset ownership/perms:\n
259 -udevadm trigger -c add /dev/kvm"
260 -
261 -qemu_support_kvm() {
262 - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386 \
263 - use qemu_softmmu_targets_ppc || use qemu_softmmu_targets_ppc64 \
264 - use qemu_softmmu_targets_s390x; then
265 - return 0
266 - fi
267 -
268 - return 1
269 -}
270 -
271 -pkg_pretend() {
272 - if use kernel_linux && kernel_is lt 2 6 25; then
273 - eerror "This version of KVM requres a host kernel of 2.6.25 or higher."
274 - elif use kernel_linux; then
275 - if ! linux_config_exists; then
276 - eerror "Unable to check your kernel for KVM support"
277 - else
278 - CONFIG_CHECK="~KVM ~TUN ~BRIDGE"
279 - ERROR_KVM="You must enable KVM in your kernel to continue"
280 - ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in"
281 - ERROR_KVM_AMD+=" your kernel configuration."
282 - ERROR_KVM_INTEL="If you have an Intel CPU, you must enable"
283 - ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration."
284 - ERROR_TUN="You will need the Universal TUN/TAP driver compiled"
285 - ERROR_TUN+=" into your kernel or loaded as a module to use the"
286 - ERROR_TUN+=" virtual network device if using -net tap."
287 - ERROR_BRIDGE="You will also need support for 802.1d"
288 - ERROR_BRIDGE+=" Ethernet Bridging for some network configurations."
289 - use vhost-net && CONFIG_CHECK+=" ~VHOST_NET"
290 - ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net"
291 - ERROR_VHOST_NET+=" support"
292 -
293 - if use amd64 || use x86 || use amd64-linux || use x86-linux; then
294 - CONFIG_CHECK+=" ~KVM_AMD ~KVM_INTEL"
295 - fi
296 -
297 - use python && CONFIG_CHECK+=" ~DEBUG_FS"
298 - ERROR_DEBUG_FS="debugFS support required for kvm_stat"
299 -
300 - # Now do the actual checks setup above
301 - check_extra_config
302 - fi
303 - fi
304 -
305 - if grep -qs '/usr/bin/qemu-kvm' "${EROOT}"/etc/libvirt/qemu/*.xml; then
306 - eerror "The kvm/qemu-kvm wrappers no longer exist, but your libvirt"
307 - eerror "instances are still pointing to it. Please update your"
308 - eerror "configs in /etc/libvirt/qemu/ to use the -enable-kvm flag"
309 - eerror "and the right system binary (e.g. qemu-system-x86_64)."
310 - die "update your virt configs to not use qemu-kvm"
311 - fi
312 -}
313 -
314 -pkg_setup() {
315 - enewgroup kvm 78
316 -}
317 -
318 -# Sanity check to make sure target lists are kept up-to-date.
319 -check_targets() {
320 - local var=$1 mak=$2
321 - local detected sorted
322 -
323 - pushd "${S}"/default-configs >/dev/null || die
324 -
325 - # Force C locale until glibc is updated. #564936
326 - detected=$(echo $(printf '%s\n' *-${mak}.mak | sed "s:-${mak}.mak::" | LC_COLLATE=C sort -u))
327 - sorted=$(echo $(printf '%s\n' ${!var} | LC_COLLATE=C sort -u))
328 - if [[ ${sorted} != "${detected}" ]] ; then
329 - eerror "The ebuild needs to be kept in sync."
330 - eerror "${var}: ${sorted}"
331 - eerror "$(printf '%-*s' ${#var} configure): ${detected}"
332 - die "sync ${var} to the list of targets"
333 - fi
334 -
335 - popd >/dev/null
336 -}
337 -
338 -handle_locales() {
339 - # Make sure locale list is kept up-to-date.
340 - local detected sorted
341 - detected=$(echo $(cd po && printf '%s\n' *.po | grep -v messages.po | sed 's:.po$::' | sort -u))
342 - sorted=$(echo $(printf '%s\n' ${PLOCALES} | sort -u))
343 - if [[ ${sorted} != "${detected}" ]] ; then
344 - eerror "The ebuild needs to be kept in sync."
345 - eerror "PLOCALES: ${sorted}"
346 - eerror " po/*.po: ${detected}"
347 - die "sync PLOCALES"
348 - fi
349 -
350 - # Deal with selective install of locales.
351 - if use nls ; then
352 - # Delete locales the user does not want. #577814
353 - rm_loc() { rm po/$1.po || die; }
354 - l10n_for_each_disabled_locale_do rm_loc
355 - else
356 - # Cheap hack to disable gettext .mo generation.
357 - rm -f po/*.po
358 - fi
359 -}
360 -
361 -src_prepare() {
362 - check_targets IUSE_SOFTMMU_TARGETS softmmu
363 - check_targets IUSE_USER_TARGETS linux-user
364 -
365 - # Alter target makefiles to accept CFLAGS set via flag-o
366 - sed -i -r \
367 - -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \
368 - Makefile Makefile.target || die
369 -
370 - epatch "${FILESDIR}"/${PN}-2.5.0-cflags.patch
371 - epatch "${FILESDIR}"/${PN}-2.5.0-sysmacros.patch
372 - epatch "${FILESDIR}"/${PN}-2.7.0-CVE-2016-8669-1.patch #597108
373 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2016-9908.patch #601826
374 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2016-9912.patch #602630
375 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2016-10028.patch #603444
376 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2016-10155.patch #606720
377 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-2615.patch #608034
378 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-2630.patch #609396
379 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5525-1.patch #606264
380 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5525-2.patch
381 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5552.patch #606722
382 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5578.patch #607000
383 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5579.patch #607100
384 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5667.patch #607766
385 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5856.patch #608036
386 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5857.patch #608038
387 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5898.patch #608520
388 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5931.patch #608728
389 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5973.patch #609334
390 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-5987.patch #609398
391 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-6058.patch #609638
392 - epatch "${FILESDIR}"/${PN}-2.8.0-CVE-2017-2620.patch #609206
393 -
394 - # Fix ld and objcopy being called directly
395 - tc-export AR LD OBJCOPY
396 -
397 - # Verbose builds
398 - MAKEOPTS+=" V=1"
399 -
400 - epatch_user
401 -
402 - # Run after we've applied all patches.
403 - handle_locales
404 -}
405 -
406 -##
407 -# configures qemu based on the build directory and the build type
408 -# we are using.
409 -#
410 -qemu_src_configure() {
411 - debug-print-function ${FUNCNAME} "$@"
412 -
413 - local buildtype=$1
414 - local builddir="${S}/${buildtype}-build"
415 - local static_flag="static-${buildtype}"
416 -
417 - mkdir "${builddir}"
418 -
419 - local conf_opts=(
420 - --prefix=/usr
421 - --sysconfdir=/etc
422 - --libdir=/usr/$(get_libdir)
423 - --docdir=/usr/share/doc/${PF}/html
424 - --disable-bsd-user
425 - --disable-guest-agent
426 - --disable-strip
427 - --disable-werror
428 - # We support gnutls/nettle for crypto operations. It is possible
429 - # to use gcrypt when gnutls/nettle are disabled (but not when they
430 - # are enabled), but it's not really worth the hassle. Disable it
431 - # all the time to avoid automatically detecting it. #568856
432 - --disable-gcrypt
433 - --python="${PYTHON}"
434 - --cc="$(tc-getCC)"
435 - --cxx="$(tc-getCXX)"
436 - --host-cc="$(tc-getBUILD_CC)"
437 - $(use_enable debug debug-info)
438 - $(use_enable debug debug-tcg)
439 - --enable-docs
440 - $(use_enable tci tcg-interpreter)
441 - $(use_enable xattr attr)
442 - )
443 -
444 - # Disable options not used by user targets as the default configure
445 - # options will autoprobe and try to link in a bunch of unused junk.
446 - conf_softmmu() {
447 - if [[ ${buildtype} == "user" ]] ; then
448 - echo "--disable-${2:-$1}"
449 - else
450 - use_enable "$@"
451 - fi
452 - }
453 - conf_opts+=(
454 - $(conf_softmmu accessibility brlapi)
455 - $(conf_softmmu aio linux-aio)
456 - $(conf_softmmu bzip2)
457 - $(conf_softmmu bluetooth bluez)
458 - $(conf_softmmu caps cap-ng)
459 - $(conf_softmmu curl)
460 - $(conf_softmmu fdt)
461 - $(conf_softmmu glusterfs)
462 - $(conf_softmmu gnutls)
463 - $(conf_softmmu gnutls nettle)
464 - $(conf_softmmu gtk)
465 - $(conf_softmmu infiniband rdma)
466 - $(conf_softmmu iscsi libiscsi)
467 - $(conf_softmmu jpeg vnc-jpeg)
468 - $(conf_softmmu kernel_linux kvm)
469 - $(conf_softmmu lzo)
470 - $(conf_softmmu ncurses curses)
471 - $(conf_softmmu nfs libnfs)
472 - $(conf_softmmu numa)
473 - $(conf_softmmu opengl)
474 - $(conf_softmmu png vnc-png)
475 - $(conf_softmmu rbd)
476 - $(conf_softmmu sasl vnc-sasl)
477 - $(conf_softmmu sdl)
478 - $(conf_softmmu seccomp)
479 - $(conf_softmmu smartcard)
480 - $(conf_softmmu snappy)
481 - $(conf_softmmu spice)
482 - $(conf_softmmu ssh libssh2)
483 - $(conf_softmmu usb libusb)
484 - $(conf_softmmu usbredir usb-redir)
485 - $(conf_softmmu vde)
486 - $(conf_softmmu vhost-net)
487 - $(conf_softmmu virgl virglrenderer)
488 - $(conf_softmmu virtfs)
489 - $(conf_softmmu vnc)
490 - $(conf_softmmu vte)
491 - $(conf_softmmu xen)
492 - $(conf_softmmu xen xen-pci-passthrough)
493 - $(conf_softmmu xfs xfsctl)
494 - )
495 -
496 - case ${buildtype} in
497 - user)
498 - conf_opts+=(
499 - --enable-linux-user
500 - --disable-system
501 - --disable-blobs
502 - --disable-tools
503 - )
504 - ;;
505 - softmmu)
506 - # audio options
507 - local audio_opts="oss"
508 - use alsa && audio_opts="alsa,${audio_opts}"
509 - use sdl && audio_opts="sdl,${audio_opts}"
510 - use pulseaudio && audio_opts="pa,${audio_opts}"
511 -
512 - conf_opts+=(
513 - --disable-linux-user
514 - --enable-system
515 - --with-system-pixman
516 - --audio-drv-list="${audio_opts}"
517 - )
518 - use gtk && conf_opts+=( --with-gtkabi=$(usex gtk2 2.0 3.0) )
519 - use sdl && conf_opts+=( --with-sdlabi=$(usex sdl2 2.0 1.2) )
520 - ;;
521 - tools)
522 - conf_opts+=(
523 - --disable-linux-user
524 - --disable-system
525 - --disable-blobs
526 - $(use_enable bzip2)
527 - )
528 - static_flag="static"
529 - ;;
530 - esac
531 -
532 - local targets="${buildtype}_targets"
533 - [[ -n ${targets} ]] && conf_opts+=( --target-list="${!targets}" )
534 -
535 - # Add support for SystemTAP
536 - use systemtap && conf_opts+=( --enable-trace-backend=dtrace )
537 -
538 - # We always want to attempt to build with PIE support as it results
539 - # in a more secure binary. But it doesn't work with static or if
540 - # the current GCC doesn't have PIE support.
541 - if use ${static_flag}; then
542 - conf_opts+=( --static --disable-pie )
543 - else
544 - gcc-specs-pie && conf_opts+=( --enable-pie )
545 - fi
546 -
547 - echo "../configure ${conf_opts[*]}"
548 - cd "${builddir}"
549 - ../configure "${conf_opts[@]}" || die "configure failed"
550 -
551 - # FreeBSD's kernel does not support QEMU assigning/grabbing
552 - # host USB devices yet
553 - use kernel_FreeBSD && \
554 - sed -i -E -e "s|^(HOST_USB=)bsd|\1stub|" "${S}"/config-host.mak
555 -}
556 -
557 -src_configure() {
558 - local target
559 -
560 - python_setup
561 -
562 - softmmu_targets= softmmu_bins=()
563 - user_targets= user_bins=()
564 -
565 - for target in ${IUSE_SOFTMMU_TARGETS} ; do
566 - if use "qemu_softmmu_targets_${target}"; then
567 - softmmu_targets+=",${target}-softmmu"
568 - softmmu_bins+=( "qemu-system-${target}" )
569 - fi
570 - done
571 -
572 - for target in ${IUSE_USER_TARGETS} ; do
573 - if use "qemu_user_targets_${target}"; then
574 - user_targets+=",${target}-linux-user"
575 - user_bins+=( "qemu-${target}" )
576 - fi
577 - done
578 -
579 - softmmu_targets=${softmmu_targets#,}
580 - user_targets=${user_targets#,}
581 -
582 - [[ -n ${softmmu_targets} ]] && qemu_src_configure "softmmu"
583 - [[ -n ${user_targets} ]] && qemu_src_configure "user"
584 - [[ -z ${softmmu_targets}${user_targets} ]] && qemu_src_configure "tools"
585 -}
586 -
587 -src_compile() {
588 - if [[ -n ${user_targets} ]]; then
589 - cd "${S}/user-build"
590 - default
591 - fi
592 -
593 - if [[ -n ${softmmu_targets} ]]; then
594 - cd "${S}/softmmu-build"
595 - default
596 - fi
597 -
598 - if [[ -z ${softmmu_targets}${user_targets} ]]; then
599 - cd "${S}/tools-build"
600 - default
601 - fi
602 -}
603 -
604 -src_test() {
605 - if [[ -n ${softmmu_targets} ]]; then
606 - cd "${S}/softmmu-build"
607 - pax-mark m */qemu-system-* #515550
608 - emake -j1 check
609 - emake -j1 check-report.html
610 - fi
611 -}
612 -
613 -qemu_python_install() {
614 - python_domodule "${S}/scripts/qmp/qmp.py"
615 -
616 - python_doscript "${S}/scripts/kvm/vmxcap"
617 - python_doscript "${S}/scripts/qmp/qmp-shell"
618 - python_doscript "${S}/scripts/qmp/qemu-ga-client"
619 -}
620 -
621 -src_install() {
622 - if [[ -n ${user_targets} ]]; then
623 - cd "${S}/user-build"
624 - emake DESTDIR="${ED}" install
625 -
626 - # Install binfmt handler init script for user targets
627 - newinitd "${FILESDIR}/qemu-binfmt.initd-r1" qemu-binfmt
628 - fi
629 -
630 - if [[ -n ${softmmu_targets} ]]; then
631 - cd "${S}/softmmu-build"
632 - emake DESTDIR="${ED}" install
633 -
634 - # This might not exist if the test failed. #512010
635 - [[ -e check-report.html ]] && dohtml check-report.html
636 -
637 - if use kernel_linux; then
638 - udev_newrules "${FILESDIR}"/65-kvm.rules-r1 65-kvm.rules
639 - fi
640 -
641 - if use python; then
642 - python_foreach_impl qemu_python_install
643 - fi
644 - fi
645 -
646 - if [[ -z ${softmmu_targets}${user_targets} ]]; then
647 - cd "${S}/tools-build"
648 - emake DESTDIR="${ED}" install
649 - fi
650 -
651 - # Disable mprotect on the qemu binaries as they use JITs to be fast #459348
652 - pushd "${ED}"/usr/bin >/dev/null
653 - pax-mark m "${softmmu_bins[@]}" "${user_bins[@]}"
654 - popd >/dev/null
655 -
656 - # Install config file example for qemu-bridge-helper
657 - insinto "/etc/qemu"
658 - doins "${FILESDIR}/bridge.conf"
659 -
660 - # Remove the docdir placed qmp-commands.txt
661 - mv "${ED}/usr/share/doc/${PF}/html/qmp-commands.txt" "${S}/docs/" || die
662 -
663 - cd "${S}"
664 - dodoc Changelog MAINTAINERS docs/specs/pci-ids.txt
665 - newdoc pc-bios/README README.pc-bios
666 - dodoc docs/qmp-*.txt
667 -
668 - if [[ -n ${softmmu_targets} ]]; then
669 - # Remove SeaBIOS since we're using the SeaBIOS packaged one
670 - rm "${ED}/usr/share/qemu/bios.bin"
671 - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
672 - dosym ../seabios/bios.bin /usr/share/qemu/bios.bin
673 - fi
674 -
675 - # Remove vgabios since we're using the vgabios packaged one
676 - rm "${ED}/usr/share/qemu/vgabios.bin"
677 - rm "${ED}/usr/share/qemu/vgabios-cirrus.bin"
678 - rm "${ED}/usr/share/qemu/vgabios-qxl.bin"
679 - rm "${ED}/usr/share/qemu/vgabios-stdvga.bin"
680 - rm "${ED}/usr/share/qemu/vgabios-vmware.bin"
681 - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
682 - dosym ../vgabios/vgabios.bin /usr/share/qemu/vgabios.bin
683 - dosym ../vgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin
684 - dosym ../vgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin
685 - dosym ../vgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin
686 - dosym ../vgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin
687 - fi
688 -
689 - # Remove sgabios since we're using the sgabios packaged one
690 - rm "${ED}/usr/share/qemu/sgabios.bin"
691 - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
692 - dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin
693 - fi
694 -
695 - # Remove iPXE since we're using the iPXE packaged one
696 - rm "${ED}"/usr/share/qemu/pxe-*.rom
697 - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
698 - dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom
699 - dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom
700 - dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom
701 - dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom
702 - dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom
703 - dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom
704 - fi
705 - fi
706 -
707 - qemu_support_kvm && readme.gentoo_create_doc
708 -}
709 -
710 -pkg_postinst() {
711 - if qemu_support_kvm; then
712 - readme.gentoo_print_elog
713 - fi
714 -
715 - if [[ -n ${softmmu_targets} ]] && use kernel_linux; then
716 - udev_reload
717 - fi
718 -
719 - fcaps cap_net_admin /usr/libexec/qemu-bridge-helper
720 -}
721 -
722 -pkg_info() {
723 - echo "Using:"
724 - echo " $(best_version app-emulation/spice-protocol)"
725 - echo " $(best_version sys-firmware/ipxe)"
726 - echo " $(best_version sys-firmware/seabios)"
727 - if has_version 'sys-firmware/seabios[binary]'; then
728 - echo " USE=binary"
729 - else
730 - echo " USE=''"
731 - fi
732 - echo " $(best_version sys-firmware/vgabios)"
733 -}