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