Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-emulation/qemu: qemu-9999.ebuild qemu-2.3.0.ebuild ChangeLog
Date: Tue, 28 Apr 2015 13:50:10
Message-Id: 20150428092005.1B319992@oystercatcher.gentoo.org
1 vapier 15/04/28 09:20:05
2
3 Modified: qemu-9999.ebuild ChangeLog
4 Added: qemu-2.3.0.ebuild
5 Log:
6 Version bump.
7
8 (Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key D2E96200)
9
10 Revision Changes Path
11 1.97 app-emulation/qemu/qemu-9999.ebuild
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu/qemu-9999.ebuild?rev=1.97&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu/qemu-9999.ebuild?rev=1.97&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu/qemu-9999.ebuild?r1=1.96&r2=1.97
16
17 Index: qemu-9999.ebuild
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/app-emulation/qemu/qemu-9999.ebuild,v
20 retrieving revision 1.96
21 retrieving revision 1.97
22 diff -u -r1.96 -r1.97
23 --- qemu-9999.ebuild 4 Apr 2015 19:59:28 -0000 1.96
24 +++ qemu-9999.ebuild 28 Apr 2015 09:20:05 -0000 1.97
25 @@ -1,6 +1,6 @@
26 # Copyright 1999-2015 Gentoo Foundation
27 # Distributed under the terms of the GNU General Public License v2
28 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu/qemu-9999.ebuild,v 1.96 2015/04/04 19:59:28 vapier Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu/qemu-9999.ebuild,v 1.97 2015/04/28 09:20:05 vapier Exp $
30
31 EAPI=5
32
33 @@ -16,7 +16,6 @@
34 EGIT_REPO_URI="git://git.qemu.org/qemu.git"
35 inherit git-2
36 SRC_URI=""
37 - KEYWORDS=""
38 else
39 SRC_URI="http://wiki.qemu-project.org/download/${P}.tar.bz2
40 ${BACKPORTS:+
41 @@ -246,7 +245,6 @@
42
43 pkg_setup() {
44 enewgroup kvm 78
45 - python_setup
46 }
47
48 src_prepare() {
49 @@ -407,7 +405,7 @@
50 src_configure() {
51 local target
52
53 - python_export_best
54 + python_setup
55
56 softmmu_targets= softmmu_bins=()
57 user_targets= user_bins=()
58
59
60
61 1.323 app-emulation/qemu/ChangeLog
62
63 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu/ChangeLog?rev=1.323&view=markup
64 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu/ChangeLog?rev=1.323&content-type=text/plain
65 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu/ChangeLog?r1=1.322&r2=1.323
66
67 Index: ChangeLog
68 ===================================================================
69 RCS file: /var/cvsroot/gentoo-x86/app-emulation/qemu/ChangeLog,v
70 retrieving revision 1.322
71 retrieving revision 1.323
72 diff -u -r1.322 -r1.323
73 --- ChangeLog 12 Apr 2015 00:29:22 -0000 1.322
74 +++ ChangeLog 28 Apr 2015 09:20:05 -0000 1.323
75 @@ -1,6 +1,12 @@
76 # ChangeLog for app-emulation/qemu
77 # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
78 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu/ChangeLog,v 1.322 2015/04/12 00:29:22 vapier Exp $
79 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu/ChangeLog,v 1.323 2015/04/28 09:20:05 vapier Exp $
80 +
81 +*qemu-2.3.0 (28 Apr 2015)
82 +
83 + 28 Apr 2015; Mike Frysinger <vapier@g.o> +qemu-2.3.0.ebuild,
84 + qemu-9999.ebuild:
85 + Version bump.
86
87 *qemu-2.2.1-r1 (12 Apr 2015)
88
89
90
91
92 1.1 app-emulation/qemu/qemu-2.3.0.ebuild
93
94 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu/qemu-2.3.0.ebuild?rev=1.1&view=markup
95 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu/qemu-2.3.0.ebuild?rev=1.1&content-type=text/plain
96
97 Index: qemu-2.3.0.ebuild
98 ===================================================================
99 # Copyright 1999-2015 Gentoo Foundation
100 # Distributed under the terms of the GNU General Public License v2
101 # $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu/qemu-2.3.0.ebuild,v 1.1 2015/04/28 09:20:05 vapier Exp $
102
103 EAPI=5
104
105 PYTHON_COMPAT=( python2_7 )
106 PYTHON_REQ_USE="ncurses,readline"
107
108 inherit eutils flag-o-matic linux-info toolchain-funcs multilib python-r1 \
109 user udev fcaps readme.gentoo pax-utils
110
111 BACKPORTS=
112
113 if [[ ${PV} = *9999* ]]; then
114 EGIT_REPO_URI="git://git.qemu.org/qemu.git"
115 inherit git-2
116 SRC_URI=""
117 else
118 SRC_URI="http://wiki.qemu-project.org/download/${P}.tar.bz2
119 ${BACKPORTS:+
120 http://dev.gentoo.org/~cardoe/distfiles/${P}-${BACKPORTS}.tar.xz}"
121 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd"
122 fi
123
124 DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools"
125 HOMEPAGE="http://www.qemu.org http://www.linux-kvm.org"
126
127 LICENSE="GPL-2 LGPL-2 BSD-2"
128 SLOT="0"
129 IUSE="accessibility +aio alsa bluetooth +caps +curl debug +fdt glusterfs \
130 gtk gtk2 infiniband iscsi +jpeg \
131 kernel_linux kernel_FreeBSD lzo ncurses nfs nls numa opengl +pin-upstream-blobs
132 +png pulseaudio python \
133 rbd sasl +seccomp sdl selinux smartcard snappy spice ssh static static-softmmu \
134 static-user systemtap tci test +threads tls usb usbredir +uuid vde +vhost-net \
135 virtfs +vnc xattr xen xfs"
136
137 COMMON_TARGETS="aarch64 alpha arm cris i386 m68k microblaze microblazeel mips
138 mips64 mips64el mipsel or32 ppc ppc64 s390x sh4 sh4eb sparc sparc64 unicore32
139 x86_64"
140 IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} lm32 moxie ppcemb xtensa xtensaeb"
141 IUSE_USER_TARGETS="${COMMON_TARGETS} armeb mipsn32 mipsn32el ppc64abi32 sparc32plus"
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 # Require at least one softmmu or user target.
148 # Block USE flag configurations known to not work.
149 REQUIRED_USE="|| ( ${use_softmmu_targets} ${use_user_targets} )
150 ${PYTHON_REQUIRED_USE}
151 gtk2? ( gtk )
152 qemu_softmmu_targets_arm? ( fdt )
153 qemu_softmmu_targets_microblaze? ( fdt )
154 qemu_softmmu_targets_ppc? ( fdt )
155 qemu_softmmu_targets_ppc64? ( fdt )
156 static? ( static-softmmu static-user )
157 static-softmmu? ( !alsa !pulseaudio !bluetooth !opengl !gtk !gtk2 )
158 virtfs? ( xattr )"
159
160 # Yep, you need both libcap and libcap-ng since virtfs only uses libcap.
161 #
162 # The attr lib isn't always linked in (although the USE flag is always
163 # respected). This is because qemu supports using the C library's API
164 # when available rather than always using the extranl library.
165 COMMON_LIB_DEPEND=">=dev-libs/glib-2.0[static-libs(+)]
166 sys-libs/zlib[static-libs(+)]
167 xattr? ( sys-apps/attr[static-libs(+)] )"
168 SOFTMMU_LIB_DEPEND="${COMMON_LIB_DEPEND}
169 >=x11-libs/pixman-0.28.0[static-libs(+)]
170 aio? ( dev-libs/libaio[static-libs(+)] )
171 caps? ( sys-libs/libcap-ng[static-libs(+)] )
172 curl? ( >=net-misc/curl-7.15.4[static-libs(+)] )
173 fdt? ( >=sys-apps/dtc-1.4.0[static-libs(+)] )
174 glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] )
175 infiniband? ( sys-infiniband/librdmacm:=[static-libs(+)] )
176 jpeg? ( virtual/jpeg:=[static-libs(+)] )
177 lzo? ( dev-libs/lzo:2[static-libs(+)] )
178 ncurses? ( sys-libs/ncurses[static-libs(+)] )
179 nfs? ( >=net-fs/libnfs-1.9.3[static-libs(+)] )
180 numa? ( sys-process/numactl[static-libs(+)] )
181 png? ( media-libs/libpng:0=[static-libs(+)] )
182 rbd? ( sys-cluster/ceph[static-libs(+)] )
183 sasl? ( dev-libs/cyrus-sasl[static-libs(+)] )
184 sdl? ( >=media-libs/libsdl-1.2.11[static-libs(+)] )
185 seccomp? ( >=sys-libs/libseccomp-2.1.0[static-libs(+)] )
186 snappy? ( app-arch/snappy[static-libs(+)] )
187 spice? ( >=app-emulation/spice-0.12.0[static-libs(+)] )
188 ssh? ( >=net-libs/libssh2-1.2.8[static-libs(+)] )
189 tls? ( net-libs/gnutls[static-libs(+)] )
190 usb? ( >=dev-libs/libusb-1.0.18[static-libs(+)] )
191 uuid? ( >=sys-apps/util-linux-2.16.0[static-libs(+)] )
192 vde? ( net-misc/vde[static-libs(+)] )
193 xfs? ( sys-fs/xfsprogs[static-libs(+)] )"
194 USER_LIB_DEPEND="${COMMON_LIB_DEPEND}"
195 X86_FIRMWARE_DEPEND="
196 >=sys-firmware/ipxe-1.0.0_p20130624
197 pin-upstream-blobs? (
198 ~sys-firmware/seabios-1.7.5
199 ~sys-firmware/sgabios-0.1_pre8
200 ~sys-firmware/vgabios-0.7a
201 )
202 !pin-upstream-blobs? (
203 sys-firmware/seabios
204 sys-firmware/sgabios
205 sys-firmware/vgabios
206 )"
207 CDEPEND="
208 !static-softmmu? ( $(printf "%s? ( ${SOFTMMU_LIB_DEPEND//\[static-libs(+)]} ) " ${use_softmmu_targets}) )
209 !static-user? ( $(printf "%s? ( ${USER_LIB_DEPEND//\[static-libs(+)]} ) " ${use_user_targets}) )
210 qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} )
211 qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} )
212 accessibility? ( app-accessibility/brltty )
213 alsa? ( >=media-libs/alsa-lib-1.0.13 )
214 bluetooth? ( net-wireless/bluez )
215 gtk? (
216 gtk2? ( x11-libs/gtk+:2 )
217 !gtk2? ( x11-libs/gtk+:3 )
218 x11-libs/vte:2.90
219 )
220 iscsi? ( net-libs/libiscsi )
221 opengl? ( virtual/opengl )
222 pulseaudio? ( media-sound/pulseaudio )
223 python? ( ${PYTHON_DEPS} )
224 sdl? ( media-libs/libsdl[X] )
225 smartcard? ( dev-libs/nss !app-emulation/libcacard )
226 spice? ( >=app-emulation/spice-protocol-0.12.3 )
227 systemtap? ( dev-util/systemtap )
228 usbredir? ( >=sys-apps/usbredir-0.6 )
229 virtfs? ( sys-libs/libcap )
230 xen? ( app-emulation/xen-tools )"
231 DEPEND="${CDEPEND}
232 dev-lang/perl
233 =dev-lang/python-2*
234 sys-apps/texinfo
235 virtual/pkgconfig
236 kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 )
237 gtk? ( nls? ( sys-devel/gettext ) )
238 static-softmmu? ( $(printf "%s? ( ${SOFTMMU_LIB_DEPEND} ) " ${use_softmmu_targets}) )
239 static-user? ( $(printf "%s? ( ${USER_LIB_DEPEND} ) " ${use_user_targets}) )
240 test? (
241 dev-libs/glib[utils]
242 sys-devel/bc
243 )"
244 RDEPEND="${CDEPEND}
245 selinux? ( sec-policy/selinux-qemu )
246 "
247
248 STRIP_MASK="/usr/share/qemu/palcode-clipper"
249
250 QA_PREBUILT="
251 usr/share/qemu/openbios-ppc
252 usr/share/qemu/openbios-sparc64
253 usr/share/qemu/openbios-sparc32
254 usr/share/qemu/palcode-clipper
255 usr/share/qemu/s390-ccw.img
256 usr/share/qemu/u-boot.e500
257 "
258
259 QA_WX_LOAD="usr/bin/qemu-i386
260 usr/bin/qemu-x86_64
261 usr/bin/qemu-alpha
262 usr/bin/qemu-arm
263 usr/bin/qemu-cris
264 usr/bin/qemu-m68k
265 usr/bin/qemu-microblaze
266 usr/bin/qemu-microblazeel
267 usr/bin/qemu-mips
268 usr/bin/qemu-mipsel
269 usr/bin/qemu-or32
270 usr/bin/qemu-ppc
271 usr/bin/qemu-ppc64
272 usr/bin/qemu-ppc64abi32
273 usr/bin/qemu-sh4
274 usr/bin/qemu-sh4eb
275 usr/bin/qemu-sparc
276 usr/bin/qemu-sparc64
277 usr/bin/qemu-armeb
278 usr/bin/qemu-sparc32plus
279 usr/bin/qemu-s390x
280 usr/bin/qemu-unicore32"
281
282 DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure
283 you have the kernel module loaded before running kvm. The easiest way to
284 ensure that the kernel module is loaded is to load it on boot.\n
285 For AMD CPUs the module is called 'kvm-amd'\n
286 For Intel CPUs the module is called 'kvm-intel'\n
287 Please review /etc/conf.d/modules for how to load these\n\n
288 Make sure your user is in the 'kvm' group\n
289 Just run 'gpasswd -a <USER> kvm', then have <USER> re-login."
290
291 qemu_support_kvm() {
292 if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386 \
293 use qemu_softmmu_targets_ppc || use qemu_softmmu_targets_ppc64 \
294 use qemu_softmmu_targets_s390x; then
295 return 0
296 fi
297
298 return 1
299 }
300
301 pkg_pretend() {
302 if use kernel_linux && kernel_is lt 2 6 25; then
303 eerror "This version of KVM requres a host kernel of 2.6.25 or higher."
304 elif use kernel_linux; then
305 if ! linux_config_exists; then
306 eerror "Unable to check your kernel for KVM support"
307 else
308 CONFIG_CHECK="~KVM ~TUN ~BRIDGE"
309 ERROR_KVM="You must enable KVM in your kernel to continue"
310 ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in"
311 ERROR_KVM_AMD+=" your kernel configuration."
312 ERROR_KVM_INTEL="If you have an Intel CPU, you must enable"
313 ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration."
314 ERROR_TUN="You will need the Universal TUN/TAP driver compiled"
315 ERROR_TUN+=" into your kernel or loaded as a module to use the"
316 ERROR_TUN+=" virtual network device if using -net tap."
317 ERROR_BRIDGE="You will also need support for 802.1d"
318 ERROR_BRIDGE+=" Ethernet Bridging for some network configurations."
319 use vhost-net && CONFIG_CHECK+=" ~VHOST_NET"
320 ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net"
321 ERROR_VHOST_NET+=" support"
322
323 if use amd64 || use x86 || use amd64-linux || use x86-linux; then
324 CONFIG_CHECK+=" ~KVM_AMD ~KVM_INTEL"
325 fi
326
327 use python && CONFIG_CHECK+=" ~DEBUG_FS"
328 ERROR_DEBUG_FS="debugFS support required for kvm_stat"
329
330 # Now do the actual checks setup above
331 check_extra_config
332 fi
333 fi
334
335 if grep -qs '/usr/bin/qemu-kvm' "${EROOT}"/etc/libvirt/qemu/*.xml; then
336 eerror "The kvm/qemu-kvm wrappers no longer exist, but your libvirt"
337 eerror "instances are still pointing to it. Please update your"
338 eerror "configs in /etc/libvirt/qemu/ to use the -enable-kvm flag"
339 eerror "and the right system binary (e.g. qemu-system-x86_64)."
340 die "update your virt configs to not use qemu-kvm"
341 fi
342 }
343
344 pkg_setup() {
345 enewgroup kvm 78
346 }
347
348 src_prepare() {
349 # Alter target makefiles to accept CFLAGS set via flag-o
350 sed -i -r \
351 -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \
352 Makefile Makefile.target || die
353
354 # Cheap hack to disable gettext .mo generation.
355 use nls || rm -f po/*.po
356
357 epatch "${FILESDIR}"/qemu-1.7.0-cflags.patch
358 [[ -n ${BACKPORTS} ]] && \
359 EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \
360 epatch
361
362 # Fix ld and objcopy being called directly
363 tc-export AR LD OBJCOPY
364
365 # Verbose builds
366 MAKEOPTS+=" V=1"
367
368 epatch_user
369 }
370
371 ##
372 # configures qemu based on the build directory and the build type
373 # we are using.
374 #
375 qemu_src_configure() {
376 debug-print-function ${FUNCNAME} "$@"
377
378 local buildtype=$1
379 local builddir=$2
380 local static_flag="static-${buildtype}"
381
382 # audio options
383 local audio_opts="oss"
384 use alsa && audio_opts="alsa,${audio_opts}"
385 use sdl && audio_opts="sdl,${audio_opts}"
386 use pulseaudio && audio_opts="pa,${audio_opts}"
387
388 local conf_opts=(
389 --prefix=/usr
390 --sysconfdir=/etc
391 --libdir=/usr/$(get_libdir)
392 --docdir=/usr/share/doc/${PF}/html
393 --disable-bsd-user
394 --disable-guest-agent
395 --disable-strip
396 --disable-werror
397 --python="${PYTHON}"
398 --cc="$(tc-getCC)"
399 --cxx="$(tc-getCXX)"
400 --host-cc="$(tc-getBUILD_CC)"
401 $(use_enable debug debug-info)
402 $(use_enable debug debug-tcg)
403 --enable-docs
404 $(use_enable tci tcg-interpreter)
405 $(use_enable xattr attr)
406 )
407
408 # Disable options not used by user targets as the default configure
409 # options will autoprobe and try to link in a bunch of unused junk.
410 conf_softmmu() {
411 if [[ ${buildtype} == "user" ]] ; then
412 echo "--disable-${2:-$1}"
413 else
414 use_enable "$@"
415 fi
416 }
417 conf_opts+=(
418 $(conf_softmmu accessibility brlapi)
419 $(conf_softmmu aio linux-aio)
420 $(conf_softmmu bluetooth bluez)
421 $(conf_softmmu caps cap-ng)
422 $(conf_softmmu curl)
423 $(conf_softmmu fdt)
424 $(conf_softmmu glusterfs)
425 $(conf_softmmu gtk)
426 $(conf_softmmu infiniband rdma)
427 $(conf_softmmu iscsi libiscsi)
428 $(conf_softmmu jpeg vnc-jpeg)
429 $(conf_softmmu kernel_linux kvm)
430 $(conf_softmmu lzo)
431 $(conf_softmmu ncurses curses)
432 $(conf_softmmu nfs libnfs)
433 $(conf_softmmu numa)
434 $(conf_softmmu opengl)
435 $(conf_softmmu png vnc-png)
436 $(conf_softmmu rbd)
437 $(conf_softmmu sasl vnc-sasl)
438 $(conf_softmmu sdl)
439 $(conf_softmmu seccomp)
440 $(conf_softmmu smartcard smartcard-nss)
441 $(conf_softmmu snappy)
442 $(conf_softmmu spice)
443 $(conf_softmmu ssh libssh2)
444 $(conf_softmmu tls quorum)
445 $(conf_softmmu tls vnc-tls)
446 $(conf_softmmu tls vnc-ws)
447 $(conf_softmmu usb libusb)
448 $(conf_softmmu usbredir usb-redir)
449 $(conf_softmmu uuid)
450 $(conf_softmmu vde)
451 $(conf_softmmu vhost-net)
452 $(conf_softmmu virtfs)
453 $(conf_softmmu vnc)
454 $(conf_softmmu xen)
455 $(conf_softmmu xen xen-pci-passthrough)
456 $(conf_softmmu xfs xfsctl)
457 )
458
459 case ${buildtype} in
460 user)
461 conf_opts+=(
462 --enable-linux-user
463 --disable-system
464 --target-list="${user_targets}"
465 --disable-blobs
466 --disable-tools
467 )
468 ;;
469 softmmu)
470 conf_opts+=(
471 --disable-linux-user
472 --enable-system
473 --target-list="${softmmu_targets}"
474 --with-system-pixman
475 --audio-drv-list="${audio_opts}"
476 )
477 use gtk && conf_opts+=( --with-gtkabi=$(usex gtk2 2.0 3.0) )
478 ;;
479 esac
480
481 # Add support for SystemTAP
482 use systemtap && conf_opts+=( --enable-trace-backend=dtrace )
483
484 # We always want to attempt to build with PIE support as it results
485 # in a more secure binary. But it doesn't work with static or if
486 # the current GCC doesn't have PIE support.
487 if use ${static_flag}; then
488 conf_opts+=( --static --disable-pie )
489 else
490 gcc-specs-pie && conf_opts+=( --enable-pie )
491 fi
492
493 einfo "../configure ${conf_opts[*]}"
494 cd "${builddir}"
495 ../configure "${conf_opts[@]}" || die "configure failed"
496
497 # FreeBSD's kernel does not support QEMU assigning/grabbing
498 # host USB devices yet
499 use kernel_FreeBSD && \
500 sed -i -E -e "s|^(HOST_USB=)bsd|\1stub|" "${S}"/config-host.mak
501 }
502
503 src_configure() {
504 local target
505
506 python_setup
507
508 softmmu_targets= softmmu_bins=()
509 user_targets= user_bins=()
510
511 for target in ${IUSE_SOFTMMU_TARGETS} ; do
512 if use "qemu_softmmu_targets_${target}"; then
513 softmmu_targets+=",${target}-softmmu"
514 softmmu_bins+=( "qemu-system-${target}" )
515 fi
516 done
517
518 for target in ${IUSE_USER_TARGETS} ; do
519 if use "qemu_user_targets_${target}"; then
520 user_targets+=",${target}-linux-user"
521 user_bins+=( "qemu-${target}" )
522 fi
523 done
524
525 [[ -n ${softmmu_targets} ]] && \
526 einfo "Building the following softmmu targets: ${softmmu_targets}"
527
528 [[ -n ${user_targets} ]] && \
529 einfo "Building the following user targets: ${user_targets}"
530
531 if [[ -n ${softmmu_targets} ]]; then
532 mkdir "${S}/softmmu-build"
533 qemu_src_configure "softmmu" "${S}/softmmu-build"
534 fi
535
536 if [[ -n ${user_targets} ]]; then
537 mkdir "${S}/user-build"
538 qemu_src_configure "user" "${S}/user-build"
539 fi
540 }
541
542 src_compile() {
543 if [[ -n ${user_targets} ]]; then
544 cd "${S}/user-build"
545 default
546 fi
547
548 if [[ -n ${softmmu_targets} ]]; then
549 cd "${S}/softmmu-build"
550 default
551 fi
552 }
553
554 src_test() {
555 if [[ -n ${softmmu_targets} ]]; then
556 cd "${S}/softmmu-build"
557 pax-mark m */qemu-system-* #515550
558 emake -j1 check
559 emake -j1 check-report.html
560 fi
561 }
562
563 qemu_python_install() {
564 python_domodule "${S}/scripts/qmp/qmp.py"
565
566 python_doscript "${S}/scripts/kvm/kvm_stat"
567 python_doscript "${S}/scripts/kvm/vmxcap"
568 python_doscript "${S}/scripts/qmp/qmp-shell"
569 python_doscript "${S}/scripts/qmp/qemu-ga-client"
570 }
571
572 src_install() {
573 if [[ -n ${user_targets} ]]; then
574 cd "${S}/user-build"
575 emake DESTDIR="${ED}" install
576
577 # Install binfmt handler init script for user targets
578 newinitd "${FILESDIR}/qemu-binfmt.initd-r1" qemu-binfmt
579 fi
580
581 if [[ -n ${softmmu_targets} ]]; then
582 cd "${S}/softmmu-build"
583 emake DESTDIR="${ED}" install
584
585 # This might not exist if the test failed. #512010
586 [[ -e check-report.html ]] && dohtml check-report.html
587
588 if use kernel_linux; then
589 udev_dorules "${FILESDIR}"/65-kvm.rules
590 fi
591
592 if use python; then
593 python_foreach_impl qemu_python_install
594 fi
595 fi
596
597 # Disable mprotect on the qemu binaries as they use JITs to be fast #459348
598 pushd "${ED}"/usr/bin >/dev/null
599 pax-mark m "${softmmu_bins[@]}" "${user_bins[@]}"
600 popd >/dev/null
601
602 # Install config file example for qemu-bridge-helper
603 insinto "/etc/qemu"
604 doins "${FILESDIR}/bridge.conf"
605
606 # Remove the docdir placed qmp-commands.txt
607 mv "${ED}/usr/share/doc/${PF}/html/qmp-commands.txt" "${S}/docs/qmp/"
608
609 cd "${S}"
610 dodoc Changelog MAINTAINERS docs/specs/pci-ids.txt
611 newdoc pc-bios/README README.pc-bios
612 dodoc docs/qmp/*.txt
613
614 # Remove SeaBIOS since we're using the SeaBIOS packaged one
615 rm "${ED}/usr/share/qemu/bios.bin"
616 if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
617 dosym ../seabios/bios.bin /usr/share/qemu/bios.bin
618 fi
619
620 # Remove vgabios since we're using the vgabios packaged one
621 if [[ -n ${softmmu_targets} ]]; then
622 rm "${ED}/usr/share/qemu/vgabios.bin"
623 rm "${ED}/usr/share/qemu/vgabios-cirrus.bin"
624 rm "${ED}/usr/share/qemu/vgabios-qxl.bin"
625 rm "${ED}/usr/share/qemu/vgabios-stdvga.bin"
626 rm "${ED}/usr/share/qemu/vgabios-vmware.bin"
627 if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
628 dosym ../vgabios/vgabios.bin /usr/share/qemu/vgabios.bin
629 dosym ../vgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin
630 dosym ../vgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin
631 dosym ../vgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin
632 dosym ../vgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin
633 fi
634
635 # Remove sgabios since we're using the sgabios packaged one
636 rm "${ED}/usr/share/qemu/sgabios.bin"
637 if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
638 dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin
639 fi
640
641 # Remove iPXE since we're using the iPXE packaged one
642 rm "${ED}"/usr/share/qemu/pxe-*.rom
643 if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
644 dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom
645 dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom
646 dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom
647 dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom
648 dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom
649 dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom
650 fi
651 fi
652
653 qemu_support_kvm && readme.gentoo_create_doc
654 }
655
656 pkg_postinst() {
657 if qemu_support_kvm; then
658 readme.gentoo_print_elog
659 ewarn "Migration from qemu-kvm instances and loading qemu-kvm created"
660 ewarn "save states has been removed starting with the 1.6.2 release"
661 ewarn
662 ewarn "It is recommended that you migrate any VMs that may be running"
663 ewarn "on qemu-kvm to a host with a newer qemu and regenerate"
664 ewarn "any saved states with a newer qemu."
665 ewarn
666 ewarn "qemu-kvm was the primary qemu provider in Gentoo through 1.2.x"
667
668 if use x86 || use amd64; then
669 ewarn
670 ewarn "The /usr/bin/kvm and /usr/bin/qemu-kvm wrappers are no longer"
671 ewarn "installed. In order to use kvm acceleration, pass the flag"
672 ewarn "-enable-kvm when running your system target."
673 fi
674 fi
675
676 if [[ -n ${softmmu_targets} ]] && use kernel_linux; then
677 udev_reload
678 fi
679
680 fcaps cap_net_admin /usr/libexec/qemu-bridge-helper
681 if use virtfs && [ -n "${softmmu_targets}" ]; then
682 local virtfs_caps="cap_chown,cap_dac_override,cap_fowner,cap_fsetid,cap_setgid,cap_mknod,cap_setuid"
683 fcaps ${virtfs_caps} /usr/bin/virtfs-proxy-helper
684 fi
685 }
686
687 pkg_info() {
688 echo "Using:"
689 echo " $(best_version app-emulation/spice-protocol)"
690 echo " $(best_version sys-firmware/ipxe)"
691 echo " $(best_version sys-firmware/seabios)"
692 if has_version sys-firmware/seabios[binary]; then
693 echo " USE=binary"
694 else
695 echo " USE=''"
696 fi
697 echo " $(best_version sys-firmware/vgabios)"
698 }