Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/qemu/
Date: Tue, 03 Mar 2020 14:59:27
Message-Id: 1583247552.346ca2b2225d7125895bea03c26f9675c8db0419.slyfox@gentoo
1 commit: 346ca2b2225d7125895bea03c26f9675c8db0419
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Tue Mar 3 14:59:12 2020 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 3 14:59:12 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=346ca2b2
7
8 app-emulation/qemu: drop old, bug #711334
9
10 Bug: https://bugs.gentoo.org/711334
11 Package-Manager: Portage-2.3.89, Repoman-2.3.20
12 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
13
14 app-emulation/qemu/Manifest | 2 -
15 app-emulation/qemu/qemu-4.0.0-r50.ebuild | 813 ------------------------------
16 app-emulation/qemu/qemu-4.1.0-r1.ebuild | 825 -------------------------------
17 3 files changed, 1640 deletions(-)
18
19 diff --git a/app-emulation/qemu/Manifest b/app-emulation/qemu/Manifest
20 index 419a3a9a9e8..5cbf56745a7 100644
21 --- a/app-emulation/qemu/Manifest
22 +++ b/app-emulation/qemu/Manifest
23 @@ -1,3 +1 @@
24 -DIST qemu-4.0.0.tar.xz 55628624 BLAKE2B 8afd1f54aa13d2e61fd36c4f4544b7c4ffb1a7eee5c69d3aa1d40a432ca296ad8abe6cb83d7c66ac4045ca624d2a00e737f51e4e62ed46fef9766ef71f43b98b SHA512 952e94194ce9e64c15388c59035cb31fb9f761d30095c2fb9441012b609c18c9976285727b93bf37b95e15675802d73f8e1c4619ebecd23606675bb503646b13
25 -DIST qemu-4.1.0.tar.xz 54001708 BLAKE2B fc89d0c967fb31a73cbdca556e79c05c44b241382a83f02150a8e39b00cb7de7fb6f248e82e1364e314680481bfb3843e74804534c0ba91a5bb2ff1b8d771130 SHA512 82fd51702a7b9b1b00b2f1bd3b4a832b80249018dbba1add0b0a73e7d4bee452afd45574b4d8df7ce4477d8711f3bda4ca072a1a6de25895c93eb21cf78fc4b2
26 DIST qemu-4.2.0.tar.xz 62222068 BLAKE2B 27c9fbcd5093af425764674817ab9299224bd03f37b5983786f6f437fff1fab3b7da247c55c4ca8b8c42726b9867005944a2f7f04f2d0d94d753961615f901ef SHA512 2a79973c2b07c53e8c57a808ea8add7b6b2cbca96488ed5d4b669ead8c9318907dec2b6109f180fc8ca8f04c0f73a56e82b3a527b5626b799d7e849f2474ec56
27
28 diff --git a/app-emulation/qemu/qemu-4.0.0-r50.ebuild b/app-emulation/qemu/qemu-4.0.0-r50.ebuild
29 deleted file mode 100644
30 index b673e589bae..00000000000
31 --- a/app-emulation/qemu/qemu-4.0.0-r50.ebuild
32 +++ /dev/null
33 @@ -1,813 +0,0 @@
34 -# Copyright 1999-2020 Gentoo Authors
35 -# Distributed under the terms of the GNU General Public License v2
36 -
37 -EAPI="7"
38 -
39 -PYTHON_COMPAT=( python{3_6,3_7} )
40 -PYTHON_REQ_USE="ncurses,readline"
41 -
42 -PLOCALES="bg de_DE fr_FR hu it tr zh_CN"
43 -
44 -FIRMWARE_ABI_VERSION="4.0.0-r50"
45 -
46 -inherit eutils linux-info toolchain-funcs multilib python-r1 \
47 - udev fcaps readme.gentoo-r1 pax-utils l10n xdg-utils
48 -
49 -if [[ ${PV} = *9999* ]]; then
50 - EGIT_REPO_URI="https://git.qemu.org/git/qemu.git"
51 - inherit git-r3
52 - SRC_URI=""
53 -else
54 - SRC_URI="https://download.qemu.org/${P}.tar.xz"
55 - KEYWORDS="amd64 ~arm64 ~ppc ~ppc64 x86"
56 -fi
57 -
58 -DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools"
59 -HOMEPAGE="http://www.qemu.org http://www.linux-kvm.org"
60 -
61 -LICENSE="GPL-2 LGPL-2 BSD-2"
62 -SLOT="0"
63 -IUSE="accessibility +aio alsa bzip2 capstone +caps +curl debug doc
64 - +fdt glusterfs gnutls gtk infiniband iscsi jemalloc +jpeg kernel_linux
65 - kernel_FreeBSD lzo ncurses nfs nls numa opengl +pin-upstream-blobs +png
66 - pulseaudio python rbd sasl +seccomp sdl selinux smartcard snappy
67 - spice ssh static static-user systemtap tci test usb usbredir vde
68 - +vhost-net virgl virtfs +vnc vte xattr xen xfs"
69 -
70 -COMMON_TARGETS="aarch64 alpha arm cris hppa i386 m68k microblaze microblazeel
71 - mips mips64 mips64el mipsel nios2 or1k ppc ppc64 riscv32 riscv64 s390x
72 - sh4 sh4eb sparc sparc64 x86_64 xtensa xtensaeb"
73 -IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS}
74 - lm32 moxie tricore unicore32"
75 -IUSE_USER_TARGETS="${COMMON_TARGETS}
76 - aarch64_be armeb mipsn32 mipsn32el ppc64abi32 ppc64le sparc32plus
77 - tilegx"
78 -
79 -use_softmmu_targets=$(printf ' qemu_softmmu_targets_%s' ${IUSE_SOFTMMU_TARGETS})
80 -use_user_targets=$(printf ' qemu_user_targets_%s' ${IUSE_USER_TARGETS})
81 -IUSE+=" ${use_softmmu_targets} ${use_user_targets}"
82 -
83 -RESTRICT="!test? ( test )"
84 -# Allow no targets to be built so that people can get a tools-only build.
85 -# Block USE flag configurations known to not work.
86 -REQUIRED_USE="${PYTHON_REQUIRED_USE}
87 - qemu_softmmu_targets_arm? ( fdt )
88 - qemu_softmmu_targets_microblaze? ( fdt )
89 - qemu_softmmu_targets_mips64el? ( fdt )
90 - qemu_softmmu_targets_ppc64? ( fdt )
91 - qemu_softmmu_targets_ppc? ( fdt )
92 - qemu_softmmu_targets_riscv32? ( fdt )
93 - qemu_softmmu_targets_riscv64? ( fdt )
94 - static? ( static-user !alsa !gtk !opengl !pulseaudio !rbd !snappy )
95 - virtfs? ( xattr )
96 - vte? ( gtk )"
97 -
98 -# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...)
99 -# and user/softmmu targets (qemu-*, qemu-system-*).
100 -#
101 -# Yep, you need both libcap and libcap-ng since virtfs only uses libcap.
102 -#
103 -# The attr lib isn't always linked in (although the USE flag is always
104 -# respected). This is because qemu supports using the C library's API
105 -# when available rather than always using the external library.
106 -ALL_DEPEND="
107 - >=dev-libs/glib-2.0[static-libs(+)]
108 - sys-libs/zlib[static-libs(+)]
109 - python? ( ${PYTHON_DEPS} )
110 - systemtap? ( dev-util/systemtap )
111 - xattr? ( sys-apps/attr[static-libs(+)] )"
112 -
113 -# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...)
114 -# softmmu targets (qemu-system-*).
115 -SOFTMMU_TOOLS_DEPEND="
116 - dev-libs/libxml2[static-libs(+)]
117 - x11-libs/libxkbcommon[static-libs(+)]
118 - >=x11-libs/pixman-0.28.0[static-libs(+)]
119 - accessibility? (
120 - app-accessibility/brltty[api]
121 - app-accessibility/brltty[static-libs(+)]
122 - )
123 - aio? ( dev-libs/libaio[static-libs(+)] )
124 - alsa? ( >=media-libs/alsa-lib-1.0.13 )
125 - bzip2? ( app-arch/bzip2[static-libs(+)] )
126 - capstone? ( dev-libs/capstone:= )
127 - caps? ( sys-libs/libcap-ng[static-libs(+)] )
128 - curl? ( >=net-misc/curl-7.15.4[static-libs(+)] )
129 - fdt? ( >=sys-apps/dtc-1.5.0[static-libs(+)] )
130 - glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] )
131 - gnutls? (
132 - dev-libs/nettle:=[static-libs(+)]
133 - >=net-libs/gnutls-3.0:=[static-libs(+)]
134 - )
135 - gtk? (
136 - x11-libs/gtk+:3
137 - vte? ( x11-libs/vte:2.91 )
138 - )
139 - infiniband? (
140 - sys-fabric/libibumad:=[static-libs(+)]
141 - sys-fabric/libibverbs:=[static-libs(+)]
142 - sys-fabric/librdmacm:=[static-libs(+)]
143 - )
144 - iscsi? ( net-libs/libiscsi )
145 - jemalloc? ( dev-libs/jemalloc )
146 - jpeg? ( virtual/jpeg:0=[static-libs(+)] )
147 - lzo? ( dev-libs/lzo:2[static-libs(+)] )
148 - ncurses? (
149 - sys-libs/ncurses:0=[unicode]
150 - sys-libs/ncurses:0=[static-libs(+)]
151 - )
152 - nfs? ( >=net-fs/libnfs-1.9.3:=[static-libs(+)] )
153 - numa? ( sys-process/numactl[static-libs(+)] )
154 - opengl? (
155 - virtual/opengl
156 - media-libs/libepoxy[static-libs(+)]
157 - media-libs/mesa[static-libs(+)]
158 - media-libs/mesa[egl,gbm]
159 - )
160 - png? ( media-libs/libpng:0=[static-libs(+)] )
161 - pulseaudio? ( media-sound/pulseaudio )
162 - rbd? ( sys-cluster/ceph )
163 - sasl? ( dev-libs/cyrus-sasl[static-libs(+)] )
164 - sdl? (
165 - media-libs/libsdl2[X]
166 - media-libs/libsdl2[static-libs(+)]
167 - )
168 - seccomp? ( >=sys-libs/libseccomp-2.1.0[static-libs(+)] )
169 - smartcard? ( >=app-emulation/libcacard-2.5.0[static-libs(+)] )
170 - snappy? ( app-arch/snappy:= )
171 - spice? (
172 - >=app-emulation/spice-protocol-0.12.3
173 - >=app-emulation/spice-0.12.0[static-libs(+)]
174 - )
175 - ssh? ( >=net-libs/libssh2-1.2.8[static-libs(+)] )
176 - usb? ( >=virtual/libusb-1-r2[static-libs(+)] )
177 - usbredir? ( >=sys-apps/usbredir-0.6[static-libs(+)] )
178 - vde? ( net-misc/vde[static-libs(+)] )
179 - virgl? ( media-libs/virglrenderer[static-libs(+)] )
180 - virtfs? ( sys-libs/libcap )
181 - xen? ( app-emulation/xen-tools:= )
182 - xfs? ( sys-fs/xfsprogs[static-libs(+)] )"
183 -
184 -X86_FIRMWARE_DEPEND="
185 - pin-upstream-blobs? (
186 - ~sys-firmware/edk2-ovmf-201905[binary]
187 - ~sys-firmware/ipxe-1.0.0_p20190728[binary]
188 - ~sys-firmware/seabios-1.12.0[binary,seavgabios]
189 - ~sys-firmware/sgabios-0.1_pre8[binary]
190 - )
191 - !pin-upstream-blobs? (
192 - sys-firmware/edk2-ovmf
193 - sys-firmware/ipxe
194 - >=sys-firmware/seabios-1.10.2[seavgabios]
195 - sys-firmware/sgabios
196 - )"
197 -PPC64_FIRMWARE_DEPEND="
198 - pin-upstream-blobs? (
199 - ~sys-firmware/seabios-1.12.0[binary,seavgabios]
200 - )
201 - !pin-upstream-blobs? (
202 - >=sys-firmware/seabios-1.10.2[seavgabios]
203 - )
204 -"
205 -
206 -BDEPEND="
207 - $(python_gen_impl_dep)
208 - dev-lang/perl
209 - sys-apps/texinfo
210 - virtual/pkgconfig
211 - doc? ( dev-python/sphinx )
212 - gtk? ( nls? ( sys-devel/gettext ) )
213 - test? (
214 - dev-libs/glib[utils]
215 - sys-devel/bc
216 - )
217 -"
218 -CDEPEND="
219 - !static? (
220 - ${ALL_DEPEND//\[static-libs(+)]}
221 - ${SOFTMMU_TOOLS_DEPEND//\[static-libs(+)]}
222 - )
223 - qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} )
224 - qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} )
225 - qemu_softmmu_targets_ppc64? ( ${PPC64_FIRMWARE_DEPEND} )
226 -"
227 -DEPEND="${CDEPEND}
228 - kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 )
229 - static? (
230 - ${ALL_DEPEND}
231 - ${SOFTMMU_TOOLS_DEPEND}
232 - )
233 - static-user? ( ${ALL_DEPEND} )"
234 -RDEPEND="${CDEPEND}
235 - acct-group/kvm
236 - selinux? ( sec-policy/selinux-qemu )"
237 -
238 -PATCHES=(
239 - "${FILESDIR}"/${PN}-2.5.0-cflags.patch
240 - "${FILESDIR}"/${PN}-2.5.0-sysmacros.patch
241 - "${FILESDIR}"/${PN}-2.11.1-capstone_include_path.patch
242 - "${FILESDIR}"/${P}-sanitize-interp_info.patch
243 - "${FILESDIR}"/${PN}-3.1.0-md-clear-md-no.patch
244 - "${FILESDIR}"/${PN}-4.0.0-mkdir_systemtap.patch #684902
245 - "${FILESDIR}"/${PN}-4.0.0-fix_infiniband_include.patch #686412
246 - "${FILESDIR}"/${PN}-4.0.0-linux-headers-5.2.patch
247 - "${FILESDIR}"/${PN}-4.0.0-pc-q35-4.0.patch
248 -)
249 -
250 -QA_PREBUILT="
251 - usr/share/qemu/hppa-firmware.img
252 - usr/share/qemu/openbios-ppc
253 - usr/share/qemu/openbios-sparc64
254 - usr/share/qemu/openbios-sparc32
255 - usr/share/qemu/palcode-clipper
256 - usr/share/qemu/s390-ccw.img
257 - usr/share/qemu/s390-netboot.img
258 - usr/share/qemu/u-boot.e500"
259 -
260 -QA_WX_LOAD="usr/bin/qemu-i386
261 - usr/bin/qemu-x86_64
262 - usr/bin/qemu-alpha
263 - usr/bin/qemu-arm
264 - usr/bin/qemu-cris
265 - usr/bin/qemu-m68k
266 - usr/bin/qemu-microblaze
267 - usr/bin/qemu-microblazeel
268 - usr/bin/qemu-mips
269 - usr/bin/qemu-mipsel
270 - usr/bin/qemu-or1k
271 - usr/bin/qemu-ppc
272 - usr/bin/qemu-ppc64
273 - usr/bin/qemu-ppc64abi32
274 - usr/bin/qemu-sh4
275 - usr/bin/qemu-sh4eb
276 - usr/bin/qemu-sparc
277 - usr/bin/qemu-sparc64
278 - usr/bin/qemu-armeb
279 - usr/bin/qemu-sparc32plus
280 - usr/bin/qemu-s390x
281 - usr/bin/qemu-unicore32"
282 -
283 -DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure you have the
284 -kernel module loaded before running kvm. The easiest way to ensure that the
285 -kernel module is loaded is to load it on boot.
286 - For AMD CPUs the module is called 'kvm-amd'.
287 - For Intel CPUs the module is called 'kvm-intel'.
288 -Please review /etc/conf.d/modules for how to load these.
289 -
290 -Make sure your user is in the 'kvm' group. Just run
291 - $ gpasswd -a <USER> kvm
292 -then have <USER> re-login.
293 -
294 -For brand new installs, the default permissions on /dev/kvm might not let
295 -you access it. You can tell udev to reset ownership/perms:
296 - $ udevadm trigger -c add /dev/kvm
297 -
298 -If you want to register binfmt handlers for qemu user targets:
299 -For openrc:
300 - # rc-update add qemu-binfmt
301 -For systemd:
302 - # ln -s /usr/share/qemu/binfmt.d/qemu.conf /etc/binfmt.d/qemu.conf"
303 -
304 -pkg_pretend() {
305 - if use kernel_linux && kernel_is lt 2 6 25; then
306 - eerror "This version of KVM requres a host kernel of 2.6.25 or higher."
307 - elif use kernel_linux; then
308 - if ! linux_config_exists; then
309 - eerror "Unable to check your kernel for KVM support"
310 - else
311 - CONFIG_CHECK="~KVM ~TUN ~BRIDGE"
312 - ERROR_KVM="You must enable KVM in your kernel to continue"
313 - ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in"
314 - ERROR_KVM_AMD+=" your kernel configuration."
315 - ERROR_KVM_INTEL="If you have an Intel CPU, you must enable"
316 - ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration."
317 - ERROR_TUN="You will need the Universal TUN/TAP driver compiled"
318 - ERROR_TUN+=" into your kernel or loaded as a module to use the"
319 - ERROR_TUN+=" virtual network device if using -net tap."
320 - ERROR_BRIDGE="You will also need support for 802.1d"
321 - ERROR_BRIDGE+=" Ethernet Bridging for some network configurations."
322 - use vhost-net && CONFIG_CHECK+=" ~VHOST_NET"
323 - ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net"
324 - ERROR_VHOST_NET+=" support"
325 -
326 - if use amd64 || use x86 || use amd64-linux || use x86-linux; then
327 - if grep -q AuthenticAMD /proc/cpuinfo; then
328 - CONFIG_CHECK+=" ~KVM_AMD"
329 - elif grep -q GenuineIntel /proc/cpuinfo; then
330 - CONFIG_CHECK+=" ~KVM_INTEL"
331 - fi
332 - fi
333 -
334 - use python && CONFIG_CHECK+=" ~DEBUG_FS"
335 - ERROR_DEBUG_FS="debugFS support required for kvm_stat"
336 -
337 - # Now do the actual checks setup above
338 - check_extra_config
339 - fi
340 - fi
341 -
342 - if grep -qs '/usr/bin/qemu-kvm' "${EROOT}"/etc/libvirt/qemu/*.xml; then
343 - eerror "The kvm/qemu-kvm wrappers no longer exist, but your libvirt"
344 - eerror "instances are still pointing to it. Please update your"
345 - eerror "configs in /etc/libvirt/qemu/ to use the -enable-kvm flag"
346 - eerror "and the right system binary (e.g. qemu-system-x86_64)."
347 - die "update your virt configs to not use qemu-kvm"
348 - fi
349 -}
350 -
351 -# Sanity check to make sure target lists are kept up-to-date.
352 -check_targets() {
353 - local var=$1 mak=$2
354 - local detected sorted
355 -
356 - pushd "${S}"/default-configs >/dev/null || die
357 -
358 - # Force C locale until glibc is updated. #564936
359 - detected=$(echo $(printf '%s\n' *-${mak}.mak | sed "s:-${mak}.mak::" | LC_COLLATE=C sort -u))
360 - sorted=$(echo $(printf '%s\n' ${!var} | LC_COLLATE=C sort -u))
361 - if [[ ${sorted} != "${detected}" ]] ; then
362 - eerror "The ebuild needs to be kept in sync."
363 - eerror "${var}: ${sorted}"
364 - eerror "$(printf '%-*s' ${#var} configure): ${detected}"
365 - die "sync ${var} to the list of targets"
366 - fi
367 -
368 - popd >/dev/null
369 -}
370 -
371 -handle_locales() {
372 - # Make sure locale list is kept up-to-date.
373 - local detected sorted
374 - detected=$(echo $(cd po && printf '%s\n' *.po | grep -v messages.po | sed 's:.po$::' | sort -u))
375 - sorted=$(echo $(printf '%s\n' ${PLOCALES} | sort -u))
376 - if [[ ${sorted} != "${detected}" ]] ; then
377 - eerror "The ebuild needs to be kept in sync."
378 - eerror "PLOCALES: ${sorted}"
379 - eerror " po/*.po: ${detected}"
380 - die "sync PLOCALES"
381 - fi
382 -
383 - # Deal with selective install of locales.
384 - if use nls ; then
385 - # Delete locales the user does not want. #577814
386 - rm_loc() { rm po/$1.po || die; }
387 - l10n_for_each_disabled_locale_do rm_loc
388 - else
389 - # Cheap hack to disable gettext .mo generation.
390 - rm -f po/*.po
391 - fi
392 -}
393 -
394 -src_prepare() {
395 - check_targets IUSE_SOFTMMU_TARGETS softmmu
396 - check_targets IUSE_USER_TARGETS linux-user
397 -
398 - default
399 -
400 - # Fix ld and objcopy being called directly
401 - tc-export AR LD OBJCOPY
402 -
403 - # Verbose builds
404 - MAKEOPTS+=" V=1"
405 -
406 - # Run after we've applied all patches.
407 - handle_locales
408 -
409 - # Remove bundled copy of libfdt
410 - rm -r dtc || die
411 -}
412 -
413 -##
414 -# configures qemu based on the build directory and the build type
415 -# we are using.
416 -#
417 -qemu_src_configure() {
418 - debug-print-function ${FUNCNAME} "$@"
419 -
420 - local buildtype=$1
421 - local builddir="${S}/${buildtype}-build"
422 -
423 - mkdir "${builddir}"
424 -
425 - local conf_opts=(
426 - --prefix=/usr
427 - --sysconfdir=/etc
428 - --libdir=/usr/$(get_libdir)
429 - --docdir=/usr/share/doc/${PF}/html
430 - --disable-bsd-user
431 - --disable-guest-agent
432 - --disable-strip
433 - --disable-werror
434 - # We support gnutls/nettle for crypto operations. It is possible
435 - # to use gcrypt when gnutls/nettle are disabled (but not when they
436 - # are enabled), but it's not really worth the hassle. Disable it
437 - # all the time to avoid automatically detecting it. #568856
438 - --disable-gcrypt
439 - --python="${PYTHON}"
440 - --cc="$(tc-getCC)"
441 - --cxx="$(tc-getCXX)"
442 - --host-cc="$(tc-getBUILD_CC)"
443 - $(use_enable debug debug-info)
444 - $(use_enable debug debug-tcg)
445 - $(use_enable doc docs)
446 - $(use_enable tci tcg-interpreter)
447 - $(use_enable xattr attr)
448 - )
449 -
450 - # Disable options not used by user targets. This simplifies building
451 - # static user targets (USE=static-user) considerably.
452 - conf_notuser() {
453 - if [[ ${buildtype} == "user" ]] ; then
454 - echo "--disable-${2:-$1}"
455 - else
456 - use_enable "$@"
457 - fi
458 - }
459 - conf_opts+=(
460 - --disable-bluez
461 - $(conf_notuser accessibility brlapi)
462 - $(conf_notuser aio linux-aio)
463 - $(conf_notuser bzip2)
464 - $(conf_notuser capstone)
465 - $(conf_notuser caps cap-ng)
466 - $(conf_notuser curl)
467 - $(conf_notuser fdt)
468 - $(conf_notuser glusterfs)
469 - $(conf_notuser gnutls)
470 - $(conf_notuser gnutls nettle)
471 - $(conf_notuser gtk)
472 - $(conf_notuser infiniband rdma)
473 - $(conf_notuser iscsi libiscsi)
474 - $(conf_notuser jemalloc jemalloc)
475 - $(conf_notuser jpeg vnc-jpeg)
476 - $(conf_notuser kernel_linux kvm)
477 - $(conf_notuser lzo)
478 - $(conf_notuser ncurses curses)
479 - $(conf_notuser nfs libnfs)
480 - $(conf_notuser numa)
481 - $(conf_notuser opengl)
482 - $(conf_notuser png vnc-png)
483 - $(conf_notuser rbd)
484 - $(conf_notuser sasl vnc-sasl)
485 - $(conf_notuser sdl)
486 - $(conf_notuser seccomp)
487 - $(conf_notuser smartcard)
488 - $(conf_notuser snappy)
489 - $(conf_notuser spice)
490 - $(conf_notuser ssh libssh2)
491 - $(conf_notuser usb libusb)
492 - $(conf_notuser usbredir usb-redir)
493 - $(conf_notuser vde)
494 - $(conf_notuser vhost-net)
495 - $(conf_notuser virgl virglrenderer)
496 - $(conf_notuser virtfs)
497 - $(conf_notuser vnc)
498 - $(conf_notuser vte)
499 - $(conf_notuser xen)
500 - $(conf_notuser xen xen-pci-passthrough)
501 - $(conf_notuser xfs xfsctl)
502 - )
503 -
504 - if [[ ${buildtype} == "user" ]] ; then
505 - conf_opts+=( --disable-libxml2 )
506 - else
507 - conf_opts+=( --enable-libxml2 )
508 - fi
509 -
510 - if [[ ! ${buildtype} == "user" ]] ; then
511 - # audio options
512 - local audio_opts="oss"
513 - use alsa && audio_opts="alsa,${audio_opts}"
514 - use sdl && audio_opts="sdl,${audio_opts}"
515 - use pulseaudio && audio_opts="pa,${audio_opts}"
516 - conf_opts+=(
517 - --audio-drv-list="${audio_opts}"
518 - )
519 - fi
520 -
521 - case ${buildtype} in
522 - user)
523 - conf_opts+=(
524 - --enable-linux-user
525 - --disable-system
526 - --disable-blobs
527 - --disable-tools
528 - )
529 - local static_flag="static-user"
530 - ;;
531 - softmmu)
532 - conf_opts+=(
533 - --disable-linux-user
534 - --enable-system
535 - --disable-tools
536 - )
537 - local static_flag="static"
538 - ;;
539 - tools)
540 - conf_opts+=(
541 - --disable-linux-user
542 - --disable-system
543 - --disable-blobs
544 - --enable-tools
545 - )
546 - local static_flag="static"
547 - ;;
548 - esac
549 -
550 - local targets="${buildtype}_targets"
551 - [[ -n ${targets} ]] && conf_opts+=( --target-list="${!targets}" )
552 -
553 - # Add support for SystemTAP
554 - use systemtap && conf_opts+=( --enable-trace-backend=dtrace )
555 -
556 - # We always want to attempt to build with PIE support as it results
557 - # in a more secure binary. But it doesn't work with static or if
558 - # the current GCC doesn't have PIE support.
559 - if use ${static_flag}; then
560 - conf_opts+=( --static --disable-pie )
561 - else
562 - tc-enables-pie && conf_opts+=( --enable-pie )
563 - fi
564 -
565 - echo "../configure ${conf_opts[*]}"
566 - cd "${builddir}"
567 - ../configure "${conf_opts[@]}" || die "configure failed"
568 -
569 - # FreeBSD's kernel does not support QEMU assigning/grabbing
570 - # host USB devices yet
571 - use kernel_FreeBSD && \
572 - sed -i -E -e "s|^(HOST_USB=)bsd|\1stub|" "${S}"/config-host.mak
573 -}
574 -
575 -src_configure() {
576 - local target
577 -
578 - python_setup
579 -
580 - softmmu_targets= softmmu_bins=()
581 - user_targets= user_bins=()
582 -
583 - for target in ${IUSE_SOFTMMU_TARGETS} ; do
584 - if use "qemu_softmmu_targets_${target}"; then
585 - softmmu_targets+=",${target}-softmmu"
586 - softmmu_bins+=( "qemu-system-${target}" )
587 - fi
588 - done
589 -
590 - for target in ${IUSE_USER_TARGETS} ; do
591 - if use "qemu_user_targets_${target}"; then
592 - user_targets+=",${target}-linux-user"
593 - user_bins+=( "qemu-${target}" )
594 - fi
595 - done
596 -
597 - softmmu_targets=${softmmu_targets#,}
598 - user_targets=${user_targets#,}
599 -
600 - [[ -n ${softmmu_targets} ]] && qemu_src_configure "softmmu"
601 - [[ -n ${user_targets} ]] && qemu_src_configure "user"
602 - qemu_src_configure "tools"
603 -}
604 -
605 -src_compile() {
606 - if [[ -n ${user_targets} ]]; then
607 - cd "${S}/user-build"
608 - default
609 - fi
610 -
611 - if [[ -n ${softmmu_targets} ]]; then
612 - cd "${S}/softmmu-build"
613 - default
614 - fi
615 -
616 - cd "${S}/tools-build"
617 - default
618 -}
619 -
620 -src_test() {
621 - if [[ -n ${softmmu_targets} ]]; then
622 - cd "${S}/softmmu-build"
623 - pax-mark m */qemu-system-* #515550
624 - emake -j1 check
625 - emake -j1 check-report.html
626 - fi
627 -}
628 -
629 -qemu_python_install() {
630 - python_domodule "${S}/python/qemu/qmp.py"
631 -
632 - python_doscript "${S}/scripts/kvm/vmxcap"
633 - python_doscript "${S}/scripts/qmp/qmp-shell"
634 - python_doscript "${S}/scripts/qmp/qemu-ga-client"
635 -}
636 -
637 -# Generate binfmt support files.
638 -# - /etc/init.d/qemu-binfmt script which registers the user handlers (openrc)
639 -# - /usr/share/qemu/binfmt.d/qemu.conf (for use with systemd-binfmt)
640 -generate_initd() {
641 - local out="${T}/qemu-binfmt"
642 - local out_systemd="${T}/qemu.conf"
643 - local d="${T}/binfmt.d"
644 -
645 - einfo "Generating qemu binfmt scripts and configuration files"
646 -
647 - # Generate the debian fragments first.
648 - mkdir -p "${d}"
649 - "${S}"/scripts/qemu-binfmt-conf.sh \
650 - --debian \
651 - --exportdir "${d}" \
652 - --qemu-path "${EPREFIX}/usr/bin" \
653 - || die
654 - # Then turn the fragments into a shell script we can source.
655 - sed -E -i \
656 - -e 's:^([^ ]+) (.*)$:\1="\2":' \
657 - "${d}"/* || die
658 -
659 - # Generate the init.d script by assembling the fragments from above.
660 - local f qcpu package interpreter magic mask
661 - cat "${FILESDIR}"/qemu-binfmt.initd.head >"${out}" || die
662 - for f in "${d}"/qemu-* ; do
663 - source "${f}"
664 -
665 - # Normalize the cpu logic like we do in the init.d for the native cpu.
666 - qcpu=${package#qemu-}
667 - case ${qcpu} in
668 - arm*) qcpu="arm";;
669 - mips*) qcpu="mips";;
670 - ppc*) qcpu="ppc";;
671 - s390*) qcpu="s390";;
672 - sh*) qcpu="sh";;
673 - sparc*) qcpu="sparc";;
674 - esac
675 -
676 - # we use 'printf' here to be portable across 'sh'
677 - # implementations: #679168
678 - cat <<EOF >>"${out}"
679 - if [ "\${cpu}" != "${qcpu}" -a -x "${interpreter}" ] ; then
680 - printf '%s\n' ':${package}:M::${magic}:${mask}:${interpreter}:'"\${QEMU_BINFMT_FLAGS}" >/proc/sys/fs/binfmt_misc/register
681 - fi
682 -EOF
683 -
684 - echo ":${package}:M::${magic}:${mask}:${interpreter}:OC" >>"${out_systemd}"
685 -
686 - done
687 - cat "${FILESDIR}"/qemu-binfmt.initd.tail >>"${out}" || die
688 -}
689 -
690 -src_install() {
691 - if [[ -n ${user_targets} ]]; then
692 - cd "${S}/user-build"
693 - emake DESTDIR="${ED}" install
694 -
695 - # Install binfmt handler init script for user targets.
696 - generate_initd
697 - doinitd "${T}/qemu-binfmt"
698 -
699 - # Install binfmt/qemu.conf.
700 - insinto "/usr/share/qemu/binfmt.d"
701 - doins "${T}/qemu.conf"
702 - fi
703 -
704 - if [[ -n ${softmmu_targets} ]]; then
705 - cd "${S}/softmmu-build"
706 - emake DESTDIR="${ED}" install
707 -
708 - # This might not exist if the test failed. #512010
709 - [[ -e check-report.html ]] && dodoc check-report.html
710 -
711 - if use kernel_linux; then
712 - udev_newrules "${FILESDIR}"/65-kvm.rules-r1 65-kvm.rules
713 - fi
714 -
715 - if use python; then
716 - python_foreach_impl qemu_python_install
717 - fi
718 - fi
719 -
720 - cd "${S}/tools-build"
721 - emake DESTDIR="${ED}" install
722 -
723 - # Disable mprotect on the qemu binaries as they use JITs to be fast #459348
724 - pushd "${ED}"/usr/bin >/dev/null
725 - pax-mark mr "${softmmu_bins[@]}" "${user_bins[@]}" # bug 575594
726 - popd >/dev/null
727 -
728 - # Install config file example for qemu-bridge-helper
729 - insinto "/etc/qemu"
730 - doins "${FILESDIR}/bridge.conf"
731 -
732 - cd "${S}"
733 - dodoc Changelog MAINTAINERS docs/specs/pci-ids.txt
734 - newdoc pc-bios/README README.pc-bios
735 -
736 - # Disallow stripping of prebuilt firmware files.
737 - dostrip -x ${QA_PREBUILT}
738 -
739 - if [[ -n ${softmmu_targets} ]]; then
740 - # Remove SeaBIOS since we're using the SeaBIOS packaged one
741 - rm "${ED}/usr/share/qemu/bios.bin"
742 - rm "${ED}/usr/share/qemu/bios-256k.bin"
743 - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
744 - dosym ../seabios/bios.bin /usr/share/qemu/bios.bin
745 - dosym ../seabios/bios-256k.bin /usr/share/qemu/bios-256k.bin
746 - fi
747 -
748 - # Remove vgabios since we're using the seavgabios packaged one
749 - rm "${ED}/usr/share/qemu/vgabios.bin"
750 - rm "${ED}/usr/share/qemu/vgabios-cirrus.bin"
751 - rm "${ED}/usr/share/qemu/vgabios-qxl.bin"
752 - rm "${ED}/usr/share/qemu/vgabios-stdvga.bin"
753 - rm "${ED}/usr/share/qemu/vgabios-virtio.bin"
754 - rm "${ED}/usr/share/qemu/vgabios-vmware.bin"
755 - # PPC64 loads vgabios-stdvga
756 - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386 || use qemu_softmmu_targets_ppc64; then
757 - dosym ../seavgabios/vgabios-isavga.bin /usr/share/qemu/vgabios.bin
758 - dosym ../seavgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin
759 - dosym ../seavgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin
760 - dosym ../seavgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin
761 - dosym ../seavgabios/vgabios-virtio.bin /usr/share/qemu/vgabios-virtio.bin
762 - dosym ../seavgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin
763 - fi
764 -
765 - # Remove sgabios since we're using the sgabios packaged one
766 - rm "${ED}/usr/share/qemu/sgabios.bin"
767 - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
768 - dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin
769 - fi
770 -
771 - # Remove iPXE since we're using the iPXE packaged one
772 - rm "${ED}"/usr/share/qemu/pxe-*.rom
773 - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
774 - dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom
775 - dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom
776 - dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom
777 - dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom
778 - dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom
779 - dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom
780 - fi
781 - fi
782 -
783 - DISABLE_AUTOFORMATTING=true
784 - readme.gentoo_create_doc
785 -}
786 -
787 -firmware_abi_change() {
788 - local pv
789 - for pv in ${REPLACING_VERSIONS}; do
790 - if ver_test $pv -lt ${FIRMWARE_ABI_VERSION}; then
791 - return 0
792 - fi
793 - done
794 - return 1
795 -}
796 -
797 -pkg_postinst() {
798 - if [[ -n ${softmmu_targets} ]] && use kernel_linux; then
799 - udev_reload
800 - fi
801 -
802 - xdg_icon_cache_update
803 -
804 - [[ -z ${EPREFIX} ]] && [[ -f ${EROOT}/usr/libexec/qemu-bridge-helper ]] && \
805 - fcaps cap_net_admin ${EROOT}/usr/libexec/qemu-bridge-helper
806 -
807 - DISABLE_AUTOFORMATTING=true
808 - readme.gentoo_print_elog
809 -
810 - if use pin-upstream-blobs && firmware_abi_change; then
811 - ewarn "This version of qemu pins new versions of firmware blobs:"
812 - ewarn " $(best_version sys-firmware/edk2-ovmf)"
813 - ewarn " $(best_version sys-firmware/ipxe)"
814 - ewarn " $(best_version sys-firmware/seabios)"
815 - ewarn " $(best_version sys-firmware/sgabios)"
816 - ewarn "This might break resume of hibernated guests (started with a different"
817 - ewarn "firmware version) and live migration to/from qemu versions with different"
818 - ewarn "firmware. Please (cold) restart all running guests. For functional"
819 - ewarn "guest migration ensure that all"
820 - ewarn "hosts run at least"
821 - ewarn " app-emulation/qemu-${FIRMWARE_ABI_VERSION}."
822 - fi
823 -}
824 -
825 -pkg_info() {
826 - echo "Using:"
827 - echo " $(best_version app-emulation/spice-protocol)"
828 - echo " $(best_version sys-firmware/edk2-ovmf)"
829 - if has_version 'sys-firmware/edk2-ovmf[binary]'; then
830 - echo " USE=binary"
831 - else
832 - echo " USE=''"
833 - fi
834 - echo " $(best_version sys-firmware/ipxe)"
835 - echo " $(best_version sys-firmware/seabios)"
836 - if has_version 'sys-firmware/seabios[binary]'; then
837 - echo " USE=binary"
838 - else
839 - echo " USE=''"
840 - fi
841 - echo " $(best_version sys-firmware/sgabios)"
842 -}
843 -
844 -pkg_postrm() {
845 - xdg_icon_cache_update
846 -}
847
848 diff --git a/app-emulation/qemu/qemu-4.1.0-r1.ebuild b/app-emulation/qemu/qemu-4.1.0-r1.ebuild
849 deleted file mode 100644
850 index 5d1ea22df8d..00000000000
851 --- a/app-emulation/qemu/qemu-4.1.0-r1.ebuild
852 +++ /dev/null
853 @@ -1,825 +0,0 @@
854 -# Copyright 1999-2020 Gentoo Authors
855 -# Distributed under the terms of the GNU General Public License v2
856 -
857 -EAPI="7"
858 -
859 -PYTHON_COMPAT=( python{3_6,3_7} )
860 -PYTHON_REQ_USE="ncurses,readline"
861 -
862 -PLOCALES="bg de_DE fr_FR hu it tr zh_CN"
863 -
864 -FIRMWARE_ABI_VERSION="4.0.0-r50"
865 -
866 -inherit eutils linux-info toolchain-funcs multilib python-r1 \
867 - udev fcaps readme.gentoo-r1 pax-utils l10n xdg-utils
868 -
869 -if [[ ${PV} = *9999* ]]; then
870 - EGIT_REPO_URI="https://git.qemu.org/git/qemu.git"
871 - EGIT_SUBMODULES=(
872 - slirp
873 - tests/fp/berkeley-{test,soft}float-3
874 - ui/keycodemapdb
875 - )
876 - inherit git-r3
877 - SRC_URI=""
878 -else
879 - SRC_URI="https://download.qemu.org/${P}.tar.xz"
880 - KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~x86"
881 -fi
882 -
883 -DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools"
884 -HOMEPAGE="http://www.qemu.org http://www.linux-kvm.org"
885 -
886 -LICENSE="GPL-2 LGPL-2 BSD-2"
887 -SLOT="0"
888 -
889 -IUSE="accessibility +aio alsa bzip2 capstone +caps +curl debug doc
890 - +fdt glusterfs gnutls gtk infiniband iscsi jemalloc +jpeg kernel_linux
891 - kernel_FreeBSD lzo ncurses nfs nls numa opengl +oss +pin-upstream-blobs
892 - +png pulseaudio python rbd sasl +seccomp sdl selinux smartcard snappy
893 - spice ssh static static-user systemtap tci test usb usbredir vde
894 - +vhost-net virgl virtfs +vnc vte xattr xen xfs +xkb"
895 -
896 -COMMON_TARGETS="aarch64 alpha arm cris hppa i386 m68k microblaze microblazeel
897 - mips mips64 mips64el mipsel nios2 or1k ppc ppc64 riscv32 riscv64 s390x
898 - sh4 sh4eb sparc sparc64 x86_64 xtensa xtensaeb"
899 -IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS}
900 - lm32 moxie tricore unicore32"
901 -IUSE_USER_TARGETS="${COMMON_TARGETS}
902 - aarch64_be armeb mipsn32 mipsn32el ppc64abi32 ppc64le sparc32plus
903 - tilegx"
904 -
905 -use_softmmu_targets=$(printf ' qemu_softmmu_targets_%s' ${IUSE_SOFTMMU_TARGETS})
906 -use_user_targets=$(printf ' qemu_user_targets_%s' ${IUSE_USER_TARGETS})
907 -IUSE+=" ${use_softmmu_targets} ${use_user_targets}"
908 -
909 -RESTRICT="!test? ( test )"
910 -# Allow no targets to be built so that people can get a tools-only build.
911 -# Block USE flag configurations known to not work.
912 -REQUIRED_USE="${PYTHON_REQUIRED_USE}
913 - qemu_softmmu_targets_arm? ( fdt )
914 - qemu_softmmu_targets_microblaze? ( fdt )
915 - qemu_softmmu_targets_mips64el? ( fdt )
916 - qemu_softmmu_targets_ppc64? ( fdt )
917 - qemu_softmmu_targets_ppc? ( fdt )
918 - qemu_softmmu_targets_riscv32? ( fdt )
919 - qemu_softmmu_targets_riscv64? ( fdt )
920 - static? ( static-user !alsa !gtk !opengl !pulseaudio !rbd !snappy )
921 - virtfs? ( xattr )
922 - vte? ( gtk )"
923 -
924 -# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...)
925 -# and user/softmmu targets (qemu-*, qemu-system-*).
926 -#
927 -# Yep, you need both libcap and libcap-ng since virtfs only uses libcap.
928 -#
929 -# The attr lib isn't always linked in (although the USE flag is always
930 -# respected). This is because qemu supports using the C library's API
931 -# when available rather than always using the external library.
932 -ALL_DEPEND="
933 - >=dev-libs/glib-2.0[static-libs(+)]
934 - sys-libs/zlib[static-libs(+)]
935 - python? ( ${PYTHON_DEPS} )
936 - systemtap? ( dev-util/systemtap )
937 - xattr? ( sys-apps/attr[static-libs(+)] )"
938 -
939 -# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...)
940 -# softmmu targets (qemu-system-*).
941 -SOFTMMU_TOOLS_DEPEND="
942 - dev-libs/libxml2[static-libs(+)]
943 - xkb? ( x11-libs/libxkbcommon[static-libs(+)] )
944 - >=x11-libs/pixman-0.28.0[static-libs(+)]
945 - accessibility? (
946 - app-accessibility/brltty[api]
947 - app-accessibility/brltty[static-libs(+)]
948 - )
949 - aio? ( dev-libs/libaio[static-libs(+)] )
950 - alsa? ( >=media-libs/alsa-lib-1.0.13 )
951 - bzip2? ( app-arch/bzip2[static-libs(+)] )
952 - capstone? ( dev-libs/capstone:= )
953 - caps? ( sys-libs/libcap-ng[static-libs(+)] )
954 - curl? ( >=net-misc/curl-7.15.4[static-libs(+)] )
955 - fdt? ( >=sys-apps/dtc-1.5.0[static-libs(+)] )
956 - glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] )
957 - gnutls? (
958 - dev-libs/nettle:=[static-libs(+)]
959 - >=net-libs/gnutls-3.0:=[static-libs(+)]
960 - )
961 - gtk? (
962 - x11-libs/gtk+:3
963 - vte? ( x11-libs/vte:2.91 )
964 - )
965 - infiniband? (
966 - sys-fabric/libibumad:=[static-libs(+)]
967 - sys-fabric/libibverbs:=[static-libs(+)]
968 - sys-fabric/librdmacm:=[static-libs(+)]
969 - )
970 - iscsi? ( net-libs/libiscsi )
971 - jemalloc? ( dev-libs/jemalloc )
972 - jpeg? ( virtual/jpeg:0=[static-libs(+)] )
973 - lzo? ( dev-libs/lzo:2[static-libs(+)] )
974 - ncurses? (
975 - sys-libs/ncurses:0=[unicode]
976 - sys-libs/ncurses:0=[static-libs(+)]
977 - )
978 - nfs? ( >=net-fs/libnfs-1.9.3:=[static-libs(+)] )
979 - numa? ( sys-process/numactl[static-libs(+)] )
980 - opengl? (
981 - virtual/opengl
982 - media-libs/libepoxy[static-libs(+)]
983 - media-libs/mesa[static-libs(+)]
984 - media-libs/mesa[egl,gbm]
985 - )
986 - png? ( media-libs/libpng:0=[static-libs(+)] )
987 - pulseaudio? ( media-sound/pulseaudio )
988 - rbd? ( sys-cluster/ceph )
989 - sasl? ( dev-libs/cyrus-sasl[static-libs(+)] )
990 - sdl? (
991 - media-libs/libsdl2[X]
992 - media-libs/libsdl2[static-libs(+)]
993 - )
994 - seccomp? ( >=sys-libs/libseccomp-2.1.0[static-libs(+)] )
995 - smartcard? ( >=app-emulation/libcacard-2.5.0[static-libs(+)] )
996 - snappy? ( app-arch/snappy:= )
997 - spice? (
998 - >=app-emulation/spice-protocol-0.12.3
999 - >=app-emulation/spice-0.12.0[static-libs(+)]
1000 - )
1001 - ssh? ( >=net-libs/libssh-0.8.6[static-libs(+)] )
1002 - usb? ( >=virtual/libusb-1-r2[static-libs(+)] )
1003 - usbredir? ( >=sys-apps/usbredir-0.6[static-libs(+)] )
1004 - vde? ( net-misc/vde[static-libs(+)] )
1005 - virgl? ( media-libs/virglrenderer[static-libs(+)] )
1006 - virtfs? ( sys-libs/libcap )
1007 - xen? ( app-emulation/xen-tools:= )
1008 - xfs? ( sys-fs/xfsprogs[static-libs(+)] )"
1009 -
1010 -X86_FIRMWARE_DEPEND="
1011 - pin-upstream-blobs? (
1012 - ~sys-firmware/edk2-ovmf-201905[binary]
1013 - ~sys-firmware/ipxe-1.0.0_p20190728[binary]
1014 - ~sys-firmware/seabios-1.12.0[binary,seavgabios]
1015 - ~sys-firmware/sgabios-0.1_pre8[binary]
1016 - )
1017 - !pin-upstream-blobs? (
1018 - sys-firmware/edk2-ovmf
1019 - sys-firmware/ipxe
1020 - >=sys-firmware/seabios-1.10.2[seavgabios]
1021 - sys-firmware/sgabios
1022 - )"
1023 -PPC64_FIRMWARE_DEPEND="
1024 - pin-upstream-blobs? (
1025 - ~sys-firmware/seabios-1.12.0[binary,seavgabios]
1026 - )
1027 - !pin-upstream-blobs? (
1028 - >=sys-firmware/seabios-1.10.2[seavgabios]
1029 - )
1030 -"
1031 -
1032 -BDEPEND="
1033 - $(python_gen_impl_dep)
1034 - dev-lang/perl
1035 - sys-apps/texinfo
1036 - virtual/pkgconfig
1037 - doc? ( dev-python/sphinx )
1038 - gtk? ( nls? ( sys-devel/gettext ) )
1039 - test? (
1040 - dev-libs/glib[utils]
1041 - sys-devel/bc
1042 - )
1043 -"
1044 -CDEPEND="
1045 - !static? (
1046 - ${ALL_DEPEND//\[static-libs(+)]}
1047 - ${SOFTMMU_TOOLS_DEPEND//\[static-libs(+)]}
1048 - )
1049 - qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} )
1050 - qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} )
1051 - qemu_softmmu_targets_ppc64? ( ${PPC64_FIRMWARE_DEPEND} )
1052 -"
1053 -DEPEND="${CDEPEND}
1054 - kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 )
1055 - static? (
1056 - ${ALL_DEPEND}
1057 - ${SOFTMMU_TOOLS_DEPEND}
1058 - )
1059 - static-user? ( ${ALL_DEPEND} )"
1060 -RDEPEND="${CDEPEND}
1061 - acct-group/kvm
1062 - selinux? ( sec-policy/selinux-qemu )"
1063 -
1064 -PATCHES=(
1065 - "${FILESDIR}"/${PN}-2.5.0-cflags.patch
1066 - "${FILESDIR}"/${PN}-2.5.0-sysmacros.patch
1067 - "${FILESDIR}"/${PN}-2.11.1-capstone_include_path.patch
1068 - "${FILESDIR}"/${PN}-4.0.0-sanitize-interp_info.patch
1069 - "${FILESDIR}"/${PN}-4.0.0-mkdir_systemtap.patch #684902
1070 - "${FILESDIR}"/${PN}-4.0.0-xkbcommon.patch
1071 -)
1072 -
1073 -QA_PREBUILT="
1074 - usr/share/qemu/hppa-firmware.img
1075 - usr/share/qemu/openbios-ppc
1076 - usr/share/qemu/openbios-sparc64
1077 - usr/share/qemu/openbios-sparc32
1078 - usr/share/qemu/palcode-clipper
1079 - usr/share/qemu/s390-ccw.img
1080 - usr/share/qemu/s390-netboot.img
1081 - usr/share/qemu/u-boot.e500"
1082 -
1083 -QA_WX_LOAD="usr/bin/qemu-i386
1084 - usr/bin/qemu-x86_64
1085 - usr/bin/qemu-alpha
1086 - usr/bin/qemu-arm
1087 - usr/bin/qemu-cris
1088 - usr/bin/qemu-m68k
1089 - usr/bin/qemu-microblaze
1090 - usr/bin/qemu-microblazeel
1091 - usr/bin/qemu-mips
1092 - usr/bin/qemu-mipsel
1093 - usr/bin/qemu-or1k
1094 - usr/bin/qemu-ppc
1095 - usr/bin/qemu-ppc64
1096 - usr/bin/qemu-ppc64abi32
1097 - usr/bin/qemu-sh4
1098 - usr/bin/qemu-sh4eb
1099 - usr/bin/qemu-sparc
1100 - usr/bin/qemu-sparc64
1101 - usr/bin/qemu-armeb
1102 - usr/bin/qemu-sparc32plus
1103 - usr/bin/qemu-s390x
1104 - usr/bin/qemu-unicore32"
1105 -
1106 -DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure you have the
1107 -kernel module loaded before running kvm. The easiest way to ensure that the
1108 -kernel module is loaded is to load it on boot.
1109 - For AMD CPUs the module is called 'kvm-amd'.
1110 - For Intel CPUs the module is called 'kvm-intel'.
1111 -Please review /etc/conf.d/modules for how to load these.
1112 -
1113 -Make sure your user is in the 'kvm' group. Just run
1114 - $ gpasswd -a <USER> kvm
1115 -then have <USER> re-login.
1116 -
1117 -For brand new installs, the default permissions on /dev/kvm might not let
1118 -you access it. You can tell udev to reset ownership/perms:
1119 - $ udevadm trigger -c add /dev/kvm
1120 -
1121 -If you want to register binfmt handlers for qemu user targets:
1122 -For openrc:
1123 - # rc-update add qemu-binfmt
1124 -For systemd:
1125 - # ln -s /usr/share/qemu/binfmt.d/qemu.conf /etc/binfmt.d/qemu.conf"
1126 -
1127 -pkg_pretend() {
1128 - if use kernel_linux && kernel_is lt 2 6 25; then
1129 - eerror "This version of KVM requres a host kernel of 2.6.25 or higher."
1130 - elif use kernel_linux; then
1131 - if ! linux_config_exists; then
1132 - eerror "Unable to check your kernel for KVM support"
1133 - else
1134 - CONFIG_CHECK="~KVM ~TUN ~BRIDGE"
1135 - ERROR_KVM="You must enable KVM in your kernel to continue"
1136 - ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in"
1137 - ERROR_KVM_AMD+=" your kernel configuration."
1138 - ERROR_KVM_INTEL="If you have an Intel CPU, you must enable"
1139 - ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration."
1140 - ERROR_TUN="You will need the Universal TUN/TAP driver compiled"
1141 - ERROR_TUN+=" into your kernel or loaded as a module to use the"
1142 - ERROR_TUN+=" virtual network device if using -net tap."
1143 - ERROR_BRIDGE="You will also need support for 802.1d"
1144 - ERROR_BRIDGE+=" Ethernet Bridging for some network configurations."
1145 - use vhost-net && CONFIG_CHECK+=" ~VHOST_NET"
1146 - ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net"
1147 - ERROR_VHOST_NET+=" support"
1148 -
1149 - if use amd64 || use x86 || use amd64-linux || use x86-linux; then
1150 - if grep -q AuthenticAMD /proc/cpuinfo; then
1151 - CONFIG_CHECK+=" ~KVM_AMD"
1152 - elif grep -q GenuineIntel /proc/cpuinfo; then
1153 - CONFIG_CHECK+=" ~KVM_INTEL"
1154 - fi
1155 - fi
1156 -
1157 - use python && CONFIG_CHECK+=" ~DEBUG_FS"
1158 - ERROR_DEBUG_FS="debugFS support required for kvm_stat"
1159 -
1160 - # Now do the actual checks setup above
1161 - check_extra_config
1162 - fi
1163 - fi
1164 -
1165 - if grep -qs '/usr/bin/qemu-kvm' "${EROOT}"/etc/libvirt/qemu/*.xml; then
1166 - eerror "The kvm/qemu-kvm wrappers no longer exist, but your libvirt"
1167 - eerror "instances are still pointing to it. Please update your"
1168 - eerror "configs in /etc/libvirt/qemu/ to use the -enable-kvm flag"
1169 - eerror "and the right system binary (e.g. qemu-system-x86_64)."
1170 - die "update your virt configs to not use qemu-kvm"
1171 - fi
1172 -}
1173 -
1174 -# Sanity check to make sure target lists are kept up-to-date.
1175 -check_targets() {
1176 - local var=$1 mak=$2
1177 - local detected sorted
1178 -
1179 - pushd "${S}"/default-configs >/dev/null || die
1180 -
1181 - # Force C locale until glibc is updated. #564936
1182 - detected=$(echo $(printf '%s\n' *-${mak}.mak | sed "s:-${mak}.mak::" | LC_COLLATE=C sort -u))
1183 - sorted=$(echo $(printf '%s\n' ${!var} | LC_COLLATE=C sort -u))
1184 - if [[ ${sorted} != "${detected}" ]] ; then
1185 - eerror "The ebuild needs to be kept in sync."
1186 - eerror "${var}: ${sorted}"
1187 - eerror "$(printf '%-*s' ${#var} configure): ${detected}"
1188 - die "sync ${var} to the list of targets"
1189 - fi
1190 -
1191 - popd >/dev/null
1192 -}
1193 -
1194 -handle_locales() {
1195 - # Make sure locale list is kept up-to-date.
1196 - local detected sorted
1197 - detected=$(echo $(cd po && printf '%s\n' *.po | grep -v messages.po | sed 's:.po$::' | sort -u))
1198 - sorted=$(echo $(printf '%s\n' ${PLOCALES} | sort -u))
1199 - if [[ ${sorted} != "${detected}" ]] ; then
1200 - eerror "The ebuild needs to be kept in sync."
1201 - eerror "PLOCALES: ${sorted}"
1202 - eerror " po/*.po: ${detected}"
1203 - die "sync PLOCALES"
1204 - fi
1205 -
1206 - # Deal with selective install of locales.
1207 - if use nls ; then
1208 - # Delete locales the user does not want. #577814
1209 - rm_loc() { rm po/$1.po || die; }
1210 - l10n_for_each_disabled_locale_do rm_loc
1211 - else
1212 - # Cheap hack to disable gettext .mo generation.
1213 - rm -f po/*.po
1214 - fi
1215 -}
1216 -
1217 -src_prepare() {
1218 - check_targets IUSE_SOFTMMU_TARGETS softmmu
1219 - check_targets IUSE_USER_TARGETS linux-user
1220 -
1221 - default
1222 -
1223 - # Use correct toolchain to fix cross-compiling
1224 - tc-export AR LD NM OBJCOPY PKG_CONFIG
1225 - export WINDRES=${CHOST}-windres
1226 -
1227 - # Verbose builds
1228 - MAKEOPTS+=" V=1"
1229 -
1230 - # Run after we've applied all patches.
1231 - handle_locales
1232 -
1233 - # Remove bundled copy of libfdt
1234 - rm -r dtc || die
1235 -}
1236 -
1237 -##
1238 -# configures qemu based on the build directory and the build type
1239 -# we are using.
1240 -#
1241 -qemu_src_configure() {
1242 - debug-print-function ${FUNCNAME} "$@"
1243 -
1244 - local buildtype=$1
1245 - local builddir="${S}/${buildtype}-build"
1246 -
1247 - mkdir "${builddir}"
1248 -
1249 - local conf_opts=(
1250 - --prefix=/usr
1251 - --sysconfdir=/etc
1252 - --bindir=/usr/bin
1253 - --libdir=/usr/$(get_libdir)
1254 - --datadir=/usr/share
1255 - --docdir=/usr/share/doc/${PF}/html
1256 - --mandir=/usr/share/man
1257 - --with-confsuffix=/qemu
1258 - --localstatedir=/var
1259 - --disable-bsd-user
1260 - --disable-guest-agent
1261 - --disable-strip
1262 - --disable-werror
1263 - # We support gnutls/nettle for crypto operations. It is possible
1264 - # to use gcrypt when gnutls/nettle are disabled (but not when they
1265 - # are enabled), but it's not really worth the hassle. Disable it
1266 - # all the time to avoid automatically detecting it. #568856
1267 - --disable-gcrypt
1268 - --python="${PYTHON}"
1269 - --cc="$(tc-getCC)"
1270 - --cxx="$(tc-getCXX)"
1271 - --host-cc="$(tc-getBUILD_CC)"
1272 - $(use_enable debug debug-info)
1273 - $(use_enable debug debug-tcg)
1274 - $(use_enable doc docs)
1275 - $(use_enable tci tcg-interpreter)
1276 - $(use_enable xattr attr)
1277 - )
1278 -
1279 - # Disable options not used by user targets. This simplifies building
1280 - # static user targets (USE=static-user) considerably.
1281 - conf_notuser() {
1282 - if [[ ${buildtype} == "user" ]] ; then
1283 - echo "--disable-${2:-$1}"
1284 - else
1285 - use_enable "$@"
1286 - fi
1287 - }
1288 - conf_opts+=(
1289 - --disable-bluez
1290 - $(conf_notuser accessibility brlapi)
1291 - $(conf_notuser aio linux-aio)
1292 - $(conf_notuser bzip2)
1293 - $(conf_notuser capstone)
1294 - $(conf_notuser caps cap-ng)
1295 - $(conf_notuser curl)
1296 - $(conf_notuser fdt)
1297 - $(conf_notuser glusterfs)
1298 - $(conf_notuser gnutls)
1299 - $(conf_notuser gnutls nettle)
1300 - $(conf_notuser gtk)
1301 - $(conf_notuser infiniband rdma)
1302 - $(conf_notuser iscsi libiscsi)
1303 - $(conf_notuser jemalloc jemalloc)
1304 - $(conf_notuser jpeg vnc-jpeg)
1305 - $(conf_notuser kernel_linux kvm)
1306 - $(conf_notuser lzo)
1307 - $(conf_notuser ncurses curses)
1308 - $(conf_notuser nfs libnfs)
1309 - $(conf_notuser numa)
1310 - $(conf_notuser opengl)
1311 - $(conf_notuser png vnc-png)
1312 - $(conf_notuser rbd)
1313 - $(conf_notuser sasl vnc-sasl)
1314 - $(conf_notuser sdl)
1315 - $(conf_notuser seccomp)
1316 - $(conf_notuser smartcard)
1317 - $(conf_notuser snappy)
1318 - $(conf_notuser spice)
1319 - $(conf_notuser ssh libssh)
1320 - $(conf_notuser usb libusb)
1321 - $(conf_notuser usbredir usb-redir)
1322 - $(conf_notuser vde)
1323 - $(conf_notuser vhost-net)
1324 - $(conf_notuser virgl virglrenderer)
1325 - $(conf_notuser virtfs)
1326 - $(conf_notuser vnc)
1327 - $(conf_notuser vte)
1328 - $(conf_notuser xen)
1329 - $(conf_notuser xen xen-pci-passthrough)
1330 - $(conf_notuser xfs xfsctl)
1331 - $(conf_notuser xkb xkbcommon)
1332 - )
1333 -
1334 - if [[ ${buildtype} == "user" ]] ; then
1335 - conf_opts+=( --disable-libxml2 )
1336 - else
1337 - conf_opts+=( --enable-libxml2 )
1338 - fi
1339 -
1340 - if [[ ! ${buildtype} == "user" ]] ; then
1341 - # audio options
1342 - local audio_opts=(
1343 - $(usev alsa)
1344 - $(usev oss)
1345 - $(usev sdl)
1346 - $(usex pulseaudio pa "")
1347 - )
1348 - conf_opts+=(
1349 - --audio-drv-list=$(printf "%s," "${audio_opts[@]}")
1350 - )
1351 - fi
1352 -
1353 - case ${buildtype} in
1354 - user)
1355 - conf_opts+=(
1356 - --enable-linux-user
1357 - --disable-system
1358 - --disable-blobs
1359 - --disable-tools
1360 - )
1361 - local static_flag="static-user"
1362 - ;;
1363 - softmmu)
1364 - conf_opts+=(
1365 - --disable-linux-user
1366 - --enable-system
1367 - --disable-tools
1368 - )
1369 - local static_flag="static"
1370 - ;;
1371 - tools)
1372 - conf_opts+=(
1373 - --disable-linux-user
1374 - --disable-system
1375 - --disable-blobs
1376 - --enable-tools
1377 - )
1378 - local static_flag="static"
1379 - ;;
1380 - esac
1381 -
1382 - local targets="${buildtype}_targets"
1383 - [[ -n ${targets} ]] && conf_opts+=( --target-list="${!targets}" )
1384 -
1385 - # Add support for SystemTAP
1386 - use systemtap && conf_opts+=( --enable-trace-backend=dtrace )
1387 -
1388 - # We always want to attempt to build with PIE support as it results
1389 - # in a more secure binary. But it doesn't work with static or if
1390 - # the current GCC doesn't have PIE support.
1391 - if use ${static_flag}; then
1392 - conf_opts+=( --static --disable-pie )
1393 - else
1394 - tc-enables-pie && conf_opts+=( --enable-pie )
1395 - fi
1396 -
1397 - echo "../configure ${conf_opts[*]}"
1398 - cd "${builddir}"
1399 - ../configure "${conf_opts[@]}" || die "configure failed"
1400 -
1401 - # FreeBSD's kernel does not support QEMU assigning/grabbing
1402 - # host USB devices yet
1403 - use kernel_FreeBSD && \
1404 - sed -i -E -e "s|^(HOST_USB=)bsd|\1stub|" "${S}"/config-host.mak
1405 -}
1406 -
1407 -src_configure() {
1408 - local target
1409 -
1410 - python_setup
1411 -
1412 - softmmu_targets= softmmu_bins=()
1413 - user_targets= user_bins=()
1414 -
1415 - for target in ${IUSE_SOFTMMU_TARGETS} ; do
1416 - if use "qemu_softmmu_targets_${target}"; then
1417 - softmmu_targets+=",${target}-softmmu"
1418 - softmmu_bins+=( "qemu-system-${target}" )
1419 - fi
1420 - done
1421 -
1422 - for target in ${IUSE_USER_TARGETS} ; do
1423 - if use "qemu_user_targets_${target}"; then
1424 - user_targets+=",${target}-linux-user"
1425 - user_bins+=( "qemu-${target}" )
1426 - fi
1427 - done
1428 -
1429 - softmmu_targets=${softmmu_targets#,}
1430 - user_targets=${user_targets#,}
1431 -
1432 - [[ -n ${softmmu_targets} ]] && qemu_src_configure "softmmu"
1433 - [[ -n ${user_targets} ]] && qemu_src_configure "user"
1434 - qemu_src_configure "tools"
1435 -}
1436 -
1437 -src_compile() {
1438 - if [[ -n ${user_targets} ]]; then
1439 - cd "${S}/user-build"
1440 - default
1441 - fi
1442 -
1443 - if [[ -n ${softmmu_targets} ]]; then
1444 - cd "${S}/softmmu-build"
1445 - default
1446 - fi
1447 -
1448 - cd "${S}/tools-build"
1449 - default
1450 -}
1451 -
1452 -src_test() {
1453 - if [[ -n ${softmmu_targets} ]]; then
1454 - cd "${S}/softmmu-build"
1455 - pax-mark m */qemu-system-* #515550
1456 - emake -j1 check
1457 - emake -j1 check-report.html
1458 - fi
1459 -}
1460 -
1461 -qemu_python_install() {
1462 - python_domodule "${S}/python/qemu"
1463 -
1464 - python_doscript "${S}/scripts/kvm/vmxcap"
1465 - python_doscript "${S}/scripts/qmp/qmp-shell"
1466 - python_doscript "${S}/scripts/qmp/qemu-ga-client"
1467 -}
1468 -
1469 -# Generate binfmt support files.
1470 -# - /etc/init.d/qemu-binfmt script which registers the user handlers (openrc)
1471 -# - /usr/share/qemu/binfmt.d/qemu.conf (for use with systemd-binfmt)
1472 -generate_initd() {
1473 - local out="${T}/qemu-binfmt"
1474 - local out_systemd="${T}/qemu.conf"
1475 - local d="${T}/binfmt.d"
1476 -
1477 - einfo "Generating qemu binfmt scripts and configuration files"
1478 -
1479 - # Generate the debian fragments first.
1480 - mkdir -p "${d}"
1481 - "${S}"/scripts/qemu-binfmt-conf.sh \
1482 - --debian \
1483 - --exportdir "${d}" \
1484 - --qemu-path "${EPREFIX}/usr/bin" \
1485 - || die
1486 - # Then turn the fragments into a shell script we can source.
1487 - sed -E -i \
1488 - -e 's:^([^ ]+) (.*)$:\1="\2":' \
1489 - "${d}"/* || die
1490 -
1491 - # Generate the init.d script by assembling the fragments from above.
1492 - local f qcpu package interpreter magic mask
1493 - cat "${FILESDIR}"/qemu-binfmt.initd.head >"${out}" || die
1494 - for f in "${d}"/qemu-* ; do
1495 - source "${f}"
1496 -
1497 - # Normalize the cpu logic like we do in the init.d for the native cpu.
1498 - qcpu=${package#qemu-}
1499 - case ${qcpu} in
1500 - arm*) qcpu="arm";;
1501 - mips*) qcpu="mips";;
1502 - ppc*) qcpu="ppc";;
1503 - s390*) qcpu="s390";;
1504 - sh*) qcpu="sh";;
1505 - sparc*) qcpu="sparc";;
1506 - esac
1507 -
1508 - # we use 'printf' here to be portable across 'sh'
1509 - # implementations: #679168
1510 - cat <<EOF >>"${out}"
1511 - if [ "\${cpu}" != "${qcpu}" -a -x "${interpreter}" ] ; then
1512 - printf '%s\n' ':${package}:M::${magic}:${mask}:${interpreter}:'"\${QEMU_BINFMT_FLAGS}" >/proc/sys/fs/binfmt_misc/register
1513 - fi
1514 -EOF
1515 -
1516 - echo ":${package}:M::${magic}:${mask}:${interpreter}:OC" >>"${out_systemd}"
1517 -
1518 - done
1519 - cat "${FILESDIR}"/qemu-binfmt.initd.tail >>"${out}" || die
1520 -}
1521 -
1522 -src_install() {
1523 - if [[ -n ${user_targets} ]]; then
1524 - cd "${S}/user-build"
1525 - emake DESTDIR="${ED}" install
1526 -
1527 - # Install binfmt handler init script for user targets.
1528 - generate_initd
1529 - doinitd "${T}/qemu-binfmt"
1530 -
1531 - # Install binfmt/qemu.conf.
1532 - insinto "/usr/share/qemu/binfmt.d"
1533 - doins "${T}/qemu.conf"
1534 - fi
1535 -
1536 - if [[ -n ${softmmu_targets} ]]; then
1537 - cd "${S}/softmmu-build"
1538 - emake DESTDIR="${ED}" install
1539 -
1540 - # This might not exist if the test failed. #512010
1541 - [[ -e check-report.html ]] && dodoc check-report.html
1542 -
1543 - if use kernel_linux; then
1544 - udev_newrules "${FILESDIR}"/65-kvm.rules-r1 65-kvm.rules
1545 - fi
1546 -
1547 - if use python; then
1548 - python_foreach_impl qemu_python_install
1549 - fi
1550 - fi
1551 -
1552 - cd "${S}/tools-build"
1553 - emake DESTDIR="${ED}" install
1554 -
1555 - # Disable mprotect on the qemu binaries as they use JITs to be fast #459348
1556 - pushd "${ED}"/usr/bin >/dev/null
1557 - pax-mark mr "${softmmu_bins[@]}" "${user_bins[@]}" # bug 575594
1558 - popd >/dev/null
1559 -
1560 - # Install config file example for qemu-bridge-helper
1561 - insinto "/etc/qemu"
1562 - doins "${FILESDIR}/bridge.conf"
1563 -
1564 - cd "${S}"
1565 - dodoc Changelog MAINTAINERS docs/specs/pci-ids.txt
1566 - newdoc pc-bios/README README.pc-bios
1567 -
1568 - # Disallow stripping of prebuilt firmware files.
1569 - dostrip -x ${QA_PREBUILT}
1570 -
1571 - if [[ -n ${softmmu_targets} ]]; then
1572 - # Remove SeaBIOS since we're using the SeaBIOS packaged one
1573 - rm "${ED}/usr/share/qemu/bios.bin"
1574 - rm "${ED}/usr/share/qemu/bios-256k.bin"
1575 - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
1576 - dosym ../seabios/bios.bin /usr/share/qemu/bios.bin
1577 - dosym ../seabios/bios-256k.bin /usr/share/qemu/bios-256k.bin
1578 - fi
1579 -
1580 - # Remove vgabios since we're using the seavgabios packaged one
1581 - rm "${ED}/usr/share/qemu/vgabios.bin"
1582 - rm "${ED}/usr/share/qemu/vgabios-cirrus.bin"
1583 - rm "${ED}/usr/share/qemu/vgabios-qxl.bin"
1584 - rm "${ED}/usr/share/qemu/vgabios-stdvga.bin"
1585 - rm "${ED}/usr/share/qemu/vgabios-virtio.bin"
1586 - rm "${ED}/usr/share/qemu/vgabios-vmware.bin"
1587 - # PPC64 loads vgabios-stdvga
1588 - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386 || use qemu_softmmu_targets_ppc64; then
1589 - dosym ../seavgabios/vgabios-isavga.bin /usr/share/qemu/vgabios.bin
1590 - dosym ../seavgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin
1591 - dosym ../seavgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin
1592 - dosym ../seavgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin
1593 - dosym ../seavgabios/vgabios-virtio.bin /usr/share/qemu/vgabios-virtio.bin
1594 - dosym ../seavgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin
1595 - fi
1596 -
1597 - # Remove sgabios since we're using the sgabios packaged one
1598 - rm "${ED}/usr/share/qemu/sgabios.bin"
1599 - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
1600 - dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin
1601 - fi
1602 -
1603 - # Remove iPXE since we're using the iPXE packaged one
1604 - rm "${ED}"/usr/share/qemu/pxe-*.rom
1605 - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
1606 - dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom
1607 - dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom
1608 - dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom
1609 - dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom
1610 - dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom
1611 - dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom
1612 - fi
1613 - fi
1614 -
1615 - DISABLE_AUTOFORMATTING=true
1616 - readme.gentoo_create_doc
1617 -}
1618 -
1619 -firmware_abi_change() {
1620 - local pv
1621 - for pv in ${REPLACING_VERSIONS}; do
1622 - if ver_test $pv -lt ${FIRMWARE_ABI_VERSION}; then
1623 - return 0
1624 - fi
1625 - done
1626 - return 1
1627 -}
1628 -
1629 -pkg_postinst() {
1630 - if [[ -n ${softmmu_targets} ]] && use kernel_linux; then
1631 - udev_reload
1632 - fi
1633 -
1634 - xdg_icon_cache_update
1635 -
1636 - [[ -z ${EPREFIX} ]] && [[ -f ${EROOT}/usr/libexec/qemu-bridge-helper ]] && \
1637 - fcaps cap_net_admin ${EROOT}/usr/libexec/qemu-bridge-helper
1638 -
1639 - DISABLE_AUTOFORMATTING=true
1640 - readme.gentoo_print_elog
1641 -
1642 - if use pin-upstream-blobs && firmware_abi_change; then
1643 - ewarn "This version of qemu pins new versions of firmware blobs:"
1644 - ewarn " $(best_version sys-firmware/edk2-ovmf)"
1645 - ewarn " $(best_version sys-firmware/ipxe)"
1646 - ewarn " $(best_version sys-firmware/seabios)"
1647 - ewarn " $(best_version sys-firmware/sgabios)"
1648 - ewarn "This might break resume of hibernated guests (started with a different"
1649 - ewarn "firmware version) and live migration to/from qemu versions with different"
1650 - ewarn "firmware. Please (cold) restart all running guests. For functional"
1651 - ewarn "guest migration ensure that all"
1652 - ewarn "hosts run at least"
1653 - ewarn " app-emulation/qemu-${FIRMWARE_ABI_VERSION}."
1654 - fi
1655 -}
1656 -
1657 -pkg_info() {
1658 - echo "Using:"
1659 - echo " $(best_version app-emulation/spice-protocol)"
1660 - echo " $(best_version sys-firmware/edk2-ovmf)"
1661 - if has_version 'sys-firmware/edk2-ovmf[binary]'; then
1662 - echo " USE=binary"
1663 - else
1664 - echo " USE=''"
1665 - fi
1666 - echo " $(best_version sys-firmware/ipxe)"
1667 - echo " $(best_version sys-firmware/seabios)"
1668 - if has_version 'sys-firmware/seabios[binary]'; then
1669 - echo " USE=binary"
1670 - else
1671 - echo " USE=''"
1672 - fi
1673 - echo " $(best_version sys-firmware/sgabios)"
1674 -}
1675 -
1676 -pkg_postrm() {
1677 - xdg_icon_cache_update
1678 -}