diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-10-07 04:26:50 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-10-07 04:26:50 +0100 |
commit | 7ad61ca2bfc8f8da08d2fb3085e4333dcccb0a64 (patch) | |
tree | f7c41a49b46acf8ae70e84a70c452a7d121c5458 /app-emulation | |
parent | d6106fb0c1ab8f79024ab6a9ac2062ddc85d4e07 (diff) |
gentoo auto-resync : 07:10:2024 - 04:26:50
Diffstat (limited to 'app-emulation')
-rw-r--r-- | app-emulation/Manifest.gz | bin | 15517 -> 15523 bytes | |||
-rw-r--r-- | app-emulation/qemu/Manifest | 6 | ||||
-rw-r--r-- | app-emulation/qemu/files/qemu-9.1.0-capstone-include-path.patch | 33 | ||||
-rw-r--r-- | app-emulation/qemu/qemu-9.1.0.ebuild | 1006 | ||||
-rw-r--r-- | app-emulation/qemu/qemu-9999.ebuild | 4 | ||||
-rw-r--r-- | app-emulation/wine-staging/Manifest | 3 | ||||
-rw-r--r-- | app-emulation/wine-staging/wine-staging-9.19.ebuild | 479 |
7 files changed, 1528 insertions, 3 deletions
diff --git a/app-emulation/Manifest.gz b/app-emulation/Manifest.gz Binary files differindex a876ac76fe9c..db6eb37ec506 100644 --- a/app-emulation/Manifest.gz +++ b/app-emulation/Manifest.gz diff --git a/app-emulation/qemu/Manifest b/app-emulation/qemu/Manifest index fe439a991c67..4c23bae22ce7 100644 --- a/app-emulation/qemu/Manifest +++ b/app-emulation/qemu/Manifest @@ -14,6 +14,7 @@ AUX qemu-8.1.0-skip-tests.patch 2767 BLAKE2B b55b4225f7afa6bc3634fe072c10150e21f AUX qemu-9.0.0-also-build-virtfs-proxy-helper.patch 1397 BLAKE2B 636e52b5286c1e939601375bf6aa1805d3b68e0299b9330b04d5f2f2a260e2cc4e8c31e1dd105248acde4a6279b7eb78bd120f9225771c4e1dfe445ebfcd653f SHA512 cc39aeedf99a6d58232acab34170a101fa86d95a9aaa75d472fdfdfc2fe2f22eeef94d20ef75b78d001e929bd49da768e5234ac848ddacb181e39f68bed1c00b AUX qemu-9.0.0-capstone-include-path.patch 1433 BLAKE2B 7ad95b5f4ce68ceb74e13183712dc2df6182019efba234f731f19bf0d6275268147f57815121b843dbddc5974f08a1d7b51db8f5ce52671edf47ff28b155ba56 SHA512 3664d3bdc549ce4ed827f08d3e9c75b1656eade4a00d33f0635be25a670a03b8c7571b1f8cee95769cfd78fa57b09c7233e07b2a1279fc4fcc66ba3985768fd9 AUX qemu-9.0.0-disable-keymap.patch 1434 BLAKE2B daef38624095a5bd861e04930decd86dd8f5a8f505e0a885df1abd5dac79217e7b0db24429bb48d7a95b0c184c24ec2da333528db619955102432b7fd7898707 SHA512 603525c4549b6a7c7f6f83150d47949ace89e659054d1a67b523d61a816c51986a56df2f972a08587a8e127823768cd2f5c6ae3b32c52f893e4fb481b7884aed +AUX qemu-9.1.0-capstone-include-path.patch 1097 BLAKE2B d59702b5e4ea11dc03e337f9cd281079f1bdbbe727f891b27c52c4a8d0b3579c2d0df1e78f3f81d86f1826f39121005373193dc4cbe2dae55be94aa028beccfc SHA512 dded3cd21740f704dab6c80c6a6037a512aa2f5777b3f7a940d12450c0ee93f0c6a0f3cda537e05d6cd2d8e854752f195f1f420d0fe89270c3f672a49f845f23 AUX qemu-binfmt.initd.head 1442 BLAKE2B 23aa5338914aa7c47f9b1cc1d28291abd0ea037a33cca81f990decfafac2907c86c042350c9dd45591d16330846d4e11d2c8a2a409a68ad81656d9c2c51964c0 SHA512 3fec8946a37bfbd2089f5d95089ed5987a198fc0139ee7482d4bb38c2ffa0e165667a7853afcf2b458bc3e2a6540f172c929ca5a334a00db47e2d0f881382c0e AUX qemu-binfmt.initd.tail 245 BLAKE2B dd59f2944c6e3f0c4d282b94b687a9b5c51dd77c5103fb9889bd9ce56874495397676ae6c8375d9e9e23094828477240778d9e0f361e68cdd63fdad574851561 SHA512 bcca16805f8380d52cc591ea3d65a8f6e5de456730618f6aee301510edb75d235a22d4d7aeed224882210392840adb403eb53234b6cb76a4cb24533852a8b737 DIST berkeley-softfloat-3-b64af41c3276f97f0e181920400ee056b9c88037.tar.bz2 84094 BLAKE2B 396f9df2e6ad559545054e89916915c3a3c8ff80e5e409498fec497b564d8b3ac9dd3cb966e26dce232ddff82af18a0e84e864ca18a80c2a2f4fe47e320249c2 SHA512 93c20d50a356c90f4293d8c7593611b2e0a9bc7567b6d946319f8ae06962ae1e297c8788f66fd38a1d3a0d44661bff9a07a63eaa84c8bb40ae01a45476be446c @@ -37,6 +38,8 @@ DIST qemu-9.0.0-docs.tar.xz 2290196 BLAKE2B 82d22637ff2629bee372550e86651f12051e DIST qemu-9.0.1.tar.xz 132368412 BLAKE2B e96ae5cc3ee935dd31232d38d46bbdc74fd3a2a0dd8517c0e035757f3ded92712dfa68d0068cd8c37f314a92d237e2b4a725b509ba402b7a1ce92df63207a08d SHA512 6c120aaf52f15e79c32d883cc83df8fc83222d538ea6be9c19aaddfba0aef91479b5826bbc03e58688fba639cb24bc6f54e525ccc2404ed5d820766d11735210 DIST qemu-9.0.2.tar.xz 132387528 BLAKE2B 6b5301f985919ae53e056410be7486b8150a65016127568bd4d58f596e94960d08eb3fc57cff7ff6a3435d71274adee516f57375d856d61b4fc7a3f24cbf75c4 SHA512 58ed84f6fe6263d279356bc9193f96edf62cf3663fb151daa3f047d52329fe49cb91c2d45e09697e0469f4f5409be96403aec9572d4871ffa40848a786c21599 DIST qemu-9.0.3.tar.xz 132420136 BLAKE2B af44ee6d3e59c28bb84cbf78a4793fa120a7cb811ab0fb0aba7b61d0b2eeb0e47dd094a4a0af9570e26d584f7ae867d46b6f61903610e155deb6479d8ea60fa4 SHA512 fcd72896ae9f9f654628540e09472c8388d980f8081990ee541f3540f92c5fd0d9332fa343dc9eaa6d7fe3dc2a5668d7d5c3784ba9d49bd7df9d37a4f9df7572 +DIST qemu-9.1.0-docs.tar.xz 2376072 BLAKE2B 31d13133b3a2e21a7d9b5af028407610ae8f2fa61dd296fc35e57fc12eb66cfd1a39ec5e3b5a3852095d10a388f424f8a38417b3ab58ca30d0817ece779328cf SHA512 5b705b577daad6aa010d5c713db9dc314114334b89901840ebcecc9032595a969f5ad9054e42b36b2be5ef9f5d6dc1159841ff46dbb08314b5c48491aa631040 +DIST qemu-9.1.0.tar.xz 132478356 BLAKE2B 77bdaf00e6111e6ac94462a6023aac0d3df9d2829a961fd89a5bdafc4aee7f95c2695d9319715e630960e64512a41b3ff987c9096692ff304cfd49357b46ef62 SHA512 bf61d65e37945fa8ee8640712c719ace05164d86e6df700b98bdc5f79e0a8d5e8f85bd48e726edb62b2419db20673f63ec8b63a60393a914b09cb365621b35e2 EBUILD qemu-7.2.11.ebuild 27665 BLAKE2B 65d908db1c7e412d3f19735c9956c7f691d1ad2a956d651f5cc19507552324b0e86c9e6d70e21293e5888dd6f74ee1d449186655531952bfe3f25b7d0bb83a03 SHA512 4d99d505e1f1df90966baff8fcd62fd784c9ba4ba64ecdc349fce965da0bfabfcc2507fd1a0e9dc4fb5a5192f93b1664ff50793d9fd285141cf7adb346acfc00 EBUILD qemu-7.2.12.ebuild 27669 BLAKE2B 29760151140a2f10228a6ffcde19f945332d9c24aa487f97be416b0bb6b04d8901274bd51dfb8c073c1718d8ef7dc17725454358106fe26a4e49ededabaae75f SHA512 90b0f5e4242d6573e2b86df34ffec1a1a6146c997d3c183aa151a29a68596c9b6199cb608044b8a8bf1a6b4d4c70b076ab7fa0a711e9f3536ac964e53daf4687 EBUILD qemu-7.2.13.ebuild 27669 BLAKE2B 29760151140a2f10228a6ffcde19f945332d9c24aa487f97be416b0bb6b04d8901274bd51dfb8c073c1718d8ef7dc17725454358106fe26a4e49ededabaae75f SHA512 90b0f5e4242d6573e2b86df34ffec1a1a6146c997d3c183aa151a29a68596c9b6199cb608044b8a8bf1a6b4d4c70b076ab7fa0a711e9f3536ac964e53daf4687 @@ -51,5 +54,6 @@ EBUILD qemu-9.0.1-r1.ebuild 28262 BLAKE2B 0f74d619ff5a5383c586600a41e313db67b609 EBUILD qemu-9.0.2-r1.ebuild 28262 BLAKE2B 0f74d619ff5a5383c586600a41e313db67b609c4eee38aec142bf584f5452a8661957b4d6e47e8af5866ed8262b4f5d915e49dd4ed533243faebc37d2c2285a8 SHA512 d9a2dd05b08ff171a03a9efee37e6a7daf2f49ceb35f902a4ee6f925e700db36c79bd1a4a76dd0128f1c48fa09d21de9b31e65b449005dbf618f97ca851620b5 EBUILD qemu-9.0.2-r2.ebuild 28338 BLAKE2B a810b16f2ec185546f9f605cf72132800321260bc35c5deb41613ac97a0e4ad04b3edc94e0f0ca29bddf028e06fe3d2812e86de29d29108a87fb321cc878cef2 SHA512 09fa0a1395ba9ea1cd645b4cb52590b46f278a81629b340c3eb99fba788e16248c3d62550605c66028ca90620daf680f0fae2fcd7ff5fa6823a2437f699a5460 EBUILD qemu-9.0.3.ebuild 28338 BLAKE2B a810b16f2ec185546f9f605cf72132800321260bc35c5deb41613ac97a0e4ad04b3edc94e0f0ca29bddf028e06fe3d2812e86de29d29108a87fb321cc878cef2 SHA512 09fa0a1395ba9ea1cd645b4cb52590b46f278a81629b340c3eb99fba788e16248c3d62550605c66028ca90620daf680f0fae2fcd7ff5fa6823a2437f699a5460 -EBUILD qemu-9999.ebuild 28329 BLAKE2B 4b98ccbea8020cef41aeab35b5c32fa03134893f821012c4bc9897b2387426f496c97375c03a50e0e598bde0aed3114f27102134c4f7573bbaa29bc6a1ce4e2f SHA512 b5bc0dc589f4d412c7aa2d85415e958bd7e07c70609041c9c0549dca5eae22317f5355888920d0dfe235cb499ad0f13958c51617d1dd01b5d50b60911420f429 +EBUILD qemu-9.1.0.ebuild 28329 BLAKE2B 8117074f7da6c61fcd66a5620c9bd772cd6ede3f0340fdd30551a7af90805cc7985927a3b6ae8acb3ed6ad4ab33bd500a73e92203a54250162e6f49a8bc9c4c1 SHA512 d203d0e680faed7202288a5cfdca82cede402941316c7e1980415d93559289045d04320d16b006ac8ec967e957518a00632f74e110acfd05086f865a23e53605 +EBUILD qemu-9999.ebuild 28329 BLAKE2B 8117074f7da6c61fcd66a5620c9bd772cd6ede3f0340fdd30551a7af90805cc7985927a3b6ae8acb3ed6ad4ab33bd500a73e92203a54250162e6f49a8bc9c4c1 SHA512 d203d0e680faed7202288a5cfdca82cede402941316c7e1980415d93559289045d04320d16b006ac8ec967e957518a00632f74e110acfd05086f865a23e53605 MISC metadata.xml 4497 BLAKE2B 4b116f5c4127c723df91fbf5746793628d56101188076c90d0c45f25e52da8a3f16d3e4860a9b11049cf0528e1d8203c318b1bd646b8f21ae9843869a3e3f41a SHA512 7c483a8b90a74f4a5cda761091f6793986087e2111e8dbc2eaa010d46283db9bc3cd475d9468498f1ad6c81beece87507998f48ec45bc1798e56a6dd327148d4 diff --git a/app-emulation/qemu/files/qemu-9.1.0-capstone-include-path.patch b/app-emulation/qemu/files/qemu-9.1.0-capstone-include-path.patch new file mode 100644 index 000000000000..7bb6a004d866 --- /dev/null +++ b/app-emulation/qemu/files/qemu-9.1.0-capstone-include-path.patch @@ -0,0 +1,33 @@ +From: Sam James <sam@gentoo.org> +Date: Sun, 6 Oct 2024 09:47:03 +0100 +Subject: [PATCH] Forward ported from qemu-7.1.0-capstone-include-path.patch. + +Bug: https://bugs.gentoo.org/873157 +Signed-off-by: Sam James <sam@gentoo.org> +--- + include/disas/capstone.h | 2 +- + meson.build | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/include/disas/capstone.h ++++ b/include/disas/capstone.h +@@ -4,7 +4,7 @@ + #ifdef CONFIG_CAPSTONE + + #define CAPSTONE_AARCH64_COMPAT_HEADER +-#include <capstone.h> ++#include <capstone/capstone.h> + + #else + +--- a/meson.build ++++ b/meson.build +@@ -1769,7 +1769,7 @@ if not get_option('capstone').auto() or have_system or have_user + # that reports a wrong -I path, causing the #include to + # fail later. If the system has such a broken version + # do not use it. +- if capstone.found() and not cc.compiles('#include <capstone.h>', ++ if capstone.found() and not cc.compiles('#include <capstone/capstone.h>', + dependencies: [capstone]) + capstone = not_found + if get_option('capstone').enabled() diff --git a/app-emulation/qemu/qemu-9.1.0.ebuild b/app-emulation/qemu/qemu-9.1.0.ebuild new file mode 100644 index 000000000000..549817d8345e --- /dev/null +++ b/app-emulation/qemu/qemu-9.1.0.ebuild @@ -0,0 +1,1006 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# Generate using https://github.com/thesamesam/sam-gentoo-scripts/blob/main/niche/generate-qemu-docs +# Set to 1 if prebuilt, 0 if not +# (the construct below is to allow overriding from env for script) +QEMU_DOCS_PREBUILT=${QEMU_DOCS_PREBUILT:-1} +QEMU_DOCS_PREBUILT_DEV=sam +QEMU_DOCS_VERSION=$(ver_cut 1-3) +# Default to generating docs (inc. man pages) if no prebuilt; overridden later +# bug #830088 +QEMU_DOC_USEFLAG="+doc" + +PYTHON_COMPAT=( python3_{10..12} ) +PYTHON_REQ_USE="ncurses,readline" + +FIRMWARE_ABI_VERSION="7.2.0" + +inherit linux-info toolchain-funcs python-r1 udev fcaps readme.gentoo-r1 \ + pax-utils xdg-utils + +if [[ ${PV} == *9999* ]]; then + QEMU_DOCS_PREBUILT=0 + + EGIT_REPO_URI="https://gitlab.com/qemu-project/qemu.git/" + EGIT_SUBMODULES=() + inherit git-r3 + SRC_URI="" + declare -A SUBPROJECTS=( + [keycodemapdb]="f5772a62ec52591ff6870b7e8ef32482371f22c6" + [berkeley-softfloat-3]="b64af41c3276f97f0e181920400ee056b9c88037" + [berkeley-testfloat-3]="e7af9751d9f9fd3b47911f51a5cfd08af256a9ab" + ) + + for proj in "${!SUBPROJECTS[@]}"; do + c=${SUBPROJECTS[${proj}]} + SRC_URI+=" https://gitlab.com/qemu-project/${proj}/-/archive/${c}/${proj}-${c}.tar.bz2" + done +else + MY_P="${PN}-${PV/_rc/-rc}" + SRC_URI="https://download.qemu.org/${MY_P}.tar.xz" + + if [[ ${QEMU_DOCS_PREBUILT} == 1 ]] ; then + SRC_URI+=" !doc? ( https://dev.gentoo.org/~${QEMU_DOCS_PREBUILT_DEV}/distfiles/${CATEGORY}/${PN}/${PN}-${QEMU_DOCS_VERSION}-docs.tar.xz )" + fi + + S="${WORKDIR}/${MY_P}" + [[ "${PV}" != *_rc* ]] && KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~x86" +fi + +DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools" +HOMEPAGE="https://www.qemu.org https://www.linux-kvm.org" + +LICENSE="GPL-2 LGPL-2 BSD-2" +SLOT="0" + +[[ ${QEMU_DOCS_PREBUILT} == 1 ]] && QEMU_DOC_USEFLAG="doc" + +IUSE="accessibility +aio alsa bpf bzip2 capstone +curl debug ${QEMU_DOC_USEFLAG} + +fdt fuse glusterfs +gnutls gtk infiniband iscsi io-uring + jack jemalloc +jpeg keyutils + lzo multipath + ncurses nfs nls numa opengl +oss pam +pin-upstream-blobs pipewire + plugins +png pulseaudio python rbd sasl +seccomp sdl sdl-image selinux + +slirp + smartcard snappy spice ssh static-user systemtap test udev usb + usbredir vde +vhost-net virgl virtfs +vnc vte xattr xdp xen + zstd" + +COMMON_TARGETS=" + aarch64 + alpha + arm + cris + hppa + i386 + loongarch64 + m68k + microblaze + microblazeel + mips + mips64 + mips64el + mipsel + or1k + ppc + ppc64 + riscv32 + riscv64 + s390x + sh4 + sh4eb + sparc + sparc64 + x86_64 + xtensa + xtensaeb +" +IUSE_SOFTMMU_TARGETS=" + ${COMMON_TARGETS} + avr + rx + tricore +" +IUSE_USER_TARGETS=" + ${COMMON_TARGETS} + aarch64_be + armeb + hexagon + mipsn32 + mipsn32el + ppc64le + sparc32plus +" + +use_softmmu_targets=$(printf ' qemu_softmmu_targets_%s' ${IUSE_SOFTMMU_TARGETS}) +use_user_targets=$(printf ' qemu_user_targets_%s' ${IUSE_USER_TARGETS}) +IUSE+=" ${use_softmmu_targets} ${use_user_targets}" + +RESTRICT="!test? ( test )" + +# Allow no targets to be built so that people can get a tools-only build. +# Block USE flag configurations known to not work. +REQUIRED_USE=" + ${PYTHON_REQUIRED_USE} + qemu_softmmu_targets_arm? ( fdt ) + qemu_softmmu_targets_microblaze? ( fdt ) + qemu_softmmu_targets_mips64el? ( fdt ) + qemu_softmmu_targets_ppc64? ( fdt ) + qemu_softmmu_targets_ppc? ( fdt ) + qemu_softmmu_targets_riscv32? ( fdt ) + qemu_softmmu_targets_riscv64? ( fdt ) + qemu_softmmu_targets_x86_64? ( fdt ) + sdl-image? ( sdl ) + static-user? ( !plugins ) + virgl? ( opengl ) + virtfs? ( xattr ) + vnc? ( gnutls ) + vte? ( gtk ) + multipath? ( udev ) + plugins? ( !static-user ) + xdp? ( bpf ) +" +for smname in ${IUSE_SOFTMMU_TARGETS} ; do + REQUIRED_USE+=" qemu_softmmu_targets_${smname}? ( kernel_linux? ( seccomp ) )" +done + +# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...) +# and user/softmmu targets (qemu-*, qemu-system-*). +# +# Yep, you need both libcap and libcap-ng since virtfs only uses libcap. +# +# The attr lib isn't always linked in (although the USE flag is always +# respected). This is because qemu supports using the C library's API +# when available rather than always using the external library. +ALL_DEPEND=" + dev-libs/glib:2[static-libs(+)] + sys-libs/zlib[static-libs(+)] + python? ( ${PYTHON_DEPS} ) + systemtap? ( dev-debug/systemtap ) + xattr? ( sys-apps/attr[static-libs(+)] ) +" + +# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...) +# softmmu targets (qemu-system-*). +SOFTMMU_TOOLS_DEPEND=" + >=x11-libs/pixman-0.28.0[static-libs(+)] + accessibility? ( + app-accessibility/brltty[api] + app-accessibility/brltty[static-libs(+)] + ) + aio? ( dev-libs/libaio[static-libs(+)] ) + alsa? ( >=media-libs/alsa-lib-1.0.13 ) + bpf? ( dev-libs/libbpf:= ) + bzip2? ( app-arch/bzip2[static-libs(+)] ) + capstone? ( dev-libs/capstone:=[static-libs(+)] ) + curl? ( >=net-misc/curl-7.15.4[static-libs(+)] ) + fdt? ( >=sys-apps/dtc-1.5.1[static-libs(+)] ) + fuse? ( >=sys-fs/fuse-3.1:3[static-libs(+)] ) + glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] ) + gnutls? ( + >=net-libs/gnutls-3.0:=[static-libs(+)] + dev-libs/nettle:=[static-libs(+)] + ) + gtk? ( + x11-libs/gtk+:3 + vte? ( x11-libs/vte:2.91 ) + ) + infiniband? ( sys-cluster/rdma-core[static-libs(+)] ) + iscsi? ( net-libs/libiscsi ) + io-uring? ( sys-libs/liburing:=[static-libs(+)] ) + jack? ( virtual/jack ) + jemalloc? ( dev-libs/jemalloc ) + jpeg? ( media-libs/libjpeg-turbo:=[static-libs(+)] ) + kernel_linux? ( sys-libs/libcap-ng[static-libs(+)] ) + keyutils? ( sys-apps/keyutils[static-libs(+)] ) + lzo? ( dev-libs/lzo:2[static-libs(+)] ) + multipath? ( sys-fs/multipath-tools ) + ncurses? ( + sys-libs/ncurses:=[unicode(+)] + sys-libs/ncurses:=[static-libs(+)] + ) + nfs? ( >=net-fs/libnfs-1.9.3:=[static-libs(+)] ) + numa? ( sys-process/numactl[static-libs(+)] ) + opengl? ( + virtual/opengl + media-libs/libepoxy[static-libs(+)] + media-libs/mesa[static-libs(+)] + media-libs/mesa[egl(+),gbm(+)] + ) + pam? ( sys-libs/pam ) + pipewire? ( >=media-video/pipewire-0.3.60 ) + png? ( >=media-libs/libpng-1.6.34:=[static-libs(+)] ) + pulseaudio? ( media-libs/libpulse ) + rbd? ( sys-cluster/ceph ) + sasl? ( dev-libs/cyrus-sasl[static-libs(+)] ) + sdl? ( + media-libs/libsdl2[video] + media-libs/libsdl2[static-libs(+)] + ) + sdl-image? ( media-libs/sdl2-image[static-libs(+)] ) + seccomp? ( >=sys-libs/libseccomp-2.1.0[static-libs(+)] ) + slirp? ( net-libs/libslirp[static-libs(+)] ) + smartcard? ( >=app-emulation/libcacard-2.5.0[static-libs(+)] ) + snappy? ( app-arch/snappy:= ) + spice? ( + >=app-emulation/spice-protocol-0.14.0 + >=app-emulation/spice-0.14.0[static-libs(+)] + ) + ssh? ( >=net-libs/libssh-0.8.6[static-libs(+)] ) + udev? ( virtual/libudev:= ) + usb? ( >=virtual/libusb-1-r2:1[static-libs(+)] ) + usbredir? ( >=sys-apps/usbredir-0.6[static-libs(+)] ) + vde? ( net-misc/vde[static-libs(+)] ) + virgl? ( media-libs/virglrenderer[static-libs(+)] ) + virtfs? ( sys-libs/libcap ) + xdp? ( net-libs/xdp-tools ) + xen? ( app-emulation/xen-tools:= ) + zstd? ( >=app-arch/zstd-1.4.0[static-libs(+)] ) +" + +EDK2_OVMF_VERSION="202202" +SEABIOS_VERSION="1.16.3" + +X86_FIRMWARE_DEPEND=" + pin-upstream-blobs? ( + ~sys-firmware/edk2-ovmf-bin-${EDK2_OVMF_VERSION} + ~sys-firmware/ipxe-1.21.1[binary,qemu] + ~sys-firmware/seabios-bin-${SEABIOS_VERSION} + ~sys-firmware/sgabios-0.1_pre10[binary] + ) + !pin-upstream-blobs? ( + || ( + >=sys-firmware/edk2-ovmf-${EDK2_OVMF_VERSION} + >=sys-firmware/edk2-ovmf-bin-${EDK2_OVMF_VERSION} + ) + sys-firmware/ipxe[qemu] + || ( + >=sys-firmware/seabios-${SEABIOS_VERSION}[seavgabios] + >=sys-firmware/seabios-bin-${SEABIOS_VERSION} + ) + sys-firmware/sgabios + ) +" +PPC_FIRMWARE_DEPEND=" + pin-upstream-blobs? ( + ~sys-firmware/seabios-bin-${SEABIOS_VERSION} + ) + !pin-upstream-blobs? ( + || ( + >=sys-firmware/seabios-${SEABIOS_VERSION}[seavgabios] + >=sys-firmware/seabios-bin-${SEABIOS_VERSION} + ) + ) +" + +# See bug #913084 for pip dep +BDEPEND=" + $(python_gen_impl_dep) + dev-lang/perl + >=dev-build/meson-0.63.0 + app-alternatives/ninja + dev-python/pip[${PYTHON_USEDEP}] + virtual/pkgconfig + doc? ( + >=dev-python/sphinx-1.6.0[${PYTHON_USEDEP}] + dev-python/sphinx-rtd-theme[${PYTHON_USEDEP}] + ) + gtk? ( nls? ( sys-devel/gettext ) ) + test? ( + dev-libs/glib[utils] + app-alternatives/bc + ) +" +CDEPEND=" + ${ALL_DEPEND//\[static-libs(+)]} + ${SOFTMMU_TOOLS_DEPEND//\[static-libs(+)]} + qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} ) + qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} ) + qemu_softmmu_targets_ppc? ( ${PPC_FIRMWARE_DEPEND} ) + qemu_softmmu_targets_ppc64? ( ${PPC_FIRMWARE_DEPEND} ) +" +DEPEND=" + ${CDEPEND} + kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 ) + static-user? ( ${ALL_DEPEND} ) +" +RDEPEND=" + ${CDEPEND} + acct-group/kvm + selinux? ( + sec-policy/selinux-qemu + sys-libs/libselinux + ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-9.0.0-disable-keymap.patch + "${FILESDIR}"/${PN}-9.1.0-capstone-include-path.patch + "${FILESDIR}"/${PN}-9.0.0-also-build-virtfs-proxy-helper.patch + "${FILESDIR}"/${PN}-8.1.0-skip-tests.patch + "${FILESDIR}"/${PN}-8.1.0-find-sphinx.patch + +) + +QA_PREBUILT=" + usr/share/qemu/hppa-firmware.img + usr/share/qemu/hppa-firmware64.img + usr/share/qemu/openbios-ppc + usr/share/qemu/openbios-sparc64 + usr/share/qemu/openbios-sparc32 + usr/share/qemu/opensbi-riscv64-generic-fw_dynamic.elf + usr/share/qemu/opensbi-riscv32-generic-fw_dynamic.elf + usr/share/qemu/palcode-clipper + usr/share/qemu/s390-ccw.img + usr/share/qemu/s390-netboot.img + usr/share/qemu/u-boot.e500 +" + +QA_WX_LOAD=" + usr/bin/qemu-i386 + usr/bin/qemu-x86_64 + usr/bin/qemu-alpha + usr/bin/qemu-arm + usr/bin/qemu-cris + usr/bin/qemu-m68k + usr/bin/qemu-microblaze + usr/bin/qemu-microblazeel + usr/bin/qemu-mips + usr/bin/qemu-mipsel + usr/bin/qemu-or1k + usr/bin/qemu-ppc + usr/bin/qemu-ppc64 + usr/bin/qemu-sh4 + usr/bin/qemu-sh4eb + usr/bin/qemu-sparc + usr/bin/qemu-sparc64 + usr/bin/qemu-armeb + usr/bin/qemu-sparc32plus + usr/bin/qemu-s390x + usr/bin/qemu-unicore32 +" + +DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure you have the +kernel module loaded before running kvm. The easiest way to ensure that the +kernel module is loaded is to load it on boot. + For AMD CPUs the module is called 'kvm-amd'. + For Intel CPUs the module is called 'kvm-intel'. +Please review /etc/conf.d/modules for how to load these. + +Make sure your user is in the 'kvm' group. Just run + $ gpasswd -a <USER> kvm +then have <USER> re-login. + +For brand new installs, the default permissions on /dev/kvm might not let +you access it. You can tell udev to reset ownership/perms: + $ udevadm trigger -c add /dev/kvm + +If you want to register binfmt handlers for qemu user targets: +For openrc: + # rc-update add qemu-binfmt +For systemd: + # ln -s /usr/share/qemu/binfmt.d/qemu.conf /etc/binfmt.d/qemu.conf" + +pkg_pretend() { + if use kernel_linux && kernel_is lt 2 6 25; then + eerror "This version of KVM requires a host kernel of 2.6.25 or higher." + elif use kernel_linux; then + if ! linux_config_exists; then + eerror "Unable to check your kernel for KVM support" + else + CONFIG_CHECK="~KVM ~TUN ~BRIDGE" + ERROR_KVM="You must enable KVM in your kernel to continue" + ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in" + ERROR_KVM_AMD+=" your kernel configuration." + ERROR_KVM_INTEL="If you have an Intel CPU, you must enable" + ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration." + ERROR_TUN="You will need the Universal TUN/TAP driver compiled" + ERROR_TUN+=" into your kernel or loaded as a module to use the" + ERROR_TUN+=" virtual network device if using -net tap." + ERROR_BRIDGE="You will also need support for 802.1d" + ERROR_BRIDGE+=" Ethernet Bridging for some network configurations." + use vhost-net && CONFIG_CHECK+=" ~VHOST_NET" + ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net" + ERROR_VHOST_NET+=" support" + use test && CONFIG_CHECK+=" IP_MULTICAST" + ERROR_IP_MULTICAST="Test suite requires IP_MULTICAST" + + if use amd64 || use x86 || use amd64-linux || use x86-linux; then + if grep -q AuthenticAMD /proc/cpuinfo; then + CONFIG_CHECK+=" ~KVM_AMD" + elif grep -q GenuineIntel /proc/cpuinfo; then + CONFIG_CHECK+=" ~KVM_INTEL" + fi + fi + + use python && CONFIG_CHECK+=" ~DEBUG_FS" + ERROR_DEBUG_FS="debugFS support required for kvm_stat" + + # Now do the actual checks setup above + check_extra_config + fi + fi + + if grep -qs '/usr/bin/qemu-kvm' "${EROOT}"/etc/libvirt/qemu/*.xml; then + eerror "The kvm/qemu-kvm wrappers no longer exist, but your libvirt" + eerror "instances are still pointing to it. Please update your" + eerror "configs in /etc/libvirt/qemu/ to use the -enable-kvm flag" + eerror "and the right system binary (e.g. qemu-system-x86_64)." + die "update your virt configs to not use qemu-kvm" + fi +} + +# Sanity check to make sure target lists are kept up-to-date. +check_targets() { + local var=$1 mak=$2 + local detected sorted + + pushd "${S}"/configs/targets/ >/dev/null || die + + # Force C locale until glibc is updated. #564936 + detected=$(echo $(printf '%s\n' *-${mak}.mak | sed "s:-${mak}.mak::" | LC_COLLATE=C sort -u)) + sorted=$(echo $(printf '%s\n' ${!var} | LC_COLLATE=C sort -u)) + if [[ ${sorted} != "${detected}" ]] ; then + eerror "The ebuild needs to be kept in sync." + eerror "${var}: ${sorted}" + eerror "$(printf '%-*s' ${#var} configure): ${detected}" + die "sync ${var} to the list of targets" + fi + + popd >/dev/null +} + +src_unpack() { + if [[ ${PV} == 9999 ]] ; then + git-r3_src_unpack + for file in ${A}; do + unpack "${file}" + done + cd "${WORKDIR}" || die + for proj in "${!SUBPROJECTS[@]}"; do + mv "${proj}-${SUBPROJECTS[${proj}]}" "${S}/subprojects/${proj}" || die + done + cd "${S}" || die + meson subprojects packagefiles --apply || die + else + default + fi +} + +src_prepare() { + check_targets IUSE_SOFTMMU_TARGETS softmmu + check_targets IUSE_USER_TARGETS linux-user + + default + + # Use correct toolchain to fix cross-compiling + tc-export AR AS LD NM OBJCOPY PKG_CONFIG RANLIB STRINGS + export WINDRES=${CHOST}-windres + + # Workaround for bug #938302 + if use systemtap && has_version "dev-debug/systemtap[-dtrace-symlink(+)]" ; then + cat >> "${S}"/configs/meson/linux.txt <<-EOF || die + [binaries] + dtrace='stap-dtrace' + EOF + fi + + # Verbose builds + MAKEOPTS+=" V=1" + + # Remove bundled modules + rm -r roms/*/ || die +} + +## +# configures qemu based on the build directory and the build type +# we are using. +# +qemu_src_configure() { + debug-print-function ${FUNCNAME} "$@" + + local buildtype=$1 + local builddir="${S}/${buildtype}-build" + + mkdir "${builddir}" || die + + local conf_opts=( + --prefix=/usr + --sysconfdir=/etc + --bindir=/usr/bin + --libdir=/usr/$(get_libdir) + --datadir=/usr/share + --docdir=/usr/share/doc/${PF}/html + --mandir=/usr/share/man + --localstatedir=/var + --disable-bsd-user + --disable-containers # bug #732972 + --disable-guest-agent + --disable-strip + --disable-download + + # bug #746752: TCG interpreter has a few limitations: + # - it does not support FPU + # - it's generally slower on non-self-modifying code + # It's advantage is support for host architectures + # where native codegeneration is not implemented. + # Gentoo has qemu keyworded only on targets with + # native code generation available. Avoid the interpreter. + --disable-tcg-interpreter + + --disable-werror + # We support gnutls/nettle for crypto operations. It is possible + # to use gcrypt when gnutls/nettle are disabled (but not when they + # are enabled), but it's not really worth the hassle. Disable it + # all the time to avoid automatically detecting it. #568856 + --disable-gcrypt + --cc="$(tc-getCC)" + --cxx="$(tc-getCXX)" + --objcc="$(tc-getCC)" + --host-cc="$(tc-getBUILD_CC)" + + $(use_enable alsa) + $(use_enable debug debug-info) + $(use_enable debug debug-tcg) + $(use_enable jack) + $(use_enable nls gettext) + $(use_enable oss) + $(use_enable pipewire) + $(use_enable plugins) + $(use_enable pulseaudio pa) + $(use_enable selinux) + $(use_enable xattr attr) + ) + + # Disable options not used by user targets. This simplifies building + # static user targets (USE=static-user) considerably. + conf_notuser() { + if [[ ${buildtype} == "user" ]] ; then + echo "--disable-${2:-$1}" + else + use_enable "$@" + fi + } + # Enable option only for softmmu build, but not 'user' or 'tools' + conf_softmmu() { + if [[ ${buildtype} == "softmmu" ]] ; then + use_enable "$@" + else + echo "--disable-${2:-$1}" + fi + } + # Enable option only for tools build, but not 'user' or 'softmmu' + conf_tools() { + if [[ ${buildtype} == "tools" ]] ; then + use_enable "$@" + else + echo "--disable-${2:-$1}" + fi + } + # Special case for the malloc flag, because the --disable flag does + # not exist and trying like above will break configuring. + conf_malloc() { + if [[ ! ${buildtype} == "user" ]] ; then + usex "${1}" "--enable-malloc=${1}" "" + fi + } + conf_opts+=( + $(conf_notuser accessibility brlapi) + $(conf_notuser aio linux-aio) + $(conf_softmmu bpf) + $(conf_notuser bzip2) + $(conf_notuser capstone) + $(conf_notuser curl) + $(conf_tools doc docs) + $(conf_notuser fdt) + $(conf_notuser fuse) + $(conf_notuser glusterfs) + $(conf_notuser gnutls) + $(conf_notuser gnutls nettle) + $(conf_notuser gtk) + $(conf_notuser infiniband rdma) + $(conf_notuser iscsi libiscsi) + $(conf_notuser io-uring linux-io-uring) + $(conf_malloc jemalloc) + $(conf_notuser jpeg vnc-jpeg) + $(conf_notuser kernel_linux kvm) + $(conf_notuser keyutils libkeyutils) + $(conf_notuser lzo) + $(conf_notuser multipath mpath) + $(conf_notuser ncurses curses) + $(conf_notuser nfs libnfs) + $(conf_notuser numa) + $(conf_notuser opengl) + $(conf_notuser pam auth-pam) + $(conf_notuser png) + $(conf_notuser rbd) + $(conf_notuser sasl vnc-sasl) + $(conf_notuser sdl) + $(conf_softmmu sdl-image) + $(conf_notuser seccomp) + $(conf_notuser slirp) + $(conf_notuser smartcard) + $(conf_notuser snappy) + $(conf_notuser spice) + $(conf_notuser ssh libssh) + $(conf_notuser udev libudev) + $(conf_notuser usb libusb) + $(conf_notuser usbredir usb-redir) + $(conf_notuser vde) + $(conf_notuser vhost-net) + $(conf_notuser virgl virglrenderer) + $(conf_softmmu virtfs) + $(conf_notuser vnc) + $(conf_notuser vte) + $(conf_softmmu xdp af-xdp) + $(conf_notuser xen) + $(conf_notuser xen xen-pci-passthrough) + # use prebuilt keymaps, bug #759604 + --disable-xkbcommon + $(conf_notuser zstd) + ) + + if [[ ! ${buildtype} == "user" ]] ; then + # audio options + local audio_opts=( + # Note: backend order matters here: #716202 + # We iterate from higher-level to lower level. + $(usex pulseaudio pa "") + $(usev pipewire) + $(usev jack) + $(usev sdl) + $(usev alsa) + $(usev oss) + ) + conf_opts+=( + --audio-drv-list=$(IFS=,; echo "${audio_opts[*]}") + ) + fi + + case ${buildtype} in + user) + conf_opts+=( + --enable-linux-user + --disable-system + --disable-tools + --disable-cap-ng + --disable-seccomp + ) + local static_flag="static-user" + ;; + softmmu) + conf_opts+=( + --disable-linux-user + --enable-system + --disable-tools + --enable-cap-ng + --enable-seccomp + ) + local static_flag="none" + ;; + tools) + conf_opts+=( + --disable-linux-user + --disable-system + --enable-tools + --enable-cap-ng + ) + local static_flag="none" + ;; + esac + + local targets="${buildtype}_targets" + [[ -n ${targets} ]] && conf_opts+=( --target-list="${!targets}" ) + + # Add support for SystemTap + use systemtap && conf_opts+=( --enable-trace-backends="dtrace" ) + + # We always want to attempt to build with PIE support as it results + # in a more secure binary. But it doesn't work with static or if + # the current GCC doesn't have PIE support. + if [[ ${static_flag} != "none" ]] && use ${static_flag}; then + conf_opts+=( --static --disable-pie ) + else + tc-enables-pie && conf_opts+=( --enable-pie ) + fi + + # Meson will not use a cross-file unless cross_prefix is set. + tc-is-cross-compiler && conf_opts+=( --cross-prefix="${CHOST}-" ) + + # Plumb through equivalent of EXTRA_ECONF to allow experiments + # like bug #747928. + conf_opts+=( ${EXTRA_CONF_QEMU} ) + + echo "../configure ${conf_opts[*]}" + cd "${builddir}" + ../configure "${conf_opts[@]}" || die "configure failed" +} + +src_configure() { + local target + + python_setup + + softmmu_targets= softmmu_bins=() + user_targets= user_bins=() + + for target in ${IUSE_SOFTMMU_TARGETS} ; do + if use "qemu_softmmu_targets_${target}"; then + softmmu_targets+=",${target}-softmmu" + softmmu_bins+=( "qemu-system-${target}" ) + fi + done + + for target in ${IUSE_USER_TARGETS} ; do + if use "qemu_user_targets_${target}"; then + user_targets+=",${target}-linux-user" + user_bins+=( "qemu-${target}" ) + fi + done + + softmmu_targets=${softmmu_targets#,} + user_targets=${user_targets#,} + + [[ -n ${softmmu_targets} ]] && qemu_src_configure "softmmu" + [[ -n ${user_targets} ]] && qemu_src_configure "user" + qemu_src_configure "tools" +} + +src_compile() { + if [[ -n ${user_targets} ]]; then + cd "${S}/user-build" || die + default + fi + + if [[ -n ${softmmu_targets} ]]; then + cd "${S}/softmmu-build" || die + default + fi + + cd "${S}/tools-build" || die + default +} + +src_test() { + if [[ -n ${softmmu_targets} ]]; then + cd "${S}/softmmu-build" || die + pax-mark m */qemu-system-* #515550 + emake check + fi +} + +qemu_python_install() { + python_domodule "${S}/python/qemu" + + python_doscript "${S}/scripts/kvm/vmxcap" + python_doscript "${S}/scripts/qmp/qmp-shell" + python_doscript "${S}/scripts/qmp/qemu-ga-client" +} + +# Generate binfmt support files. +# - /etc/init.d/qemu-binfmt script which registers the user handlers (openrc) +# - /usr/share/qemu/binfmt.d/qemu.conf (for use with systemd-binfmt) +generate_initd() { + local out="${T}/qemu-binfmt" + local out_systemd="${T}/qemu.conf" + local d="${T}/binfmt.d" + + einfo "Generating qemu binfmt scripts and configuration files" + + # Generate the debian fragments first. + mkdir -p "${d}" + "${S}"/scripts/qemu-binfmt-conf.sh \ + --debian \ + --exportdir "${d}" \ + --qemu-path "${EPREFIX}/usr/bin" \ + || die + # Then turn the fragments into a shell script we can source. + sed -E -i \ + -e 's:^([^ ]+) (.*)$:\1="\2":' \ + "${d}"/* || die + + # Generate the init.d script by assembling the fragments from above. + local f qcpu package interpreter magic mask + cat "${FILESDIR}"/qemu-binfmt.initd.head >"${out}" || die + for f in "${d}"/qemu-* ; do + source "${f}" + + # Normalize the cpu logic like we do in the init.d for the native cpu. + qcpu=${package#qemu-} + case ${qcpu} in + arm*) qcpu="arm";; + mips*) qcpu="mips";; + ppc*) qcpu="ppc";; + s390*) qcpu="s390";; + sh*) qcpu="sh";; + sparc*) qcpu="sparc";; + esac + + # we use 'printf' here to be portable across 'sh' + # implementations: #679168 + cat <<EOF >>"${out}" + if [ "\${cpu}" != "${qcpu}" -a -x "${interpreter}" ] ; then + printf '%s\n' ':${package}:M::${magic}:${mask}:${interpreter}:'"\${QEMU_BINFMT_FLAGS}" >/proc/sys/fs/binfmt_misc/register + fi +EOF + + echo ":${package}:M::${magic}:${mask}:${interpreter}:OC" >>"${out_systemd}" + + done + cat "${FILESDIR}"/qemu-binfmt.initd.tail >>"${out}" || die +} + +src_install() { + if [[ -n ${user_targets} ]]; then + cd "${S}/user-build" + emake DESTDIR="${ED}" install + + # Install binfmt handler init script for user targets. + generate_initd + doinitd "${T}/qemu-binfmt" + + # Install binfmt/qemu.conf. + insinto "/usr/share/qemu/binfmt.d" + doins "${T}/qemu.conf" + fi + + if [[ -n ${softmmu_targets} ]]; then + cd "${S}/softmmu-build" + emake DESTDIR="${ED}" install + + # This might not exist if the test failed. #512010 + [[ -e check-report.html ]] && dodoc check-report.html + + if use kernel_linux; then + udev_newrules "${FILESDIR}"/65-kvm.rules-r2 65-kvm.rules + fi + + if use python; then + python_foreach_impl qemu_python_install + fi + fi + + cd "${S}/tools-build" || die + emake DESTDIR="${ED}" install + + # If USE=doc, there'll be newly generated docs which we install instead. + if ! use doc && [[ ${QEMU_DOCS_PREBUILT} == 1 ]] ; then + doman "${WORKDIR}"/${PN}-${QEMU_DOCS_VERSION}-docs/docs/*.[0-8] + fi + + # Disable mprotect on the qemu binaries as they use JITs to be fast #459348 + pushd "${ED}"/usr/bin >/dev/null || die + pax-mark mr "${softmmu_bins[@]}" "${user_bins[@]}" # bug 575594 + popd >/dev/null || die + + # Install config file example for qemu-bridge-helper + insinto "/etc/qemu" + doins "${FILESDIR}/bridge.conf" + + cd "${S}" || die + dodoc MAINTAINERS + newdoc pc-bios/README README.pc-bios + + # Disallow stripping of prebuilt firmware files. + dostrip -x ${QA_PREBUILT} + + if [[ -n ${softmmu_targets} ]]; then + # Remove SeaBIOS since we're using the SeaBIOS packaged one + if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then + dosym ../seabios/bios-256k.bin /usr/share/qemu/bios-256k.bin + fi + + # Remove vgabios since we're using the seavgabios packaged one + rm "${ED}/usr/share/qemu/vgabios.bin" + rm "${ED}/usr/share/qemu/vgabios-cirrus.bin" + rm "${ED}/usr/share/qemu/vgabios-qxl.bin" + rm "${ED}/usr/share/qemu/vgabios-stdvga.bin" + rm "${ED}/usr/share/qemu/vgabios-virtio.bin" + rm "${ED}/usr/share/qemu/vgabios-vmware.bin" + + # PPC/PPC64 loads vgabios-stdvga + if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386 || use qemu_softmmu_targets_ppc || use qemu_softmmu_targets_ppc64; then + dosym ../seavgabios/vgabios-isavga.bin /usr/share/qemu/vgabios.bin + dosym ../seavgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin + dosym ../seavgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin + dosym ../seavgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin + dosym ../seavgabios/vgabios-virtio.bin /usr/share/qemu/vgabios-virtio.bin + dosym ../seavgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin + fi + + # Remove sgabios since we're using the sgabios packaged one + if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then + dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin + fi + + # Remove iPXE since we're using the iPXE packaged one + if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then + dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom + dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom + dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom + dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom + dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom + dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom + fi + fi + + DISABLE_AUTOFORMATTING=true + readme.gentoo_create_doc +} + +firmware_abi_change() { + local pv + for pv in ${REPLACING_VERSIONS}; do + if ver_test ${pv} -lt ${FIRMWARE_ABI_VERSION}; then + return 0 + fi + done + return 1 +} + +pkg_postinst() { + if [[ -n ${softmmu_targets} ]] && use kernel_linux; then + udev_reload + fi + + xdg_icon_cache_update + + [[ -z ${EPREFIX} ]] && [[ -f ${EROOT}/usr/libexec/qemu-bridge-helper ]] && \ + fcaps cap_net_admin "${EROOT}"/usr/libexec/qemu-bridge-helper + + DISABLE_AUTOFORMATTING=true + readme.gentoo_print_elog + + if use pin-upstream-blobs && firmware_abi_change; then + ewarn "This version of qemu pins new versions of firmware blobs:" + + if has_version 'sys-firmware/edk2-ovmf-bin'; then + ewarn " $(best_version sys-firmware/edk2-ovmf-bin)" + else + ewarn " $(best_version sys-firmware/edk2-ovmf)" + fi + + if has_version 'sys-firmware/seabios-bin'; then + ewarn " $(best_version sys-firmware/seabios-bin)" + else + ewarn " $(best_version sys-firmware/seabios)" + fi + + ewarn " $(best_version sys-firmware/ipxe)" + ewarn " $(best_version sys-firmware/sgabios)" + ewarn "This might break resume of hibernated guests (started with a different" + ewarn "firmware version) and live migration to/from qemu versions with different" + ewarn "firmware. Please (cold) restart all running guests. For functional" + ewarn "guest migration ensure that all" + ewarn "hosts run at least" + ewarn " app-emulation/qemu-${FIRMWARE_ABI_VERSION}." + fi +} + +pkg_info() { + echo "Using:" + echo " $(best_version app-emulation/spice-protocol)" + + if has_version 'sys-firmware/edk2-ovmf-bin'; then + echo " $(best_version sys-firmware/edk2-ovmf-bin)" + else + echo " $(best_version sys-firmware/edk2-ovmf)" + fi + + if has_version 'sys-firmware/seabios-bin'; then + echo " $(best_version sys-firmware/seabios-bin)" + else + echo " $(best_version sys-firmware/seabios)" + fi + + echo " $(best_version sys-firmware/ipxe)" + echo " $(best_version sys-firmware/sgabios)" +} + +pkg_postrm() { + xdg_icon_cache_update + udev_reload +} diff --git a/app-emulation/qemu/qemu-9999.ebuild b/app-emulation/qemu/qemu-9999.ebuild index c959ff18faaf..549817d8345e 100644 --- a/app-emulation/qemu/qemu-9999.ebuild +++ b/app-emulation/qemu/qemu-9999.ebuild @@ -6,7 +6,7 @@ EAPI=8 # Generate using https://github.com/thesamesam/sam-gentoo-scripts/blob/main/niche/generate-qemu-docs # Set to 1 if prebuilt, 0 if not # (the construct below is to allow overriding from env for script) -QEMU_DOCS_PREBUILT=${QEMU_DOCS_PREBUILT:-0} +QEMU_DOCS_PREBUILT=${QEMU_DOCS_PREBUILT:-1} QEMU_DOCS_PREBUILT_DEV=sam QEMU_DOCS_VERSION=$(ver_cut 1-3) # Default to generating docs (inc. man pages) if no prebuilt; overridden later @@ -318,7 +318,7 @@ RDEPEND=" PATCHES=( "${FILESDIR}"/${PN}-9.0.0-disable-keymap.patch - "${FILESDIR}"/${PN}-9.0.0-capstone-include-path.patch + "${FILESDIR}"/${PN}-9.1.0-capstone-include-path.patch "${FILESDIR}"/${PN}-9.0.0-also-build-virtfs-proxy-helper.patch "${FILESDIR}"/${PN}-8.1.0-skip-tests.patch "${FILESDIR}"/${PN}-8.1.0-find-sphinx.patch diff --git a/app-emulation/wine-staging/Manifest b/app-emulation/wine-staging/Manifest index e1dfe1c00174..d9f053375464 100644 --- a/app-emulation/wine-staging/Manifest +++ b/app-emulation/wine-staging/Manifest @@ -6,15 +6,18 @@ DIST wine-9.15.tar.xz 30580680 BLAKE2B 70a3dd1d566ce2022a197735bfbc6a879f99608d3 DIST wine-9.16.tar.xz 30638928 BLAKE2B 65665d674842980345d4f3730a75a1734fd5b9c3f08a2700624e4cc18b3d496a1db790e6098c404e05ea9544e671e2cf3f5d10f7fdc0863c6cf0714a9b597af9 SHA512 5f2994d20b8c7635125b38b6a4d89db4b71791f096276fa93e36dc6951c47c25b8a3354f0be0931799ac83c54f048e34693b56512cc446b93c74344b1a458187 DIST wine-9.17.tar.xz 30684564 BLAKE2B 36049b7ed096865a647cea9ac1def6cf2a35984a72ae192d402a40f34c8a97e967cee31724d84d422f835f272fcba9ba818e1e787f7940b18d835aa234b0c6b7 SHA512 06ee82fc0f0c8c02f1f646f674e8e3c5d4b9ca9cf64a910b01eb9c6d5dbe0471a6b232875e099c2e5cfd8e1c183ee72850820f24fc026b11523b56872a2efec5 DIST wine-9.18.tar.xz 30760808 BLAKE2B 2ac93d28c76358be47615d6a1f053fc61ff023193bd000cacded262ceafb39072778461c72fc797657df6ae71c7fc072d0bfe69da04660cd14e4b6ddec36a0b5 SHA512 d6e049374d1e654937a0c767215076e5f12c7ff69aac930881292c075d0eee1a1af4c38937271c515875db12b98adebe8553d356b30e32d78d9ac8b1c7914509 +DIST wine-9.19.tar.xz 30812468 BLAKE2B 24bdcd8d06c9f6b480dbb92469b41ff21b4174fcea6eaccf2359616f018d1c0a1305b5ae8acfcb2f7161b285963f26cc16530d1518db3d1bda7cdbb9807860d5 SHA512 530219c6a337f2996eac92d644ab603528b82cc6136cc37c1e6aa736d418f33c6f4b0d54f3537b04bceaf4487d84abcf926a2f5e9536ed4e966c4fe63c5b6ddd DIST wine-staging-9.0.tar.gz 9577631 BLAKE2B 0012978f54c618e73d407dd49dccff02853912d0c015098889802518e8c51b280f5d60e11291335dafc68944ee01cbcb7fd6c5825ef10ae1520c7b82d9846718 SHA512 362209fcadcf029152b681c76beb231d0cc8de1609b994094f1dc88ab871fddda08b3d8c2fe36ceb38909a9d634c1ade864ca0f28a6a7715ec286a8b2884981f DIST wine-staging-9.15.tar.gz 9516589 BLAKE2B e0511494a9cefec0349f7f24830e6dafb032ea33290b09c9b168f06cc7c621a53ede34dbc379a0adb17feb17af4d8872c6863ca4a38c5979572feaa3c0cabbc5 SHA512 37237e4f19319e34341fef1bb656d5c98309d148cdef7f105e7cd4eb10134364766df5287755ba23ebc2a3d28294bd10c7991c9a3acbe076ad33a386ae92b304 DIST wine-staging-9.16.tar.gz 9506127 BLAKE2B 05311c5af15052b1a8d846d3ff3f09b476b71eb13f82e37e8d1dcd08032c85d9ab03c27f595d5b72dd121f143f07b6b7246b7bd9f8df16e0923aa26a8f92195f SHA512 513af6d56f491e49c29ffced546b9025d0dbd4cf0c0186cd118132380bf58f45277d129c49fd3f5bc1ccc5d391e456fd2f0792b60b92d1dc448ba8b1f98efa34 DIST wine-staging-9.17.tar.gz 9383269 BLAKE2B b82d74a6cfefce477193f72906fccd69dc34e4199db4f9c68efda484dfc462b6a828c549d4428f6a3c7479d3a3ad939eb3f4b28b2d64e31093d107b1c2316ef8 SHA512 ce21e026870dece09713eb64a046381942085742456057dc147490968724a0f7dc5ef059f0b26f9125f20de50a3e6beaae5cea2aa95ab1fae3e1d92305d92488 DIST wine-staging-9.18.tar.gz 9439240 BLAKE2B fd21f9d49e2ab28a1b6dc15c01559b42626b6c62cdb59d56ac134c6e8ecb9b3ec40ce34f39b9aa9bfdb7204acdcaf5556f3b7fd396e0269bbc674d915a5597d5 SHA512 21c7ff8e80f48837cbb268ef932906c65fb3d77cf72dfc4f9118fb72a216906222ed051cef9986aa2fd2339e86bd3a5766c93e9390d95dbb7bc46eebfe55ac66 +DIST wine-staging-9.19.tar.gz 9460757 BLAKE2B 20b5cb89b73409bb45129cc59ed776271cb45347bb344a3f5b4b8075d783dd6f6ff03b14ab0bc4237b67020b909f6235c0fb8822331f171915dbf2c4417cb78e SHA512 c2504af047125e2bf29e4c1d9d7bef275a7bc236bc85344977448a8c4a2bd32cdb813db4ebe26de1b91d04371751ffe3498b9d9c96793d3d3d236fe6be9903dd EBUILD wine-staging-9.0.ebuild 15677 BLAKE2B a60e2f72c3896f6de7b045ba51c41338531eb2dccd0b783725c1c793cddf4f17311c5941c99b0d29bc1b61607bb4e26c4114b3240b4c3b219927d26151406593 SHA512 affaba6aff52e930d8345a5b3c6ecf4df5479463f4bf8ad036b9215f7f802bc94efa5ac47897af11bdd9a12f5d93947fdda4407ddc75b937a489f783c9cf2389 EBUILD wine-staging-9.15.ebuild 15630 BLAKE2B d77747e02096632bd21a4f7cdf8ba38bae7101ca157f839ed72ee0a3c00ef0cfc8030822d6499f918eaf7ed619c836b74b69044c172fff9a4e4b86937a664e25 SHA512 cf244df5a00d3efa549c368541fb8bbe22063896d59b16e5cbc051602f0ee8e3d5214640d292c5e35868bb94faadf3cc3a9ab8998f1d136c1304e85e3763f7a7 EBUILD wine-staging-9.16.ebuild 15366 BLAKE2B 3fb369257308b17554c0c3a95e8977f489929364345b4c7895dcd89bfc01b4ea0ba98f517fee19e026707025aa1eb45bae7d60234eaf4f0eb7cd8ffe26af2d43 SHA512 328e3e74578cc28ccc54dce73b06071bc1ad46a7fd6abd1c615f7c9d9eb68a6f2cb37d1cb31fe8d04c8653216b9a2f253318648a7203cea7d2faee170cb8449c EBUILD wine-staging-9.17.ebuild 15386 BLAKE2B 6035e7adedc96d16b34d7d96741b479171e010fee0115470df8a35df358816cc7a7843934a804daf749d8a41de1498761f4b9026648cb3a9dba6952d0ddbff8a SHA512 133cae5f3d231f3d2e9552c0af9d563d33ee8497cb54a73b754afcb666e0eba485838617d02ab27755f802e1dfb95a185c13d4a660eaa3d99c9a0e9f2e5663d6 EBUILD wine-staging-9.18.ebuild 15468 BLAKE2B 9cb861dd4f2018ee042a968c93da960fc332426e970769e3a96de2378a7e51f458e45cf32344f2cd03454f88d9caa01800beb9723f119d3c51acfa3cc9248f1b SHA512 eb2b3a9d0e986e1ba785891a274afbd08fde4bd6132fa3e1bc4cb76c36cb3cb7489a177ea8c44966b1d3d0939335b7f2475d60e89849ed779621dd4eb943dafd +EBUILD wine-staging-9.19.ebuild 15468 BLAKE2B 9cb861dd4f2018ee042a968c93da960fc332426e970769e3a96de2378a7e51f458e45cf32344f2cd03454f88d9caa01800beb9723f119d3c51acfa3cc9248f1b SHA512 eb2b3a9d0e986e1ba785891a274afbd08fde4bd6132fa3e1bc4cb76c36cb3cb7489a177ea8c44966b1d3d0939335b7f2475d60e89849ed779621dd4eb943dafd EBUILD wine-staging-9999.ebuild 15468 BLAKE2B 9cb861dd4f2018ee042a968c93da960fc332426e970769e3a96de2378a7e51f458e45cf32344f2cd03454f88d9caa01800beb9723f119d3c51acfa3cc9248f1b SHA512 eb2b3a9d0e986e1ba785891a274afbd08fde4bd6132fa3e1bc4cb76c36cb3cb7489a177ea8c44966b1d3d0939335b7f2475d60e89849ed779621dd4eb943dafd MISC metadata.xml 2659 BLAKE2B 8a80b12643e82b98b71bc408e2fd79736da01c8f7d914c7a592cb685893ea3896bc44fecf0160faec803b284d3f6bb38cf36fb4745d9d43e0e1ced8702fcaf9d SHA512 a271e537318a4e90236c195f1f8c24c3255b5465345246627797d37238e2b6292d0734a9ab19542ee34fc1e9312dc4418694992f5ce3c53310228cc6bf14ef90 diff --git a/app-emulation/wine-staging/wine-staging-9.19.ebuild b/app-emulation/wine-staging/wine-staging-9.19.ebuild new file mode 100644 index 000000000000..69c45f1c51f2 --- /dev/null +++ b/app-emulation/wine-staging/wine-staging-9.19.ebuild @@ -0,0 +1,479 @@ +# Copyright 2022-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MULTILIB_COMPAT=( abi_x86_{32,64} ) +PYTHON_COMPAT=( python3_{10..13} ) +inherit autotools edo flag-o-matic multilib multilib-build optfeature +inherit prefix python-any-r1 toolchain-funcs wrapper + +WINE_GECKO=2.47.4 +WINE_MONO=9.3.0 +WINE_P=wine-$(ver_cut 1-2) + +if [[ ${PV} == *9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://gitlab.winehq.org/wine/wine-staging.git" + WINE_EGIT_REPO_URI="https://gitlab.winehq.org/wine/wine.git" +else + (( $(ver_cut 2) )) && WINE_SDIR=$(ver_cut 1).x || WINE_SDIR=$(ver_cut 1).0 + SRC_URI=" + https://dl.winehq.org/wine/source/${WINE_SDIR}/${WINE_P}.tar.xz + https://github.com/wine-staging/wine-staging/archive/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="-* ~amd64 ~x86" +fi + +DESCRIPTION="Free implementation of Windows(tm) on Unix, with Wine-Staging patchset" +HOMEPAGE=" + https://wiki.winehq.org/Wine-Staging + https://gitlab.winehq.org/wine/wine-staging/ +" + +S="${WORKDIR}/${WINE_P}" + +LICENSE="LGPL-2.1+ BSD-2 IJG MIT OPENLDAP ZLIB gsm libpng2 libtiff" +SLOT="${PV}" +IUSE=" + +X +abi_x86_32 +abi_x86_64 +alsa capi crossdev-mingw cups dos + llvm-libunwind custom-cflags ffmpeg +fontconfig +gecko gphoto2 + +gstreamer kerberos +mingw +mono netapi nls odbc opencl +opengl + osmesa pcap perl pulseaudio samba scanner +sdl selinux smartcard + +ssl +strip +truetype udev udisks +unwind usb v4l +vulkan wayland + wow64 +xcomposite xinerama +" +# bug #551124 for truetype +# TODO: wow64 can be done without mingw if using clang (needs bug #912237) +REQUIRED_USE=" + X? ( truetype ) + crossdev-mingw? ( mingw ) + wow64? ( abi_x86_64 !abi_x86_32 mingw ) +" + +# tests are non-trivial to run, can hang easily, don't play well with +# sandbox, and several need real opengl/vulkan or network access +RESTRICT="test" + +# `grep WINE_CHECK_SONAME configure.ac` + if not directly linked +WINE_DLOPEN_DEPEND=" + X? ( + x11-libs/libXcursor[${MULTILIB_USEDEP}] + x11-libs/libXfixes[${MULTILIB_USEDEP}] + x11-libs/libXi[${MULTILIB_USEDEP}] + x11-libs/libXrandr[${MULTILIB_USEDEP}] + x11-libs/libXrender[${MULTILIB_USEDEP}] + x11-libs/libXxf86vm[${MULTILIB_USEDEP}] + opengl? ( + media-libs/libglvnd[X,${MULTILIB_USEDEP}] + osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] ) + ) + xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] ) + xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] ) + ) + cups? ( net-print/cups[${MULTILIB_USEDEP}] ) + fontconfig? ( media-libs/fontconfig[${MULTILIB_USEDEP}] ) + kerberos? ( virtual/krb5[${MULTILIB_USEDEP}] ) + netapi? ( net-fs/samba[${MULTILIB_USEDEP}] ) + odbc? ( dev-db/unixODBC[${MULTILIB_USEDEP}] ) + sdl? ( media-libs/libsdl2[haptic,joystick,${MULTILIB_USEDEP}] ) + ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] ) + truetype? ( media-libs/freetype[${MULTILIB_USEDEP}] ) + udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] ) + v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] ) + vulkan? ( media-libs/vulkan-loader[X?,wayland?,${MULTILIB_USEDEP}] ) +" +WINE_COMMON_DEPEND=" + ${WINE_DLOPEN_DEPEND} + X? ( + x11-libs/libX11[${MULTILIB_USEDEP}] + x11-libs/libXext[${MULTILIB_USEDEP}] + ) + alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] ) + capi? ( net-libs/libcapi:=[${MULTILIB_USEDEP}] ) + ffmpeg? ( media-video/ffmpeg:=[${MULTILIB_USEDEP}] ) + gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] ) + gstreamer? ( + dev-libs/glib:2[${MULTILIB_USEDEP}] + media-libs/gst-plugins-base:1.0[${MULTILIB_USEDEP}] + media-libs/gstreamer:1.0[${MULTILIB_USEDEP}] + ) + opencl? ( virtual/opencl[${MULTILIB_USEDEP}] ) + pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] ) + pulseaudio? ( media-libs/libpulse[${MULTILIB_USEDEP}] ) + scanner? ( media-gfx/sane-backends[${MULTILIB_USEDEP}] ) + smartcard? ( sys-apps/pcsc-lite[${MULTILIB_USEDEP}] ) + udev? ( virtual/libudev:=[${MULTILIB_USEDEP}] ) + unwind? ( + llvm-libunwind? ( sys-libs/llvm-libunwind[${MULTILIB_USEDEP}] ) + !llvm-libunwind? ( sys-libs/libunwind:=[${MULTILIB_USEDEP}] ) + ) + usb? ( dev-libs/libusb:1[${MULTILIB_USEDEP}] ) + wayland? ( + dev-libs/wayland[${MULTILIB_USEDEP}] + x11-libs/libxkbcommon[${MULTILIB_USEDEP}] + ) +" +RDEPEND=" + ${WINE_COMMON_DEPEND} + app-emulation/wine-desktop-common + dos? ( + || ( + games-emulation/dosbox + games-emulation/dosbox-staging + ) + ) + gecko? ( + app-emulation/wine-gecko:${WINE_GECKO}[${MULTILIB_USEDEP}] + wow64? ( app-emulation/wine-gecko[abi_x86_32] ) + ) + gstreamer? ( media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}] ) + mono? ( app-emulation/wine-mono:${WINE_MONO} ) + perl? ( + dev-lang/perl + dev-perl/XML-LibXML + ) + samba? ( net-fs/samba[winbind] ) + selinux? ( sec-policy/selinux-wine ) + udisks? ( sys-fs/udisks:2 ) +" +DEPEND=" + ${WINE_COMMON_DEPEND} + sys-kernel/linux-headers + X? ( x11-base/xorg-proto ) +" +# gitapply.sh "can" work without git but that is hardly tested +# and known failing with some versions, so force real git +BDEPEND=" + ${PYTHON_DEPS} + || ( + sys-devel/binutils + sys-devel/lld + ) + dev-lang/perl + dev-vcs/git + sys-devel/bison + sys-devel/flex + virtual/pkgconfig + mingw? ( !crossdev-mingw? ( + >=dev-util/mingw64-toolchain-10.0.0_p1-r2[${MULTILIB_USEDEP}] + wow64? ( dev-util/mingw64-toolchain[abi_x86_32] ) + ) ) + nls? ( sys-devel/gettext ) + wayland? ( dev-util/wayland-scanner ) +" +IDEPEND=">=app-eselect/eselect-wine-2" + +QA_CONFIG_IMPL_DECL_SKIP=( + __clear_cache # unused on amd64+x86 (bug #900334) + res_getservers # false positive +) +QA_TEXTRELS="usr/lib/*/wine/i386-unix/*.so" # uses -fno-PIC -Wl,-z,notext + +PATCHES=( + "${FILESDIR}"/${PN}-7.17-noexecstack.patch + "${FILESDIR}"/${PN}-7.20-unwind.patch + "${FILESDIR}"/${PN}-8.13-rpath.patch +) + +pkg_pretend() { + [[ ${MERGE_TYPE} == binary ]] && return + + if use crossdev-mingw && [[ ! -v MINGW_BYPASS ]]; then + local mingw=-w64-mingw32 + for mingw in $(usev abi_x86_64 x86_64${mingw}) \ + $(use abi_x86_32 || use wow64 && echo i686${mingw}); do + if ! type -P ${mingw}-gcc >/dev/null; then + eerror "With USE=crossdev-mingw, you must prepare the MinGW toolchain" + eerror "yourself by installing sys-devel/crossdev then running:" + eerror + eerror " crossdev --target ${mingw}" + eerror + eerror "For more information, please see: https://wiki.gentoo.org/wiki/Mingw" + die "USE=crossdev-mingw is enabled, but ${mingw}-gcc was not found" + fi + done + fi +} + +src_unpack() { + if [[ ${PV} == *9999 ]]; then + EGIT_CHECKOUT_DIR=${WORKDIR}/${P} + git-r3_src_unpack + + # hack: use subshell to preserve state (including what git-r3 unpack + # sets) for smart-live-rebuild as this is not the repo to look at + ( + EGIT_COMMIT=$(<"${EGIT_CHECKOUT_DIR}"/staging/upstream-commit) || die + EGIT_REPO_URI=${WINE_EGIT_REPO_URI} + EGIT_CHECKOUT_DIR=${S} + einfo "Fetching Wine commit matching the current patchset by default (${EGIT_COMMIT})" + git-r3_src_unpack + ) + else + default + fi +} + +src_prepare() { + local patchinstallargs=( + --all + --no-autoconf + ${MY_WINE_STAGING_CONF} + ) + + edo "${PYTHON}" ../${P}/staging/patchinstall.py "${patchinstallargs[@]}" + + # sanity check, bumping these has a history of oversights + local geckomono=$(sed -En '/^#define (GECKO|MONO)_VER/{s/[^0-9.]//gp}' \ + dlls/appwiz.cpl/addons.c || die) + if [[ ${WINE_GECKO}$'\n'${WINE_MONO} != "${geckomono}" ]]; then + local gmfatal= + [[ ${PV} == *9999 ]] && gmfatal=nonfatal + ${gmfatal} die -n "gecko/mono mismatch in ebuild, has: " ${geckomono} " (please file a bug)" + fi + + default + + if tc-is-clang; then + if use mingw; then + # -mabi=ms was ignored by <clang:16 then turned error in :17 + # if used without --target *-windows, then gets used in install + # phase despite USE=mingw, drop as a quick fix for now + sed -i '/MSVCRTFLAGS=/s/-mabi=ms//' configure.ac || die + else + # fails in ./configure unless --enable-archs is passed, allow to + # bypass with EXTRA_ECONF but is currently considered unsupported + # (by Gentoo) as additional work is needed for (proper) support + # note: also fails w/ :17, but unsure if safe to drop w/o mingw + [[ ${EXTRA_ECONF} == *--enable-archs* ]] || + die "building ${PN} with clang is only supported with USE=mingw" + fi + fi + + # ensure .desktop calls this variant + slot + sed -i "/^Exec=/s/wine /${P} /" loader/wine.desktop || die + + # datadir is not where wine-mono is installed, so prefixy alternate paths + hprefixify -w /get_mono_path/ dlls/mscoree/metahost.c + + # always update for patches (including user's wrt #432348) + eautoreconf + tools/make_requests || die # perl + # tip: if need more for user patches, with portage can e.g. do + # echo "post_src_prepare() { tools/make_specfiles || die; }" \ + # > /etc/portage/env/app-emulation/wine-staging +} + +src_configure() { + WINE_PREFIX=/usr/lib/${P} + WINE_DATADIR=/usr/share/${P} + + local conf=( + --prefix="${EPREFIX}"${WINE_PREFIX} + --datadir="${EPREFIX}"${WINE_DATADIR} + --includedir="${EPREFIX}"/usr/include/${P} + --libdir="${EPREFIX}"${WINE_PREFIX} + --mandir="${EPREFIX}"${WINE_DATADIR}/man + + $(usev wow64 --enable-archs=x86_64,i386) + + $(use_enable gecko mshtml) + $(use_enable mono mscoree) + --disable-tests + + $(use_with X x) + $(use_with alsa) + $(use_with capi) + $(use_with cups) + $(use_with ffmpeg) + $(use_with fontconfig) + $(use_with gphoto2 gphoto) + $(use_with gstreamer) + $(use_with kerberos gssapi) + $(use_with kerberos krb5) + $(use_with mingw) + $(use_with netapi) + $(use_with nls gettext) + $(use_with opencl) + $(use_with opengl) + $(use_with osmesa) + --without-oss # media-sound/oss is not packaged (OSSv4) + $(use_with pcap) + $(use_with pulseaudio pulse) + $(use_with scanner sane) + $(use_with sdl) + $(use_with smartcard pcsclite) + $(use_with ssl gnutls) + $(use_with truetype freetype) + $(use_with udev) + $(use_with udisks dbus) # dbus is only used for udisks + $(use_with unwind) + $(use_with usb) + $(use_with v4l v4l2) + $(use_with vulkan) + $(use_with wayland) + $(use_with xcomposite) + $(use_with xinerama) + $(usev !odbc ac_cv_lib_soname_odbc=) + ) + + filter-lto # build failure + filter-flags -Wl,--gc-sections # runtime issues (bug #931329) + use custom-cflags || strip-flags # can break in obscure ways at runtime + + # wine uses linker tricks unlikely to work with non-bfd/lld (bug #867097) + # (do self test until https://github.com/gentoo/gentoo/pull/28355) + if [[ $(LC_ALL=C $(tc-getCC) ${LDFLAGS} -Wl,--version 2>/dev/null) != @(LLD|GNU\ ld)* ]] + then + has_version -b sys-devel/binutils && + append-ldflags -fuse-ld=bfd || + append-ldflags -fuse-ld=lld + strip-unsupported-flags + fi + + if use mingw; then + use crossdev-mingw || PATH=${BROOT}/usr/lib/mingw64-toolchain/bin:${PATH} + + # CROSSCC was formerly recognized by wine, thus been using similar + # variables (subject to change, esp. if ever make a mingw.eclass). + local mingwcc_amd64=${CROSSCC:-${CROSSCC_amd64:-x86_64-w64-mingw32-gcc}} + local mingwcc_x86=${CROSSCC:-${CROSSCC_x86:-i686-w64-mingw32-gcc}} + local -n mingwcc=mingwcc_$(usex abi_x86_64 amd64 x86) + + conf+=( + ac_cv_prog_x86_64_CC="${mingwcc_amd64}" + ac_cv_prog_i386_CC="${mingwcc_x86}" + + CROSSCFLAGS="${CROSSCFLAGS:-$( + filter-flags '-fstack-protector*' #870136 + filter-flags '-mfunction-return=thunk*' #878849 + + # some bashrc-mv users tend to do CFLAGS="${LDFLAGS}" and then + # strip-unsupported-flags miss these during compile-only tests + # (primarily done for 23.0 profiles' -z, not full coverage) + filter-flags '-Wl,-z,*' + + CC=${mingwcc} test-flags-CC ${CFLAGS:--O2} + )}" + + CROSSLDFLAGS="${CROSSLDFLAGS:-$( + filter-flags '-fuse-ld=*' + + CC=${mingwcc} test-flags-CCLD ${LDFLAGS} + )}" + ) + fi + + # order matters with multilib: configure+compile 64->32, install 32->64 + local -i bits + for bits in $(usev abi_x86_64 64) $(usev abi_x86_32 32); do + ( + einfo "Configuring ${PN} for ${bits}bits in ${WORKDIR}/build${bits} ..." + + mkdir ../build${bits} || die + cd ../build${bits} || die + + if (( bits == 64 )); then + conf+=( --enable-win64 ) + elif use amd64; then + conf+=( + $(usev abi_x86_64 --with-wine64=../build64) + TARGETFLAGS=-m32 # for widl + ) + # _setup is optional, but use over Wine's auto-detect (+#472038) + multilib_toolchain_setup x86 + fi + + ECONF_SOURCE=${S} econf "${conf[@]}" + ) + done +} + +src_compile() { + use abi_x86_64 && emake -C ../build64 # do first + use abi_x86_32 && emake -C ../build32 +} + +src_install() { + use abi_x86_32 && emake DESTDIR="${D}" -C ../build32 install + use abi_x86_64 && emake DESTDIR="${D}" -C ../build64 install # do last + + # Ensure both wine64 and wine are available if USE=abi_x86_64 (wow64, + # -abi_x86_32, and/or EXTRA_ECONF could cause varying scenarios where + # one or the other could be missing and that is unexpected for users + # and some tools like winetricks) + if use abi_x86_64; then + if [[ -e ${ED}${WINE_PREFIX}/bin/wine64 && ! -e ${ED}${WINE_PREFIX}/bin/wine ]]; then + dosym wine64 ${WINE_PREFIX}/bin/wine + dosym wine64-preloader ${WINE_PREFIX}/bin/wine-preloader + + # also install wine(1) man pages (incl. translations) + local man + for man in ../build64/loader/wine.*man; do + : "${man##*/wine}" + : "${_%.*}" + insinto ${WINE_DATADIR}/man/${_:+${_#.}/}man1 + newins ${man} wine.1 + done + elif [[ ! -e ${ED}${WINE_PREFIX}/bin/wine64 && -e ${ED}${WINE_PREFIX}/bin/wine ]]; then + dosym wine ${WINE_PREFIX}/bin/wine64 + dosym wine-preloader ${WINE_PREFIX}/bin/wine64-preloader + fi + fi + + use perl || rm "${ED}"${WINE_DATADIR}/man/man1/wine{dump,maker}.1 \ + "${ED}"${WINE_PREFIX}/bin/{function_grep.pl,wine{dump,maker}} || die + + # create variant wrappers for eselect-wine + local bin + for bin in "${ED}"${WINE_PREFIX}/bin/*; do + make_wrapper "${bin##*/}-${P#wine-}" "${bin#"${ED}"}" + done + + if use mingw; then + # don't let portage try to strip PE files with the wrong + # strip executable and instead handle it here (saves ~120MB) + dostrip -x ${WINE_PREFIX}/wine/{i386,x86_64}-windows + + if use strip; then + ebegin "Stripping Windows (PE) binaries" + find "${ED}"${WINE_PREFIX}/wine/*-windows -regex '.*\.\(a\|dll\|exe\)' \ + -exec $(usex abi_x86_64 x86_64 i686)-w64-mingw32-strip --strip-unneeded {} + + eend ${?} || die + fi + fi + + dodoc ANNOUNCE* AUTHORS README* documentation/README* +} + +pkg_postinst() { + if use !abi_x86_32 && use !wow64; then + ewarn "32bit support is disabled. While 64bit applications themselves will" + ewarn "work, be warned that it is not unusual that installers or other helpers" + ewarn "will attempt to use 32bit and fail. If do not want full USE=abi_x86_32," + ewarn "note the experimental/WIP USE=wow64 can allow 32bit without multilib." + elif use abi_x86_32 && { use opengl || use vulkan; }; then + # difficult to tell what is needed from here, but try to warn + if has_version 'x11-drivers/nvidia-drivers'; then + if has_version 'x11-drivers/nvidia-drivers[-abi_x86_32]'; then + ewarn "x11-drivers/nvidia-drivers is installed but is built without" + ewarn "USE=abi_x86_32 (ABI_X86=32), hardware acceleration with 32bit" + ewarn "applications under ${PN} will likely not be usable." + ewarn "Multi-card setups may need this on media-libs/mesa as well." + fi + elif has_version 'media-libs/mesa[-abi_x86_32]'; then + ewarn "media-libs/mesa seems to be in use but is built without" + ewarn "USE=abi_x86_32 (ABI_X86=32), hardware acceleration with 32bit" + ewarn "applications under ${PN} will likely not be usable." + fi + fi + + optfeature "/dev/hidraw* access used for *some* controllers (e.g. DualShock4)" \ + games-util/game-device-udev-rules + + eselect wine update --if-unset || die +} + +pkg_postrm() { + eselect wine update --if-unset || die +} |