1 |
commit: 152a39317a543f2acc8bf61cc084d87c17399d32 |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jun 12 10:05:23 2021 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jun 12 10:07:07 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=152a3931 |
7 |
|
8 |
app-emulation/qemu: drop old |
9 |
|
10 |
Package-Manager: Portage-3.0.19, Repoman-3.0.3 |
11 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
12 |
|
13 |
app-emulation/qemu/Manifest | 1 - |
14 |
app-emulation/qemu/qemu-5.2.0-r2.ebuild | 863 ------------------------------ |
15 |
app-emulation/qemu/qemu-5.2.0-r3.ebuild | 868 ------------------------------ |
16 |
app-emulation/qemu/qemu-5.2.0-r50.ebuild | 871 ------------------------------- |
17 |
4 files changed, 2603 deletions(-) |
18 |
|
19 |
diff --git a/app-emulation/qemu/Manifest b/app-emulation/qemu/Manifest |
20 |
index 5ef8e5ca098..4e6705f4885 100644 |
21 |
--- a/app-emulation/qemu/Manifest |
22 |
+++ b/app-emulation/qemu/Manifest |
23 |
@@ -1,2 +1 @@ |
24 |
-DIST qemu-5.2.0.tar.xz 106902800 BLAKE2B 4413d5591cbabf80faba5b0b7347ee7749ff0a71af44bdf7f64b1995e17ecf1f3df539fa8e63959e0d50cd0502a41a2921e60cc6d078ed8ab5b09ab4b86d4ed7 SHA512 bddd633ce111471ebc651e03080251515178808556b49a308a724909e55dac0be0cc0c79c536ac12d239678ae94c60100dc124be9b9d9538340c03a2f27177f3 |
25 |
DIST qemu-6.0.0.tar.xz 107333232 BLAKE2B 7746329d3e13782b7c346ce4052cc517cfc65cd9b2d514d199e4d5b8570ca79566ec04b0c114db2e97c84e68eb551e0d4cdce1b14b91a88fe08d2a5f682c1418 SHA512 ee3ff00aebec4d8891d2ff6dabe4e667e510b2a4fe3f6190aa34673a91ea32dcd2db2e9bf94c2f1bf05aa79788f17cfbbedc6027c0988ea08a92587b79ee05e4 |
26 |
|
27 |
diff --git a/app-emulation/qemu/qemu-5.2.0-r2.ebuild b/app-emulation/qemu/qemu-5.2.0-r2.ebuild |
28 |
deleted file mode 100644 |
29 |
index 6b38e035765..00000000000 |
30 |
--- a/app-emulation/qemu/qemu-5.2.0-r2.ebuild |
31 |
+++ /dev/null |
32 |
@@ -1,863 +0,0 @@ |
33 |
-# Copyright 1999-2021 Gentoo Authors |
34 |
-# Distributed under the terms of the GNU General Public License v2 |
35 |
- |
36 |
-EAPI="7" |
37 |
- |
38 |
-PYTHON_COMPAT=( python3_{7,8,9} ) |
39 |
-PYTHON_REQ_USE="ncurses,readline" |
40 |
- |
41 |
-FIRMWARE_ABI_VERSION="4.0.0-r50" |
42 |
- |
43 |
-inherit eutils linux-info toolchain-funcs multilib python-r1 \ |
44 |
- udev fcaps readme.gentoo-r1 pax-utils l10n xdg-utils |
45 |
- |
46 |
-if [[ ${PV} = *9999* ]]; then |
47 |
- EGIT_REPO_URI="https://git.qemu.org/git/qemu.git" |
48 |
- EGIT_SUBMODULES=( |
49 |
- meson |
50 |
- tests/fp/berkeley-softfloat-3 |
51 |
- tests/fp/berkeley-testfloat-3 |
52 |
- ui/keycodemapdb |
53 |
- ) |
54 |
- inherit git-r3 |
55 |
- SRC_URI="" |
56 |
-else |
57 |
- SRC_URI="https://download.qemu.org/${P}.tar.xz" |
58 |
- KEYWORDS="amd64 arm64 ~ppc ppc64 x86" |
59 |
-fi |
60 |
- |
61 |
-DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools" |
62 |
-HOMEPAGE="http://www.qemu.org http://www.linux-kvm.org" |
63 |
- |
64 |
-LICENSE="GPL-2 LGPL-2 BSD-2" |
65 |
-SLOT="0" |
66 |
- |
67 |
-IUSE="accessibility +aio alsa bzip2 capstone +caps +curl debug +doc |
68 |
- +fdt glusterfs gnutls gtk infiniband iscsi io-uring |
69 |
- jack jemalloc +jpeg kernel_linux |
70 |
- kernel_FreeBSD lzo multipath |
71 |
- ncurses nfs nls numa opengl +oss +pin-upstream-blobs |
72 |
- plugins +png pulseaudio python rbd sasl +seccomp sdl sdl-image selinux |
73 |
- +slirp |
74 |
- smartcard snappy spice ssh static static-user systemtap test udev usb |
75 |
- usbredir vde +vhost-net vhost-user-fs virgl virtfs +vnc vte xattr xen |
76 |
- xfs zstd" |
77 |
- |
78 |
-COMMON_TARGETS="aarch64 alpha arm cris hppa i386 m68k microblaze microblazeel |
79 |
- mips mips64 mips64el mipsel nios2 or1k ppc ppc64 riscv32 riscv64 s390x |
80 |
- sh4 sh4eb sparc sparc64 x86_64 xtensa xtensaeb" |
81 |
-IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} |
82 |
- avr lm32 moxie rx tricore unicore32" |
83 |
-IUSE_USER_TARGETS="${COMMON_TARGETS} |
84 |
- aarch64_be armeb mipsn32 mipsn32el ppc64abi32 ppc64le sparc32plus |
85 |
- tilegx" |
86 |
- |
87 |
-use_softmmu_targets=$(printf ' qemu_softmmu_targets_%s' ${IUSE_SOFTMMU_TARGETS}) |
88 |
-use_user_targets=$(printf ' qemu_user_targets_%s' ${IUSE_USER_TARGETS}) |
89 |
-IUSE+=" ${use_softmmu_targets} ${use_user_targets}" |
90 |
- |
91 |
-RESTRICT="!test? ( test )" |
92 |
-# Allow no targets to be built so that people can get a tools-only build. |
93 |
-# Block USE flag configurations known to not work. |
94 |
-REQUIRED_USE="${PYTHON_REQUIRED_USE} |
95 |
- qemu_softmmu_targets_arm? ( fdt ) |
96 |
- qemu_softmmu_targets_microblaze? ( fdt ) |
97 |
- qemu_softmmu_targets_mips64el? ( fdt ) |
98 |
- qemu_softmmu_targets_ppc64? ( fdt ) |
99 |
- qemu_softmmu_targets_ppc? ( fdt ) |
100 |
- qemu_softmmu_targets_riscv32? ( fdt ) |
101 |
- qemu_softmmu_targets_riscv64? ( fdt ) |
102 |
- static? ( static-user !alsa !gtk !jack !opengl !pulseaudio !plugins !rbd !snappy ) |
103 |
- static-user? ( !plugins ) |
104 |
- vhost-user-fs? ( caps seccomp ) |
105 |
- virtfs? ( caps xattr ) |
106 |
- vte? ( gtk ) |
107 |
- multipath? ( udev ) |
108 |
- plugins? ( !static !static-user ) |
109 |
-" |
110 |
- |
111 |
-# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...) |
112 |
-# and user/softmmu targets (qemu-*, qemu-system-*). |
113 |
-# |
114 |
-# Yep, you need both libcap and libcap-ng since virtfs only uses libcap. |
115 |
-# |
116 |
-# The attr lib isn't always linked in (although the USE flag is always |
117 |
-# respected). This is because qemu supports using the C library's API |
118 |
-# when available rather than always using the external library. |
119 |
-ALL_DEPEND=" |
120 |
- >=dev-libs/glib-2.0[static-libs(+)] |
121 |
- sys-libs/zlib[static-libs(+)] |
122 |
- python? ( ${PYTHON_DEPS} ) |
123 |
- systemtap? ( dev-util/systemtap ) |
124 |
- xattr? ( sys-apps/attr[static-libs(+)] )" |
125 |
- |
126 |
-# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...) |
127 |
-# softmmu targets (qemu-system-*). |
128 |
-SOFTMMU_TOOLS_DEPEND=" |
129 |
- dev-libs/libxml2[static-libs(+)] |
130 |
- >=x11-libs/pixman-0.28.0[static-libs(+)] |
131 |
- accessibility? ( |
132 |
- app-accessibility/brltty[api] |
133 |
- app-accessibility/brltty[static-libs(+)] |
134 |
- ) |
135 |
- aio? ( dev-libs/libaio[static-libs(+)] ) |
136 |
- alsa? ( >=media-libs/alsa-lib-1.0.13 ) |
137 |
- bzip2? ( app-arch/bzip2[static-libs(+)] ) |
138 |
- capstone? ( dev-libs/capstone:= ) |
139 |
- caps? ( sys-libs/libcap-ng[static-libs(+)] ) |
140 |
- curl? ( >=net-misc/curl-7.15.4[static-libs(+)] ) |
141 |
- fdt? ( >=sys-apps/dtc-1.5.0[static-libs(+)] ) |
142 |
- glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] ) |
143 |
- gnutls? ( |
144 |
- dev-libs/nettle:=[static-libs(+)] |
145 |
- >=net-libs/gnutls-3.0:=[static-libs(+)] |
146 |
- ) |
147 |
- gtk? ( |
148 |
- x11-libs/gtk+:3 |
149 |
- vte? ( x11-libs/vte:2.91 ) |
150 |
- ) |
151 |
- infiniband? ( |
152 |
- sys-fabric/libibumad:=[static-libs(+)] |
153 |
- sys-fabric/libibverbs:=[static-libs(+)] |
154 |
- sys-fabric/librdmacm:=[static-libs(+)] |
155 |
- ) |
156 |
- iscsi? ( net-libs/libiscsi ) |
157 |
- io-uring? ( sys-libs/liburing:=[static-libs(+)] ) |
158 |
- jack? ( virtual/jack ) |
159 |
- jemalloc? ( dev-libs/jemalloc ) |
160 |
- jpeg? ( virtual/jpeg:0=[static-libs(+)] ) |
161 |
- lzo? ( dev-libs/lzo:2[static-libs(+)] ) |
162 |
- multipath? ( sys-fs/multipath-tools ) |
163 |
- ncurses? ( |
164 |
- sys-libs/ncurses:0=[unicode] |
165 |
- sys-libs/ncurses:0=[static-libs(+)] |
166 |
- ) |
167 |
- nfs? ( >=net-fs/libnfs-1.9.3:=[static-libs(+)] ) |
168 |
- numa? ( sys-process/numactl[static-libs(+)] ) |
169 |
- opengl? ( |
170 |
- virtual/opengl |
171 |
- media-libs/libepoxy[static-libs(+)] |
172 |
- media-libs/mesa[static-libs(+)] |
173 |
- media-libs/mesa[egl,gbm] |
174 |
- ) |
175 |
- png? ( media-libs/libpng:0=[static-libs(+)] ) |
176 |
- pulseaudio? ( media-sound/pulseaudio ) |
177 |
- rbd? ( sys-cluster/ceph ) |
178 |
- sasl? ( dev-libs/cyrus-sasl[static-libs(+)] ) |
179 |
- sdl? ( |
180 |
- media-libs/libsdl2[video] |
181 |
- media-libs/libsdl2[static-libs(+)] |
182 |
- ) |
183 |
- sdl-image? ( media-libs/sdl2-image[static-libs(+)] ) |
184 |
- seccomp? ( >=sys-libs/libseccomp-2.1.0[static-libs(+)] ) |
185 |
- slirp? ( net-libs/libslirp[static-libs(+)] ) |
186 |
- smartcard? ( >=app-emulation/libcacard-2.5.0[static-libs(+)] ) |
187 |
- snappy? ( app-arch/snappy:= ) |
188 |
- spice? ( |
189 |
- >=app-emulation/spice-protocol-0.12.3 |
190 |
- >=app-emulation/spice-0.12.0[static-libs(+)] |
191 |
- ) |
192 |
- ssh? ( >=net-libs/libssh-0.8.6[static-libs(+)] ) |
193 |
- udev? ( virtual/libudev[static-libs(+)] ) |
194 |
- usb? ( >=virtual/libusb-1-r2[static-libs(+)] ) |
195 |
- usbredir? ( >=sys-apps/usbredir-0.6[static-libs(+)] ) |
196 |
- vde? ( net-misc/vde[static-libs(+)] ) |
197 |
- virgl? ( media-libs/virglrenderer[static-libs(+)] ) |
198 |
- virtfs? ( sys-libs/libcap ) |
199 |
- xen? ( app-emulation/xen-tools:= ) |
200 |
- xfs? ( sys-fs/xfsprogs[static-libs(+)] ) |
201 |
- zstd? ( >=app-arch/zstd-1.4.0[static-libs(+)] ) |
202 |
-" |
203 |
- |
204 |
-X86_FIRMWARE_DEPEND=" |
205 |
- pin-upstream-blobs? ( |
206 |
- ~sys-firmware/edk2-ovmf-201905[binary] |
207 |
- ~sys-firmware/ipxe-1.0.0_p20190728[binary,qemu] |
208 |
- ~sys-firmware/seabios-1.12.0[binary,seavgabios] |
209 |
- ~sys-firmware/sgabios-0.1_pre8[binary] |
210 |
- ) |
211 |
- !pin-upstream-blobs? ( |
212 |
- sys-firmware/edk2-ovmf |
213 |
- sys-firmware/ipxe[qemu] |
214 |
- >=sys-firmware/seabios-1.10.2[seavgabios] |
215 |
- sys-firmware/sgabios |
216 |
- )" |
217 |
-PPC_FIRMWARE_DEPEND=" |
218 |
- pin-upstream-blobs? ( |
219 |
- ~sys-firmware/seabios-1.12.0[binary,seavgabios] |
220 |
- ) |
221 |
- !pin-upstream-blobs? ( |
222 |
- >=sys-firmware/seabios-1.10.2[seavgabios] |
223 |
- ) |
224 |
-" |
225 |
- |
226 |
-BDEPEND=" |
227 |
- $(python_gen_impl_dep) |
228 |
- dev-lang/perl |
229 |
- sys-apps/texinfo |
230 |
- virtual/pkgconfig |
231 |
- doc? ( dev-python/sphinx ) |
232 |
- gtk? ( nls? ( sys-devel/gettext ) ) |
233 |
- test? ( |
234 |
- dev-libs/glib[utils] |
235 |
- sys-devel/bc |
236 |
- ) |
237 |
-" |
238 |
-CDEPEND=" |
239 |
- !static? ( |
240 |
- ${ALL_DEPEND//\[static-libs(+)]} |
241 |
- ${SOFTMMU_TOOLS_DEPEND//\[static-libs(+)]} |
242 |
- ) |
243 |
- qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} ) |
244 |
- qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} ) |
245 |
- qemu_softmmu_targets_ppc? ( ${PPC_FIRMWARE_DEPEND} ) |
246 |
- qemu_softmmu_targets_ppc64? ( ${PPC_FIRMWARE_DEPEND} ) |
247 |
-" |
248 |
-DEPEND="${CDEPEND} |
249 |
- kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 ) |
250 |
- static? ( |
251 |
- ${ALL_DEPEND} |
252 |
- ${SOFTMMU_TOOLS_DEPEND} |
253 |
- ) |
254 |
- static-user? ( ${ALL_DEPEND} )" |
255 |
-RDEPEND="${CDEPEND} |
256 |
- acct-group/kvm |
257 |
- selinux? ( sec-policy/selinux-qemu )" |
258 |
- |
259 |
-PATCHES=( |
260 |
- "${FILESDIR}"/${PN}-2.11.1-capstone_include_path.patch |
261 |
- "${FILESDIR}"/${PN}-5.2.0-cleaner-werror.patch |
262 |
- "${FILESDIR}"/${PN}-5.2.0-disable-keymap.patch |
263 |
- "${FILESDIR}"/${PN}-5.2.0-strings.patch |
264 |
- "${FILESDIR}"/${PN}-5.2.0-fix-firmware-path.patch |
265 |
- "${FILESDIR}"/${PN}-5.2.0-no-pie-ld.patch |
266 |
-) |
267 |
- |
268 |
-QA_PREBUILT=" |
269 |
- usr/share/qemu/hppa-firmware.img |
270 |
- usr/share/qemu/openbios-ppc |
271 |
- usr/share/qemu/openbios-sparc64 |
272 |
- usr/share/qemu/openbios-sparc32 |
273 |
- usr/share/qemu/opensbi-riscv64-generic-fw_dynamic.elf |
274 |
- usr/share/qemu/opensbi-riscv32-generic-fw_dynamic.elf |
275 |
- usr/share/qemu/palcode-clipper |
276 |
- usr/share/qemu/s390-ccw.img |
277 |
- usr/share/qemu/s390-netboot.img |
278 |
- usr/share/qemu/u-boot.e500 |
279 |
-" |
280 |
- |
281 |
-QA_WX_LOAD="usr/bin/qemu-i386 |
282 |
- usr/bin/qemu-x86_64 |
283 |
- usr/bin/qemu-alpha |
284 |
- usr/bin/qemu-arm |
285 |
- usr/bin/qemu-cris |
286 |
- usr/bin/qemu-m68k |
287 |
- usr/bin/qemu-microblaze |
288 |
- usr/bin/qemu-microblazeel |
289 |
- usr/bin/qemu-mips |
290 |
- usr/bin/qemu-mipsel |
291 |
- usr/bin/qemu-or1k |
292 |
- usr/bin/qemu-ppc |
293 |
- usr/bin/qemu-ppc64 |
294 |
- usr/bin/qemu-ppc64abi32 |
295 |
- usr/bin/qemu-sh4 |
296 |
- usr/bin/qemu-sh4eb |
297 |
- usr/bin/qemu-sparc |
298 |
- usr/bin/qemu-sparc64 |
299 |
- usr/bin/qemu-armeb |
300 |
- usr/bin/qemu-sparc32plus |
301 |
- usr/bin/qemu-s390x |
302 |
- usr/bin/qemu-unicore32 |
303 |
-" |
304 |
- |
305 |
-DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure you have the |
306 |
-kernel module loaded before running kvm. The easiest way to ensure that the |
307 |
-kernel module is loaded is to load it on boot. |
308 |
- For AMD CPUs the module is called 'kvm-amd'. |
309 |
- For Intel CPUs the module is called 'kvm-intel'. |
310 |
-Please review /etc/conf.d/modules for how to load these. |
311 |
- |
312 |
-Make sure your user is in the 'kvm' group. Just run |
313 |
- $ gpasswd -a <USER> kvm |
314 |
-then have <USER> re-login. |
315 |
- |
316 |
-For brand new installs, the default permissions on /dev/kvm might not let |
317 |
-you access it. You can tell udev to reset ownership/perms: |
318 |
- $ udevadm trigger -c add /dev/kvm |
319 |
- |
320 |
-If you want to register binfmt handlers for qemu user targets: |
321 |
-For openrc: |
322 |
- # rc-update add qemu-binfmt |
323 |
-For systemd: |
324 |
- # ln -s /usr/share/qemu/binfmt.d/qemu.conf /etc/binfmt.d/qemu.conf" |
325 |
- |
326 |
-pkg_pretend() { |
327 |
- if use kernel_linux && kernel_is lt 2 6 25; then |
328 |
- eerror "This version of KVM requires a host kernel of 2.6.25 or higher." |
329 |
- elif use kernel_linux; then |
330 |
- if ! linux_config_exists; then |
331 |
- eerror "Unable to check your kernel for KVM support" |
332 |
- else |
333 |
- CONFIG_CHECK="~KVM ~TUN ~BRIDGE" |
334 |
- ERROR_KVM="You must enable KVM in your kernel to continue" |
335 |
- ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in" |
336 |
- ERROR_KVM_AMD+=" your kernel configuration." |
337 |
- ERROR_KVM_INTEL="If you have an Intel CPU, you must enable" |
338 |
- ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration." |
339 |
- ERROR_TUN="You will need the Universal TUN/TAP driver compiled" |
340 |
- ERROR_TUN+=" into your kernel or loaded as a module to use the" |
341 |
- ERROR_TUN+=" virtual network device if using -net tap." |
342 |
- ERROR_BRIDGE="You will also need support for 802.1d" |
343 |
- ERROR_BRIDGE+=" Ethernet Bridging for some network configurations." |
344 |
- use vhost-net && CONFIG_CHECK+=" ~VHOST_NET" |
345 |
- ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net" |
346 |
- ERROR_VHOST_NET+=" support" |
347 |
- |
348 |
- if use amd64 || use x86 || use amd64-linux || use x86-linux; then |
349 |
- if grep -q AuthenticAMD /proc/cpuinfo; then |
350 |
- CONFIG_CHECK+=" ~KVM_AMD" |
351 |
- elif grep -q GenuineIntel /proc/cpuinfo; then |
352 |
- CONFIG_CHECK+=" ~KVM_INTEL" |
353 |
- fi |
354 |
- fi |
355 |
- |
356 |
- use python && CONFIG_CHECK+=" ~DEBUG_FS" |
357 |
- ERROR_DEBUG_FS="debugFS support required for kvm_stat" |
358 |
- |
359 |
- # Now do the actual checks setup above |
360 |
- check_extra_config |
361 |
- fi |
362 |
- fi |
363 |
- |
364 |
- if grep -qs '/usr/bin/qemu-kvm' "${EROOT}"/etc/libvirt/qemu/*.xml; then |
365 |
- eerror "The kvm/qemu-kvm wrappers no longer exist, but your libvirt" |
366 |
- eerror "instances are still pointing to it. Please update your" |
367 |
- eerror "configs in /etc/libvirt/qemu/ to use the -enable-kvm flag" |
368 |
- eerror "and the right system binary (e.g. qemu-system-x86_64)." |
369 |
- die "update your virt configs to not use qemu-kvm" |
370 |
- fi |
371 |
-} |
372 |
- |
373 |
-# Sanity check to make sure target lists are kept up-to-date. |
374 |
-check_targets() { |
375 |
- local var=$1 mak=$2 |
376 |
- local detected sorted |
377 |
- |
378 |
- pushd "${S}"/default-configs/targets/ >/dev/null || die |
379 |
- |
380 |
- # Force C locale until glibc is updated. #564936 |
381 |
- detected=$(echo $(printf '%s\n' *-${mak}.mak | sed "s:-${mak}.mak::" | LC_COLLATE=C sort -u)) |
382 |
- sorted=$(echo $(printf '%s\n' ${!var} | LC_COLLATE=C sort -u)) |
383 |
- if [[ ${sorted} != "${detected}" ]] ; then |
384 |
- eerror "The ebuild needs to be kept in sync." |
385 |
- eerror "${var}: ${sorted}" |
386 |
- eerror "$(printf '%-*s' ${#var} configure): ${detected}" |
387 |
- die "sync ${var} to the list of targets" |
388 |
- fi |
389 |
- |
390 |
- popd >/dev/null |
391 |
-} |
392 |
- |
393 |
-src_prepare() { |
394 |
- check_targets IUSE_SOFTMMU_TARGETS softmmu |
395 |
- check_targets IUSE_USER_TARGETS linux-user |
396 |
- |
397 |
- default |
398 |
- |
399 |
- # Use correct toolchain to fix cross-compiling |
400 |
- tc-export AR AS LD NM OBJCOPY PKG_CONFIG RANLIB STRINGS |
401 |
- export WINDRES=${CHOST}-windres |
402 |
- |
403 |
- # Verbose builds |
404 |
- MAKEOPTS+=" V=1" |
405 |
- |
406 |
- # Remove bundled copy of libfdt |
407 |
- rm -r dtc || die |
408 |
-} |
409 |
- |
410 |
-## |
411 |
-# configures qemu based on the build directory and the build type |
412 |
-# we are using. |
413 |
-# |
414 |
-qemu_src_configure() { |
415 |
- debug-print-function ${FUNCNAME} "$@" |
416 |
- |
417 |
- local buildtype=$1 |
418 |
- local builddir="${S}/${buildtype}-build" |
419 |
- |
420 |
- mkdir "${builddir}" |
421 |
- |
422 |
- local conf_opts=( |
423 |
- --prefix=/usr |
424 |
- --sysconfdir=/etc |
425 |
- --bindir=/usr/bin |
426 |
- --libdir=/usr/$(get_libdir) |
427 |
- --datadir=/usr/share |
428 |
- --docdir=/usr/share/doc/${PF}/html |
429 |
- --mandir=/usr/share/man |
430 |
- --localstatedir=/var |
431 |
- --disable-bsd-user |
432 |
- --disable-containers # bug #732972 |
433 |
- --disable-guest-agent |
434 |
- --disable-strip |
435 |
- |
436 |
- # bug #746752: TCG interpreter has a few limitations: |
437 |
- # - it does not support FPU |
438 |
- # - it's generally slower on non-self-modifying code |
439 |
- # It's advantage is support for host architectures |
440 |
- # where native codegeneration is not implemented. |
441 |
- # Gentoo has qemu keyworded only on targets with |
442 |
- # native code generation available. Avoid the interpreter. |
443 |
- --disable-tcg-interpreter |
444 |
- |
445 |
- --disable-werror |
446 |
- # We support gnutls/nettle for crypto operations. It is possible |
447 |
- # to use gcrypt when gnutls/nettle are disabled (but not when they |
448 |
- # are enabled), but it's not really worth the hassle. Disable it |
449 |
- # all the time to avoid automatically detecting it. #568856 |
450 |
- --disable-gcrypt |
451 |
- --python="${PYTHON}" |
452 |
- --cc="$(tc-getCC)" |
453 |
- --cxx="$(tc-getCXX)" |
454 |
- --host-cc="$(tc-getBUILD_CC)" |
455 |
- $(use_enable debug debug-info) |
456 |
- $(use_enable debug debug-tcg) |
457 |
- $(use_enable doc docs) |
458 |
- $(use_enable nls gettext) |
459 |
- $(use_enable plugins) |
460 |
- $(use_enable xattr attr) |
461 |
- ) |
462 |
- |
463 |
- # Disable options not used by user targets. This simplifies building |
464 |
- # static user targets (USE=static-user) considerably. |
465 |
- conf_notuser() { |
466 |
- if [[ ${buildtype} == "user" ]] ; then |
467 |
- echo "--disable-${2:-$1}" |
468 |
- else |
469 |
- use_enable "$@" |
470 |
- fi |
471 |
- } |
472 |
- # Enable option only for softmmu build, but not 'user' or 'tools' |
473 |
- conf_softmmu() { |
474 |
- if [[ ${buildtype} == "softmmu" ]] ; then |
475 |
- use_enable "$@" |
476 |
- else |
477 |
- echo "--disable-${2:-$1}" |
478 |
- fi |
479 |
- } |
480 |
- # Enable option only for tools build, but not 'user' or 'softmmu' |
481 |
- conf_tools() { |
482 |
- if [[ ${buildtype} == "tools" ]] ; then |
483 |
- use_enable "$@" |
484 |
- else |
485 |
- echo "--disable-${2:-$1}" |
486 |
- fi |
487 |
- } |
488 |
- conf_opts+=( |
489 |
- $(conf_notuser accessibility brlapi) |
490 |
- $(conf_notuser aio linux-aio) |
491 |
- $(conf_notuser bzip2) |
492 |
- $(conf_notuser capstone) |
493 |
- $(conf_notuser caps cap-ng) |
494 |
- $(conf_notuser curl) |
495 |
- $(conf_notuser fdt) |
496 |
- $(conf_notuser glusterfs) |
497 |
- $(conf_notuser gnutls) |
498 |
- $(conf_notuser gnutls nettle) |
499 |
- $(conf_notuser gtk) |
500 |
- $(conf_notuser infiniband rdma) |
501 |
- $(conf_notuser iscsi libiscsi) |
502 |
- $(conf_notuser io-uring linux-io-uring) |
503 |
- $(conf_notuser jemalloc jemalloc) |
504 |
- $(conf_notuser jpeg vnc-jpeg) |
505 |
- $(conf_notuser kernel_linux kvm) |
506 |
- $(conf_notuser lzo) |
507 |
- $(conf_notuser multipath mpath) |
508 |
- $(conf_notuser ncurses curses) |
509 |
- $(conf_notuser nfs libnfs) |
510 |
- $(conf_notuser numa) |
511 |
- $(conf_notuser opengl) |
512 |
- $(conf_notuser png vnc-png) |
513 |
- $(conf_notuser rbd) |
514 |
- $(conf_notuser sasl vnc-sasl) |
515 |
- $(conf_notuser sdl) |
516 |
- $(conf_softmmu sdl-image) |
517 |
- $(conf_notuser seccomp) |
518 |
- $(conf_notuser slirp slirp system) |
519 |
- $(conf_notuser smartcard) |
520 |
- $(conf_notuser snappy) |
521 |
- $(conf_notuser spice) |
522 |
- $(conf_notuser ssh libssh) |
523 |
- $(conf_notuser udev libudev) |
524 |
- $(conf_notuser usb libusb) |
525 |
- $(conf_notuser usbredir usb-redir) |
526 |
- $(conf_notuser vde) |
527 |
- $(conf_notuser vhost-net) |
528 |
- $(conf_notuser vhost-user-fs) |
529 |
- $(conf_tools vhost-user-fs virtiofsd) |
530 |
- $(conf_notuser virgl virglrenderer) |
531 |
- $(conf_notuser virtfs) |
532 |
- $(conf_notuser vnc) |
533 |
- $(conf_notuser vte) |
534 |
- $(conf_notuser xen) |
535 |
- $(conf_notuser xen xen-pci-passthrough) |
536 |
- $(conf_notuser xfs xfsctl) |
537 |
- # use prebuilt keymaps, bug #759604 |
538 |
- --disable-xkbcommon |
539 |
- $(conf_notuser zstd) |
540 |
- ) |
541 |
- |
542 |
- if [[ ${buildtype} == "user" ]] ; then |
543 |
- conf_opts+=( --disable-libxml2 ) |
544 |
- else |
545 |
- conf_opts+=( --enable-libxml2 ) |
546 |
- fi |
547 |
- |
548 |
- if [[ ! ${buildtype} == "user" ]] ; then |
549 |
- # audio options |
550 |
- local audio_opts=( |
551 |
- # Note: backend order matters here: #716202 |
552 |
- # We iterate from higher-level to lower level. |
553 |
- $(usex pulseaudio pa "") |
554 |
- $(usev jack) |
555 |
- $(usev sdl) |
556 |
- $(usev alsa) |
557 |
- $(usev oss) |
558 |
- ) |
559 |
- conf_opts+=( |
560 |
- --audio-drv-list=$(printf "%s," "${audio_opts[@]}") |
561 |
- ) |
562 |
- fi |
563 |
- |
564 |
- case ${buildtype} in |
565 |
- user) |
566 |
- conf_opts+=( |
567 |
- --enable-linux-user |
568 |
- --disable-system |
569 |
- --disable-blobs |
570 |
- --disable-tools |
571 |
- ) |
572 |
- local static_flag="static-user" |
573 |
- ;; |
574 |
- softmmu) |
575 |
- conf_opts+=( |
576 |
- --disable-linux-user |
577 |
- --enable-system |
578 |
- --disable-tools |
579 |
- ) |
580 |
- local static_flag="static" |
581 |
- ;; |
582 |
- tools) |
583 |
- conf_opts+=( |
584 |
- --disable-linux-user |
585 |
- --disable-system |
586 |
- --disable-blobs |
587 |
- --enable-tools |
588 |
- ) |
589 |
- local static_flag="static" |
590 |
- ;; |
591 |
- esac |
592 |
- |
593 |
- local targets="${buildtype}_targets" |
594 |
- [[ -n ${targets} ]] && conf_opts+=( --target-list="${!targets}" ) |
595 |
- |
596 |
- # Add support for SystemTAP |
597 |
- use systemtap && conf_opts+=( --enable-trace-backend=dtrace ) |
598 |
- |
599 |
- # We always want to attempt to build with PIE support as it results |
600 |
- # in a more secure binary. But it doesn't work with static or if |
601 |
- # the current GCC doesn't have PIE support. |
602 |
- if use ${static_flag}; then |
603 |
- conf_opts+=( --static --disable-pie ) |
604 |
- else |
605 |
- tc-enables-pie && conf_opts+=( --enable-pie ) |
606 |
- fi |
607 |
- |
608 |
- # Meson will not use a cross-file unless cross_prefix is set. |
609 |
- tc-is-cross-compiler && conf_opts+=( --cross-prefix="${CHOST}-" ) |
610 |
- |
611 |
- # Plumb through equivalent of EXTRA_ECONF to allow experiments |
612 |
- # like bug #747928. |
613 |
- conf_opts+=( ${EXTRA_CONF_QEMU} ) |
614 |
- |
615 |
- echo "../configure ${conf_opts[*]}" |
616 |
- cd "${builddir}" |
617 |
- ../configure "${conf_opts[@]}" || die "configure failed" |
618 |
- |
619 |
- # FreeBSD's kernel does not support QEMU assigning/grabbing |
620 |
- # host USB devices yet |
621 |
- use kernel_FreeBSD && \ |
622 |
- sed -i -E -e "s|^(HOST_USB=)bsd|\1stub|" "${S}"/config-host.mak |
623 |
-} |
624 |
- |
625 |
-src_configure() { |
626 |
- local target |
627 |
- |
628 |
- python_setup |
629 |
- |
630 |
- softmmu_targets= softmmu_bins=() |
631 |
- user_targets= user_bins=() |
632 |
- |
633 |
- for target in ${IUSE_SOFTMMU_TARGETS} ; do |
634 |
- if use "qemu_softmmu_targets_${target}"; then |
635 |
- softmmu_targets+=",${target}-softmmu" |
636 |
- softmmu_bins+=( "qemu-system-${target}" ) |
637 |
- fi |
638 |
- done |
639 |
- |
640 |
- for target in ${IUSE_USER_TARGETS} ; do |
641 |
- if use "qemu_user_targets_${target}"; then |
642 |
- user_targets+=",${target}-linux-user" |
643 |
- user_bins+=( "qemu-${target}" ) |
644 |
- fi |
645 |
- done |
646 |
- |
647 |
- softmmu_targets=${softmmu_targets#,} |
648 |
- user_targets=${user_targets#,} |
649 |
- |
650 |
- [[ -n ${softmmu_targets} ]] && qemu_src_configure "softmmu" |
651 |
- [[ -n ${user_targets} ]] && qemu_src_configure "user" |
652 |
- qemu_src_configure "tools" |
653 |
-} |
654 |
- |
655 |
-src_compile() { |
656 |
- if [[ -n ${user_targets} ]]; then |
657 |
- cd "${S}/user-build" |
658 |
- default |
659 |
- fi |
660 |
- |
661 |
- if [[ -n ${softmmu_targets} ]]; then |
662 |
- cd "${S}/softmmu-build" |
663 |
- default |
664 |
- fi |
665 |
- |
666 |
- cd "${S}/tools-build" |
667 |
- default |
668 |
-} |
669 |
- |
670 |
-src_test() { |
671 |
- if [[ -n ${softmmu_targets} ]]; then |
672 |
- cd "${S}/softmmu-build" |
673 |
- pax-mark m */qemu-system-* #515550 |
674 |
- emake check |
675 |
- fi |
676 |
-} |
677 |
- |
678 |
-qemu_python_install() { |
679 |
- python_domodule "${S}/python/qemu" |
680 |
- |
681 |
- python_doscript "${S}/scripts/kvm/vmxcap" |
682 |
- python_doscript "${S}/scripts/qmp/qmp-shell" |
683 |
- python_doscript "${S}/scripts/qmp/qemu-ga-client" |
684 |
-} |
685 |
- |
686 |
-# Generate binfmt support files. |
687 |
-# - /etc/init.d/qemu-binfmt script which registers the user handlers (openrc) |
688 |
-# - /usr/share/qemu/binfmt.d/qemu.conf (for use with systemd-binfmt) |
689 |
-generate_initd() { |
690 |
- local out="${T}/qemu-binfmt" |
691 |
- local out_systemd="${T}/qemu.conf" |
692 |
- local d="${T}/binfmt.d" |
693 |
- |
694 |
- einfo "Generating qemu binfmt scripts and configuration files" |
695 |
- |
696 |
- # Generate the debian fragments first. |
697 |
- mkdir -p "${d}" |
698 |
- "${S}"/scripts/qemu-binfmt-conf.sh \ |
699 |
- --debian \ |
700 |
- --exportdir "${d}" \ |
701 |
- --qemu-path "${EPREFIX}/usr/bin" \ |
702 |
- || die |
703 |
- # Then turn the fragments into a shell script we can source. |
704 |
- sed -E -i \ |
705 |
- -e 's:^([^ ]+) (.*)$:\1="\2":' \ |
706 |
- "${d}"/* || die |
707 |
- |
708 |
- # Generate the init.d script by assembling the fragments from above. |
709 |
- local f qcpu package interpreter magic mask |
710 |
- cat "${FILESDIR}"/qemu-binfmt.initd.head >"${out}" || die |
711 |
- for f in "${d}"/qemu-* ; do |
712 |
- source "${f}" |
713 |
- |
714 |
- # Normalize the cpu logic like we do in the init.d for the native cpu. |
715 |
- qcpu=${package#qemu-} |
716 |
- case ${qcpu} in |
717 |
- arm*) qcpu="arm";; |
718 |
- mips*) qcpu="mips";; |
719 |
- ppc*) qcpu="ppc";; |
720 |
- s390*) qcpu="s390";; |
721 |
- sh*) qcpu="sh";; |
722 |
- sparc*) qcpu="sparc";; |
723 |
- esac |
724 |
- |
725 |
- # we use 'printf' here to be portable across 'sh' |
726 |
- # implementations: #679168 |
727 |
- cat <<EOF >>"${out}" |
728 |
- if [ "\${cpu}" != "${qcpu}" -a -x "${interpreter}" ] ; then |
729 |
- printf '%s\n' ':${package}:M::${magic}:${mask}:${interpreter}:'"\${QEMU_BINFMT_FLAGS}" >/proc/sys/fs/binfmt_misc/register |
730 |
- fi |
731 |
-EOF |
732 |
- |
733 |
- echo ":${package}:M::${magic}:${mask}:${interpreter}:OC" >>"${out_systemd}" |
734 |
- |
735 |
- done |
736 |
- cat "${FILESDIR}"/qemu-binfmt.initd.tail >>"${out}" || die |
737 |
-} |
738 |
- |
739 |
-src_install() { |
740 |
- if [[ -n ${user_targets} ]]; then |
741 |
- cd "${S}/user-build" |
742 |
- emake DESTDIR="${ED}" install |
743 |
- |
744 |
- # Install binfmt handler init script for user targets. |
745 |
- generate_initd |
746 |
- doinitd "${T}/qemu-binfmt" |
747 |
- |
748 |
- # Install binfmt/qemu.conf. |
749 |
- insinto "/usr/share/qemu/binfmt.d" |
750 |
- doins "${T}/qemu.conf" |
751 |
- fi |
752 |
- |
753 |
- if [[ -n ${softmmu_targets} ]]; then |
754 |
- cd "${S}/softmmu-build" |
755 |
- emake DESTDIR="${ED}" install |
756 |
- |
757 |
- # This might not exist if the test failed. #512010 |
758 |
- [[ -e check-report.html ]] && dodoc check-report.html |
759 |
- |
760 |
- if use kernel_linux; then |
761 |
- udev_newrules "${FILESDIR}"/65-kvm.rules-r1 65-kvm.rules |
762 |
- fi |
763 |
- |
764 |
- if use python; then |
765 |
- python_foreach_impl qemu_python_install |
766 |
- fi |
767 |
- fi |
768 |
- |
769 |
- cd "${S}/tools-build" |
770 |
- emake DESTDIR="${ED}" install |
771 |
- |
772 |
- # Disable mprotect on the qemu binaries as they use JITs to be fast #459348 |
773 |
- pushd "${ED}"/usr/bin >/dev/null |
774 |
- pax-mark mr "${softmmu_bins[@]}" "${user_bins[@]}" # bug 575594 |
775 |
- popd >/dev/null |
776 |
- |
777 |
- # Install config file example for qemu-bridge-helper |
778 |
- insinto "/etc/qemu" |
779 |
- doins "${FILESDIR}/bridge.conf" |
780 |
- |
781 |
- cd "${S}" |
782 |
- dodoc MAINTAINERS docs/specs/pci-ids.txt |
783 |
- newdoc pc-bios/README README.pc-bios |
784 |
- |
785 |
- # Disallow stripping of prebuilt firmware files. |
786 |
- dostrip -x ${QA_PREBUILT} |
787 |
- |
788 |
- if [[ -n ${softmmu_targets} ]]; then |
789 |
- # Remove SeaBIOS since we're using the SeaBIOS packaged one |
790 |
- rm "${ED}/usr/share/qemu/bios.bin" |
791 |
- rm "${ED}/usr/share/qemu/bios-256k.bin" |
792 |
- if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
793 |
- dosym ../seabios/bios.bin /usr/share/qemu/bios.bin |
794 |
- dosym ../seabios/bios-256k.bin /usr/share/qemu/bios-256k.bin |
795 |
- fi |
796 |
- |
797 |
- # Remove vgabios since we're using the seavgabios packaged one |
798 |
- rm "${ED}/usr/share/qemu/vgabios.bin" |
799 |
- rm "${ED}/usr/share/qemu/vgabios-cirrus.bin" |
800 |
- rm "${ED}/usr/share/qemu/vgabios-qxl.bin" |
801 |
- rm "${ED}/usr/share/qemu/vgabios-stdvga.bin" |
802 |
- rm "${ED}/usr/share/qemu/vgabios-virtio.bin" |
803 |
- rm "${ED}/usr/share/qemu/vgabios-vmware.bin" |
804 |
- # PPC/PPC64 loads vgabios-stdvga |
805 |
- if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386 || use qemu_softmmu_targets_ppc || use qemu_softmmu_targets_ppc64; then |
806 |
- dosym ../seavgabios/vgabios-isavga.bin /usr/share/qemu/vgabios.bin |
807 |
- dosym ../seavgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin |
808 |
- dosym ../seavgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin |
809 |
- dosym ../seavgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin |
810 |
- dosym ../seavgabios/vgabios-virtio.bin /usr/share/qemu/vgabios-virtio.bin |
811 |
- dosym ../seavgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin |
812 |
- fi |
813 |
- |
814 |
- # Remove sgabios since we're using the sgabios packaged one |
815 |
- rm "${ED}/usr/share/qemu/sgabios.bin" |
816 |
- if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
817 |
- dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin |
818 |
- fi |
819 |
- |
820 |
- # Remove iPXE since we're using the iPXE packaged one |
821 |
- rm "${ED}"/usr/share/qemu/pxe-*.rom |
822 |
- if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
823 |
- dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom |
824 |
- dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom |
825 |
- dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom |
826 |
- dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom |
827 |
- dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom |
828 |
- dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom |
829 |
- fi |
830 |
- fi |
831 |
- |
832 |
- DISABLE_AUTOFORMATTING=true |
833 |
- readme.gentoo_create_doc |
834 |
-} |
835 |
- |
836 |
-firmware_abi_change() { |
837 |
- local pv |
838 |
- for pv in ${REPLACING_VERSIONS}; do |
839 |
- if ver_test ${pv} -lt ${FIRMWARE_ABI_VERSION}; then |
840 |
- return 0 |
841 |
- fi |
842 |
- done |
843 |
- return 1 |
844 |
-} |
845 |
- |
846 |
-pkg_postinst() { |
847 |
- if [[ -n ${softmmu_targets} ]] && use kernel_linux; then |
848 |
- udev_reload |
849 |
- fi |
850 |
- |
851 |
- xdg_icon_cache_update |
852 |
- |
853 |
- [[ -z ${EPREFIX} ]] && [[ -f ${EROOT}/usr/libexec/qemu-bridge-helper ]] && \ |
854 |
- fcaps cap_net_admin ${EROOT}/usr/libexec/qemu-bridge-helper |
855 |
- |
856 |
- DISABLE_AUTOFORMATTING=true |
857 |
- readme.gentoo_print_elog |
858 |
- |
859 |
- if use pin-upstream-blobs && firmware_abi_change; then |
860 |
- ewarn "This version of qemu pins new versions of firmware blobs:" |
861 |
- ewarn " $(best_version sys-firmware/edk2-ovmf)" |
862 |
- ewarn " $(best_version sys-firmware/ipxe)" |
863 |
- ewarn " $(best_version sys-firmware/seabios)" |
864 |
- ewarn " $(best_version sys-firmware/sgabios)" |
865 |
- ewarn "This might break resume of hibernated guests (started with a different" |
866 |
- ewarn "firmware version) and live migration to/from qemu versions with different" |
867 |
- ewarn "firmware. Please (cold) restart all running guests. For functional" |
868 |
- ewarn "guest migration ensure that all" |
869 |
- ewarn "hosts run at least" |
870 |
- ewarn " app-emulation/qemu-${FIRMWARE_ABI_VERSION}." |
871 |
- fi |
872 |
-} |
873 |
- |
874 |
-pkg_info() { |
875 |
- echo "Using:" |
876 |
- echo " $(best_version app-emulation/spice-protocol)" |
877 |
- echo " $(best_version sys-firmware/edk2-ovmf)" |
878 |
- if has_version 'sys-firmware/edk2-ovmf[binary]'; then |
879 |
- echo " USE=binary" |
880 |
- else |
881 |
- echo " USE=''" |
882 |
- fi |
883 |
- echo " $(best_version sys-firmware/ipxe)" |
884 |
- echo " $(best_version sys-firmware/seabios)" |
885 |
- if has_version 'sys-firmware/seabios[binary]'; then |
886 |
- echo " USE=binary" |
887 |
- else |
888 |
- echo " USE=''" |
889 |
- fi |
890 |
- echo " $(best_version sys-firmware/sgabios)" |
891 |
-} |
892 |
- |
893 |
-pkg_postrm() { |
894 |
- xdg_icon_cache_update |
895 |
-} |
896 |
|
897 |
diff --git a/app-emulation/qemu/qemu-5.2.0-r3.ebuild b/app-emulation/qemu/qemu-5.2.0-r3.ebuild |
898 |
deleted file mode 100644 |
899 |
index b1a5e2581a4..00000000000 |
900 |
--- a/app-emulation/qemu/qemu-5.2.0-r3.ebuild |
901 |
+++ /dev/null |
902 |
@@ -1,868 +0,0 @@ |
903 |
-# Copyright 1999-2021 Gentoo Authors |
904 |
-# Distributed under the terms of the GNU General Public License v2 |
905 |
- |
906 |
-EAPI="7" |
907 |
- |
908 |
-PYTHON_COMPAT=( python3_{7,8,9} ) |
909 |
-PYTHON_REQ_USE="ncurses,readline" |
910 |
- |
911 |
-FIRMWARE_ABI_VERSION="4.0.0-r50" |
912 |
- |
913 |
-inherit eutils linux-info toolchain-funcs multilib python-r1 |
914 |
-inherit udev fcaps readme.gentoo-r1 pax-utils l10n xdg-utils |
915 |
-inherit flag-o-matic |
916 |
- |
917 |
-if [[ ${PV} = *9999* ]]; then |
918 |
- EGIT_REPO_URI="https://git.qemu.org/git/qemu.git" |
919 |
- EGIT_SUBMODULES=( |
920 |
- meson |
921 |
- tests/fp/berkeley-softfloat-3 |
922 |
- tests/fp/berkeley-testfloat-3 |
923 |
- ui/keycodemapdb |
924 |
- ) |
925 |
- inherit git-r3 |
926 |
- SRC_URI="" |
927 |
-else |
928 |
- SRC_URI="https://download.qemu.org/${P}.tar.xz" |
929 |
- KEYWORDS="amd64 arm64 ~ppc ppc64 ~x86" |
930 |
-fi |
931 |
- |
932 |
-DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools" |
933 |
-HOMEPAGE="http://www.qemu.org http://www.linux-kvm.org" |
934 |
- |
935 |
-LICENSE="GPL-2 LGPL-2 BSD-2" |
936 |
-SLOT="0" |
937 |
- |
938 |
-IUSE="accessibility +aio alsa bzip2 capstone +caps +curl debug +doc |
939 |
- +fdt glusterfs gnutls gtk infiniband iscsi io-uring |
940 |
- jack jemalloc +jpeg kernel_linux |
941 |
- kernel_FreeBSD lzo multipath |
942 |
- ncurses nfs nls numa opengl +oss +pin-upstream-blobs |
943 |
- plugins +png pulseaudio python rbd sasl +seccomp sdl sdl-image selinux |
944 |
- +slirp |
945 |
- smartcard snappy spice ssh static static-user systemtap test udev usb |
946 |
- usbredir vde +vhost-net vhost-user-fs virgl virtfs +vnc vte xattr xen |
947 |
- xfs zstd" |
948 |
- |
949 |
-COMMON_TARGETS="aarch64 alpha arm cris hppa i386 m68k microblaze microblazeel |
950 |
- mips mips64 mips64el mipsel nios2 or1k ppc ppc64 riscv32 riscv64 s390x |
951 |
- sh4 sh4eb sparc sparc64 x86_64 xtensa xtensaeb" |
952 |
-IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} |
953 |
- avr lm32 moxie rx tricore unicore32" |
954 |
-IUSE_USER_TARGETS="${COMMON_TARGETS} |
955 |
- aarch64_be armeb mipsn32 mipsn32el ppc64abi32 ppc64le sparc32plus |
956 |
- tilegx" |
957 |
- |
958 |
-use_softmmu_targets=$(printf ' qemu_softmmu_targets_%s' ${IUSE_SOFTMMU_TARGETS}) |
959 |
-use_user_targets=$(printf ' qemu_user_targets_%s' ${IUSE_USER_TARGETS}) |
960 |
-IUSE+=" ${use_softmmu_targets} ${use_user_targets}" |
961 |
- |
962 |
-RESTRICT="!test? ( test )" |
963 |
-# Allow no targets to be built so that people can get a tools-only build. |
964 |
-# Block USE flag configurations known to not work. |
965 |
-REQUIRED_USE="${PYTHON_REQUIRED_USE} |
966 |
- qemu_softmmu_targets_arm? ( fdt ) |
967 |
- qemu_softmmu_targets_microblaze? ( fdt ) |
968 |
- qemu_softmmu_targets_mips64el? ( fdt ) |
969 |
- qemu_softmmu_targets_ppc64? ( fdt ) |
970 |
- qemu_softmmu_targets_ppc? ( fdt ) |
971 |
- qemu_softmmu_targets_riscv32? ( fdt ) |
972 |
- qemu_softmmu_targets_riscv64? ( fdt ) |
973 |
- static? ( static-user !alsa !gtk !jack !opengl !pulseaudio !plugins !rbd !snappy ) |
974 |
- static-user? ( !plugins ) |
975 |
- vhost-user-fs? ( caps seccomp ) |
976 |
- virtfs? ( caps xattr ) |
977 |
- vte? ( gtk ) |
978 |
- multipath? ( udev ) |
979 |
- plugins? ( !static !static-user ) |
980 |
-" |
981 |
- |
982 |
-# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...) |
983 |
-# and user/softmmu targets (qemu-*, qemu-system-*). |
984 |
-# |
985 |
-# Yep, you need both libcap and libcap-ng since virtfs only uses libcap. |
986 |
-# |
987 |
-# The attr lib isn't always linked in (although the USE flag is always |
988 |
-# respected). This is because qemu supports using the C library's API |
989 |
-# when available rather than always using the external library. |
990 |
-ALL_DEPEND=" |
991 |
- >=dev-libs/glib-2.0[static-libs(+)] |
992 |
- sys-libs/zlib[static-libs(+)] |
993 |
- python? ( ${PYTHON_DEPS} ) |
994 |
- systemtap? ( dev-util/systemtap ) |
995 |
- xattr? ( sys-apps/attr[static-libs(+)] )" |
996 |
- |
997 |
-# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...) |
998 |
-# softmmu targets (qemu-system-*). |
999 |
-SOFTMMU_TOOLS_DEPEND=" |
1000 |
- dev-libs/libxml2[static-libs(+)] |
1001 |
- >=x11-libs/pixman-0.28.0[static-libs(+)] |
1002 |
- accessibility? ( |
1003 |
- app-accessibility/brltty[api] |
1004 |
- app-accessibility/brltty[static-libs(+)] |
1005 |
- ) |
1006 |
- aio? ( dev-libs/libaio[static-libs(+)] ) |
1007 |
- alsa? ( >=media-libs/alsa-lib-1.0.13 ) |
1008 |
- bzip2? ( app-arch/bzip2[static-libs(+)] ) |
1009 |
- capstone? ( dev-libs/capstone:= ) |
1010 |
- caps? ( sys-libs/libcap-ng[static-libs(+)] ) |
1011 |
- curl? ( >=net-misc/curl-7.15.4[static-libs(+)] ) |
1012 |
- fdt? ( >=sys-apps/dtc-1.5.0[static-libs(+)] ) |
1013 |
- glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] ) |
1014 |
- gnutls? ( |
1015 |
- dev-libs/nettle:=[static-libs(+)] |
1016 |
- >=net-libs/gnutls-3.0:=[static-libs(+)] |
1017 |
- ) |
1018 |
- gtk? ( |
1019 |
- x11-libs/gtk+:3 |
1020 |
- vte? ( x11-libs/vte:2.91 ) |
1021 |
- ) |
1022 |
- infiniband? ( |
1023 |
- sys-fabric/libibumad:=[static-libs(+)] |
1024 |
- sys-fabric/libibverbs:=[static-libs(+)] |
1025 |
- sys-fabric/librdmacm:=[static-libs(+)] |
1026 |
- ) |
1027 |
- iscsi? ( net-libs/libiscsi ) |
1028 |
- io-uring? ( sys-libs/liburing:=[static-libs(+)] ) |
1029 |
- jack? ( virtual/jack ) |
1030 |
- jemalloc? ( dev-libs/jemalloc ) |
1031 |
- jpeg? ( virtual/jpeg:0=[static-libs(+)] ) |
1032 |
- lzo? ( dev-libs/lzo:2[static-libs(+)] ) |
1033 |
- multipath? ( sys-fs/multipath-tools ) |
1034 |
- ncurses? ( |
1035 |
- sys-libs/ncurses:0=[unicode] |
1036 |
- sys-libs/ncurses:0=[static-libs(+)] |
1037 |
- ) |
1038 |
- nfs? ( >=net-fs/libnfs-1.9.3:=[static-libs(+)] ) |
1039 |
- numa? ( sys-process/numactl[static-libs(+)] ) |
1040 |
- opengl? ( |
1041 |
- virtual/opengl |
1042 |
- media-libs/libepoxy[static-libs(+)] |
1043 |
- media-libs/mesa[static-libs(+)] |
1044 |
- media-libs/mesa[egl,gbm] |
1045 |
- ) |
1046 |
- png? ( media-libs/libpng:0=[static-libs(+)] ) |
1047 |
- pulseaudio? ( media-sound/pulseaudio ) |
1048 |
- rbd? ( sys-cluster/ceph ) |
1049 |
- sasl? ( dev-libs/cyrus-sasl[static-libs(+)] ) |
1050 |
- sdl? ( |
1051 |
- media-libs/libsdl2[video] |
1052 |
- media-libs/libsdl2[static-libs(+)] |
1053 |
- ) |
1054 |
- sdl-image? ( media-libs/sdl2-image[static-libs(+)] ) |
1055 |
- seccomp? ( >=sys-libs/libseccomp-2.1.0[static-libs(+)] ) |
1056 |
- slirp? ( net-libs/libslirp[static-libs(+)] ) |
1057 |
- smartcard? ( >=app-emulation/libcacard-2.5.0[static-libs(+)] ) |
1058 |
- snappy? ( app-arch/snappy:= ) |
1059 |
- spice? ( |
1060 |
- >=app-emulation/spice-protocol-0.12.3 |
1061 |
- >=app-emulation/spice-0.12.0[static-libs(+)] |
1062 |
- ) |
1063 |
- ssh? ( >=net-libs/libssh-0.8.6[static-libs(+)] ) |
1064 |
- udev? ( virtual/libudev[static-libs(+)] ) |
1065 |
- usb? ( >=virtual/libusb-1-r2[static-libs(+)] ) |
1066 |
- usbredir? ( >=sys-apps/usbredir-0.6[static-libs(+)] ) |
1067 |
- vde? ( net-misc/vde[static-libs(+)] ) |
1068 |
- virgl? ( media-libs/virglrenderer[static-libs(+)] ) |
1069 |
- virtfs? ( sys-libs/libcap ) |
1070 |
- xen? ( app-emulation/xen-tools:= ) |
1071 |
- xfs? ( sys-fs/xfsprogs[static-libs(+)] ) |
1072 |
- zstd? ( >=app-arch/zstd-1.4.0[static-libs(+)] ) |
1073 |
-" |
1074 |
- |
1075 |
-X86_FIRMWARE_DEPEND=" |
1076 |
- pin-upstream-blobs? ( |
1077 |
- ~sys-firmware/edk2-ovmf-201905[binary] |
1078 |
- ~sys-firmware/ipxe-1.0.0_p20190728[binary,qemu] |
1079 |
- ~sys-firmware/seabios-1.12.0[binary,seavgabios] |
1080 |
- ~sys-firmware/sgabios-0.1_pre8[binary] |
1081 |
- ) |
1082 |
- !pin-upstream-blobs? ( |
1083 |
- sys-firmware/edk2-ovmf |
1084 |
- sys-firmware/ipxe[qemu] |
1085 |
- >=sys-firmware/seabios-1.10.2[seavgabios] |
1086 |
- sys-firmware/sgabios |
1087 |
- )" |
1088 |
-PPC_FIRMWARE_DEPEND=" |
1089 |
- pin-upstream-blobs? ( |
1090 |
- ~sys-firmware/seabios-1.12.0[binary,seavgabios] |
1091 |
- ) |
1092 |
- !pin-upstream-blobs? ( |
1093 |
- >=sys-firmware/seabios-1.10.2[seavgabios] |
1094 |
- ) |
1095 |
-" |
1096 |
- |
1097 |
-BDEPEND=" |
1098 |
- $(python_gen_impl_dep) |
1099 |
- dev-lang/perl |
1100 |
- sys-apps/texinfo |
1101 |
- virtual/pkgconfig |
1102 |
- doc? ( dev-python/sphinx ) |
1103 |
- gtk? ( nls? ( sys-devel/gettext ) ) |
1104 |
- test? ( |
1105 |
- dev-libs/glib[utils] |
1106 |
- sys-devel/bc |
1107 |
- ) |
1108 |
-" |
1109 |
-CDEPEND=" |
1110 |
- !static? ( |
1111 |
- ${ALL_DEPEND//\[static-libs(+)]} |
1112 |
- ${SOFTMMU_TOOLS_DEPEND//\[static-libs(+)]} |
1113 |
- ) |
1114 |
- qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} ) |
1115 |
- qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} ) |
1116 |
- qemu_softmmu_targets_ppc? ( ${PPC_FIRMWARE_DEPEND} ) |
1117 |
- qemu_softmmu_targets_ppc64? ( ${PPC_FIRMWARE_DEPEND} ) |
1118 |
-" |
1119 |
-DEPEND="${CDEPEND} |
1120 |
- kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 ) |
1121 |
- static? ( |
1122 |
- ${ALL_DEPEND} |
1123 |
- ${SOFTMMU_TOOLS_DEPEND} |
1124 |
- ) |
1125 |
- static-user? ( ${ALL_DEPEND} )" |
1126 |
-RDEPEND="${CDEPEND} |
1127 |
- acct-group/kvm |
1128 |
- selinux? ( sec-policy/selinux-qemu )" |
1129 |
- |
1130 |
-PATCHES=( |
1131 |
- "${FILESDIR}"/${PN}-2.11.1-capstone_include_path.patch |
1132 |
- "${FILESDIR}"/${PN}-5.2.0-cleaner-werror.patch |
1133 |
- "${FILESDIR}"/${PN}-5.2.0-disable-keymap.patch |
1134 |
- "${FILESDIR}"/${PN}-5.2.0-strings.patch |
1135 |
- "${FILESDIR}"/${PN}-5.2.0-fix-firmware-path.patch |
1136 |
- "${FILESDIR}"/${PN}-5.2.0-no-pie-ld.patch |
1137 |
-) |
1138 |
- |
1139 |
-QA_PREBUILT=" |
1140 |
- usr/share/qemu/hppa-firmware.img |
1141 |
- usr/share/qemu/openbios-ppc |
1142 |
- usr/share/qemu/openbios-sparc64 |
1143 |
- usr/share/qemu/openbios-sparc32 |
1144 |
- usr/share/qemu/opensbi-riscv64-generic-fw_dynamic.elf |
1145 |
- usr/share/qemu/opensbi-riscv32-generic-fw_dynamic.elf |
1146 |
- usr/share/qemu/palcode-clipper |
1147 |
- usr/share/qemu/s390-ccw.img |
1148 |
- usr/share/qemu/s390-netboot.img |
1149 |
- usr/share/qemu/u-boot.e500 |
1150 |
-" |
1151 |
- |
1152 |
-QA_WX_LOAD="usr/bin/qemu-i386 |
1153 |
- usr/bin/qemu-x86_64 |
1154 |
- usr/bin/qemu-alpha |
1155 |
- usr/bin/qemu-arm |
1156 |
- usr/bin/qemu-cris |
1157 |
- usr/bin/qemu-m68k |
1158 |
- usr/bin/qemu-microblaze |
1159 |
- usr/bin/qemu-microblazeel |
1160 |
- usr/bin/qemu-mips |
1161 |
- usr/bin/qemu-mipsel |
1162 |
- usr/bin/qemu-or1k |
1163 |
- usr/bin/qemu-ppc |
1164 |
- usr/bin/qemu-ppc64 |
1165 |
- usr/bin/qemu-ppc64abi32 |
1166 |
- usr/bin/qemu-sh4 |
1167 |
- usr/bin/qemu-sh4eb |
1168 |
- usr/bin/qemu-sparc |
1169 |
- usr/bin/qemu-sparc64 |
1170 |
- usr/bin/qemu-armeb |
1171 |
- usr/bin/qemu-sparc32plus |
1172 |
- usr/bin/qemu-s390x |
1173 |
- usr/bin/qemu-unicore32 |
1174 |
-" |
1175 |
- |
1176 |
-DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure you have the |
1177 |
-kernel module loaded before running kvm. The easiest way to ensure that the |
1178 |
-kernel module is loaded is to load it on boot. |
1179 |
- For AMD CPUs the module is called 'kvm-amd'. |
1180 |
- For Intel CPUs the module is called 'kvm-intel'. |
1181 |
-Please review /etc/conf.d/modules for how to load these. |
1182 |
- |
1183 |
-Make sure your user is in the 'kvm' group. Just run |
1184 |
- $ gpasswd -a <USER> kvm |
1185 |
-then have <USER> re-login. |
1186 |
- |
1187 |
-For brand new installs, the default permissions on /dev/kvm might not let |
1188 |
-you access it. You can tell udev to reset ownership/perms: |
1189 |
- $ udevadm trigger -c add /dev/kvm |
1190 |
- |
1191 |
-If you want to register binfmt handlers for qemu user targets: |
1192 |
-For openrc: |
1193 |
- # rc-update add qemu-binfmt |
1194 |
-For systemd: |
1195 |
- # ln -s /usr/share/qemu/binfmt.d/qemu.conf /etc/binfmt.d/qemu.conf" |
1196 |
- |
1197 |
-pkg_pretend() { |
1198 |
- if use kernel_linux && kernel_is lt 2 6 25; then |
1199 |
- eerror "This version of KVM requires a host kernel of 2.6.25 or higher." |
1200 |
- elif use kernel_linux; then |
1201 |
- if ! linux_config_exists; then |
1202 |
- eerror "Unable to check your kernel for KVM support" |
1203 |
- else |
1204 |
- CONFIG_CHECK="~KVM ~TUN ~BRIDGE" |
1205 |
- ERROR_KVM="You must enable KVM in your kernel to continue" |
1206 |
- ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in" |
1207 |
- ERROR_KVM_AMD+=" your kernel configuration." |
1208 |
- ERROR_KVM_INTEL="If you have an Intel CPU, you must enable" |
1209 |
- ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration." |
1210 |
- ERROR_TUN="You will need the Universal TUN/TAP driver compiled" |
1211 |
- ERROR_TUN+=" into your kernel or loaded as a module to use the" |
1212 |
- ERROR_TUN+=" virtual network device if using -net tap." |
1213 |
- ERROR_BRIDGE="You will also need support for 802.1d" |
1214 |
- ERROR_BRIDGE+=" Ethernet Bridging for some network configurations." |
1215 |
- use vhost-net && CONFIG_CHECK+=" ~VHOST_NET" |
1216 |
- ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net" |
1217 |
- ERROR_VHOST_NET+=" support" |
1218 |
- |
1219 |
- if use amd64 || use x86 || use amd64-linux || use x86-linux; then |
1220 |
- if grep -q AuthenticAMD /proc/cpuinfo; then |
1221 |
- CONFIG_CHECK+=" ~KVM_AMD" |
1222 |
- elif grep -q GenuineIntel /proc/cpuinfo; then |
1223 |
- CONFIG_CHECK+=" ~KVM_INTEL" |
1224 |
- fi |
1225 |
- fi |
1226 |
- |
1227 |
- use python && CONFIG_CHECK+=" ~DEBUG_FS" |
1228 |
- ERROR_DEBUG_FS="debugFS support required for kvm_stat" |
1229 |
- |
1230 |
- # Now do the actual checks setup above |
1231 |
- check_extra_config |
1232 |
- fi |
1233 |
- fi |
1234 |
- |
1235 |
- if grep -qs '/usr/bin/qemu-kvm' "${EROOT}"/etc/libvirt/qemu/*.xml; then |
1236 |
- eerror "The kvm/qemu-kvm wrappers no longer exist, but your libvirt" |
1237 |
- eerror "instances are still pointing to it. Please update your" |
1238 |
- eerror "configs in /etc/libvirt/qemu/ to use the -enable-kvm flag" |
1239 |
- eerror "and the right system binary (e.g. qemu-system-x86_64)." |
1240 |
- die "update your virt configs to not use qemu-kvm" |
1241 |
- fi |
1242 |
-} |
1243 |
- |
1244 |
-# Sanity check to make sure target lists are kept up-to-date. |
1245 |
-check_targets() { |
1246 |
- local var=$1 mak=$2 |
1247 |
- local detected sorted |
1248 |
- |
1249 |
- pushd "${S}"/default-configs/targets/ >/dev/null || die |
1250 |
- |
1251 |
- # Force C locale until glibc is updated. #564936 |
1252 |
- detected=$(echo $(printf '%s\n' *-${mak}.mak | sed "s:-${mak}.mak::" | LC_COLLATE=C sort -u)) |
1253 |
- sorted=$(echo $(printf '%s\n' ${!var} | LC_COLLATE=C sort -u)) |
1254 |
- if [[ ${sorted} != "${detected}" ]] ; then |
1255 |
- eerror "The ebuild needs to be kept in sync." |
1256 |
- eerror "${var}: ${sorted}" |
1257 |
- eerror "$(printf '%-*s' ${#var} configure): ${detected}" |
1258 |
- die "sync ${var} to the list of targets" |
1259 |
- fi |
1260 |
- |
1261 |
- popd >/dev/null |
1262 |
-} |
1263 |
- |
1264 |
-src_prepare() { |
1265 |
- # workaround -fcommon breakage: bug #726560 |
1266 |
- [[ ${PV} == 5.2.0 ]] || die "Check if -fcommon hack is needed" |
1267 |
- filter-flags -fcommon |
1268 |
- |
1269 |
- check_targets IUSE_SOFTMMU_TARGETS softmmu |
1270 |
- check_targets IUSE_USER_TARGETS linux-user |
1271 |
- |
1272 |
- default |
1273 |
- |
1274 |
- # Use correct toolchain to fix cross-compiling |
1275 |
- tc-export AR AS LD NM OBJCOPY PKG_CONFIG RANLIB STRINGS |
1276 |
- export WINDRES=${CHOST}-windres |
1277 |
- |
1278 |
- # Verbose builds |
1279 |
- MAKEOPTS+=" V=1" |
1280 |
- |
1281 |
- # Remove bundled copy of libfdt |
1282 |
- rm -r dtc || die |
1283 |
-} |
1284 |
- |
1285 |
-## |
1286 |
-# configures qemu based on the build directory and the build type |
1287 |
-# we are using. |
1288 |
-# |
1289 |
-qemu_src_configure() { |
1290 |
- debug-print-function ${FUNCNAME} "$@" |
1291 |
- |
1292 |
- local buildtype=$1 |
1293 |
- local builddir="${S}/${buildtype}-build" |
1294 |
- |
1295 |
- mkdir "${builddir}" |
1296 |
- |
1297 |
- local conf_opts=( |
1298 |
- --prefix=/usr |
1299 |
- --sysconfdir=/etc |
1300 |
- --bindir=/usr/bin |
1301 |
- --libdir=/usr/$(get_libdir) |
1302 |
- --datadir=/usr/share |
1303 |
- --docdir=/usr/share/doc/${PF}/html |
1304 |
- --mandir=/usr/share/man |
1305 |
- --localstatedir=/var |
1306 |
- --disable-bsd-user |
1307 |
- --disable-containers # bug #732972 |
1308 |
- --disable-guest-agent |
1309 |
- --disable-strip |
1310 |
- |
1311 |
- # bug #746752: TCG interpreter has a few limitations: |
1312 |
- # - it does not support FPU |
1313 |
- # - it's generally slower on non-self-modifying code |
1314 |
- # It's advantage is support for host architectures |
1315 |
- # where native codegeneration is not implemented. |
1316 |
- # Gentoo has qemu keyworded only on targets with |
1317 |
- # native code generation available. Avoid the interpreter. |
1318 |
- --disable-tcg-interpreter |
1319 |
- |
1320 |
- --disable-werror |
1321 |
- # We support gnutls/nettle for crypto operations. It is possible |
1322 |
- # to use gcrypt when gnutls/nettle are disabled (but not when they |
1323 |
- # are enabled), but it's not really worth the hassle. Disable it |
1324 |
- # all the time to avoid automatically detecting it. #568856 |
1325 |
- --disable-gcrypt |
1326 |
- --python="${PYTHON}" |
1327 |
- --cc="$(tc-getCC)" |
1328 |
- --cxx="$(tc-getCXX)" |
1329 |
- --host-cc="$(tc-getBUILD_CC)" |
1330 |
- $(use_enable debug debug-info) |
1331 |
- $(use_enable debug debug-tcg) |
1332 |
- $(use_enable doc docs) |
1333 |
- $(use_enable nls gettext) |
1334 |
- $(use_enable plugins) |
1335 |
- $(use_enable xattr attr) |
1336 |
- ) |
1337 |
- |
1338 |
- # Disable options not used by user targets. This simplifies building |
1339 |
- # static user targets (USE=static-user) considerably. |
1340 |
- conf_notuser() { |
1341 |
- if [[ ${buildtype} == "user" ]] ; then |
1342 |
- echo "--disable-${2:-$1}" |
1343 |
- else |
1344 |
- use_enable "$@" |
1345 |
- fi |
1346 |
- } |
1347 |
- # Enable option only for softmmu build, but not 'user' or 'tools' |
1348 |
- conf_softmmu() { |
1349 |
- if [[ ${buildtype} == "softmmu" ]] ; then |
1350 |
- use_enable "$@" |
1351 |
- else |
1352 |
- echo "--disable-${2:-$1}" |
1353 |
- fi |
1354 |
- } |
1355 |
- # Enable option only for tools build, but not 'user' or 'softmmu' |
1356 |
- conf_tools() { |
1357 |
- if [[ ${buildtype} == "tools" ]] ; then |
1358 |
- use_enable "$@" |
1359 |
- else |
1360 |
- echo "--disable-${2:-$1}" |
1361 |
- fi |
1362 |
- } |
1363 |
- conf_opts+=( |
1364 |
- $(conf_notuser accessibility brlapi) |
1365 |
- $(conf_notuser aio linux-aio) |
1366 |
- $(conf_notuser bzip2) |
1367 |
- $(conf_notuser capstone) |
1368 |
- $(conf_notuser caps cap-ng) |
1369 |
- $(conf_notuser curl) |
1370 |
- $(conf_notuser fdt) |
1371 |
- $(conf_notuser glusterfs) |
1372 |
- $(conf_notuser gnutls) |
1373 |
- $(conf_notuser gnutls nettle) |
1374 |
- $(conf_notuser gtk) |
1375 |
- $(conf_notuser infiniband rdma) |
1376 |
- $(conf_notuser iscsi libiscsi) |
1377 |
- $(conf_notuser io-uring linux-io-uring) |
1378 |
- $(conf_notuser jemalloc jemalloc) |
1379 |
- $(conf_notuser jpeg vnc-jpeg) |
1380 |
- $(conf_notuser kernel_linux kvm) |
1381 |
- $(conf_notuser lzo) |
1382 |
- $(conf_notuser multipath mpath) |
1383 |
- $(conf_notuser ncurses curses) |
1384 |
- $(conf_notuser nfs libnfs) |
1385 |
- $(conf_notuser numa) |
1386 |
- $(conf_notuser opengl) |
1387 |
- $(conf_notuser png vnc-png) |
1388 |
- $(conf_notuser rbd) |
1389 |
- $(conf_notuser sasl vnc-sasl) |
1390 |
- $(conf_notuser sdl) |
1391 |
- $(conf_softmmu sdl-image) |
1392 |
- $(conf_notuser seccomp) |
1393 |
- $(conf_notuser slirp slirp system) |
1394 |
- $(conf_notuser smartcard) |
1395 |
- $(conf_notuser snappy) |
1396 |
- $(conf_notuser spice) |
1397 |
- $(conf_notuser ssh libssh) |
1398 |
- $(conf_notuser udev libudev) |
1399 |
- $(conf_notuser usb libusb) |
1400 |
- $(conf_notuser usbredir usb-redir) |
1401 |
- $(conf_notuser vde) |
1402 |
- $(conf_notuser vhost-net) |
1403 |
- $(conf_notuser vhost-user-fs) |
1404 |
- $(conf_tools vhost-user-fs virtiofsd) |
1405 |
- $(conf_notuser virgl virglrenderer) |
1406 |
- $(conf_notuser virtfs) |
1407 |
- $(conf_notuser vnc) |
1408 |
- $(conf_notuser vte) |
1409 |
- $(conf_notuser xen) |
1410 |
- $(conf_notuser xen xen-pci-passthrough) |
1411 |
- $(conf_notuser xfs xfsctl) |
1412 |
- # use prebuilt keymaps, bug #759604 |
1413 |
- --disable-xkbcommon |
1414 |
- $(conf_notuser zstd) |
1415 |
- ) |
1416 |
- |
1417 |
- if [[ ${buildtype} == "user" ]] ; then |
1418 |
- conf_opts+=( --disable-libxml2 ) |
1419 |
- else |
1420 |
- conf_opts+=( --enable-libxml2 ) |
1421 |
- fi |
1422 |
- |
1423 |
- if [[ ! ${buildtype} == "user" ]] ; then |
1424 |
- # audio options |
1425 |
- local audio_opts=( |
1426 |
- # Note: backend order matters here: #716202 |
1427 |
- # We iterate from higher-level to lower level. |
1428 |
- $(usex pulseaudio pa "") |
1429 |
- $(usev jack) |
1430 |
- $(usev sdl) |
1431 |
- $(usev alsa) |
1432 |
- $(usev oss) |
1433 |
- ) |
1434 |
- conf_opts+=( |
1435 |
- --audio-drv-list=$(printf "%s," "${audio_opts[@]}") |
1436 |
- ) |
1437 |
- fi |
1438 |
- |
1439 |
- case ${buildtype} in |
1440 |
- user) |
1441 |
- conf_opts+=( |
1442 |
- --enable-linux-user |
1443 |
- --disable-system |
1444 |
- --disable-blobs |
1445 |
- --disable-tools |
1446 |
- ) |
1447 |
- local static_flag="static-user" |
1448 |
- ;; |
1449 |
- softmmu) |
1450 |
- conf_opts+=( |
1451 |
- --disable-linux-user |
1452 |
- --enable-system |
1453 |
- --disable-tools |
1454 |
- ) |
1455 |
- local static_flag="static" |
1456 |
- ;; |
1457 |
- tools) |
1458 |
- conf_opts+=( |
1459 |
- --disable-linux-user |
1460 |
- --disable-system |
1461 |
- --disable-blobs |
1462 |
- --enable-tools |
1463 |
- ) |
1464 |
- local static_flag="static" |
1465 |
- ;; |
1466 |
- esac |
1467 |
- |
1468 |
- local targets="${buildtype}_targets" |
1469 |
- [[ -n ${targets} ]] && conf_opts+=( --target-list="${!targets}" ) |
1470 |
- |
1471 |
- # Add support for SystemTAP |
1472 |
- use systemtap && conf_opts+=( --enable-trace-backend=dtrace ) |
1473 |
- |
1474 |
- # We always want to attempt to build with PIE support as it results |
1475 |
- # in a more secure binary. But it doesn't work with static or if |
1476 |
- # the current GCC doesn't have PIE support. |
1477 |
- if use ${static_flag}; then |
1478 |
- conf_opts+=( --static --disable-pie ) |
1479 |
- else |
1480 |
- tc-enables-pie && conf_opts+=( --enable-pie ) |
1481 |
- fi |
1482 |
- |
1483 |
- # Meson will not use a cross-file unless cross_prefix is set. |
1484 |
- tc-is-cross-compiler && conf_opts+=( --cross-prefix="${CHOST}-" ) |
1485 |
- |
1486 |
- # Plumb through equivalent of EXTRA_ECONF to allow experiments |
1487 |
- # like bug #747928. |
1488 |
- conf_opts+=( ${EXTRA_CONF_QEMU} ) |
1489 |
- |
1490 |
- echo "../configure ${conf_opts[*]}" |
1491 |
- cd "${builddir}" |
1492 |
- ../configure "${conf_opts[@]}" || die "configure failed" |
1493 |
- |
1494 |
- # FreeBSD's kernel does not support QEMU assigning/grabbing |
1495 |
- # host USB devices yet |
1496 |
- use kernel_FreeBSD && \ |
1497 |
- sed -i -E -e "s|^(HOST_USB=)bsd|\1stub|" "${S}"/config-host.mak |
1498 |
-} |
1499 |
- |
1500 |
-src_configure() { |
1501 |
- local target |
1502 |
- |
1503 |
- python_setup |
1504 |
- |
1505 |
- softmmu_targets= softmmu_bins=() |
1506 |
- user_targets= user_bins=() |
1507 |
- |
1508 |
- for target in ${IUSE_SOFTMMU_TARGETS} ; do |
1509 |
- if use "qemu_softmmu_targets_${target}"; then |
1510 |
- softmmu_targets+=",${target}-softmmu" |
1511 |
- softmmu_bins+=( "qemu-system-${target}" ) |
1512 |
- fi |
1513 |
- done |
1514 |
- |
1515 |
- for target in ${IUSE_USER_TARGETS} ; do |
1516 |
- if use "qemu_user_targets_${target}"; then |
1517 |
- user_targets+=",${target}-linux-user" |
1518 |
- user_bins+=( "qemu-${target}" ) |
1519 |
- fi |
1520 |
- done |
1521 |
- |
1522 |
- softmmu_targets=${softmmu_targets#,} |
1523 |
- user_targets=${user_targets#,} |
1524 |
- |
1525 |
- [[ -n ${softmmu_targets} ]] && qemu_src_configure "softmmu" |
1526 |
- [[ -n ${user_targets} ]] && qemu_src_configure "user" |
1527 |
- qemu_src_configure "tools" |
1528 |
-} |
1529 |
- |
1530 |
-src_compile() { |
1531 |
- if [[ -n ${user_targets} ]]; then |
1532 |
- cd "${S}/user-build" |
1533 |
- default |
1534 |
- fi |
1535 |
- |
1536 |
- if [[ -n ${softmmu_targets} ]]; then |
1537 |
- cd "${S}/softmmu-build" |
1538 |
- default |
1539 |
- fi |
1540 |
- |
1541 |
- cd "${S}/tools-build" |
1542 |
- default |
1543 |
-} |
1544 |
- |
1545 |
-src_test() { |
1546 |
- if [[ -n ${softmmu_targets} ]]; then |
1547 |
- cd "${S}/softmmu-build" |
1548 |
- pax-mark m */qemu-system-* #515550 |
1549 |
- emake check |
1550 |
- fi |
1551 |
-} |
1552 |
- |
1553 |
-qemu_python_install() { |
1554 |
- python_domodule "${S}/python/qemu" |
1555 |
- |
1556 |
- python_doscript "${S}/scripts/kvm/vmxcap" |
1557 |
- python_doscript "${S}/scripts/qmp/qmp-shell" |
1558 |
- python_doscript "${S}/scripts/qmp/qemu-ga-client" |
1559 |
-} |
1560 |
- |
1561 |
-# Generate binfmt support files. |
1562 |
-# - /etc/init.d/qemu-binfmt script which registers the user handlers (openrc) |
1563 |
-# - /usr/share/qemu/binfmt.d/qemu.conf (for use with systemd-binfmt) |
1564 |
-generate_initd() { |
1565 |
- local out="${T}/qemu-binfmt" |
1566 |
- local out_systemd="${T}/qemu.conf" |
1567 |
- local d="${T}/binfmt.d" |
1568 |
- |
1569 |
- einfo "Generating qemu binfmt scripts and configuration files" |
1570 |
- |
1571 |
- # Generate the debian fragments first. |
1572 |
- mkdir -p "${d}" |
1573 |
- "${S}"/scripts/qemu-binfmt-conf.sh \ |
1574 |
- --debian \ |
1575 |
- --exportdir "${d}" \ |
1576 |
- --qemu-path "${EPREFIX}/usr/bin" \ |
1577 |
- || die |
1578 |
- # Then turn the fragments into a shell script we can source. |
1579 |
- sed -E -i \ |
1580 |
- -e 's:^([^ ]+) (.*)$:\1="\2":' \ |
1581 |
- "${d}"/* || die |
1582 |
- |
1583 |
- # Generate the init.d script by assembling the fragments from above. |
1584 |
- local f qcpu package interpreter magic mask |
1585 |
- cat "${FILESDIR}"/qemu-binfmt.initd.head >"${out}" || die |
1586 |
- for f in "${d}"/qemu-* ; do |
1587 |
- source "${f}" |
1588 |
- |
1589 |
- # Normalize the cpu logic like we do in the init.d for the native cpu. |
1590 |
- qcpu=${package#qemu-} |
1591 |
- case ${qcpu} in |
1592 |
- arm*) qcpu="arm";; |
1593 |
- mips*) qcpu="mips";; |
1594 |
- ppc*) qcpu="ppc";; |
1595 |
- s390*) qcpu="s390";; |
1596 |
- sh*) qcpu="sh";; |
1597 |
- sparc*) qcpu="sparc";; |
1598 |
- esac |
1599 |
- |
1600 |
- # we use 'printf' here to be portable across 'sh' |
1601 |
- # implementations: #679168 |
1602 |
- cat <<EOF >>"${out}" |
1603 |
- if [ "\${cpu}" != "${qcpu}" -a -x "${interpreter}" ] ; then |
1604 |
- printf '%s\n' ':${package}:M::${magic}:${mask}:${interpreter}:'"\${QEMU_BINFMT_FLAGS}" >/proc/sys/fs/binfmt_misc/register |
1605 |
- fi |
1606 |
-EOF |
1607 |
- |
1608 |
- echo ":${package}:M::${magic}:${mask}:${interpreter}:OC" >>"${out_systemd}" |
1609 |
- |
1610 |
- done |
1611 |
- cat "${FILESDIR}"/qemu-binfmt.initd.tail >>"${out}" || die |
1612 |
-} |
1613 |
- |
1614 |
-src_install() { |
1615 |
- if [[ -n ${user_targets} ]]; then |
1616 |
- cd "${S}/user-build" |
1617 |
- emake DESTDIR="${ED}" install |
1618 |
- |
1619 |
- # Install binfmt handler init script for user targets. |
1620 |
- generate_initd |
1621 |
- doinitd "${T}/qemu-binfmt" |
1622 |
- |
1623 |
- # Install binfmt/qemu.conf. |
1624 |
- insinto "/usr/share/qemu/binfmt.d" |
1625 |
- doins "${T}/qemu.conf" |
1626 |
- fi |
1627 |
- |
1628 |
- if [[ -n ${softmmu_targets} ]]; then |
1629 |
- cd "${S}/softmmu-build" |
1630 |
- emake DESTDIR="${ED}" install |
1631 |
- |
1632 |
- # This might not exist if the test failed. #512010 |
1633 |
- [[ -e check-report.html ]] && dodoc check-report.html |
1634 |
- |
1635 |
- if use kernel_linux; then |
1636 |
- udev_newrules "${FILESDIR}"/65-kvm.rules-r2 65-kvm.rules |
1637 |
- fi |
1638 |
- |
1639 |
- if use python; then |
1640 |
- python_foreach_impl qemu_python_install |
1641 |
- fi |
1642 |
- fi |
1643 |
- |
1644 |
- cd "${S}/tools-build" |
1645 |
- emake DESTDIR="${ED}" install |
1646 |
- |
1647 |
- # Disable mprotect on the qemu binaries as they use JITs to be fast #459348 |
1648 |
- pushd "${ED}"/usr/bin >/dev/null |
1649 |
- pax-mark mr "${softmmu_bins[@]}" "${user_bins[@]}" # bug 575594 |
1650 |
- popd >/dev/null |
1651 |
- |
1652 |
- # Install config file example for qemu-bridge-helper |
1653 |
- insinto "/etc/qemu" |
1654 |
- doins "${FILESDIR}/bridge.conf" |
1655 |
- |
1656 |
- cd "${S}" |
1657 |
- dodoc MAINTAINERS docs/specs/pci-ids.txt |
1658 |
- newdoc pc-bios/README README.pc-bios |
1659 |
- |
1660 |
- # Disallow stripping of prebuilt firmware files. |
1661 |
- dostrip -x ${QA_PREBUILT} |
1662 |
- |
1663 |
- if [[ -n ${softmmu_targets} ]]; then |
1664 |
- # Remove SeaBIOS since we're using the SeaBIOS packaged one |
1665 |
- rm "${ED}/usr/share/qemu/bios.bin" |
1666 |
- rm "${ED}/usr/share/qemu/bios-256k.bin" |
1667 |
- if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
1668 |
- dosym ../seabios/bios.bin /usr/share/qemu/bios.bin |
1669 |
- dosym ../seabios/bios-256k.bin /usr/share/qemu/bios-256k.bin |
1670 |
- fi |
1671 |
- |
1672 |
- # Remove vgabios since we're using the seavgabios packaged one |
1673 |
- rm "${ED}/usr/share/qemu/vgabios.bin" |
1674 |
- rm "${ED}/usr/share/qemu/vgabios-cirrus.bin" |
1675 |
- rm "${ED}/usr/share/qemu/vgabios-qxl.bin" |
1676 |
- rm "${ED}/usr/share/qemu/vgabios-stdvga.bin" |
1677 |
- rm "${ED}/usr/share/qemu/vgabios-virtio.bin" |
1678 |
- rm "${ED}/usr/share/qemu/vgabios-vmware.bin" |
1679 |
- # PPC/PPC64 loads vgabios-stdvga |
1680 |
- if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386 || use qemu_softmmu_targets_ppc || use qemu_softmmu_targets_ppc64; then |
1681 |
- dosym ../seavgabios/vgabios-isavga.bin /usr/share/qemu/vgabios.bin |
1682 |
- dosym ../seavgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin |
1683 |
- dosym ../seavgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin |
1684 |
- dosym ../seavgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin |
1685 |
- dosym ../seavgabios/vgabios-virtio.bin /usr/share/qemu/vgabios-virtio.bin |
1686 |
- dosym ../seavgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin |
1687 |
- fi |
1688 |
- |
1689 |
- # Remove sgabios since we're using the sgabios packaged one |
1690 |
- rm "${ED}/usr/share/qemu/sgabios.bin" |
1691 |
- if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
1692 |
- dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin |
1693 |
- fi |
1694 |
- |
1695 |
- # Remove iPXE since we're using the iPXE packaged one |
1696 |
- rm "${ED}"/usr/share/qemu/pxe-*.rom |
1697 |
- if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
1698 |
- dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom |
1699 |
- dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom |
1700 |
- dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom |
1701 |
- dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom |
1702 |
- dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom |
1703 |
- dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom |
1704 |
- fi |
1705 |
- fi |
1706 |
- |
1707 |
- DISABLE_AUTOFORMATTING=true |
1708 |
- readme.gentoo_create_doc |
1709 |
-} |
1710 |
- |
1711 |
-firmware_abi_change() { |
1712 |
- local pv |
1713 |
- for pv in ${REPLACING_VERSIONS}; do |
1714 |
- if ver_test ${pv} -lt ${FIRMWARE_ABI_VERSION}; then |
1715 |
- return 0 |
1716 |
- fi |
1717 |
- done |
1718 |
- return 1 |
1719 |
-} |
1720 |
- |
1721 |
-pkg_postinst() { |
1722 |
- if [[ -n ${softmmu_targets} ]] && use kernel_linux; then |
1723 |
- udev_reload |
1724 |
- fi |
1725 |
- |
1726 |
- xdg_icon_cache_update |
1727 |
- |
1728 |
- [[ -z ${EPREFIX} ]] && [[ -f ${EROOT}/usr/libexec/qemu-bridge-helper ]] && \ |
1729 |
- fcaps cap_net_admin ${EROOT}/usr/libexec/qemu-bridge-helper |
1730 |
- |
1731 |
- DISABLE_AUTOFORMATTING=true |
1732 |
- readme.gentoo_print_elog |
1733 |
- |
1734 |
- if use pin-upstream-blobs && firmware_abi_change; then |
1735 |
- ewarn "This version of qemu pins new versions of firmware blobs:" |
1736 |
- ewarn " $(best_version sys-firmware/edk2-ovmf)" |
1737 |
- ewarn " $(best_version sys-firmware/ipxe)" |
1738 |
- ewarn " $(best_version sys-firmware/seabios)" |
1739 |
- ewarn " $(best_version sys-firmware/sgabios)" |
1740 |
- ewarn "This might break resume of hibernated guests (started with a different" |
1741 |
- ewarn "firmware version) and live migration to/from qemu versions with different" |
1742 |
- ewarn "firmware. Please (cold) restart all running guests. For functional" |
1743 |
- ewarn "guest migration ensure that all" |
1744 |
- ewarn "hosts run at least" |
1745 |
- ewarn " app-emulation/qemu-${FIRMWARE_ABI_VERSION}." |
1746 |
- fi |
1747 |
-} |
1748 |
- |
1749 |
-pkg_info() { |
1750 |
- echo "Using:" |
1751 |
- echo " $(best_version app-emulation/spice-protocol)" |
1752 |
- echo " $(best_version sys-firmware/edk2-ovmf)" |
1753 |
- if has_version 'sys-firmware/edk2-ovmf[binary]'; then |
1754 |
- echo " USE=binary" |
1755 |
- else |
1756 |
- echo " USE=''" |
1757 |
- fi |
1758 |
- echo " $(best_version sys-firmware/ipxe)" |
1759 |
- echo " $(best_version sys-firmware/seabios)" |
1760 |
- if has_version 'sys-firmware/seabios[binary]'; then |
1761 |
- echo " USE=binary" |
1762 |
- else |
1763 |
- echo " USE=''" |
1764 |
- fi |
1765 |
- echo " $(best_version sys-firmware/sgabios)" |
1766 |
-} |
1767 |
- |
1768 |
-pkg_postrm() { |
1769 |
- xdg_icon_cache_update |
1770 |
-} |
1771 |
|
1772 |
diff --git a/app-emulation/qemu/qemu-5.2.0-r50.ebuild b/app-emulation/qemu/qemu-5.2.0-r50.ebuild |
1773 |
deleted file mode 100644 |
1774 |
index 5e20ed0ce71..00000000000 |
1775 |
--- a/app-emulation/qemu/qemu-5.2.0-r50.ebuild |
1776 |
+++ /dev/null |
1777 |
@@ -1,871 +0,0 @@ |
1778 |
-# Copyright 1999-2021 Gentoo Authors |
1779 |
-# Distributed under the terms of the GNU General Public License v2 |
1780 |
- |
1781 |
-EAPI="7" |
1782 |
- |
1783 |
-PYTHON_COMPAT=( python3_{7,8,9} ) |
1784 |
-PYTHON_REQ_USE="ncurses,readline" |
1785 |
- |
1786 |
-FIRMWARE_ABI_VERSION="5.2.0-r50" |
1787 |
- |
1788 |
-inherit eutils linux-info toolchain-funcs multilib python-r1 |
1789 |
-inherit udev fcaps readme.gentoo-r1 pax-utils l10n xdg-utils |
1790 |
-inherit flag-o-matic |
1791 |
- |
1792 |
-if [[ ${PV} = *9999* ]]; then |
1793 |
- EGIT_REPO_URI="https://git.qemu.org/git/qemu.git" |
1794 |
- EGIT_SUBMODULES=( |
1795 |
- meson |
1796 |
- tests/fp/berkeley-softfloat-3 |
1797 |
- tests/fp/berkeley-testfloat-3 |
1798 |
- ui/keycodemapdb |
1799 |
- ) |
1800 |
- inherit git-r3 |
1801 |
- SRC_URI="" |
1802 |
-else |
1803 |
- SRC_URI="https://download.qemu.org/${P}.tar.xz" |
1804 |
- KEYWORDS="amd64 arm64 ~ppc ppc64 x86" |
1805 |
-fi |
1806 |
- |
1807 |
-DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools" |
1808 |
-HOMEPAGE="http://www.qemu.org http://www.linux-kvm.org" |
1809 |
- |
1810 |
-LICENSE="GPL-2 LGPL-2 BSD-2" |
1811 |
-SLOT="0" |
1812 |
- |
1813 |
-IUSE="accessibility +aio alsa bzip2 capstone +caps +curl debug +doc |
1814 |
- +fdt glusterfs gnutls gtk infiniband iscsi io-uring |
1815 |
- jack jemalloc +jpeg kernel_linux |
1816 |
- kernel_FreeBSD lzo multipath |
1817 |
- ncurses nfs nls numa opengl +oss +pin-upstream-blobs |
1818 |
- plugins +png pulseaudio python rbd sasl +seccomp sdl sdl-image selinux |
1819 |
- +slirp |
1820 |
- smartcard snappy spice ssh static static-user systemtap test udev usb |
1821 |
- usbredir vde +vhost-net vhost-user-fs virgl virtfs +vnc vte xattr xen |
1822 |
- xfs zstd" |
1823 |
- |
1824 |
-COMMON_TARGETS="aarch64 alpha arm cris hppa i386 m68k microblaze microblazeel |
1825 |
- mips mips64 mips64el mipsel nios2 or1k ppc ppc64 riscv32 riscv64 s390x |
1826 |
- sh4 sh4eb sparc sparc64 x86_64 xtensa xtensaeb" |
1827 |
-IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} |
1828 |
- avr lm32 moxie rx tricore unicore32" |
1829 |
-IUSE_USER_TARGETS="${COMMON_TARGETS} |
1830 |
- aarch64_be armeb mipsn32 mipsn32el ppc64abi32 ppc64le sparc32plus |
1831 |
- tilegx" |
1832 |
- |
1833 |
-use_softmmu_targets=$(printf ' qemu_softmmu_targets_%s' ${IUSE_SOFTMMU_TARGETS}) |
1834 |
-use_user_targets=$(printf ' qemu_user_targets_%s' ${IUSE_USER_TARGETS}) |
1835 |
-IUSE+=" ${use_softmmu_targets} ${use_user_targets}" |
1836 |
- |
1837 |
-RESTRICT="!test? ( test )" |
1838 |
-# Allow no targets to be built so that people can get a tools-only build. |
1839 |
-# Block USE flag configurations known to not work. |
1840 |
-REQUIRED_USE="${PYTHON_REQUIRED_USE} |
1841 |
- qemu_softmmu_targets_arm? ( fdt ) |
1842 |
- qemu_softmmu_targets_microblaze? ( fdt ) |
1843 |
- qemu_softmmu_targets_mips64el? ( fdt ) |
1844 |
- qemu_softmmu_targets_ppc64? ( fdt ) |
1845 |
- qemu_softmmu_targets_ppc? ( fdt ) |
1846 |
- qemu_softmmu_targets_riscv32? ( fdt ) |
1847 |
- qemu_softmmu_targets_riscv64? ( fdt ) |
1848 |
- static? ( static-user !alsa !gtk !jack !opengl !pulseaudio !plugins !rbd !snappy ) |
1849 |
- static-user? ( !plugins ) |
1850 |
- vhost-user-fs? ( caps seccomp ) |
1851 |
- virtfs? ( caps xattr ) |
1852 |
- vte? ( gtk ) |
1853 |
- multipath? ( udev ) |
1854 |
- plugins? ( !static !static-user ) |
1855 |
-" |
1856 |
- |
1857 |
-# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...) |
1858 |
-# and user/softmmu targets (qemu-*, qemu-system-*). |
1859 |
-# |
1860 |
-# Yep, you need both libcap and libcap-ng since virtfs only uses libcap. |
1861 |
-# |
1862 |
-# The attr lib isn't always linked in (although the USE flag is always |
1863 |
-# respected). This is because qemu supports using the C library's API |
1864 |
-# when available rather than always using the external library. |
1865 |
-ALL_DEPEND=" |
1866 |
- >=dev-libs/glib-2.0[static-libs(+)] |
1867 |
- sys-libs/zlib[static-libs(+)] |
1868 |
- python? ( ${PYTHON_DEPS} ) |
1869 |
- systemtap? ( dev-util/systemtap ) |
1870 |
- xattr? ( sys-apps/attr[static-libs(+)] )" |
1871 |
- |
1872 |
-# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...) |
1873 |
-# softmmu targets (qemu-system-*). |
1874 |
-SOFTMMU_TOOLS_DEPEND=" |
1875 |
- dev-libs/libxml2[static-libs(+)] |
1876 |
- >=x11-libs/pixman-0.28.0[static-libs(+)] |
1877 |
- accessibility? ( |
1878 |
- app-accessibility/brltty[api] |
1879 |
- app-accessibility/brltty[static-libs(+)] |
1880 |
- ) |
1881 |
- aio? ( dev-libs/libaio[static-libs(+)] ) |
1882 |
- alsa? ( >=media-libs/alsa-lib-1.0.13 ) |
1883 |
- bzip2? ( app-arch/bzip2[static-libs(+)] ) |
1884 |
- capstone? ( dev-libs/capstone:= ) |
1885 |
- caps? ( sys-libs/libcap-ng[static-libs(+)] ) |
1886 |
- curl? ( >=net-misc/curl-7.15.4[static-libs(+)] ) |
1887 |
- fdt? ( >=sys-apps/dtc-1.5.0[static-libs(+)] ) |
1888 |
- glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] ) |
1889 |
- gnutls? ( |
1890 |
- dev-libs/nettle:=[static-libs(+)] |
1891 |
- >=net-libs/gnutls-3.0:=[static-libs(+)] |
1892 |
- ) |
1893 |
- gtk? ( |
1894 |
- x11-libs/gtk+:3 |
1895 |
- vte? ( x11-libs/vte:2.91 ) |
1896 |
- ) |
1897 |
- infiniband? ( |
1898 |
- sys-fabric/libibumad:=[static-libs(+)] |
1899 |
- sys-fabric/libibverbs:=[static-libs(+)] |
1900 |
- sys-fabric/librdmacm:=[static-libs(+)] |
1901 |
- ) |
1902 |
- iscsi? ( net-libs/libiscsi ) |
1903 |
- io-uring? ( sys-libs/liburing:=[static-libs(+)] ) |
1904 |
- jack? ( virtual/jack ) |
1905 |
- jemalloc? ( dev-libs/jemalloc ) |
1906 |
- jpeg? ( virtual/jpeg:0=[static-libs(+)] ) |
1907 |
- lzo? ( dev-libs/lzo:2[static-libs(+)] ) |
1908 |
- multipath? ( sys-fs/multipath-tools ) |
1909 |
- ncurses? ( |
1910 |
- sys-libs/ncurses:0=[unicode] |
1911 |
- sys-libs/ncurses:0=[static-libs(+)] |
1912 |
- ) |
1913 |
- nfs? ( >=net-fs/libnfs-1.9.3:=[static-libs(+)] ) |
1914 |
- numa? ( sys-process/numactl[static-libs(+)] ) |
1915 |
- opengl? ( |
1916 |
- virtual/opengl |
1917 |
- media-libs/libepoxy[static-libs(+)] |
1918 |
- media-libs/mesa[static-libs(+)] |
1919 |
- media-libs/mesa[egl,gbm] |
1920 |
- ) |
1921 |
- png? ( media-libs/libpng:0=[static-libs(+)] ) |
1922 |
- pulseaudio? ( media-sound/pulseaudio ) |
1923 |
- rbd? ( sys-cluster/ceph ) |
1924 |
- sasl? ( dev-libs/cyrus-sasl[static-libs(+)] ) |
1925 |
- sdl? ( |
1926 |
- media-libs/libsdl2[video] |
1927 |
- media-libs/libsdl2[static-libs(+)] |
1928 |
- ) |
1929 |
- sdl-image? ( media-libs/sdl2-image[static-libs(+)] ) |
1930 |
- seccomp? ( >=sys-libs/libseccomp-2.1.0[static-libs(+)] ) |
1931 |
- slirp? ( net-libs/libslirp[static-libs(+)] ) |
1932 |
- smartcard? ( >=app-emulation/libcacard-2.5.0[static-libs(+)] ) |
1933 |
- snappy? ( app-arch/snappy:= ) |
1934 |
- spice? ( |
1935 |
- >=app-emulation/spice-protocol-0.12.3 |
1936 |
- >=app-emulation/spice-0.12.0[static-libs(+)] |
1937 |
- ) |
1938 |
- ssh? ( >=net-libs/libssh-0.8.6[static-libs(+)] ) |
1939 |
- udev? ( virtual/libudev[static-libs(+)] ) |
1940 |
- usb? ( >=virtual/libusb-1-r2[static-libs(+)] ) |
1941 |
- usbredir? ( >=sys-apps/usbredir-0.6[static-libs(+)] ) |
1942 |
- vde? ( net-misc/vde[static-libs(+)] ) |
1943 |
- virgl? ( media-libs/virglrenderer[static-libs(+)] ) |
1944 |
- virtfs? ( sys-libs/libcap ) |
1945 |
- xen? ( app-emulation/xen-tools:= ) |
1946 |
- xfs? ( sys-fs/xfsprogs[static-libs(+)] ) |
1947 |
- zstd? ( >=app-arch/zstd-1.4.0[static-libs(+)] ) |
1948 |
-" |
1949 |
- |
1950 |
-SEABIOS_VERSION="1.14.0" |
1951 |
- |
1952 |
-X86_FIRMWARE_DEPEND=" |
1953 |
- pin-upstream-blobs? ( |
1954 |
- ~sys-firmware/edk2-ovmf-202008[binary] |
1955 |
- ~sys-firmware/ipxe-1.21.1[binary,qemu] |
1956 |
- ~sys-firmware/seabios-${SEABIOS_VERSION}[binary,seavgabios] |
1957 |
- ~sys-firmware/sgabios-0.1_pre10[binary] |
1958 |
- ) |
1959 |
- !pin-upstream-blobs? ( |
1960 |
- sys-firmware/edk2-ovmf |
1961 |
- sys-firmware/ipxe[qemu] |
1962 |
- >=sys-firmware/seabios-${SEABIOS_VERSION}[seavgabios] |
1963 |
- sys-firmware/sgabios |
1964 |
- )" |
1965 |
-PPC_FIRMWARE_DEPEND=" |
1966 |
- pin-upstream-blobs? ( |
1967 |
- ~sys-firmware/seabios-${SEABIOS_VERSION}[binary,seavgabios] |
1968 |
- ) |
1969 |
- !pin-upstream-blobs? ( |
1970 |
- >=sys-firmware/seabios-${SEABIOS_VERSION}[seavgabios] |
1971 |
- ) |
1972 |
-" |
1973 |
- |
1974 |
-BDEPEND=" |
1975 |
- $(python_gen_impl_dep) |
1976 |
- dev-lang/perl |
1977 |
- sys-apps/texinfo |
1978 |
- virtual/pkgconfig |
1979 |
- doc? ( dev-python/sphinx ) |
1980 |
- gtk? ( nls? ( sys-devel/gettext ) ) |
1981 |
- test? ( |
1982 |
- dev-libs/glib[utils] |
1983 |
- sys-devel/bc |
1984 |
- ) |
1985 |
-" |
1986 |
-CDEPEND=" |
1987 |
- !static? ( |
1988 |
- ${ALL_DEPEND//\[static-libs(+)]} |
1989 |
- ${SOFTMMU_TOOLS_DEPEND//\[static-libs(+)]} |
1990 |
- ) |
1991 |
- qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} ) |
1992 |
- qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} ) |
1993 |
- qemu_softmmu_targets_ppc? ( ${PPC_FIRMWARE_DEPEND} ) |
1994 |
- qemu_softmmu_targets_ppc64? ( ${PPC_FIRMWARE_DEPEND} ) |
1995 |
-" |
1996 |
-DEPEND="${CDEPEND} |
1997 |
- kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 ) |
1998 |
- static? ( |
1999 |
- ${ALL_DEPEND} |
2000 |
- ${SOFTMMU_TOOLS_DEPEND} |
2001 |
- ) |
2002 |
- static-user? ( ${ALL_DEPEND} )" |
2003 |
-RDEPEND="${CDEPEND} |
2004 |
- acct-group/kvm |
2005 |
- selinux? ( sec-policy/selinux-qemu )" |
2006 |
- |
2007 |
-PATCHES=( |
2008 |
- "${FILESDIR}"/${PN}-2.11.1-capstone_include_path.patch |
2009 |
- "${FILESDIR}"/${PN}-5.2.0-cleaner-werror.patch |
2010 |
- "${FILESDIR}"/${PN}-5.2.0-disable-keymap.patch |
2011 |
- "${FILESDIR}"/${PN}-5.2.0-strings.patch |
2012 |
- "${FILESDIR}"/${PN}-5.2.0-fix-firmware-path.patch |
2013 |
- "${FILESDIR}"/${PN}-5.2.0-no-pie-ld.patch |
2014 |
- "${FILESDIR}"/${PN}-5.2.0-dce-locks.patch |
2015 |
-) |
2016 |
- |
2017 |
-QA_PREBUILT=" |
2018 |
- usr/share/qemu/hppa-firmware.img |
2019 |
- usr/share/qemu/openbios-ppc |
2020 |
- usr/share/qemu/openbios-sparc64 |
2021 |
- usr/share/qemu/openbios-sparc32 |
2022 |
- usr/share/qemu/opensbi-riscv64-generic-fw_dynamic.elf |
2023 |
- usr/share/qemu/opensbi-riscv32-generic-fw_dynamic.elf |
2024 |
- usr/share/qemu/palcode-clipper |
2025 |
- usr/share/qemu/s390-ccw.img |
2026 |
- usr/share/qemu/s390-netboot.img |
2027 |
- usr/share/qemu/u-boot.e500 |
2028 |
-" |
2029 |
- |
2030 |
-QA_WX_LOAD="usr/bin/qemu-i386 |
2031 |
- usr/bin/qemu-x86_64 |
2032 |
- usr/bin/qemu-alpha |
2033 |
- usr/bin/qemu-arm |
2034 |
- usr/bin/qemu-cris |
2035 |
- usr/bin/qemu-m68k |
2036 |
- usr/bin/qemu-microblaze |
2037 |
- usr/bin/qemu-microblazeel |
2038 |
- usr/bin/qemu-mips |
2039 |
- usr/bin/qemu-mipsel |
2040 |
- usr/bin/qemu-or1k |
2041 |
- usr/bin/qemu-ppc |
2042 |
- usr/bin/qemu-ppc64 |
2043 |
- usr/bin/qemu-ppc64abi32 |
2044 |
- usr/bin/qemu-sh4 |
2045 |
- usr/bin/qemu-sh4eb |
2046 |
- usr/bin/qemu-sparc |
2047 |
- usr/bin/qemu-sparc64 |
2048 |
- usr/bin/qemu-armeb |
2049 |
- usr/bin/qemu-sparc32plus |
2050 |
- usr/bin/qemu-s390x |
2051 |
- usr/bin/qemu-unicore32 |
2052 |
-" |
2053 |
- |
2054 |
-DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure you have the |
2055 |
-kernel module loaded before running kvm. The easiest way to ensure that the |
2056 |
-kernel module is loaded is to load it on boot. |
2057 |
- For AMD CPUs the module is called 'kvm-amd'. |
2058 |
- For Intel CPUs the module is called 'kvm-intel'. |
2059 |
-Please review /etc/conf.d/modules for how to load these. |
2060 |
- |
2061 |
-Make sure your user is in the 'kvm' group. Just run |
2062 |
- $ gpasswd -a <USER> kvm |
2063 |
-then have <USER> re-login. |
2064 |
- |
2065 |
-For brand new installs, the default permissions on /dev/kvm might not let |
2066 |
-you access it. You can tell udev to reset ownership/perms: |
2067 |
- $ udevadm trigger -c add /dev/kvm |
2068 |
- |
2069 |
-If you want to register binfmt handlers for qemu user targets: |
2070 |
-For openrc: |
2071 |
- # rc-update add qemu-binfmt |
2072 |
-For systemd: |
2073 |
- # ln -s /usr/share/qemu/binfmt.d/qemu.conf /etc/binfmt.d/qemu.conf" |
2074 |
- |
2075 |
-pkg_pretend() { |
2076 |
- if use kernel_linux && kernel_is lt 2 6 25; then |
2077 |
- eerror "This version of KVM requires a host kernel of 2.6.25 or higher." |
2078 |
- elif use kernel_linux; then |
2079 |
- if ! linux_config_exists; then |
2080 |
- eerror "Unable to check your kernel for KVM support" |
2081 |
- else |
2082 |
- CONFIG_CHECK="~KVM ~TUN ~BRIDGE" |
2083 |
- ERROR_KVM="You must enable KVM in your kernel to continue" |
2084 |
- ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in" |
2085 |
- ERROR_KVM_AMD+=" your kernel configuration." |
2086 |
- ERROR_KVM_INTEL="If you have an Intel CPU, you must enable" |
2087 |
- ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration." |
2088 |
- ERROR_TUN="You will need the Universal TUN/TAP driver compiled" |
2089 |
- ERROR_TUN+=" into your kernel or loaded as a module to use the" |
2090 |
- ERROR_TUN+=" virtual network device if using -net tap." |
2091 |
- ERROR_BRIDGE="You will also need support for 802.1d" |
2092 |
- ERROR_BRIDGE+=" Ethernet Bridging for some network configurations." |
2093 |
- use vhost-net && CONFIG_CHECK+=" ~VHOST_NET" |
2094 |
- ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net" |
2095 |
- ERROR_VHOST_NET+=" support" |
2096 |
- |
2097 |
- if use amd64 || use x86 || use amd64-linux || use x86-linux; then |
2098 |
- if grep -q AuthenticAMD /proc/cpuinfo; then |
2099 |
- CONFIG_CHECK+=" ~KVM_AMD" |
2100 |
- elif grep -q GenuineIntel /proc/cpuinfo; then |
2101 |
- CONFIG_CHECK+=" ~KVM_INTEL" |
2102 |
- fi |
2103 |
- fi |
2104 |
- |
2105 |
- use python && CONFIG_CHECK+=" ~DEBUG_FS" |
2106 |
- ERROR_DEBUG_FS="debugFS support required for kvm_stat" |
2107 |
- |
2108 |
- # Now do the actual checks setup above |
2109 |
- check_extra_config |
2110 |
- fi |
2111 |
- fi |
2112 |
- |
2113 |
- if grep -qs '/usr/bin/qemu-kvm' "${EROOT}"/etc/libvirt/qemu/*.xml; then |
2114 |
- eerror "The kvm/qemu-kvm wrappers no longer exist, but your libvirt" |
2115 |
- eerror "instances are still pointing to it. Please update your" |
2116 |
- eerror "configs in /etc/libvirt/qemu/ to use the -enable-kvm flag" |
2117 |
- eerror "and the right system binary (e.g. qemu-system-x86_64)." |
2118 |
- die "update your virt configs to not use qemu-kvm" |
2119 |
- fi |
2120 |
-} |
2121 |
- |
2122 |
-# Sanity check to make sure target lists are kept up-to-date. |
2123 |
-check_targets() { |
2124 |
- local var=$1 mak=$2 |
2125 |
- local detected sorted |
2126 |
- |
2127 |
- pushd "${S}"/default-configs/targets/ >/dev/null || die |
2128 |
- |
2129 |
- # Force C locale until glibc is updated. #564936 |
2130 |
- detected=$(echo $(printf '%s\n' *-${mak}.mak | sed "s:-${mak}.mak::" | LC_COLLATE=C sort -u)) |
2131 |
- sorted=$(echo $(printf '%s\n' ${!var} | LC_COLLATE=C sort -u)) |
2132 |
- if [[ ${sorted} != "${detected}" ]] ; then |
2133 |
- eerror "The ebuild needs to be kept in sync." |
2134 |
- eerror "${var}: ${sorted}" |
2135 |
- eerror "$(printf '%-*s' ${#var} configure): ${detected}" |
2136 |
- die "sync ${var} to the list of targets" |
2137 |
- fi |
2138 |
- |
2139 |
- popd >/dev/null |
2140 |
-} |
2141 |
- |
2142 |
-src_prepare() { |
2143 |
- # workaround -fcommon breakage: bug #726560 |
2144 |
- [[ ${PV} == 5.2.0 ]] || die "Check if -fcommon hack is needed" |
2145 |
- filter-flags -fcommon |
2146 |
- |
2147 |
- check_targets IUSE_SOFTMMU_TARGETS softmmu |
2148 |
- check_targets IUSE_USER_TARGETS linux-user |
2149 |
- |
2150 |
- default |
2151 |
- |
2152 |
- # Use correct toolchain to fix cross-compiling |
2153 |
- tc-export AR AS LD NM OBJCOPY PKG_CONFIG RANLIB STRINGS |
2154 |
- export WINDRES=${CHOST}-windres |
2155 |
- |
2156 |
- # Verbose builds |
2157 |
- MAKEOPTS+=" V=1" |
2158 |
- |
2159 |
- # Remove bundled copy of libfdt |
2160 |
- rm -r dtc || die |
2161 |
-} |
2162 |
- |
2163 |
-## |
2164 |
-# configures qemu based on the build directory and the build type |
2165 |
-# we are using. |
2166 |
-# |
2167 |
-qemu_src_configure() { |
2168 |
- debug-print-function ${FUNCNAME} "$@" |
2169 |
- |
2170 |
- local buildtype=$1 |
2171 |
- local builddir="${S}/${buildtype}-build" |
2172 |
- |
2173 |
- mkdir "${builddir}" |
2174 |
- |
2175 |
- local conf_opts=( |
2176 |
- --prefix=/usr |
2177 |
- --sysconfdir=/etc |
2178 |
- --bindir=/usr/bin |
2179 |
- --libdir=/usr/$(get_libdir) |
2180 |
- --datadir=/usr/share |
2181 |
- --docdir=/usr/share/doc/${PF}/html |
2182 |
- --mandir=/usr/share/man |
2183 |
- --localstatedir=/var |
2184 |
- --disable-bsd-user |
2185 |
- --disable-containers # bug #732972 |
2186 |
- --disable-guest-agent |
2187 |
- --disable-strip |
2188 |
- |
2189 |
- # bug #746752: TCG interpreter has a few limitations: |
2190 |
- # - it does not support FPU |
2191 |
- # - it's generally slower on non-self-modifying code |
2192 |
- # It's advantage is support for host architectures |
2193 |
- # where native codegeneration is not implemented. |
2194 |
- # Gentoo has qemu keyworded only on targets with |
2195 |
- # native code generation available. Avoid the interpreter. |
2196 |
- --disable-tcg-interpreter |
2197 |
- |
2198 |
- --disable-werror |
2199 |
- # We support gnutls/nettle for crypto operations. It is possible |
2200 |
- # to use gcrypt when gnutls/nettle are disabled (but not when they |
2201 |
- # are enabled), but it's not really worth the hassle. Disable it |
2202 |
- # all the time to avoid automatically detecting it. #568856 |
2203 |
- --disable-gcrypt |
2204 |
- --python="${PYTHON}" |
2205 |
- --cc="$(tc-getCC)" |
2206 |
- --cxx="$(tc-getCXX)" |
2207 |
- --host-cc="$(tc-getBUILD_CC)" |
2208 |
- $(use_enable debug debug-info) |
2209 |
- $(use_enable debug debug-tcg) |
2210 |
- $(use_enable doc docs) |
2211 |
- $(use_enable nls gettext) |
2212 |
- $(use_enable plugins) |
2213 |
- $(use_enable xattr attr) |
2214 |
- ) |
2215 |
- |
2216 |
- # Disable options not used by user targets. This simplifies building |
2217 |
- # static user targets (USE=static-user) considerably. |
2218 |
- conf_notuser() { |
2219 |
- if [[ ${buildtype} == "user" ]] ; then |
2220 |
- echo "--disable-${2:-$1}" |
2221 |
- else |
2222 |
- use_enable "$@" |
2223 |
- fi |
2224 |
- } |
2225 |
- # Enable option only for softmmu build, but not 'user' or 'tools' |
2226 |
- conf_softmmu() { |
2227 |
- if [[ ${buildtype} == "softmmu" ]] ; then |
2228 |
- use_enable "$@" |
2229 |
- else |
2230 |
- echo "--disable-${2:-$1}" |
2231 |
- fi |
2232 |
- } |
2233 |
- # Enable option only for tools build, but not 'user' or 'softmmu' |
2234 |
- conf_tools() { |
2235 |
- if [[ ${buildtype} == "tools" ]] ; then |
2236 |
- use_enable "$@" |
2237 |
- else |
2238 |
- echo "--disable-${2:-$1}" |
2239 |
- fi |
2240 |
- } |
2241 |
- conf_opts+=( |
2242 |
- $(conf_notuser accessibility brlapi) |
2243 |
- $(conf_notuser aio linux-aio) |
2244 |
- $(conf_notuser bzip2) |
2245 |
- $(conf_notuser capstone) |
2246 |
- $(conf_notuser caps cap-ng) |
2247 |
- $(conf_notuser curl) |
2248 |
- $(conf_notuser fdt) |
2249 |
- $(conf_notuser glusterfs) |
2250 |
- $(conf_notuser gnutls) |
2251 |
- $(conf_notuser gnutls nettle) |
2252 |
- $(conf_notuser gtk) |
2253 |
- $(conf_notuser infiniband rdma) |
2254 |
- $(conf_notuser iscsi libiscsi) |
2255 |
- $(conf_notuser io-uring linux-io-uring) |
2256 |
- $(conf_notuser jemalloc jemalloc) |
2257 |
- $(conf_notuser jpeg vnc-jpeg) |
2258 |
- $(conf_notuser kernel_linux kvm) |
2259 |
- $(conf_notuser lzo) |
2260 |
- $(conf_notuser multipath mpath) |
2261 |
- $(conf_notuser ncurses curses) |
2262 |
- $(conf_notuser nfs libnfs) |
2263 |
- $(conf_notuser numa) |
2264 |
- $(conf_notuser opengl) |
2265 |
- $(conf_notuser png vnc-png) |
2266 |
- $(conf_notuser rbd) |
2267 |
- $(conf_notuser sasl vnc-sasl) |
2268 |
- $(conf_notuser sdl) |
2269 |
- $(conf_softmmu sdl-image) |
2270 |
- $(conf_notuser seccomp) |
2271 |
- $(conf_notuser slirp slirp system) |
2272 |
- $(conf_notuser smartcard) |
2273 |
- $(conf_notuser snappy) |
2274 |
- $(conf_notuser spice) |
2275 |
- $(conf_notuser ssh libssh) |
2276 |
- $(conf_notuser udev libudev) |
2277 |
- $(conf_notuser usb libusb) |
2278 |
- $(conf_notuser usbredir usb-redir) |
2279 |
- $(conf_notuser vde) |
2280 |
- $(conf_notuser vhost-net) |
2281 |
- $(conf_notuser vhost-user-fs) |
2282 |
- $(conf_tools vhost-user-fs virtiofsd) |
2283 |
- $(conf_notuser virgl virglrenderer) |
2284 |
- $(conf_notuser virtfs) |
2285 |
- $(conf_notuser vnc) |
2286 |
- $(conf_notuser vte) |
2287 |
- $(conf_notuser xen) |
2288 |
- $(conf_notuser xen xen-pci-passthrough) |
2289 |
- $(conf_notuser xfs xfsctl) |
2290 |
- # use prebuilt keymaps, bug #759604 |
2291 |
- --disable-xkbcommon |
2292 |
- $(conf_notuser zstd) |
2293 |
- ) |
2294 |
- |
2295 |
- if [[ ${buildtype} == "user" ]] ; then |
2296 |
- conf_opts+=( --disable-libxml2 ) |
2297 |
- else |
2298 |
- conf_opts+=( --enable-libxml2 ) |
2299 |
- fi |
2300 |
- |
2301 |
- if [[ ! ${buildtype} == "user" ]] ; then |
2302 |
- # audio options |
2303 |
- local audio_opts=( |
2304 |
- # Note: backend order matters here: #716202 |
2305 |
- # We iterate from higher-level to lower level. |
2306 |
- $(usex pulseaudio pa "") |
2307 |
- $(usev jack) |
2308 |
- $(usev sdl) |
2309 |
- $(usev alsa) |
2310 |
- $(usev oss) |
2311 |
- ) |
2312 |
- conf_opts+=( |
2313 |
- --audio-drv-list=$(printf "%s," "${audio_opts[@]}") |
2314 |
- ) |
2315 |
- fi |
2316 |
- |
2317 |
- case ${buildtype} in |
2318 |
- user) |
2319 |
- conf_opts+=( |
2320 |
- --enable-linux-user |
2321 |
- --disable-system |
2322 |
- --disable-blobs |
2323 |
- --disable-tools |
2324 |
- ) |
2325 |
- local static_flag="static-user" |
2326 |
- ;; |
2327 |
- softmmu) |
2328 |
- conf_opts+=( |
2329 |
- --disable-linux-user |
2330 |
- --enable-system |
2331 |
- --disable-tools |
2332 |
- ) |
2333 |
- local static_flag="static" |
2334 |
- ;; |
2335 |
- tools) |
2336 |
- conf_opts+=( |
2337 |
- --disable-linux-user |
2338 |
- --disable-system |
2339 |
- --disable-blobs |
2340 |
- --enable-tools |
2341 |
- ) |
2342 |
- local static_flag="static" |
2343 |
- ;; |
2344 |
- esac |
2345 |
- |
2346 |
- local targets="${buildtype}_targets" |
2347 |
- [[ -n ${targets} ]] && conf_opts+=( --target-list="${!targets}" ) |
2348 |
- |
2349 |
- # Add support for SystemTAP |
2350 |
- use systemtap && conf_opts+=( --enable-trace-backend=dtrace ) |
2351 |
- |
2352 |
- # We always want to attempt to build with PIE support as it results |
2353 |
- # in a more secure binary. But it doesn't work with static or if |
2354 |
- # the current GCC doesn't have PIE support. |
2355 |
- if use ${static_flag}; then |
2356 |
- conf_opts+=( --static --disable-pie ) |
2357 |
- else |
2358 |
- tc-enables-pie && conf_opts+=( --enable-pie ) |
2359 |
- fi |
2360 |
- |
2361 |
- # Meson will not use a cross-file unless cross_prefix is set. |
2362 |
- tc-is-cross-compiler && conf_opts+=( --cross-prefix="${CHOST}-" ) |
2363 |
- |
2364 |
- # Plumb through equivalent of EXTRA_ECONF to allow experiments |
2365 |
- # like bug #747928. |
2366 |
- conf_opts+=( ${EXTRA_CONF_QEMU} ) |
2367 |
- |
2368 |
- echo "../configure ${conf_opts[*]}" |
2369 |
- cd "${builddir}" |
2370 |
- ../configure "${conf_opts[@]}" || die "configure failed" |
2371 |
- |
2372 |
- # FreeBSD's kernel does not support QEMU assigning/grabbing |
2373 |
- # host USB devices yet |
2374 |
- use kernel_FreeBSD && \ |
2375 |
- sed -i -E -e "s|^(HOST_USB=)bsd|\1stub|" "${S}"/config-host.mak |
2376 |
-} |
2377 |
- |
2378 |
-src_configure() { |
2379 |
- local target |
2380 |
- |
2381 |
- python_setup |
2382 |
- |
2383 |
- softmmu_targets= softmmu_bins=() |
2384 |
- user_targets= user_bins=() |
2385 |
- |
2386 |
- for target in ${IUSE_SOFTMMU_TARGETS} ; do |
2387 |
- if use "qemu_softmmu_targets_${target}"; then |
2388 |
- softmmu_targets+=",${target}-softmmu" |
2389 |
- softmmu_bins+=( "qemu-system-${target}" ) |
2390 |
- fi |
2391 |
- done |
2392 |
- |
2393 |
- for target in ${IUSE_USER_TARGETS} ; do |
2394 |
- if use "qemu_user_targets_${target}"; then |
2395 |
- user_targets+=",${target}-linux-user" |
2396 |
- user_bins+=( "qemu-${target}" ) |
2397 |
- fi |
2398 |
- done |
2399 |
- |
2400 |
- softmmu_targets=${softmmu_targets#,} |
2401 |
- user_targets=${user_targets#,} |
2402 |
- |
2403 |
- [[ -n ${softmmu_targets} ]] && qemu_src_configure "softmmu" |
2404 |
- [[ -n ${user_targets} ]] && qemu_src_configure "user" |
2405 |
- qemu_src_configure "tools" |
2406 |
-} |
2407 |
- |
2408 |
-src_compile() { |
2409 |
- if [[ -n ${user_targets} ]]; then |
2410 |
- cd "${S}/user-build" |
2411 |
- default |
2412 |
- fi |
2413 |
- |
2414 |
- if [[ -n ${softmmu_targets} ]]; then |
2415 |
- cd "${S}/softmmu-build" |
2416 |
- default |
2417 |
- fi |
2418 |
- |
2419 |
- cd "${S}/tools-build" |
2420 |
- default |
2421 |
-} |
2422 |
- |
2423 |
-src_test() { |
2424 |
- if [[ -n ${softmmu_targets} ]]; then |
2425 |
- cd "${S}/softmmu-build" |
2426 |
- pax-mark m */qemu-system-* #515550 |
2427 |
- emake check |
2428 |
- fi |
2429 |
-} |
2430 |
- |
2431 |
-qemu_python_install() { |
2432 |
- python_domodule "${S}/python/qemu" |
2433 |
- |
2434 |
- python_doscript "${S}/scripts/kvm/vmxcap" |
2435 |
- python_doscript "${S}/scripts/qmp/qmp-shell" |
2436 |
- python_doscript "${S}/scripts/qmp/qemu-ga-client" |
2437 |
-} |
2438 |
- |
2439 |
-# Generate binfmt support files. |
2440 |
-# - /etc/init.d/qemu-binfmt script which registers the user handlers (openrc) |
2441 |
-# - /usr/share/qemu/binfmt.d/qemu.conf (for use with systemd-binfmt) |
2442 |
-generate_initd() { |
2443 |
- local out="${T}/qemu-binfmt" |
2444 |
- local out_systemd="${T}/qemu.conf" |
2445 |
- local d="${T}/binfmt.d" |
2446 |
- |
2447 |
- einfo "Generating qemu binfmt scripts and configuration files" |
2448 |
- |
2449 |
- # Generate the debian fragments first. |
2450 |
- mkdir -p "${d}" |
2451 |
- "${S}"/scripts/qemu-binfmt-conf.sh \ |
2452 |
- --debian \ |
2453 |
- --exportdir "${d}" \ |
2454 |
- --qemu-path "${EPREFIX}/usr/bin" \ |
2455 |
- || die |
2456 |
- # Then turn the fragments into a shell script we can source. |
2457 |
- sed -E -i \ |
2458 |
- -e 's:^([^ ]+) (.*)$:\1="\2":' \ |
2459 |
- "${d}"/* || die |
2460 |
- |
2461 |
- # Generate the init.d script by assembling the fragments from above. |
2462 |
- local f qcpu package interpreter magic mask |
2463 |
- cat "${FILESDIR}"/qemu-binfmt.initd.head >"${out}" || die |
2464 |
- for f in "${d}"/qemu-* ; do |
2465 |
- source "${f}" |
2466 |
- |
2467 |
- # Normalize the cpu logic like we do in the init.d for the native cpu. |
2468 |
- qcpu=${package#qemu-} |
2469 |
- case ${qcpu} in |
2470 |
- arm*) qcpu="arm";; |
2471 |
- mips*) qcpu="mips";; |
2472 |
- ppc*) qcpu="ppc";; |
2473 |
- s390*) qcpu="s390";; |
2474 |
- sh*) qcpu="sh";; |
2475 |
- sparc*) qcpu="sparc";; |
2476 |
- esac |
2477 |
- |
2478 |
- # we use 'printf' here to be portable across 'sh' |
2479 |
- # implementations: #679168 |
2480 |
- cat <<EOF >>"${out}" |
2481 |
- if [ "\${cpu}" != "${qcpu}" -a -x "${interpreter}" ] ; then |
2482 |
- printf '%s\n' ':${package}:M::${magic}:${mask}:${interpreter}:'"\${QEMU_BINFMT_FLAGS}" >/proc/sys/fs/binfmt_misc/register |
2483 |
- fi |
2484 |
-EOF |
2485 |
- |
2486 |
- echo ":${package}:M::${magic}:${mask}:${interpreter}:OC" >>"${out_systemd}" |
2487 |
- |
2488 |
- done |
2489 |
- cat "${FILESDIR}"/qemu-binfmt.initd.tail >>"${out}" || die |
2490 |
-} |
2491 |
- |
2492 |
-src_install() { |
2493 |
- if [[ -n ${user_targets} ]]; then |
2494 |
- cd "${S}/user-build" |
2495 |
- emake DESTDIR="${ED}" install |
2496 |
- |
2497 |
- # Install binfmt handler init script for user targets. |
2498 |
- generate_initd |
2499 |
- doinitd "${T}/qemu-binfmt" |
2500 |
- |
2501 |
- # Install binfmt/qemu.conf. |
2502 |
- insinto "/usr/share/qemu/binfmt.d" |
2503 |
- doins "${T}/qemu.conf" |
2504 |
- fi |
2505 |
- |
2506 |
- if [[ -n ${softmmu_targets} ]]; then |
2507 |
- cd "${S}/softmmu-build" |
2508 |
- emake DESTDIR="${ED}" install |
2509 |
- |
2510 |
- # This might not exist if the test failed. #512010 |
2511 |
- [[ -e check-report.html ]] && dodoc check-report.html |
2512 |
- |
2513 |
- if use kernel_linux; then |
2514 |
- udev_newrules "${FILESDIR}"/65-kvm.rules-r2 65-kvm.rules |
2515 |
- fi |
2516 |
- |
2517 |
- if use python; then |
2518 |
- python_foreach_impl qemu_python_install |
2519 |
- fi |
2520 |
- fi |
2521 |
- |
2522 |
- cd "${S}/tools-build" |
2523 |
- emake DESTDIR="${ED}" install |
2524 |
- |
2525 |
- # Disable mprotect on the qemu binaries as they use JITs to be fast #459348 |
2526 |
- pushd "${ED}"/usr/bin >/dev/null |
2527 |
- pax-mark mr "${softmmu_bins[@]}" "${user_bins[@]}" # bug 575594 |
2528 |
- popd >/dev/null |
2529 |
- |
2530 |
- # Install config file example for qemu-bridge-helper |
2531 |
- insinto "/etc/qemu" |
2532 |
- doins "${FILESDIR}/bridge.conf" |
2533 |
- |
2534 |
- cd "${S}" |
2535 |
- dodoc MAINTAINERS docs/specs/pci-ids.txt |
2536 |
- newdoc pc-bios/README README.pc-bios |
2537 |
- |
2538 |
- # Disallow stripping of prebuilt firmware files. |
2539 |
- dostrip -x ${QA_PREBUILT} |
2540 |
- |
2541 |
- if [[ -n ${softmmu_targets} ]]; then |
2542 |
- # Remove SeaBIOS since we're using the SeaBIOS packaged one |
2543 |
- rm "${ED}/usr/share/qemu/bios.bin" |
2544 |
- rm "${ED}/usr/share/qemu/bios-256k.bin" |
2545 |
- if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
2546 |
- dosym ../seabios/bios.bin /usr/share/qemu/bios.bin |
2547 |
- dosym ../seabios/bios-256k.bin /usr/share/qemu/bios-256k.bin |
2548 |
- fi |
2549 |
- |
2550 |
- # Remove vgabios since we're using the seavgabios packaged one |
2551 |
- rm "${ED}/usr/share/qemu/vgabios.bin" |
2552 |
- rm "${ED}/usr/share/qemu/vgabios-cirrus.bin" |
2553 |
- rm "${ED}/usr/share/qemu/vgabios-qxl.bin" |
2554 |
- rm "${ED}/usr/share/qemu/vgabios-stdvga.bin" |
2555 |
- rm "${ED}/usr/share/qemu/vgabios-virtio.bin" |
2556 |
- rm "${ED}/usr/share/qemu/vgabios-vmware.bin" |
2557 |
- # PPC/PPC64 loads vgabios-stdvga |
2558 |
- if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386 || use qemu_softmmu_targets_ppc || use qemu_softmmu_targets_ppc64; then |
2559 |
- dosym ../seavgabios/vgabios-isavga.bin /usr/share/qemu/vgabios.bin |
2560 |
- dosym ../seavgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin |
2561 |
- dosym ../seavgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin |
2562 |
- dosym ../seavgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin |
2563 |
- dosym ../seavgabios/vgabios-virtio.bin /usr/share/qemu/vgabios-virtio.bin |
2564 |
- dosym ../seavgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin |
2565 |
- fi |
2566 |
- |
2567 |
- # Remove sgabios since we're using the sgabios packaged one |
2568 |
- rm "${ED}/usr/share/qemu/sgabios.bin" |
2569 |
- if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
2570 |
- dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin |
2571 |
- fi |
2572 |
- |
2573 |
- # Remove iPXE since we're using the iPXE packaged one |
2574 |
- rm "${ED}"/usr/share/qemu/pxe-*.rom |
2575 |
- if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
2576 |
- dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom |
2577 |
- dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom |
2578 |
- dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom |
2579 |
- dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom |
2580 |
- dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom |
2581 |
- dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom |
2582 |
- fi |
2583 |
- fi |
2584 |
- |
2585 |
- DISABLE_AUTOFORMATTING=true |
2586 |
- readme.gentoo_create_doc |
2587 |
-} |
2588 |
- |
2589 |
-firmware_abi_change() { |
2590 |
- local pv |
2591 |
- for pv in ${REPLACING_VERSIONS}; do |
2592 |
- if ver_test ${pv} -lt ${FIRMWARE_ABI_VERSION}; then |
2593 |
- return 0 |
2594 |
- fi |
2595 |
- done |
2596 |
- return 1 |
2597 |
-} |
2598 |
- |
2599 |
-pkg_postinst() { |
2600 |
- if [[ -n ${softmmu_targets} ]] && use kernel_linux; then |
2601 |
- udev_reload |
2602 |
- fi |
2603 |
- |
2604 |
- xdg_icon_cache_update |
2605 |
- |
2606 |
- [[ -z ${EPREFIX} ]] && [[ -f ${EROOT}/usr/libexec/qemu-bridge-helper ]] && \ |
2607 |
- fcaps cap_net_admin ${EROOT}/usr/libexec/qemu-bridge-helper |
2608 |
- |
2609 |
- DISABLE_AUTOFORMATTING=true |
2610 |
- readme.gentoo_print_elog |
2611 |
- |
2612 |
- if use pin-upstream-blobs && firmware_abi_change; then |
2613 |
- ewarn "This version of qemu pins new versions of firmware blobs:" |
2614 |
- ewarn " $(best_version sys-firmware/edk2-ovmf)" |
2615 |
- ewarn " $(best_version sys-firmware/ipxe)" |
2616 |
- ewarn " $(best_version sys-firmware/seabios)" |
2617 |
- ewarn " $(best_version sys-firmware/sgabios)" |
2618 |
- ewarn "This might break resume of hibernated guests (started with a different" |
2619 |
- ewarn "firmware version) and live migration to/from qemu versions with different" |
2620 |
- ewarn "firmware. Please (cold) restart all running guests. For functional" |
2621 |
- ewarn "guest migration ensure that all" |
2622 |
- ewarn "hosts run at least" |
2623 |
- ewarn " app-emulation/qemu-${FIRMWARE_ABI_VERSION}." |
2624 |
- fi |
2625 |
-} |
2626 |
- |
2627 |
-pkg_info() { |
2628 |
- echo "Using:" |
2629 |
- echo " $(best_version app-emulation/spice-protocol)" |
2630 |
- echo " $(best_version sys-firmware/edk2-ovmf)" |
2631 |
- if has_version 'sys-firmware/edk2-ovmf[binary]'; then |
2632 |
- echo " USE=binary" |
2633 |
- else |
2634 |
- echo " USE=''" |
2635 |
- fi |
2636 |
- echo " $(best_version sys-firmware/ipxe)" |
2637 |
- echo " $(best_version sys-firmware/seabios)" |
2638 |
- if has_version 'sys-firmware/seabios[binary]'; then |
2639 |
- echo " USE=binary" |
2640 |
- else |
2641 |
- echo " USE=''" |
2642 |
- fi |
2643 |
- echo " $(best_version sys-firmware/sgabios)" |
2644 |
-} |
2645 |
- |
2646 |
-pkg_postrm() { |
2647 |
- xdg_icon_cache_update |
2648 |
-} |