Merge pull request #376 from flatcar/krnowak/qemu-update

Update app-emulation/qemu and its dependencies
This commit is contained in:
Krzesimir Nowak 2023-01-19 17:37:00 +01:00 committed by GitHub
commit 6aca39cd2e
153 changed files with 2737 additions and 5956 deletions

View File

@ -71,6 +71,7 @@ app-crypt/mit-krb5
app-editors/vim
app-editors/vim-core
app-emulation/qemu
app-emulation/qemu-guest-agent
app-portage/portage-utils
@ -84,16 +85,20 @@ dev-lang/python
dev-libs/boost
dev-libs/cJSON
dev-libs/cyrus-sasl
dev-libs/elfutils
dev-libs/expat
dev-libs/glib
dev-libs/gmp
dev-libs/gobject-introspection
dev-libs/gobject-introspection-common
dev-libs/libaio
dev-libs/libksba
dev-libs/libltdl
dev-libs/libpcre2
dev-libs/libtasn1
dev-libs/libxml2
dev-libs/libxslt
dev-libs/nettle
dev-libs/oniguruma
dev-python/fasteners
@ -132,7 +137,15 @@ eclass/autotools.eclass
# eclass/bash-completion-r1.eclass
eclass/cmake-multilib.eclass
eclass/cmake.eclass
eclass/desktop.eclass
eclass/eapi7-ver.eclass
eclass/edo.eclass
eclass/edos2unix.eclass
eclass/elisp-common.eclass
eclass/epatch.eclass
eclass/eqawarn.eclass
eclass/estack.eclass
eclass/eutils.eclass
eclass/fcaps.eclass
eclass/flag-o-matic.eclass
eclass/git-r3.eclass
@ -140,39 +153,51 @@ eclass/gnome.org.eclass
eclass/gnuconfig.eclass
eclass/java-pkg-opt-2.eclass
eclass/java-utils-2.eclass
eclass/kernel-2.eclass
eclass/libtool.eclass
eclass/linux-info.eclass
eclass/linux-mod.eclass
eclass/llvm.eclass
eclass/ltprune.eclass
eclass/meson-multilib.eclass
eclass/meson.eclass
eclass/multilib-build.eclass
eclass/multilib-minimal.eclass
eclass/multilib.eclass
eclass/multiprocessing.eclass
eclass/ninja-utils.eclass
eclass/optfeature.eclass
eclass/pam.eclass
eclass/pax-utils.eclass
eclass/perl-functions.eclass
eclass/portability.eclass
eclass/plocale.eclass
eclass/prefix.eclass
eclass/preserve-libs.eclass
eclass/readme.gentoo-r1
eclass/savedconfig.eclass
eclass/strip-linguas.eclass
eclass/systemd.eclass
eclass/tmpfiles.eclass
eclass/toolchain-funcs.eclass
eclass/toolchain.eclass
eclass/udev.eclass
eclass/user-info.eclass
# This file is modified by us to be an empty file, so can't be synced for now.
#
# eclass/usr-ldscript.eclass
eclass/vcs-clean.eclass
eclass/verify-sig.eclass
eclass/vim-doc.eclass
eclass/vim-plugin.eclass
eclass/virtualx.eclass
eclass/wrapper.eclass
eclass/xdg-utils.eclass
licenses
media-libs/libpng
net-analyzer/nmap
net-analyzer/traceroute
@ -182,6 +207,7 @@ net-fs/cifs-utils
net-libs/gnutls
net-libs/libpcap
net-libs/libslirp
net-misc/bridge-utils
net-misc/curl
@ -201,7 +227,9 @@ profiles
#
# scripts
sys-apps/attr
sys-apps/diffutils
sys-apps/dtc
sys-apps/file
sys-apps/gentoo-functions
sys-apps/help2man
@ -227,14 +255,26 @@ sys-devel/libtool
sys-devel/m4
sys-devel/patch
sys-firmware/edk2-ovmf-bin
sys-firmware/intel-microcode
sys-firmware/ipxe
sys-firmware/seabios-bin
sys-firmware/sgabios
sys-kernel/linux-headers
sys-fs/multipath-tools
sys-libs/binutils-libs
sys-libs/libcap
sys-libs/libcap-ng
sys-libs/libseccomp
sys-libs/zlib
sys-power/iasl
virtual/libcrypt
virtual/libelf
virtual/pkgconfig
x11-libs/pixman

View File

@ -1,3 +1,4 @@
DIST qemu-6.2.0.tar.xz 115667324 BLAKE2B 3f2f02e5c36113df6231a9474c6d5db774e541312173813c28f578d669a51f391695d364dc806f5906d9e3c2796bb20b2606fcd46a247eb751ea517de9d7ce15 SHA512 e9f8231c9e1cfcc41cb47f10a55d63f6b8aee307af00cf6acf64acb7aa4f49fa7e9d6330703a2abea15d8b7bbaba7d3cb08c83edd98d82642367b527df730817
DIST qemu-7.0.0-rc4.tar.xz 125126604 BLAKE2B e1614daf71ff2625cdd8307812d6dfc4103c7c8a981b49fdda7409b8b4749e2d8354d3f8e903791100e966744485148c9b70ff046c0f8c2b1259a4997a245248 SHA512 ca0e8f5f1608b36f8ad8d9e6aeeb00e07af23e59ffecbda84c4c34bbe686a53c481e26bcedd13165363057cab063dcda7e5191dd5aff2798fde5be711c6dd2ff
DIST qemu-7.0.0.tar.xz 125117636 BLAKE2B ceda6d9f1a585298bd49fed61e8bb35f0064ad8388a9f979c8bd68a38bfe1a47c5bb055e5f74f970c2c440957042b9de4a861524120040c56e4cd8b56c5cfb68 SHA512 44ecd10c018a3763e1bc87d1d35b98890d0d5636acd69fe9b5cadf5024d5af6a31684d60cbe1c3370e02986434c1fb0ad99224e0e6f6fe7eda169992508157b1
DIST qemu-7.1.0-docs.tar.xz 2016780 BLAKE2B 1b84361fe58d504ab740a0b805a25d02f497ca776e7251a99f0e98e3720d1a2029b7a171f9d79dd128ba17a82c72d497e09baa1a4b2f192ba390f0f3b1950792 SHA512 7a328303b8af0ab63aa1f0fe07a121d3ca459d00fca817412e645416af795930dbea0a3e60f4ca006a74d1672e84fa4e626e4d83918e0b685b601043d0d8159e
DIST qemu-7.1.0.tar.xz 121833004 BLAKE2B e05f91ce4993c7591a2df08b5fb017f8b8ec2141ab7bfd55d14730ea6b793ac1091de539992058392a5522d4e58beee92a87752707be58e3619b8213ef9f35bf SHA512 c60c5ff8ec99b7552e485768908920658fdd8035ff7a6fa370fb6881957dc8b7e5f18ff1a8f49bd6aa22909ede2a7c084986d8244f12074ccd33ebe40a0c411f
DIST qemu-7.2.0-docs.tar.xz 1984184 BLAKE2B 103900fb7903ed8d75f7f012bf61fa2d6fce345b657c851d0437c3384f5735bd1cfd3129320683ea7846ea0b0940e5af5b2663c9320f12fee74b058523a8ea06 SHA512 a7edd448982865e07533c300d3e44a8b50cefbdde1982b73c24d0b2aa74315439252c59b634c75de312860874c7b06c75aa72629da681b5105f28ee936794585
DIST qemu-7.2.0.tar.xz 122408576 BLAKE2B 415ff621356c59f88b29cfe3ef5db1e282b26bbafbee3d535477c6125ccb060ec9762d9e3ab9f70ce5478804dca0a46a59bcf12c112a2462029a93e578e61530 SHA512 f3cfa00da739ba819a218d7e6e95c77fb79a8e0f487b024ddd281602e785249b81144595e3f8c746c32a4f5c4d1a88c6aebae3c162603edfbb50ae3722d7ed13

View File

@ -1,11 +0,0 @@
--- qemu-2.11.1/include/disas/capstone.h 2018-02-14 22:53:22.000000000 +0100
+++ qemu-2.11.1/include/disas/capstone.h 2018-02-17 20:12:12.754703951 +0100
@@ -3,7 +3,7 @@
#ifdef CONFIG_CAPSTONE
-#include <capstone.h>
+#include <capstone/capstone.h>
#else

View File

@ -1,34 +0,0 @@
From 42e53a0aadb76dfa7c11cd3b14eb4a41efba9bbe Mon Sep 17 00:00:00 2001
From: Matthias Maier <tamiko@43-1.org>
Date: Tue, 11 Jan 2022 07:20:31 -0600
Subject: [PATCH] also build virtfs-proxy-helper
The Gentoo ebuild splits the qemu build into a softmmu, user and tool
phase in order to be able to build and link some of the qemu emulators
statically. This unfortunately has the consequence that we never
configure with "have_virtfs" and "have_tools" at the same time.
As a workaround, simply build the virtfs userland unconditionally. After
all, it is a tiny executable
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index fbe856700..d6918b04c 100644
--- a/meson.build
+++ b/meson.build
@@ -1390,7 +1390,7 @@ have_virtfs = (targetos == 'linux' and
libattr.found() and
libcap_ng.found())
-have_virtfs_proxy_helper = have_virtfs and have_tools
+have_virtfs_proxy_helper = have_tools and libcap_ng.found()
if get_option('virtfs').enabled()
if not have_virtfs
--
2.34.1

View File

@ -1,61 +0,0 @@
https://gitlab.com/qemu/qemu/-/commit/7b223e38603de3a75602e14914d26f9d4baf52eb.patch
https://bugs.gentoo.org/836300
From 7b223e38603de3a75602e14914d26f9d4baf52eb Mon Sep 17 00:00:00 2001
From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Date: Wed, 9 Feb 2022 12:14:56 +0100
Subject: [PATCH] tools/virtiofsd: Add rseq syscall to the seccomp allowlist
The virtiofsd currently crashes when used with glibc 2.35.
That is due to the rseq system call being added to every thread
creation [1][2].
[1]: https://www.efficios.com/blog/2019/02/08/linux-restartable-sequences/
[2]: https://sourceware.org/pipermail/libc-alpha/2022-February/136040.html
This happens not at daemon start, but when a guest connects
/usr/lib/qemu/virtiofsd -f --socket-path=/tmp/testvfsd -o sandbox=chroot \
-o source=/var/guests/j-virtiofs --socket-group=kvm
virtio_session_mount: Waiting for vhost-user socket connection...
# start ok, now guest will connect
virtio_session_mount: Received vhost-user socket connection
virtio_loop: Entry
fv_queue_set_started: qidx=0 started=1
fv_queue_set_started: qidx=1 started=1
Bad system call (core dumped)
We have to put rseq on the seccomp allowlist to avoid that the daemon
is crashing in this case.
Reported-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-id: 20220209111456.3328420-1-christian.ehrhardt@canonical.com
[Moved rseq to its alphabetically ordered position in the seccomp
allowlist.
--Stefan]
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
tools/virtiofsd/passthrough_seccomp.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/virtiofsd/passthrough_seccomp.c b/tools/virtiofsd/passthrough_seccomp.c
index a3ce9f898d..2bc0127b69 100644
--- a/tools/virtiofsd/passthrough_seccomp.c
+++ b/tools/virtiofsd/passthrough_seccomp.c
@@ -91,6 +91,9 @@ static const int syscall_allowlist[] = {
SCMP_SYS(renameat2),
SCMP_SYS(removexattr),
SCMP_SYS(restart_syscall),
+#ifdef __NR_rseq
+ SCMP_SYS(rseq), /* required since glibc 2.35 */
+#endif
SCMP_SYS(rt_sigaction),
SCMP_SYS(rt_sigprocmask),
SCMP_SYS(rt_sigreturn),
--
GitLab

View File

@ -1,173 +0,0 @@
Gentoo bug: https://bugs.gentoo.org/830170
Upstream bug: https://gitlab.com/qemu-project/qemu/-/issues/786
Patches taken from
https://lore.kernel.org/qemu-devel/20211227193120.1084176-1-imammedo@redhat.com/
commit dce6c86f54eab61028e110497c222e73381379df
Author: Igor Mammedov <imammedo@redhat.com>
Date: Mon Dec 27 14:31:17 2021 -0500
acpi: fix QEMU crash when started with SLIC table
if QEMU is started with used provided SLIC table blob,
-acpitable sig=SLIC,oem_id='CRASH ',oem_table_id="ME",oem_rev=00002210,asl_compiler_id="",asl_compiler_rev=00000000,data=/dev/null
it will assert with:
hw/acpi/aml-build.c:61:build_append_padded_str: assertion failed: (len <= maxlen)
and following backtrace:
...
build_append_padded_str (array=0x555556afe320, str=0x555556afdb2e "CRASH ME", maxlen=0x6, pad=0x20) at hw/acpi/aml-build.c:61
acpi_table_begin (desc=0x7fffffffd1b0, array=0x555556afe320) at hw/acpi/aml-build.c:1727
build_fadt (tbl=0x555556afe320, linker=0x555557ca3830, f=0x7fffffffd318, oem_id=0x555556afdb2e "CRASH ME", oem_table_id=0x555556afdb34 "ME") at hw/acpi/aml-build.c:2064
...
which happens due to acpi_table_begin() expecting NULL terminated
oem_id and oem_table_id strings, which is normally the case, but
in case of user provided SLIC table, oem_id points to table's blob
directly and as result oem_id became longer than expected.
Fix issue by handling oem_id consistently and make acpi_get_slic_oem()
return NULL terminated strings.
PS:
After [1] refactoring, oem_id semantics became inconsistent, where
NULL terminated string was coming from machine and old way pointer
into byte array coming from -acpitable option. That used to work
since build_header() wasn't expecting NULL terminated string and
blindly copied the 1st 6 bytes only.
However commit [2] broke that by replacing build_header() with
acpi_table_begin(), which was expecting NULL terminated string
and was checking oem_id size.
1) 602b45820 ("acpi: Permit OEM ID and OEM table ID fields to be changed")
2)
Fixes: 4b56e1e4eb08 ("acpi: build_fadt: use acpi_table_begin()/acpi_table_end() instead of build_header()")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/786
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
diff --git a/hw/acpi/core.c b/hw/acpi/core.c
index 1e004d0078..3e811bf03c 100644
--- a/hw/acpi/core.c
+++ b/hw/acpi/core.c
@@ -345,8 +345,8 @@ int acpi_get_slic_oem(AcpiSlicOem *oem)
struct acpi_table_header *hdr = (void *)(u - sizeof(hdr->_length));
if (memcmp(hdr->sig, "SLIC", 4) == 0) {
- oem->id = hdr->oem_id;
- oem->table_id = hdr->oem_table_id;
+ oem->id = g_strndup(hdr->oem_id, 6);
+ oem->table_id = g_strndup(hdr->oem_table_id, 8);
return 0;
}
}
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index a99c6e4fe3..570f82997b 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -2721,6 +2721,8 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)
/* Cleanup memory that's no longer used. */
g_array_free(table_offsets, true);
+ g_free(slic_oem.id);
+ g_free(slic_oem.table_id);
}
static void acpi_ram_update(MemoryRegion *mr, GArray *data)
commit a22de122ad03ea40953ad0328b2c3e31002d8052
Author: Igor Mammedov <imammedo@redhat.com>
Date: Mon Dec 27 14:31:18 2021 -0500
tests: acpi: whitelist expected blobs before changing them
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
diff --git a/tests/data/acpi/q35/FACP.slic b/tests/data/acpi/q35/FACP.slic
new file mode 100644
index 0000000000..f6a864cc86
Binary files /dev/null and b/tests/data/acpi/q35/FACP.slic differ
diff --git a/tests/data/acpi/q35/SLIC.slic b/tests/data/acpi/q35/SLIC.slic
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
index dfb8523c8b..49dbf8fa3e 100644
--- a/tests/qtest/bios-tables-test-allowed-diff.h
+++ b/tests/qtest/bios-tables-test-allowed-diff.h
@@ -1 +1,3 @@
/* List of comma-separated changed AML files to ignore */
+"tests/data/acpi/q35/FACP.slic",
+"tests/data/acpi/q35/SLIC.slic",
commit cb913395d76f8fdfd7f1d0c8ea77d4710821bbd3
Author: Igor Mammedov <imammedo@redhat.com>
Date: Mon Dec 27 14:31:19 2021 -0500
tests: acpi: add SLIC table test
When user uses '-acpitable' to add SLIC table, some ACPI
tables (FADT) will change its 'Oem ID'/'Oem Table ID' fields to
match that of SLIC. Test makes sure thati QEMU handles
those fields correctly when SLIC table is added with
'-acpitable' option.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index 258874167e..ae7ef13ec7 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -1567,6 +1567,19 @@ static void test_acpi_oem_fields_virt(void)
g_free(args);
}
+static void test_acpi_q35_slic(void)
+{
+ test_data data = {
+ .machine = MACHINE_Q35,
+ .variant = ".slic",
+ };
+
+ test_acpi_one("-acpitable sig=SLIC,oem_id='CRASH ',oem_table_id='ME',"
+ "oem_rev=00002210,asl_compiler_id='qemu',"
+ "asl_compiler_rev=00000000,data=/dev/null",
+ &data);
+ free_test_data(&data);
+}
int main(int argc, char *argv[])
{
@@ -1639,6 +1652,7 @@ int main(int argc, char *argv[])
qtest_add_func("acpi/q35/kvm/xapic", test_acpi_q35_kvm_xapic);
qtest_add_func("acpi/q35/kvm/dmar", test_acpi_q35_kvm_dmar);
}
+ qtest_add_func("acpi/q35/slic", test_acpi_q35_slic);
} else if (strcmp(arch, "aarch64") == 0) {
if (has_tcg) {
qtest_add_func("acpi/virt", test_acpi_virt_tcg);
commit ffba261306370e0ad8506401b104be5fa4749ade
Author: Igor Mammedov <imammedo@redhat.com>
Date: Mon Dec 27 14:31:20 2021 -0500
tests: acpi: SLIC: update expected blobs
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
diff --git a/tests/data/acpi/q35/FACP.slic b/tests/data/acpi/q35/FACP.slic
index f6a864cc86..891fd4b784 100644
Binary files a/tests/data/acpi/q35/FACP.slic and b/tests/data/acpi/q35/FACP.slic differ
diff --git a/tests/data/acpi/q35/SLIC.slic b/tests/data/acpi/q35/SLIC.slic
index e69de29bb2..fd26592e24 100644
Binary files a/tests/data/acpi/q35/SLIC.slic and b/tests/data/acpi/q35/SLIC.slic differ
diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h
index 49dbf8fa3e..dfb8523c8b 100644
--- a/tests/qtest/bios-tables-test-allowed-diff.h
+++ b/tests/qtest/bios-tables-test-allowed-diff.h
@@ -1,3 +1 @@
/* List of comma-separated changed AML files to ignore */
-"tests/data/acpi/q35/FACP.slic",
-"tests/data/acpi/q35/SLIC.slic",

View File

@ -1,4 +1,4 @@
From c1093041466772f4b62961bcc5a354801d41355d Mon Sep 17 00:00:00 2001
From d02ea89239768c93651a161d057f2bf04d56a024 Mon Sep 17 00:00:00 2001
From: Matthias Maier <tamiko@43-1.org>
Date: Mon, 4 Apr 2022 12:56:59 +0200
Subject: [PATCH] also build virtfs-proxy-helper
@ -15,18 +15,18 @@ all, it is a tiny executable
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 861de93c4f..a8d29be3aa 100644
index 65a885ea69..29ce7a5a8e 100644
--- a/meson.build
+++ b/meson.build
@@ -1474,7 +1474,7 @@ have_virtfs = get_option('virtfs') \
@@ -1684,7 +1684,7 @@ have_virtfs = get_option('virtfs') \
.disable_auto_if(not have_tools and not have_system) \
.allowed()
-have_virtfs_proxy_helper = targetos != 'darwin' and have_virtfs and have_tools
+have_virtfs_proxy_helper = have_tools and libattr.found() and libcap_ng.found()
foreach k : get_option('trace_backends')
config_host_data.set('CONFIG_TRACE_' + k.to_upper(), true)
if get_option('block_drv_ro_whitelist') == ''
config_host_data.set('CONFIG_BDRV_RO_WHITELIST', '')
--
2.35.1

View File

@ -0,0 +1,31 @@
Forward ported from qemu-2.11.1-capstone_include_path.patch.
This time also fix the capstone.h header check to use the path we're
already patching in.
Bug: https://bugs.gentoo.org/873157
diff --git a/include/disas/capstone.h b/include/disas/capstone.h
index e29068dd97..d8fdc5d537 100644
--- a/include/disas/capstone.h
+++ b/include/disas/capstone.h
@@ -3,7 +3,7 @@
#ifdef CONFIG_CAPSTONE
-#include <capstone.h>
+#include <capstone/capstone.h>
#else
diff --git a/meson.build b/meson.build
index 20fddbd707..50ce96bbd1 100644
--- a/meson.build
+++ b/meson.build
@@ -2605,7 +2605,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()

View File

@ -0,0 +1,78 @@
From 35a2c85f7d691db7aa2c47181902ac87478eef7a Mon Sep 17 00:00:00 2001
From: WANG Xuerui <xen0n@gentoo.org>
Date: Sun, 9 Oct 2022 14:08:13 +0800
Subject: [PATCH] linux-user: Implement faccessat2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
User space has been preferring this syscall for a while, due to its
closer match with C semantics, and newer platforms such as LoongArch
apparently have libc implementations that don't fallback to faccessat
so normal access checks are failing without the emulation in place.
Tested by successfully emerging several packages within a Gentoo loong
stage3 chroot, emulated on amd64 with help of static qemu-loongarch64.
Reported-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
Message-Id: <20221009060813.2289077-1-xen0n@gentoo.org>
[lv: removing defined(__NR_faccessat2) in syscall.c,
adding defined(TARGET_NR_faccessat2) on print_faccessat()]
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
linux-user/strace.c | 2 +-
linux-user/strace.list | 3 +++
linux-user/syscall.c | 9 +++++++++
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/linux-user/strace.c b/linux-user/strace.c
index 86c081c83f..9ae5a812cd 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -1969,7 +1969,7 @@ print_execv(CPUArchState *cpu_env, const struct syscallname *name,
}
#endif
-#ifdef TARGET_NR_faccessat
+#if defined(TARGET_NR_faccessat) || defined(TARGET_NR_faccessat2)
static void
print_faccessat(CPUArchState *cpu_env, const struct syscallname *name,
abi_long arg0, abi_long arg1, abi_long arg2,
diff --git a/linux-user/strace.list b/linux-user/strace.list
index a87415bf3d..3df2184580 100644
--- a/linux-user/strace.list
+++ b/linux-user/strace.list
@@ -178,6 +178,9 @@
#ifdef TARGET_NR_faccessat
{ TARGET_NR_faccessat, "faccessat" , NULL, print_faccessat, NULL },
#endif
+#ifdef TARGET_NR_faccessat2
+{ TARGET_NR_faccessat2, "faccessat2" , NULL, print_faccessat, NULL },
+#endif
#ifdef TARGET_NR_fadvise64
{ TARGET_NR_fadvise64, "fadvise64" , NULL, NULL, NULL },
#endif
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index d499cac1d5..e985ad167f 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -9143,6 +9143,15 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
unlock_user(p, arg2, 0);
return ret;
#endif
+#if defined(TARGET_NR_faccessat2)
+ case TARGET_NR_faccessat2:
+ if (!(p = lock_user_string(arg2))) {
+ return -TARGET_EFAULT;
+ }
+ ret = get_errno(faccessat(arg1, p, arg3, arg4));
+ unlock_user(p, arg2, 0);
+ return ret;
+#endif
#ifdef TARGET_NR_nice /* not on alpha */
case TARGET_NR_nice:
return get_errno(nice(arg1));
--
2.37.4

View File

@ -0,0 +1,98 @@
From xen0n@gentoo.org Thu Oct 06 10:07:10 2022
Return-Path: <xen0n@gentoo.org>
X-Original-To: dilfridge@gentoo.org
Delivered-To: dilfridge@gentoo.org
From: WANG Xuerui <xen0n@gentoo.org>
To: qemu-devel@nongnu.org
Cc: Richard Henderson <richard.henderson@linaro.org>,
=?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <f4bug@amsat.org>,
WANG Xuerui <xen0n@gentoo.org>,
Song Gao <gaosong@loongson.cn>,
Xiaojuan Yang <yangxiaojuan@loongson.cn>,
=?UTF-8?q?Andreas=20K=20=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Subject: [PATCH RESEND] linux-user: Fix struct statfs ABI on loongarch64
Date: Thu, 6 Oct 2022 18:07:10 +0800
Message-Id: <20221006100710.427252-1-xen0n@gentoo.org>
X-Mailer: git-send-email 2.38.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Previously the 32-bit version was incorrectly chosen, leading to funny
but incorrect output from e.g. df(1). Simply select the version
corresponding to the 64-bit asm-generic definition.
For reference, this program should produce the same output no matter
natively compiled or not, for loongarch64 or not:
```c
#include <stdio.h>
#include <sys/statfs.h>
int main(int argc, const char *argv[])
{
struct statfs b;
if (statfs(argv[0], &b))
return 1;
printf("f_type = 0x%lx\n", b.f_type);
printf("f_bsize = %ld\n", b.f_bsize);
printf("f_blocks = %ld\n", b.f_blocks);
printf("f_bfree = %ld\n", b.f_bfree);
printf("f_bavail = %ld\n", b.f_bavail);
return 0;
}
// Example output on my amd64 box, with the test binary residing on a
// btrfs partition.
// Native and emulated output after the fix:
//
// f_type = 0x9123683e
// f_bsize = 4096
// f_blocks = 268435456
// f_bfree = 168406890
// f_bavail = 168355058
// Output before the fix, note the messed layout:
//
// f_type = 0x10009123683e
// f_bsize = 723302085239504896
// f_blocks = 168355058
// f_bfree = 2250817541779750912
// f_bavail = 1099229433104
```
Fixes: 1f63019632 ("linux-user: Add LoongArch syscall support")
Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
Cc: Song Gao <gaosong@loongson.cn>
Cc: Xiaojuan Yang <yangxiaojuan@loongson.cn>
Cc: Andreas K. Hüttel <dilfridge@gentoo.org>
---
Resend with amended commit message to 100% clarify the example output
are generated on my box and will differ for everyone else. Sorry for
the noise.
linux-user/syscall_defs.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 01ee10a88f..77864de57f 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -2262,7 +2262,8 @@ struct target_statfs64 {
};
#elif (defined(TARGET_PPC64) || defined(TARGET_X86_64) || \
defined(TARGET_SPARC64) || defined(TARGET_AARCH64) || \
- defined(TARGET_RISCV)) && !defined(TARGET_ABI32)
+ defined(TARGET_RISCV) || defined(TARGET_LOONGARCH64)) && \
+ !defined(TARGET_ABI32)
struct target_statfs {
abi_long f_type;
abi_long f_bsize;
--
2.38.0

View File

@ -0,0 +1,94 @@
From xen0n@gentoo.org Thu Oct 06 08:55:00 2022
Return-Path: <xen0n@gentoo.org>
X-Original-To: dilfridge@gentoo.org
Delivered-To: dilfridge@gentoo.org
From: WANG Xuerui <xen0n@gentoo.org>
To: qemu-devel@nongnu.org
Cc: WANG Xuerui <xen0n@gentoo.org>,
=?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <f4bug@amsat.org>,
Jiaxun Yang <jiaxun.yang@flygoat.com>,
=?UTF-8?q?Andreas=20K=20=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>,
Joshua Kinard <kumba@gentoo.org>
Subject: [PATCH] linux-user: Fix more MIPS n32 syscall ABI issues
Date: Thu, 6 Oct 2022 16:55:00 +0800
Message-Id: <20221006085500.290341-1-xen0n@gentoo.org>
X-Mailer: git-send-email 2.38.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In commit 80f0fe3a85 ("linux-user: Fix syscall parameter handling for
MIPS n32") the ABI problem regarding offset64 on MIPS n32 was fixed,
but still some cases remain where the n32 is incorrectly treated as any
other 32-bit ABI that passes 64-bit arguments in pairs of GPRs. Fix by
excluding TARGET_ABI_MIPSN32 from various TARGET_ABI_BITS == 32 checks.
Closes: https://gitlab.com/qemu-project/qemu/-/issues/1238
Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: Andreas K. Hüttel <dilfridge@gentoo.org>
Cc: Joshua Kinard <kumba@gentoo.org>
---
Note: I can't reproduce the crash with neither MIPS n32 sysroot at my hand
(a self-built one for Loongson-2F, and stage3-mips64_n32-openrc-20221001T170527Z),
so I can only verify by looking at the (host and qemu) strace outputs, and
would have to ask you to review/test this harder. Thanks.
linux-user/syscall.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 2e954d8dbd..8b2d39fe73 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -11793,7 +11793,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
return -host_to_target_errno(ret);
#endif
-#if TARGET_ABI_BITS == 32
+#if TARGET_ABI_BITS == 32 && !defined(TARGET_ABI_MIPSN32)
#ifdef TARGET_NR_fadvise64_64
case TARGET_NR_fadvise64_64:
@@ -11920,7 +11920,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
return get_errno(sys_gettid());
#ifdef TARGET_NR_readahead
case TARGET_NR_readahead:
-#if TARGET_ABI_BITS == 32
+#if TARGET_ABI_BITS == 32 && !defined(TARGET_ABI_MIPSN32)
if (regpairs_aligned(cpu_env, num)) {
arg2 = arg3;
arg3 = arg4;
@@ -12612,7 +12612,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
#endif /* CONFIG_EVENTFD */
#if defined(CONFIG_FALLOCATE) && defined(TARGET_NR_fallocate)
case TARGET_NR_fallocate:
-#if TARGET_ABI_BITS == 32
+#if TARGET_ABI_BITS == 32 && !defined(TARGET_ABI_MIPSN32)
ret = get_errno(fallocate(arg1, arg2, target_offset64(arg3, arg4),
target_offset64(arg5, arg6)));
#else
@@ -12623,7 +12623,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
#if defined(CONFIG_SYNC_FILE_RANGE)
#if defined(TARGET_NR_sync_file_range)
case TARGET_NR_sync_file_range:
-#if TARGET_ABI_BITS == 32
+#if TARGET_ABI_BITS == 32 && !defined(TARGET_ABI_MIPSN32)
#if defined(TARGET_MIPS)
ret = get_errno(sync_file_range(arg1, target_offset64(arg3, arg4),
target_offset64(arg5, arg6), arg7));
@@ -12645,7 +12645,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
case TARGET_NR_arm_sync_file_range:
#endif
/* This is like sync_file_range but the arguments are reordered */
-#if TARGET_ABI_BITS == 32
+#if TARGET_ABI_BITS == 32 && !defined(TARGET_ABI_MIPSN32)
ret = get_errno(sync_file_range(arg1, target_offset64(arg3, arg4),
target_offset64(arg5, arg6), arg2));
#else
--
2.38.0

View File

@ -4,15 +4,15 @@ diff --git a/configure b/configure
index da2501489f..4660ee3ee5 100755
--- a/configure
+++ b/configure
@@ -516,6 +516,7 @@ ld="${LD-${cross_prefix}ld}"
ranlib="${RANLIB-${cross_prefix}ranlib}"
@@ -400,6 +400,7 @@ ld="${LD-${cross_prefix}ld}"
nm="${NM-${cross_prefix}nm}"
smbd="$SMBD"
strip="${STRIP-${cross_prefix}strip}"
+strings="${STRINGS-${cross_prefix}strings}"
widl="${WIDL-${cross_prefix}widl}"
windres="${WINDRES-${cross_prefix}windres}"
pkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}"
query_pkg_config() {
@@ -2380,9 +2381,9 @@ int main(int argc, char *argv[])
@@ -1466,9 +1467,9 @@ int main(int argc, char *argv[])
EOF
if compile_prog ; then

View File

@ -1,26 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>ajak@gentoo.org</email>
<name>John Helmert III</name>
</maintainer>
<maintainer type="person">
<email>sam@gentoo.org</email>
<name>Sam James</name>
</maintainer>
<maintainer type="person">
<email>tamiko@gentoo.org</email>
<name>Matthias Maier</name>
</maintainer>
<maintainer type="person">
<email>zlogene@gentoo.org</email>
<name>Mikle Kolyada</name>
</maintainer>
<maintainer type="project">
<email>virtualization@gentoo.org</email>
<name>Gentoo Virtualization Project</name>
</maintainer>
<maintainer type="person">
<email>dilfridge@gentoo.org</email>
<name>Andreas K. Hüttel</name>
</maintainer>
<use>
<flag name="accessibility">Adds support for braille displays using brltty</flag>
<flag name="aio">Enables support for Linux's Async IO</flag>
@ -72,7 +60,8 @@
<flag name="xattr">Add support for getting and setting POSIX extended attributes, through
<pkg>sys-apps/attr</pkg>. Requisite for the virtfs backend.</flag>
<flag name="xen">Enables support for Xen backends</flag>
<flag name="xfs">Support xfsctl() notification and syncing for XFS backed
virtual disks.</flag>
</use>
<upstream>
<remote-id type="gitlab">qemu-project/qemu</remote-id>
</upstream>
</pkgmetadata>

View File

@ -1,913 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{8,9,10} )
PYTHON_REQ_USE="ncurses,readline"
FIRMWARE_ABI_VERSION="6.2.0"
inherit linux-info toolchain-funcs python-r1 udev fcaps readme.gentoo-r1 \
pax-utils xdg-utils
if [[ ${PV} = *9999* ]]; then
EGIT_REPO_URI="https://git.qemu.org/git/qemu.git"
EGIT_SUBMODULES=(
meson
tests/fp/berkeley-softfloat-3
tests/fp/berkeley-testfloat-3
ui/keycodemapdb
)
inherit git-r3
SRC_URI=""
else
SRC_URI="https://download.qemu.org/${P}.tar.xz"
KEYWORDS="amd64 arm64 ~ppc ppc64 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"
IUSE="accessibility +aio alsa bpf bzip2 capstone +caps +curl debug +doc
+fdt fuse glusterfs +gnutls gtk infiniband iscsi io-uring
jack jemalloc +jpeg
lzo multipath
ncurses nfs nls numa opengl +oss +pin-upstream-blobs
plugins +png pulseaudio python rbd sasl +seccomp sdl sdl-image selinux
+slirp
smartcard snappy spice ssh static static-user systemtap test udev usb
usbredir vde +vhost-net vhost-user-fs virgl virtfs +vnc vte xattr xen
xfs zstd"
COMMON_TARGETS="
aarch64
alpha
arm
cris
hppa
i386
m68k
microblaze
microblazeel
mips
mips64
mips64el
mipsel
nios2
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
ppc64abi32
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? ( static-user !alsa !gtk !jack !opengl !pulseaudio !plugins !rbd !snappy !udev )
static-user? ( !plugins )
vhost-user-fs? ( caps seccomp )
virgl? ( opengl )
virtfs? ( caps xattr )
vnc? ( gnutls )
vte? ( gtk )
multipath? ( udev )
plugins? ( !static !static-user )
"
# 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.0[static-libs(+)]
sys-libs/zlib[static-libs(+)]
python? ( ${PYTHON_DEPS} )
systemtap? ( dev-util/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="
dev-libs/libxml2[static-libs(+)]
>=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:= )
caps? ( sys-libs/libcap-ng[static-libs(+)] )
curl? ( >=net-misc/curl-7.15.4[static-libs(+)] )
fdt? ( >=sys-apps/dtc-1.5.0[static-libs(+)] )
fuse? ( >=sys-fs/fuse-3.1:3[static-libs(+)] )
glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] )
gnutls? (
dev-libs/nettle:=[static-libs(+)]
>=net-libs/gnutls-3.0:=[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? ( virtual/jpeg:0=[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(+)]
)
png? ( media-libs/libpng:0=[static-libs(+)] )
pulseaudio? ( media-sound/pulseaudio )
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.12.3
>=app-emulation/spice-0.12.0[static-libs(+)]
)
ssh? ( >=net-libs/libssh-0.8.6[static-libs(+)] )
udev? ( virtual/libudev:= )
usb? ( >=virtual/libusb-1-r2[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 )
xen? ( app-emulation/xen-tools:= )
xfs? ( sys-fs/xfsprogs[static-libs(+)] )
zstd? ( >=app-arch/zstd-1.4.0[static-libs(+)] )
"
EDK2_OVMF_VERSION="202105"
SEABIOS_VERSION="1.14.0"
X86_FIRMWARE_DEPEND="
pin-upstream-blobs? (
~sys-firmware/edk2-ovmf-${EDK2_OVMF_VERSION}[binary]
~sys-firmware/ipxe-1.21.1[binary,qemu]
~sys-firmware/seabios-${SEABIOS_VERSION}[binary,seavgabios]
~sys-firmware/sgabios-0.1_pre10[binary]
)
!pin-upstream-blobs? (
>=sys-firmware/edk2-ovmf-${EDK2_OVMF_VERSION}
sys-firmware/ipxe[qemu]
>=sys-firmware/seabios-${SEABIOS_VERSION}[seavgabios]
sys-firmware/sgabios
)"
PPC_FIRMWARE_DEPEND="
pin-upstream-blobs? (
~sys-firmware/seabios-${SEABIOS_VERSION}[binary,seavgabios]
)
!pin-upstream-blobs? (
>=sys-firmware/seabios-${SEABIOS_VERSION}[seavgabios]
)
"
BDEPEND="
$(python_gen_impl_dep)
dev-lang/perl
sys-apps/texinfo
virtual/pkgconfig
doc? (
dev-python/sphinx[${PYTHON_USEDEP}]
dev-python/sphinx_rtd_theme[${PYTHON_USEDEP}]
)
gtk? ( nls? ( sys-devel/gettext ) )
test? (
dev-libs/glib[utils]
sys-devel/bc
)
"
CDEPEND="
!static? (
${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? (
${ALL_DEPEND}
${SOFTMMU_TOOLS_DEPEND}
)
static-user? ( ${ALL_DEPEND} )"
RDEPEND="${CDEPEND}
acct-group/kvm
selinux? ( sec-policy/selinux-qemu )"
PATCHES=(
"${FILESDIR}"/${PN}-2.11.1-capstone_include_path.patch
"${FILESDIR}"/${PN}-5.2.0-disable-keymap.patch
"${FILESDIR}"/${PN}-6.0.0-make.patch
"${FILESDIR}"/${PN}-6.1.0-strings.patch
)
QA_PREBUILT="
usr/share/qemu/hppa-firmware.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-ppc64abi32
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"
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_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
# Verbose builds
MAKEOPTS+=" V=1"
# Remove bundled copy of libfdt
rm -r dtc || 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}"
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
# 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
--python="${PYTHON}"
--cc="$(tc-getCC)"
--cxx="$(tc-getCXX)"
--host-cc="$(tc-getBUILD_CC)"
$(use_enable debug debug-info)
$(use_enable debug debug-tcg)
$(use_enable doc docs)
$(use_enable nls gettext)
$(use_enable plugins)
$(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 caps cap-ng)
$(conf_notuser curl)
$(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 lzo)
$(conf_notuser multipath mpath)
$(conf_notuser ncurses curses)
$(conf_notuser nfs libnfs)
$(conf_notuser numa)
$(conf_notuser opengl)
$(conf_notuser png vnc-png)
$(conf_notuser rbd)
$(conf_notuser sasl vnc-sasl)
$(conf_notuser sdl)
$(conf_softmmu sdl-image)
$(conf_notuser seccomp)
$(conf_notuser slirp slirp system)
$(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 vhost-user-fs)
$(conf_tools vhost-user-fs virtiofsd)
$(conf_notuser virgl virglrenderer)
$(conf_softmmu virtfs)
$(conf_notuser vnc)
$(conf_notuser vte)
$(conf_notuser xen)
$(conf_notuser xen xen-pci-passthrough)
$(conf_notuser xfs xfsctl)
# use prebuilt keymaps, bug #759604
--disable-xkbcommon
$(conf_notuser zstd)
)
if [[ ${buildtype} == "user" ]] ; then
conf_opts+=( --disable-libxml2 )
else
conf_opts+=( --enable-libxml2 )
fi
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 jack)
$(usev sdl)
$(usev alsa)
$(usev oss)
)
conf_opts+=(
--audio-drv-list="${audio_opts// /,}"
)
fi
case ${buildtype} in
user)
conf_opts+=(
--enable-linux-user
--disable-system
--disable-blobs
--disable-tools
)
local static_flag="static-user"
;;
softmmu)
conf_opts+=(
--disable-linux-user
--enable-system
--disable-tools
)
local static_flag="static"
;;
tools)
conf_opts+=(
--disable-linux-user
--disable-system
--disable-blobs
--enable-tools
)
local static_flag="static"
;;
esac
local targets="${buildtype}_targets"
[[ -n ${targets} ]] && conf_opts+=( --target-list="${!targets}" )
# Add support for SystemTAP
use systemtap && conf_opts+=( --enable-trace-backend=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 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"
default
fi
if [[ -n ${softmmu_targets} ]]; then
cd "${S}/softmmu-build"
default
fi
cd "${S}/tools-build"
default
}
src_test() {
if [[ -n ${softmmu_targets} ]]; then
cd "${S}/softmmu-build"
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"
emake DESTDIR="${ED}" install
# Disable mprotect on the qemu binaries as they use JITs to be fast #459348
pushd "${ED}"/usr/bin >/dev/null
pax-mark mr "${softmmu_bins[@]}" "${user_bins[@]}" # bug 575594
popd >/dev/null
# Install config file example for qemu-bridge-helper
insinto "/etc/qemu"
doins "${FILESDIR}/bridge.conf"
cd "${S}"
dodoc MAINTAINERS docs/specs/pci-ids.txt
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
rm "${ED}/usr/share/qemu/bios.bin"
rm "${ED}/usr/share/qemu/bios-256k.bin"
if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
dosym ../seabios/bios.bin /usr/share/qemu/bios.bin
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
rm "${ED}/usr/share/qemu/sgabios.bin"
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
rm "${ED}"/usr/share/qemu/pxe-*.rom
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:"
ewarn " $(best_version sys-firmware/edk2-ovmf)"
ewarn " $(best_version sys-firmware/ipxe)"
ewarn " $(best_version sys-firmware/seabios)"
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)"
echo " $(best_version sys-firmware/edk2-ovmf)"
if has_version 'sys-firmware/edk2-ovmf[binary]'; then
echo " USE=binary"
else
echo " USE=''"
fi
echo " $(best_version sys-firmware/ipxe)"
echo " $(best_version sys-firmware/seabios)"
if has_version 'sys-firmware/seabios[binary]'; then
echo " USE=binary"
else
echo " USE=''"
fi
echo " $(best_version sys-firmware/sgabios)"
}
pkg_postrm() {
xdg_icon_cache_update
}

View File

@ -1,20 +1,31 @@
# Copyright 1999-2022 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{8,9,10} )
# 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=ajak
QEMU_DOCS_VERSION="${PV}"
# Default to generating docs (inc. man pages) if no prebuilt; overridden later
# bug #830088
QEMU_DOC_USEFLAG="+doc"
PYTHON_COMPAT=( python3_{9,10,11} )
PYTHON_REQ_USE="ncurses,readline"
FIRMWARE_ABI_VERSION="6.2.0"
FIRMWARE_ABI_VERSION="7.1.0"
inherit linux-info toolchain-funcs python-r1 udev fcaps readme.gentoo-r1 \
pax-utils xdg-utils
if [[ ${PV} = *9999* ]]; then
EGIT_REPO_URI="https://git.qemu.org/git/qemu.git"
if [[ ${PV} == *9999* ]]; then
QEMU_DOCS_PREBUILT=0
EGIT_REPO_URI="https://gitlab.com/qemu-project/qemu.git/"
EGIT_SUBMODULES=(
meson
tests/fp/berkeley-softfloat-3
tests/fp/berkeley-testfloat-3
ui/keycodemapdb
@ -22,8 +33,15 @@ if [[ ${PV} = *9999* ]]; then
inherit git-r3
SRC_URI=""
else
SRC_URI="https://download.qemu.org/${P}.tar.xz"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~x86"
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}"
KEYWORDS="amd64 ~arm arm64 ~loong ~ppc ppc64 ~riscv x86"
fi
DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools"
@ -32,16 +50,18 @@ HOMEPAGE="https://www.qemu.org https://www.linux-kvm.org"
LICENSE="GPL-2 LGPL-2 BSD-2"
SLOT="0"
IUSE="accessibility +aio alsa bpf bzip2 capstone +caps +curl debug +doc
[[ ${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
lzo multipath
ncurses nfs nls numa opengl +oss pam +pin-upstream-blobs
plugins +png pulseaudio python rbd sasl +seccomp sdl sdl-image selinux
plugins +png pulseaudio python rbd sasl sdl sdl-image selinux
+slirp
smartcard snappy spice ssh static static-user systemtap test udev usb
usbredir vde +vhost-net vhost-user-fs virgl virtfs +vnc vte xattr xen
xfs zstd"
usbredir vde +vhost-net virgl virtfs +vnc vte xattr xen
zstd"
COMMON_TARGETS="
aarch64
@ -50,6 +70,7 @@ COMMON_TARGETS="
cris
hppa
i386
loongarch64
m68k
microblaze
microblazeel
@ -85,7 +106,6 @@ IUSE_USER_TARGETS="
hexagon
mipsn32
mipsn32el
ppc64abi32
ppc64le
sparc32plus
"
@ -97,7 +117,8 @@ 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}
REQUIRED_USE="
${PYTHON_REQUIRED_USE}
qemu_softmmu_targets_arm? ( fdt )
qemu_softmmu_targets_microblaze? ( fdt )
qemu_softmmu_targets_mips64el? ( fdt )
@ -109,9 +130,8 @@ REQUIRED_USE="${PYTHON_REQUIRED_USE}
sdl-image? ( sdl )
static? ( static-user !alsa !gtk !jack !opengl !pam !pulseaudio !plugins !rbd !snappy !udev )
static-user? ( !plugins )
vhost-user-fs? ( caps seccomp )
virgl? ( opengl )
virtfs? ( caps xattr )
virtfs? ( xattr )
vnc? ( gnutls )
vte? ( gtk )
multipath? ( udev )
@ -136,7 +156,8 @@ ALL_DEPEND="
# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...)
# softmmu targets (qemu-system-*).
SOFTMMU_TOOLS_DEPEND="
dev-libs/libxml2[static-libs(+)]
sys-libs/libcap-ng[static-libs(+)]
>=sys-libs/libseccomp-2.1.0[static-libs(+)]
>=x11-libs/pixman-0.28.0[static-libs(+)]
accessibility? (
app-accessibility/brltty[api]
@ -147,9 +168,8 @@ SOFTMMU_TOOLS_DEPEND="
bpf? ( dev-libs/libbpf:= )
bzip2? ( app-arch/bzip2[static-libs(+)] )
capstone? ( dev-libs/capstone:= )
caps? ( sys-libs/libcap-ng[static-libs(+)] )
curl? ( >=net-misc/curl-7.15.4[static-libs(+)] )
fdt? ( >=sys-apps/dtc-1.5.0[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? (
@ -165,7 +185,7 @@ SOFTMMU_TOOLS_DEPEND="
io-uring? ( sys-libs/liburing:=[static-libs(+)] )
jack? ( virtual/jack )
jemalloc? ( dev-libs/jemalloc )
jpeg? ( virtual/jpeg:0=[static-libs(+)] )
jpeg? ( media-libs/libjpeg-turbo:=[static-libs(+)] )
lzo? ( dev-libs/lzo:2[static-libs(+)] )
multipath? ( sys-fs/multipath-tools )
ncurses? (
@ -190,7 +210,6 @@ SOFTMMU_TOOLS_DEPEND="
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:= )
@ -206,38 +225,47 @@ SOFTMMU_TOOLS_DEPEND="
virgl? ( media-libs/virglrenderer[static-libs(+)] )
virtfs? ( sys-libs/libcap )
xen? ( app-emulation/xen-tools:= )
xfs? ( sys-fs/xfsprogs[static-libs(+)] )
zstd? ( >=app-arch/zstd-1.4.0[static-libs(+)] )
"
EDK2_OVMF_VERSION="202105"
SEABIOS_VERSION="1.14.0"
EDK2_OVMF_VERSION="202202"
SEABIOS_VERSION="1.16.0"
X86_FIRMWARE_DEPEND="
pin-upstream-blobs? (
~sys-firmware/edk2-ovmf-${EDK2_OVMF_VERSION}[binary]
~sys-firmware/edk2-ovmf-bin-${EDK2_OVMF_VERSION}
~sys-firmware/ipxe-1.21.1[binary,qemu]
~sys-firmware/seabios-${SEABIOS_VERSION}[binary,seavgabios]
~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-${SEABIOS_VERSION}[binary,seavgabios]
~sys-firmware/seabios-bin-${SEABIOS_VERSION}
)
!pin-upstream-blobs? (
|| (
>=sys-firmware/seabios-${SEABIOS_VERSION}[seavgabios]
>=sys-firmware/seabios-bin-${SEABIOS_VERSION}
)
)
"
BDEPEND="
$(python_gen_impl_dep)
dev-lang/perl
dev-util/meson
sys-apps/texinfo
virtual/pkgconfig
doc? (
@ -275,12 +303,14 @@ RDEPEND="${CDEPEND}
)"
PATCHES=(
"${FILESDIR}"/${PN}-2.11.1-capstone_include_path.patch
"${FILESDIR}"/${PN}-5.2.0-disable-keymap.patch
"${FILESDIR}"/${PN}-6.0.0-make.patch
"${FILESDIR}"/${PN}-6.1.0-strings.patch
"${FILESDIR}"/${PN}-6.2.0-user-SLIC-crash.patch
"${FILESDIR}"/${PN}-6.2.0-also-build-virtfs-proxy-helper.patch
"${FILESDIR}"/${PN}-7.1.0-also-build-virtfs-proxy-helper.patch
"${FILESDIR}"/${PN}-7.1.0-strings.patch
"${FILESDIR}"/${PN}-7.1.0-capstone-include-path.patch
"${FILESDIR}"/${PN}-7.1.0-mips-n32-syscalls.patch
"${FILESDIR}"/${PN}-7.1.0-loong-stat.patch
"${FILESDIR}"/${PN}-7.1.0-faccessat2.patch
)
QA_PREBUILT="
@ -309,7 +339,6 @@ QA_WX_LOAD="usr/bin/qemu-i386
usr/bin/qemu-or1k
usr/bin/qemu-ppc
usr/bin/qemu-ppc64
usr/bin/qemu-ppc64abi32
usr/bin/qemu-sh4
usr/bin/qemu-sh4eb
usr/bin/qemu-sparc
@ -421,8 +450,13 @@ src_prepare() {
# Verbose builds
MAKEOPTS+=" V=1"
# Remove bundled copy of libfdt
rm -r dtc || die
# We already force -D_FORTIFY_SOURCE=2 (or 3) in our toolchain, but
# this setting (-U then -D..=2) will prevent us from trying out 3, so
# drop it. No change to level of protection b/c we patch our toolchain.
sed -i -e 's/-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2//' configure || die
# Remove bundled modules
rm -r dtc meson roms/*/ slirp || die
}
##
@ -435,7 +469,7 @@ qemu_src_configure() {
local buildtype=$1
local builddir="${S}/${buildtype}-build"
mkdir "${builddir}"
mkdir "${builddir}" || die
local conf_opts=(
--prefix=/usr
@ -467,10 +501,10 @@ qemu_src_configure() {
# are enabled), but it's not really worth the hassle. Disable it
# all the time to avoid automatically detecting it. #568856
--disable-gcrypt
--python="${PYTHON}"
--cc="$(tc-getCC)"
--cxx="$(tc-getCXX)"
--host-cc="$(tc-getBUILD_CC)"
$(use_enable alsa)
$(use_enable debug debug-info)
$(use_enable debug debug-tcg)
@ -521,7 +555,6 @@ qemu_src_configure() {
$(conf_softmmu bpf)
$(conf_notuser bzip2)
$(conf_notuser capstone)
$(conf_notuser caps cap-ng)
$(conf_notuser curl)
$(conf_tools doc docs)
$(conf_notuser fdt)
@ -543,12 +576,11 @@ qemu_src_configure() {
$(conf_notuser numa)
$(conf_notuser opengl)
$(conf_notuser pam auth-pam)
$(conf_notuser png vnc-png)
$(conf_notuser png)
$(conf_notuser rbd)
$(conf_notuser sasl vnc-sasl)
$(conf_notuser sdl)
$(conf_softmmu sdl-image)
$(conf_notuser seccomp)
$(conf_notuser slirp slirp system)
$(conf_notuser smartcard)
$(conf_notuser snappy)
@ -559,26 +591,17 @@ qemu_src_configure() {
$(conf_notuser usbredir usb-redir)
$(conf_notuser vde)
$(conf_notuser vhost-net)
$(conf_notuser vhost-user-fs)
$(conf_tools vhost-user-fs virtiofsd)
$(conf_notuser virgl virglrenderer)
$(conf_softmmu virtfs)
$(conf_notuser vnc)
$(conf_notuser vte)
$(conf_notuser xen)
$(conf_notuser xen xen-pci-passthrough)
$(conf_notuser xfs xfsctl)
# use prebuilt keymaps, bug #759604
--disable-xkbcommon
$(conf_notuser zstd)
)
if [[ ${buildtype} == "user" ]] ; then
conf_opts+=( --disable-libxml2 )
else
conf_opts+=( --enable-libxml2 )
fi
if [[ ! ${buildtype} == "user" ]] ; then
# audio options
local audio_opts=(
@ -602,6 +625,8 @@ qemu_src_configure() {
--disable-system
--disable-blobs
--disable-tools
--disable-cap-ng
--disable-seccomp
)
local static_flag="static-user"
;;
@ -610,6 +635,8 @@ qemu_src_configure() {
--disable-linux-user
--enable-system
--disable-tools
--enable-cap-ng
--enable-seccomp
)
local static_flag="static"
;;
@ -618,6 +645,8 @@ qemu_src_configure() {
--disable-linux-user
--disable-system
--disable-blobs
--enable-cap-ng
--enable-seccomp
--enable-tools
)
local static_flag="static"
@ -683,22 +712,22 @@ src_configure() {
src_compile() {
if [[ -n ${user_targets} ]]; then
cd "${S}/user-build"
cd "${S}/user-build" || die
default
fi
if [[ -n ${softmmu_targets} ]]; then
cd "${S}/softmmu-build"
cd "${S}/softmmu-build" || die
default
fi
cd "${S}/tools-build"
cd "${S}/tools-build" || die
default
}
src_test() {
if [[ -n ${softmmu_targets} ]]; then
cd "${S}/softmmu-build"
cd "${S}/softmmu-build" || die
pax-mark m */qemu-system-* #515550
emake check
fi
@ -795,19 +824,24 @@ src_install() {
fi
fi
cd "${S}/tools-build"
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
pushd "${ED}"/usr/bin >/dev/null || die
pax-mark mr "${softmmu_bins[@]}" "${user_bins[@]}" # bug 575594
popd >/dev/null
popd >/dev/null || die
# Install config file example for qemu-bridge-helper
insinto "/etc/qemu"
doins "${FILESDIR}/bridge.conf"
cd "${S}"
cd "${S}" || die
dodoc MAINTAINERS docs/specs/pci-ids.txt
newdoc pc-bios/README README.pc-bios
@ -816,10 +850,7 @@ src_install() {
if [[ -n ${softmmu_targets} ]]; then
# Remove SeaBIOS since we're using the SeaBIOS packaged one
rm "${ED}/usr/share/qemu/bios.bin"
rm "${ED}/usr/share/qemu/bios-256k.bin"
if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
dosym ../seabios/bios.bin /usr/share/qemu/bios.bin
dosym ../seabios/bios-256k.bin /usr/share/qemu/bios-256k.bin
fi
@ -830,6 +861,7 @@ src_install() {
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
@ -841,13 +873,11 @@ src_install() {
fi
# Remove sgabios since we're using the sgabios packaged one
rm "${ED}/usr/share/qemu/sgabios.bin"
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
rm "${ED}"/usr/share/qemu/pxe-*.rom
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
@ -880,16 +910,27 @@ pkg_postinst() {
xdg_icon_cache_update
[[ -z ${EPREFIX} ]] && [[ -f ${EROOT}/usr/libexec/qemu-bridge-helper ]] && \
fcaps cap_net_admin ${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)"
ewarn " $(best_version sys-firmware/ipxe)"
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"
@ -903,22 +944,24 @@ pkg_postinst() {
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)"
if has_version 'sys-firmware/edk2-ovmf[binary]'; then
echo " USE=binary"
else
echo " USE=''"
fi
echo " $(best_version sys-firmware/ipxe)"
if has_version 'sys-firmware/seabios-bin'; then
echo " $(best_version sys-firmware/seabios-bin)"
else
echo " $(best_version sys-firmware/seabios)"
if has_version 'sys-firmware/seabios[binary]'; then
echo " USE=binary"
else
echo " USE=''"
fi
echo " $(best_version sys-firmware/ipxe)"
echo " $(best_version sys-firmware/sgabios)"
}
pkg_postrm() {
xdg_icon_cache_update
udev_reload
}

View File

@ -1,20 +1,31 @@
# Copyright 1999-2022 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{8,9,10} )
# 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=ajak
QEMU_DOCS_VERSION="${PV}"
# Default to generating docs (inc. man pages) if no prebuilt; overridden later
# bug #830088
QEMU_DOC_USEFLAG="+doc"
PYTHON_COMPAT=( python3_{9,10,11} )
PYTHON_REQ_USE="ncurses,readline"
FIRMWARE_ABI_VERSION="6.2.0"
FIRMWARE_ABI_VERSION="7.1.0"
inherit linux-info toolchain-funcs python-r1 udev fcaps readme.gentoo-r1 \
pax-utils xdg-utils
if [[ ${PV} = *9999* ]]; then
EGIT_REPO_URI="https://git.qemu.org/git/qemu.git"
if [[ ${PV} == *9999* ]]; then
QEMU_DOCS_PREBUILT=0
EGIT_REPO_URI="https://gitlab.com/qemu-project/qemu.git/"
EGIT_SUBMODULES=(
meson
tests/fp/berkeley-softfloat-3
tests/fp/berkeley-testfloat-3
ui/keycodemapdb
@ -22,8 +33,15 @@ if [[ ${PV} = *9999* ]]; then
inherit git-r3
SRC_URI=""
else
SRC_URI="https://download.qemu.org/${P}.tar.xz"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~x86"
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}"
KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~x86"
fi
DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools"
@ -32,7 +50,9 @@ HOMEPAGE="https://www.qemu.org https://www.linux-kvm.org"
LICENSE="GPL-2 LGPL-2 BSD-2"
SLOT="0"
IUSE="accessibility +aio alsa bpf bzip2 capstone +caps +curl debug +doc
[[ ${QEMU_DOCS_PREBUILT} == 1 ]] && QEMU_DOC_USEFLAG="doc"
IUSE="accessibility +aio alsa bpf bzip2 capstone +caps +curl debug ${QEMU_DOC_USEFLAG}
+fdt fuse glusterfs +gnutls gtk infiniband iscsi io-uring
jack jemalloc +jpeg
lzo multipath
@ -41,7 +61,7 @@ IUSE="accessibility +aio alsa bpf bzip2 capstone +caps +curl debug +doc
+slirp
smartcard snappy spice ssh static static-user systemtap test udev usb
usbredir vde +vhost-net vhost-user-fs virgl virtfs +vnc vte xattr xen
xfs zstd"
zstd"
COMMON_TARGETS="
aarch64
@ -50,6 +70,7 @@ COMMON_TARGETS="
cris
hppa
i386
loongarch64
m68k
microblaze
microblazeel
@ -85,7 +106,6 @@ IUSE_USER_TARGETS="
hexagon
mipsn32
mipsn32el
ppc64abi32
ppc64le
sparc32plus
"
@ -136,7 +156,6 @@ ALL_DEPEND="
# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...)
# softmmu targets (qemu-system-*).
SOFTMMU_TOOLS_DEPEND="
dev-libs/libxml2[static-libs(+)]
>=x11-libs/pixman-0.28.0[static-libs(+)]
accessibility? (
app-accessibility/brltty[api]
@ -149,7 +168,7 @@ SOFTMMU_TOOLS_DEPEND="
capstone? ( dev-libs/capstone:= )
caps? ( sys-libs/libcap-ng[static-libs(+)] )
curl? ( >=net-misc/curl-7.15.4[static-libs(+)] )
fdt? ( >=sys-apps/dtc-1.5.0[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? (
@ -165,7 +184,7 @@ SOFTMMU_TOOLS_DEPEND="
io-uring? ( sys-libs/liburing:=[static-libs(+)] )
jack? ( virtual/jack )
jemalloc? ( dev-libs/jemalloc )
jpeg? ( virtual/jpeg:0=[static-libs(+)] )
jpeg? ( media-libs/libjpeg-turbo:=[static-libs(+)] )
lzo? ( dev-libs/lzo:2[static-libs(+)] )
multipath? ( sys-fs/multipath-tools )
ncurses? (
@ -206,38 +225,47 @@ SOFTMMU_TOOLS_DEPEND="
virgl? ( media-libs/virglrenderer[static-libs(+)] )
virtfs? ( sys-libs/libcap )
xen? ( app-emulation/xen-tools:= )
xfs? ( sys-fs/xfsprogs[static-libs(+)] )
zstd? ( >=app-arch/zstd-1.4.0[static-libs(+)] )
"
EDK2_OVMF_VERSION="202105"
SEABIOS_VERSION="1.14.0"
EDK2_OVMF_VERSION="202202"
SEABIOS_VERSION="1.16.0"
X86_FIRMWARE_DEPEND="
pin-upstream-blobs? (
~sys-firmware/edk2-ovmf-${EDK2_OVMF_VERSION}[binary]
~sys-firmware/edk2-ovmf-bin-${EDK2_OVMF_VERSION}
~sys-firmware/ipxe-1.21.1[binary,qemu]
~sys-firmware/seabios-${SEABIOS_VERSION}[binary,seavgabios]
~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-${SEABIOS_VERSION}[binary,seavgabios]
~sys-firmware/seabios-bin-${SEABIOS_VERSION}
)
!pin-upstream-blobs? (
|| (
>=sys-firmware/seabios-${SEABIOS_VERSION}[seavgabios]
>=sys-firmware/seabios-bin-${SEABIOS_VERSION}
)
)
"
BDEPEND="
$(python_gen_impl_dep)
dev-lang/perl
dev-util/meson
sys-apps/texinfo
virtual/pkgconfig
doc? (
@ -275,13 +303,11 @@ RDEPEND="${CDEPEND}
)"
PATCHES=(
"${FILESDIR}"/${PN}-2.11.1-capstone_include_path.patch
"${FILESDIR}"/${PN}-5.2.0-disable-keymap.patch
"${FILESDIR}"/${PN}-6.0.0-make.patch
"${FILESDIR}"/${PN}-6.1.0-strings.patch
"${FILESDIR}"/${PN}-6.2.0-user-SLIC-crash.patch
"${FILESDIR}"/${PN}-6.2.0-also-build-virtfs-proxy-helper.patch
"${FILESDIR}"/${PN}-6.2.0-glibc-2.35-rseq-seccomp-virtiofsd.patch
"${FILESDIR}"/${PN}-7.1.0-also-build-virtfs-proxy-helper.patch
"${FILESDIR}"/${PN}-7.1.0-strings.patch
"${FILESDIR}"/${PN}-7.1.0-capstone-include-path.patch
)
QA_PREBUILT="
@ -310,7 +336,6 @@ QA_WX_LOAD="usr/bin/qemu-i386
usr/bin/qemu-or1k
usr/bin/qemu-ppc
usr/bin/qemu-ppc64
usr/bin/qemu-ppc64abi32
usr/bin/qemu-sh4
usr/bin/qemu-sh4eb
usr/bin/qemu-sparc
@ -422,8 +447,13 @@ src_prepare() {
# Verbose builds
MAKEOPTS+=" V=1"
# Remove bundled copy of libfdt
rm -r dtc || die
# We already force -D_FORTIFY_SOURCE=2 (or 3) in our toolchain, but
# this setting (-U then -D..=2) will prevent us from trying out 3, so
# drop it. No change to level of protection b/c we patch our toolchain.
sed -i -e 's/-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2//' configure || die
# Remove bundled modules
rm -r dtc meson roms/*/ slirp || die
}
##
@ -436,7 +466,7 @@ qemu_src_configure() {
local buildtype=$1
local builddir="${S}/${buildtype}-build"
mkdir "${builddir}"
mkdir "${builddir}" || die
local conf_opts=(
--prefix=/usr
@ -468,10 +498,10 @@ qemu_src_configure() {
# are enabled), but it's not really worth the hassle. Disable it
# all the time to avoid automatically detecting it. #568856
--disable-gcrypt
--python="${PYTHON}"
--cc="$(tc-getCC)"
--cxx="$(tc-getCXX)"
--host-cc="$(tc-getBUILD_CC)"
$(use_enable alsa)
$(use_enable debug debug-info)
$(use_enable debug debug-tcg)
@ -544,7 +574,7 @@ qemu_src_configure() {
$(conf_notuser numa)
$(conf_notuser opengl)
$(conf_notuser pam auth-pam)
$(conf_notuser png vnc-png)
$(conf_notuser png)
$(conf_notuser rbd)
$(conf_notuser sasl vnc-sasl)
$(conf_notuser sdl)
@ -560,26 +590,17 @@ qemu_src_configure() {
$(conf_notuser usbredir usb-redir)
$(conf_notuser vde)
$(conf_notuser vhost-net)
$(conf_notuser vhost-user-fs)
$(conf_tools vhost-user-fs virtiofsd)
$(conf_notuser virgl virglrenderer)
$(conf_softmmu virtfs)
$(conf_notuser vnc)
$(conf_notuser vte)
$(conf_notuser xen)
$(conf_notuser xen xen-pci-passthrough)
$(conf_notuser xfs xfsctl)
# use prebuilt keymaps, bug #759604
--disable-xkbcommon
$(conf_notuser zstd)
)
if [[ ${buildtype} == "user" ]] ; then
conf_opts+=( --disable-libxml2 )
else
conf_opts+=( --enable-libxml2 )
fi
if [[ ! ${buildtype} == "user" ]] ; then
# audio options
local audio_opts=(
@ -613,6 +634,16 @@ qemu_src_configure() {
--disable-tools
)
local static_flag="static"
for target in ${IUSE_SOFTMMU_TARGETS}; do
if use "qemu_softmmu_targets_${target}"; then
conf_opts+=(
# For some reason, adding this with the setting set
# to on *or* off makes the build always fail.
# --with-devices-${target}=gentoo
)
fi
done
;;
tools)
conf_opts+=(
@ -664,6 +695,21 @@ src_configure() {
if use "qemu_softmmu_targets_${target}"; then
softmmu_targets+=",${target}-softmmu"
softmmu_bins+=( "qemu-system-${target}" )
# Needed to rework vhost-user-fs handling thanks to https://gitlab.com/qemu-project/qemu/-/commit/5166dab
# The option was converted into being configurable by
# Kconfig's. So, to enable it, we insert the necessary
# options into each arch's softmmu target gentoo.mak file,
# then configure with --with-devices-${target}=gentoo.
if use vhost-user-fs; then
echo "CONFIG_VHOST_USER_FS=y for ${target}-softmmu" || die
echo "CONFIG_VIRTIO=y" >> "configs/devices/${target}-softmmu/gentoo.mak" || die
echo "CONFIG_VHOST_USER_FS=y" >> "configs/devices/${target}-softmmu/gentoo.mak" || die
else
echo "CONFIG_VHOST_USER_FS=n for ${target}-softmmu" || die
echo "CONFIG_VIRTIO=n" >> "configs/devices/${target}-softmmu/gentoo.mak" || die
echo "CONFIG_VHOST_USER_FS=n" >> "configs/devices/${target}-softmmu/gentoo.mak" || die
fi
fi
done
@ -684,22 +730,22 @@ src_configure() {
src_compile() {
if [[ -n ${user_targets} ]]; then
cd "${S}/user-build"
cd "${S}/user-build" || die
default
fi
if [[ -n ${softmmu_targets} ]]; then
cd "${S}/softmmu-build"
cd "${S}/softmmu-build" || die
default
fi
cd "${S}/tools-build"
cd "${S}/tools-build" || die
default
}
src_test() {
if [[ -n ${softmmu_targets} ]]; then
cd "${S}/softmmu-build"
cd "${S}/softmmu-build" || die
pax-mark m */qemu-system-* #515550
emake check
fi
@ -796,19 +842,24 @@ src_install() {
fi
fi
cd "${S}/tools-build"
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
pushd "${ED}"/usr/bin >/dev/null || die
pax-mark mr "${softmmu_bins[@]}" "${user_bins[@]}" # bug 575594
popd >/dev/null
popd >/dev/null || die
# Install config file example for qemu-bridge-helper
insinto "/etc/qemu"
doins "${FILESDIR}/bridge.conf"
cd "${S}"
cd "${S}" || die
dodoc MAINTAINERS docs/specs/pci-ids.txt
newdoc pc-bios/README README.pc-bios
@ -817,10 +868,7 @@ src_install() {
if [[ -n ${softmmu_targets} ]]; then
# Remove SeaBIOS since we're using the SeaBIOS packaged one
rm "${ED}/usr/share/qemu/bios.bin"
rm "${ED}/usr/share/qemu/bios-256k.bin"
if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
dosym ../seabios/bios.bin /usr/share/qemu/bios.bin
dosym ../seabios/bios-256k.bin /usr/share/qemu/bios-256k.bin
fi
@ -831,6 +879,7 @@ src_install() {
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
@ -842,13 +891,11 @@ src_install() {
fi
# Remove sgabios since we're using the sgabios packaged one
rm "${ED}/usr/share/qemu/sgabios.bin"
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
rm "${ED}"/usr/share/qemu/pxe-*.rom
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
@ -881,16 +928,27 @@ pkg_postinst() {
xdg_icon_cache_update
[[ -z ${EPREFIX} ]] && [[ -f ${EROOT}/usr/libexec/qemu-bridge-helper ]] && \
fcaps cap_net_admin ${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)"
ewarn " $(best_version sys-firmware/ipxe)"
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"
@ -904,22 +962,24 @@ pkg_postinst() {
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)"
if has_version 'sys-firmware/edk2-ovmf[binary]'; then
echo " USE=binary"
else
echo " USE=''"
fi
echo " $(best_version sys-firmware/ipxe)"
if has_version 'sys-firmware/seabios-bin'; then
echo " $(best_version sys-firmware/seabios-bin)"
else
echo " $(best_version sys-firmware/seabios)"
if has_version 'sys-firmware/seabios[binary]'; then
echo " USE=binary"
else
echo " USE=''"
fi
echo " $(best_version sys-firmware/ipxe)"
echo " $(best_version sys-firmware/sgabios)"
}
pkg_postrm() {
xdg_icon_cache_update
udev_reload
}

View File

@ -1,20 +1,31 @@
# Copyright 1999-2022 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{8,9,10} )
# 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=ajak
QEMU_DOCS_VERSION="${PV}"
# Default to generating docs (inc. man pages) if no prebuilt; overridden later
# bug #830088
QEMU_DOC_USEFLAG="+doc"
PYTHON_COMPAT=( python3_{9,10,11} )
PYTHON_REQ_USE="ncurses,readline"
FIRMWARE_ABI_VERSION="7.0.0"
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
if [[ ${PV} == *9999* ]]; then
QEMU_DOCS_PREBUILT=0
EGIT_REPO_URI="https://gitlab.com/qemu-project/qemu.git/"
EGIT_SUBMODULES=(
meson
tests/fp/berkeley-softfloat-3
tests/fp/berkeley-testfloat-3
ui/keycodemapdb
@ -24,8 +35,13 @@ if [[ ${PV} = *9999* ]]; then
else
MY_P="${PN}-${PV/_rc/-rc}"
SRC_URI="https://download.qemu.org/${MY_P}.tar.xz"
KEYWORDS="amd64 ~arm ~arm64 ~ppc ppc64 ~riscv ~x86"
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"
@ -34,7 +50,9 @@ HOMEPAGE="https://www.qemu.org https://www.linux-kvm.org"
LICENSE="GPL-2 LGPL-2 BSD-2"
SLOT="0"
IUSE="accessibility +aio alsa bpf bzip2 capstone +caps +curl debug +doc
[[ ${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
lzo multipath
@ -42,7 +60,7 @@ IUSE="accessibility +aio alsa bpf bzip2 capstone +caps +curl debug +doc
plugins +png pulseaudio python rbd sasl +seccomp sdl sdl-image selinux
+slirp
smartcard snappy spice ssh static static-user systemtap test udev usb
usbredir vde +vhost-net vhost-user-fs virgl virtfs +vnc vte xattr xen
usbredir vde +vhost-net virgl virtfs +vnc vte xattr xen
zstd"
COMMON_TARGETS="
@ -52,6 +70,7 @@ COMMON_TARGETS="
cris
hppa
i386
loongarch64
m68k
microblaze
microblazeel
@ -96,9 +115,11 @@ 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}
REQUIRED_USE="
${PYTHON_REQUIRED_USE}
qemu_softmmu_targets_arm? ( fdt )
qemu_softmmu_targets_microblaze? ( fdt )
qemu_softmmu_targets_mips64el? ( fdt )
@ -110,14 +131,16 @@ REQUIRED_USE="${PYTHON_REQUIRED_USE}
sdl-image? ( sdl )
static? ( static-user !alsa !gtk !jack !opengl !pam !pulseaudio !plugins !rbd !snappy !udev )
static-user? ( !plugins )
vhost-user-fs? ( caps seccomp )
virgl? ( opengl )
virtfs? ( caps xattr )
virtfs? ( xattr )
vnc? ( gnutls )
vte? ( gtk )
multipath? ( udev )
plugins? ( !static !static-user )
"
for smname in ${IUSE_SOFTMMU_TARGETS} ; do
REQUIRED_USE+=" qemu_softmmu_targets_${smname}? ( seccomp ) "
done
# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...)
# and user/softmmu targets (qemu-*, qemu-system-*).
@ -137,6 +160,7 @@ ALL_DEPEND="
# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...)
# softmmu targets (qemu-system-*).
SOFTMMU_TOOLS_DEPEND="
sys-libs/libcap-ng[static-libs(+)]
>=x11-libs/pixman-0.28.0[static-libs(+)]
accessibility? (
app-accessibility/brltty[api]
@ -147,7 +171,6 @@ SOFTMMU_TOOLS_DEPEND="
bpf? ( dev-libs/libbpf:= )
bzip2? ( app-arch/bzip2[static-libs(+)] )
capstone? ( dev-libs/capstone:= )
caps? ( sys-libs/libcap-ng[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(+)] )
@ -165,7 +188,7 @@ SOFTMMU_TOOLS_DEPEND="
io-uring? ( sys-libs/liburing:=[static-libs(+)] )
jack? ( virtual/jack )
jemalloc? ( dev-libs/jemalloc )
jpeg? ( virtual/jpeg:0=[static-libs(+)] )
jpeg? ( media-libs/libjpeg-turbo:=[static-libs(+)] )
lzo? ( dev-libs/lzo:2[static-libs(+)] )
multipath? ( sys-fs/multipath-tools )
ncurses? (
@ -209,34 +232,44 @@ SOFTMMU_TOOLS_DEPEND="
zstd? ( >=app-arch/zstd-1.4.0[static-libs(+)] )
"
EDK2_OVMF_VERSION="202105"
SEABIOS_VERSION="1.14.0"
EDK2_OVMF_VERSION="202202"
SEABIOS_VERSION="1.16.0"
X86_FIRMWARE_DEPEND="
pin-upstream-blobs? (
~sys-firmware/edk2-ovmf-${EDK2_OVMF_VERSION}[binary]
~sys-firmware/edk2-ovmf-bin-${EDK2_OVMF_VERSION}
~sys-firmware/ipxe-1.21.1[binary,qemu]
~sys-firmware/seabios-${SEABIOS_VERSION}[binary,seavgabios]
~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-${SEABIOS_VERSION}[binary,seavgabios]
~sys-firmware/seabios-bin-${SEABIOS_VERSION}
)
!pin-upstream-blobs? (
|| (
>=sys-firmware/seabios-${SEABIOS_VERSION}[seavgabios]
>=sys-firmware/seabios-bin-${SEABIOS_VERSION}
)
)
"
BDEPEND="
$(python_gen_impl_dep)
dev-lang/perl
dev-util/meson
sys-apps/texinfo
virtual/pkgconfig
doc? (
@ -274,11 +307,10 @@ RDEPEND="${CDEPEND}
)"
PATCHES=(
"${FILESDIR}"/${PN}-2.11.1-capstone_include_path.patch
"${FILESDIR}"/${PN}-5.2.0-disable-keymap.patch
"${FILESDIR}"/${PN}-6.0.0-make.patch
"${FILESDIR}"/${PN}-6.1.0-strings.patch
"${FILESDIR}"/${PN}-7.0.0-also-build-virtfs-proxy-helper.patch
"${FILESDIR}"/${PN}-7.1.0-also-build-virtfs-proxy-helper.patch
"${FILESDIR}"/${PN}-7.1.0-capstone-include-path.patch
)
QA_PREBUILT="
@ -418,8 +450,13 @@ src_prepare() {
# Verbose builds
MAKEOPTS+=" V=1"
# Remove bundled copy of libfdt
rm -r dtc || die
# We already force -D_FORTIFY_SOURCE=2 (or 3) in our toolchain, but
# this setting (-U then -D..=2) will prevent us from trying out 3, so
# drop it. No change to level of protection b/c we patch our toolchain.
sed -i -e 's/-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2//' configure || die
# Remove bundled modules
rm -r dtc meson roms/*/ || die
}
##
@ -432,7 +469,7 @@ qemu_src_configure() {
local buildtype=$1
local builddir="${S}/${buildtype}-build"
mkdir "${builddir}"
mkdir "${builddir}" || die
local conf_opts=(
--prefix=/usr
@ -464,10 +501,10 @@ qemu_src_configure() {
# are enabled), but it's not really worth the hassle. Disable it
# all the time to avoid automatically detecting it. #568856
--disable-gcrypt
--python="${PYTHON}"
--cc="$(tc-getCC)"
--cxx="$(tc-getCXX)"
--host-cc="$(tc-getBUILD_CC)"
$(use_enable alsa)
$(use_enable debug debug-info)
$(use_enable debug debug-tcg)
@ -518,7 +555,6 @@ qemu_src_configure() {
$(conf_softmmu bpf)
$(conf_notuser bzip2)
$(conf_notuser capstone)
$(conf_notuser caps cap-ng)
$(conf_notuser curl)
$(conf_tools doc docs)
$(conf_notuser fdt)
@ -540,13 +576,13 @@ qemu_src_configure() {
$(conf_notuser numa)
$(conf_notuser opengl)
$(conf_notuser pam auth-pam)
$(conf_notuser png vnc-png)
$(conf_notuser png)
$(conf_notuser rbd)
$(conf_notuser sasl vnc-sasl)
$(conf_notuser sdl)
$(conf_softmmu sdl-image)
$(conf_notuser seccomp)
$(conf_notuser slirp slirp system)
$(conf_notuser slirp)
$(conf_notuser smartcard)
$(conf_notuser snappy)
$(conf_notuser spice)
@ -556,8 +592,6 @@ qemu_src_configure() {
$(conf_notuser usbredir usb-redir)
$(conf_notuser vde)
$(conf_notuser vhost-net)
$(conf_notuser vhost-user-fs)
$(conf_tools vhost-user-fs virtiofsd)
$(conf_notuser virgl virglrenderer)
$(conf_softmmu virtfs)
$(conf_notuser vnc)
@ -592,6 +626,8 @@ qemu_src_configure() {
--disable-system
--disable-blobs
--disable-tools
--disable-cap-ng
--disable-seccomp
)
local static_flag="static-user"
;;
@ -600,6 +636,8 @@ qemu_src_configure() {
--disable-linux-user
--enable-system
--disable-tools
--enable-cap-ng
--enable-seccomp
)
local static_flag="static"
;;
@ -609,6 +647,7 @@ qemu_src_configure() {
--disable-system
--disable-blobs
--enable-tools
--enable-cap-ng
)
local static_flag="static"
;;
@ -673,22 +712,22 @@ src_configure() {
src_compile() {
if [[ -n ${user_targets} ]]; then
cd "${S}/user-build"
cd "${S}/user-build" || die
default
fi
if [[ -n ${softmmu_targets} ]]; then
cd "${S}/softmmu-build"
cd "${S}/softmmu-build" || die
default
fi
cd "${S}/tools-build"
cd "${S}/tools-build" || die
default
}
src_test() {
if [[ -n ${softmmu_targets} ]]; then
cd "${S}/softmmu-build"
cd "${S}/softmmu-build" || die
pax-mark m */qemu-system-* #515550
emake check
fi
@ -785,19 +824,24 @@ src_install() {
fi
fi
cd "${S}/tools-build"
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
pushd "${ED}"/usr/bin >/dev/null || die
pax-mark mr "${softmmu_bins[@]}" "${user_bins[@]}" # bug 575594
popd >/dev/null
popd >/dev/null || die
# Install config file example for qemu-bridge-helper
insinto "/etc/qemu"
doins "${FILESDIR}/bridge.conf"
cd "${S}"
cd "${S}" || die
dodoc MAINTAINERS docs/specs/pci-ids.txt
newdoc pc-bios/README README.pc-bios
@ -806,10 +850,7 @@ src_install() {
if [[ -n ${softmmu_targets} ]]; then
# Remove SeaBIOS since we're using the SeaBIOS packaged one
rm "${ED}/usr/share/qemu/bios.bin"
rm "${ED}/usr/share/qemu/bios-256k.bin"
if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
dosym ../seabios/bios.bin /usr/share/qemu/bios.bin
dosym ../seabios/bios-256k.bin /usr/share/qemu/bios-256k.bin
fi
@ -820,6 +861,7 @@ src_install() {
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
@ -831,13 +873,11 @@ src_install() {
fi
# Remove sgabios since we're using the sgabios packaged one
rm "${ED}/usr/share/qemu/sgabios.bin"
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
rm "${ED}"/usr/share/qemu/pxe-*.rom
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
@ -870,16 +910,27 @@ pkg_postinst() {
xdg_icon_cache_update
[[ -z ${EPREFIX} ]] && [[ -f ${EROOT}/usr/libexec/qemu-bridge-helper ]] && \
fcaps cap_net_admin ${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)"
ewarn " $(best_version sys-firmware/ipxe)"
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"
@ -893,22 +944,24 @@ pkg_postinst() {
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)"
if has_version 'sys-firmware/edk2-ovmf[binary]'; then
echo " USE=binary"
else
echo " USE=''"
fi
echo " $(best_version sys-firmware/ipxe)"
if has_version 'sys-firmware/seabios-bin'; then
echo " $(best_version sys-firmware/seabios-bin)"
else
echo " $(best_version sys-firmware/seabios)"
if has_version 'sys-firmware/seabios[binary]'; then
echo " USE=binary"
else
echo " USE=''"
fi
echo " $(best_version sys-firmware/ipxe)"
echo " $(best_version sys-firmware/sgabios)"
}
pkg_postrm() {
xdg_icon_cache_update
udev_reload
}

View File

@ -1,20 +1,31 @@
# Copyright 1999-2022 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{8,9,10} )
# 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=ajak
QEMU_DOCS_VERSION="${PV}"
# Default to generating docs (inc. man pages) if no prebuilt; overridden later
# bug #830088
QEMU_DOC_USEFLAG="+doc"
PYTHON_COMPAT=( python3_{9,10,11} )
PYTHON_REQ_USE="ncurses,readline"
FIRMWARE_ABI_VERSION="6.2.0"
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
if [[ ${PV} == *9999* ]]; then
QEMU_DOCS_PREBUILT=0
EGIT_REPO_URI="https://gitlab.com/qemu-project/qemu.git/"
EGIT_SUBMODULES=(
meson
tests/fp/berkeley-softfloat-3
tests/fp/berkeley-testfloat-3
ui/keycodemapdb
@ -24,8 +35,13 @@ if [[ ${PV} = *9999* ]]; then
else
MY_P="${PN}-${PV/_rc/-rc}"
SRC_URI="https://download.qemu.org/${MY_P}.tar.xz"
#KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~x86"
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"
@ -34,15 +50,17 @@ HOMEPAGE="https://www.qemu.org https://www.linux-kvm.org"
LICENSE="GPL-2 LGPL-2 BSD-2"
SLOT="0"
IUSE="accessibility +aio alsa bpf bzip2 capstone +caps +curl debug +doc
[[ ${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
lzo multipath
ncurses nfs nls numa opengl +oss pam +pin-upstream-blobs
plugins +png pulseaudio python rbd sasl +seccomp sdl sdl-image selinux
plugins +png pulseaudio python rbd sasl sdl sdl-image selinux
+slirp
smartcard snappy spice ssh static static-user systemtap test udev usb
usbredir vde +vhost-net vhost-user-fs virgl virtfs +vnc vte xattr xen
usbredir vde +vhost-net virgl virtfs +vnc vte xattr xen
zstd"
COMMON_TARGETS="
@ -52,6 +70,7 @@ COMMON_TARGETS="
cris
hppa
i386
loongarch64
m68k
microblaze
microblazeel
@ -98,7 +117,8 @@ 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}
REQUIRED_USE="
${PYTHON_REQUIRED_USE}
qemu_softmmu_targets_arm? ( fdt )
qemu_softmmu_targets_microblaze? ( fdt )
qemu_softmmu_targets_mips64el? ( fdt )
@ -110,9 +130,8 @@ REQUIRED_USE="${PYTHON_REQUIRED_USE}
sdl-image? ( sdl )
static? ( static-user !alsa !gtk !jack !opengl !pam !pulseaudio !plugins !rbd !snappy !udev )
static-user? ( !plugins )
vhost-user-fs? ( caps seccomp )
virgl? ( opengl )
virtfs? ( caps xattr )
virtfs? ( xattr )
vnc? ( gnutls )
vte? ( gtk )
multipath? ( udev )
@ -137,6 +156,8 @@ ALL_DEPEND="
# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...)
# softmmu targets (qemu-system-*).
SOFTMMU_TOOLS_DEPEND="
sys-libs/libcap-ng[static-libs(+)]
>=sys-libs/libseccomp-2.1.0[static-libs(+)]
>=x11-libs/pixman-0.28.0[static-libs(+)]
accessibility? (
app-accessibility/brltty[api]
@ -147,9 +168,8 @@ SOFTMMU_TOOLS_DEPEND="
bpf? ( dev-libs/libbpf:= )
bzip2? ( app-arch/bzip2[static-libs(+)] )
capstone? ( dev-libs/capstone:= )
caps? ( sys-libs/libcap-ng[static-libs(+)] )
curl? ( >=net-misc/curl-7.15.4[static-libs(+)] )
fdt? ( >=sys-apps/dtc-1.5.0[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? (
@ -165,7 +185,7 @@ SOFTMMU_TOOLS_DEPEND="
io-uring? ( sys-libs/liburing:=[static-libs(+)] )
jack? ( virtual/jack )
jemalloc? ( dev-libs/jemalloc )
jpeg? ( virtual/jpeg:0=[static-libs(+)] )
jpeg? ( media-libs/libjpeg-turbo:=[static-libs(+)] )
lzo? ( dev-libs/lzo:2[static-libs(+)] )
multipath? ( sys-fs/multipath-tools )
ncurses? (
@ -190,7 +210,6 @@ SOFTMMU_TOOLS_DEPEND="
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:= )
@ -209,34 +228,44 @@ SOFTMMU_TOOLS_DEPEND="
zstd? ( >=app-arch/zstd-1.4.0[static-libs(+)] )
"
EDK2_OVMF_VERSION="202105"
SEABIOS_VERSION="1.14.0"
EDK2_OVMF_VERSION="202202"
SEABIOS_VERSION="1.16.0"
X86_FIRMWARE_DEPEND="
pin-upstream-blobs? (
~sys-firmware/edk2-ovmf-${EDK2_OVMF_VERSION}[binary]
~sys-firmware/edk2-ovmf-bin-${EDK2_OVMF_VERSION}
~sys-firmware/ipxe-1.21.1[binary,qemu]
~sys-firmware/seabios-${SEABIOS_VERSION}[binary,seavgabios]
~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-${SEABIOS_VERSION}[binary,seavgabios]
~sys-firmware/seabios-bin-${SEABIOS_VERSION}
)
!pin-upstream-blobs? (
|| (
>=sys-firmware/seabios-${SEABIOS_VERSION}[seavgabios]
>=sys-firmware/seabios-bin-${SEABIOS_VERSION}
)
)
"
BDEPEND="
$(python_gen_impl_dep)
dev-lang/perl
dev-util/meson
sys-apps/texinfo
virtual/pkgconfig
doc? (
@ -274,11 +303,10 @@ RDEPEND="${CDEPEND}
)"
PATCHES=(
"${FILESDIR}"/${PN}-2.11.1-capstone_include_path.patch
"${FILESDIR}"/${PN}-5.2.0-disable-keymap.patch
"${FILESDIR}"/${PN}-6.0.0-make.patch
"${FILESDIR}"/${PN}-6.1.0-strings.patch
"${FILESDIR}"/${PN}-7.0.0-also-build-virtfs-proxy-helper.patch
"${FILESDIR}"/${PN}-7.1.0-also-build-virtfs-proxy-helper.patch
"${FILESDIR}"/${PN}-7.1.0-capstone-include-path.patch
)
QA_PREBUILT="
@ -418,8 +446,13 @@ src_prepare() {
# Verbose builds
MAKEOPTS+=" V=1"
# Remove bundled copy of libfdt
rm -r dtc || die
# We already force -D_FORTIFY_SOURCE=2 (or 3) in our toolchain, but
# this setting (-U then -D..=2) will prevent us from trying out 3, so
# drop it. No change to level of protection b/c we patch our toolchain.
sed -i -e 's/-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2//' configure || die
# Remove bundled modules
rm -r dtc meson roms/*/ || die
}
##
@ -432,7 +465,7 @@ qemu_src_configure() {
local buildtype=$1
local builddir="${S}/${buildtype}-build"
mkdir "${builddir}"
mkdir "${builddir}" || die
local conf_opts=(
--prefix=/usr
@ -464,10 +497,10 @@ qemu_src_configure() {
# are enabled), but it's not really worth the hassle. Disable it
# all the time to avoid automatically detecting it. #568856
--disable-gcrypt
--python="${PYTHON}"
--cc="$(tc-getCC)"
--cxx="$(tc-getCXX)"
--host-cc="$(tc-getBUILD_CC)"
$(use_enable alsa)
$(use_enable debug debug-info)
$(use_enable debug debug-tcg)
@ -518,7 +551,6 @@ qemu_src_configure() {
$(conf_softmmu bpf)
$(conf_notuser bzip2)
$(conf_notuser capstone)
$(conf_notuser caps cap-ng)
$(conf_notuser curl)
$(conf_tools doc docs)
$(conf_notuser fdt)
@ -540,13 +572,12 @@ qemu_src_configure() {
$(conf_notuser numa)
$(conf_notuser opengl)
$(conf_notuser pam auth-pam)
$(conf_notuser png vnc-png)
$(conf_notuser png)
$(conf_notuser rbd)
$(conf_notuser sasl vnc-sasl)
$(conf_notuser sdl)
$(conf_softmmu sdl-image)
$(conf_notuser seccomp)
$(conf_notuser slirp slirp system)
$(conf_notuser slirp)
$(conf_notuser smartcard)
$(conf_notuser snappy)
$(conf_notuser spice)
@ -556,8 +587,6 @@ qemu_src_configure() {
$(conf_notuser usbredir usb-redir)
$(conf_notuser vde)
$(conf_notuser vhost-net)
$(conf_notuser vhost-user-fs)
$(conf_tools vhost-user-fs virtiofsd)
$(conf_notuser virgl virglrenderer)
$(conf_softmmu virtfs)
$(conf_notuser vnc)
@ -592,6 +621,8 @@ qemu_src_configure() {
--disable-system
--disable-blobs
--disable-tools
--disable-cap-ng
--disable-seccomp
)
local static_flag="static-user"
;;
@ -600,6 +631,8 @@ qemu_src_configure() {
--disable-linux-user
--enable-system
--disable-tools
--enable-cap-ng
--enable-seccomp
)
local static_flag="static"
;;
@ -609,6 +642,8 @@ qemu_src_configure() {
--disable-system
--disable-blobs
--enable-tools
--enable-cap-ng
--enable-seccomp
)
local static_flag="static"
;;
@ -673,22 +708,22 @@ src_configure() {
src_compile() {
if [[ -n ${user_targets} ]]; then
cd "${S}/user-build"
cd "${S}/user-build" || die
default
fi
if [[ -n ${softmmu_targets} ]]; then
cd "${S}/softmmu-build"
cd "${S}/softmmu-build" || die
default
fi
cd "${S}/tools-build"
cd "${S}/tools-build" || die
default
}
src_test() {
if [[ -n ${softmmu_targets} ]]; then
cd "${S}/softmmu-build"
cd "${S}/softmmu-build" || die
pax-mark m */qemu-system-* #515550
emake check
fi
@ -785,19 +820,24 @@ src_install() {
fi
fi
cd "${S}/tools-build"
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
pushd "${ED}"/usr/bin >/dev/null || die
pax-mark mr "${softmmu_bins[@]}" "${user_bins[@]}" # bug 575594
popd >/dev/null
popd >/dev/null || die
# Install config file example for qemu-bridge-helper
insinto "/etc/qemu"
doins "${FILESDIR}/bridge.conf"
cd "${S}"
cd "${S}" || die
dodoc MAINTAINERS docs/specs/pci-ids.txt
newdoc pc-bios/README README.pc-bios
@ -806,10 +846,7 @@ src_install() {
if [[ -n ${softmmu_targets} ]]; then
# Remove SeaBIOS since we're using the SeaBIOS packaged one
rm "${ED}/usr/share/qemu/bios.bin"
rm "${ED}/usr/share/qemu/bios-256k.bin"
if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
dosym ../seabios/bios.bin /usr/share/qemu/bios.bin
dosym ../seabios/bios-256k.bin /usr/share/qemu/bios-256k.bin
fi
@ -820,6 +857,7 @@ src_install() {
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
@ -831,13 +869,11 @@ src_install() {
fi
# Remove sgabios since we're using the sgabios packaged one
rm "${ED}/usr/share/qemu/sgabios.bin"
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
rm "${ED}"/usr/share/qemu/pxe-*.rom
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
@ -870,16 +906,27 @@ pkg_postinst() {
xdg_icon_cache_update
[[ -z ${EPREFIX} ]] && [[ -f ${EROOT}/usr/libexec/qemu-bridge-helper ]] && \
fcaps cap_net_admin ${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)"
ewarn " $(best_version sys-firmware/ipxe)"
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"
@ -893,22 +940,24 @@ pkg_postinst() {
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)"
if has_version 'sys-firmware/edk2-ovmf[binary]'; then
echo " USE=binary"
else
echo " USE=''"
fi
echo " $(best_version sys-firmware/ipxe)"
if has_version 'sys-firmware/seabios-bin'; then
echo " $(best_version sys-firmware/seabios-bin)"
else
echo " $(best_version sys-firmware/seabios)"
if has_version 'sys-firmware/seabios[binary]'; then
echo " USE=binary"
else
echo " USE=''"
fi
echo " $(best_version sys-firmware/ipxe)"
echo " $(best_version sys-firmware/sgabios)"
}
pkg_postrm() {
xdg_icon_cache_update
udev_reload
}

View File

@ -1,20 +1,32 @@
# Copyright 1999-2022 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{8,9,10} )
# 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:=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_{9,10,11} )
PYTHON_REQ_USE="ncurses,readline"
FIRMWARE_ABI_VERSION="6.2.0"
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
if [[ ${PV} == *9999* ]]; then
QEMU_DOCS_PREBUILT=0
EGIT_REPO_URI="https://gitlab.com/qemu-project/qemu.git/"
EGIT_SUBMODULES=(
meson
tests/fp/berkeley-softfloat-3
tests/fp/berkeley-testfloat-3
ui/keycodemapdb
@ -22,8 +34,15 @@ if [[ ${PV} = *9999* ]]; then
inherit git-r3
SRC_URI=""
else
SRC_URI="https://download.qemu.org/${P}.tar.xz"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~x86"
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"
@ -32,7 +51,9 @@ HOMEPAGE="https://www.qemu.org https://www.linux-kvm.org"
LICENSE="GPL-2 LGPL-2 BSD-2"
SLOT="0"
IUSE="accessibility +aio alsa bpf bzip2 capstone +caps +curl debug +doc
[[ ${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
lzo multipath
@ -40,7 +61,7 @@ IUSE="accessibility +aio alsa bpf bzip2 capstone +caps +curl debug +doc
plugins +png pulseaudio python rbd sasl +seccomp sdl sdl-image selinux
+slirp
smartcard snappy spice ssh static static-user systemtap test udev usb
usbredir vde +vhost-net vhost-user-fs virgl virtfs +vnc vte xattr xen
usbredir vde +vhost-net virgl virtfs +vnc vte xattr xen
zstd"
COMMON_TARGETS="
@ -50,6 +71,7 @@ COMMON_TARGETS="
cris
hppa
i386
loongarch64
m68k
microblaze
microblazeel
@ -94,9 +116,11 @@ 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}
REQUIRED_USE="
${PYTHON_REQUIRED_USE}
qemu_softmmu_targets_arm? ( fdt )
qemu_softmmu_targets_microblaze? ( fdt )
qemu_softmmu_targets_mips64el? ( fdt )
@ -108,14 +132,16 @@ REQUIRED_USE="${PYTHON_REQUIRED_USE}
sdl-image? ( sdl )
static? ( static-user !alsa !gtk !jack !opengl !pam !pulseaudio !plugins !rbd !snappy !udev )
static-user? ( !plugins )
vhost-user-fs? ( caps seccomp )
virgl? ( opengl )
virtfs? ( caps xattr )
virtfs? ( xattr )
vnc? ( gnutls )
vte? ( gtk )
multipath? ( udev )
plugins? ( !static !static-user )
"
for smname in ${IUSE_SOFTMMU_TARGETS} ; do
REQUIRED_USE+=" qemu_softmmu_targets_${smname}? ( seccomp ) "
done
# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...)
# and user/softmmu targets (qemu-*, qemu-system-*).
@ -135,6 +161,7 @@ ALL_DEPEND="
# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...)
# softmmu targets (qemu-system-*).
SOFTMMU_TOOLS_DEPEND="
sys-libs/libcap-ng[static-libs(+)]
>=x11-libs/pixman-0.28.0[static-libs(+)]
accessibility? (
app-accessibility/brltty[api]
@ -145,9 +172,8 @@ SOFTMMU_TOOLS_DEPEND="
bpf? ( dev-libs/libbpf:= )
bzip2? ( app-arch/bzip2[static-libs(+)] )
capstone? ( dev-libs/capstone:= )
caps? ( sys-libs/libcap-ng[static-libs(+)] )
curl? ( >=net-misc/curl-7.15.4[static-libs(+)] )
fdt? ( >=sys-apps/dtc-1.5.0[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? (
@ -163,7 +189,7 @@ SOFTMMU_TOOLS_DEPEND="
io-uring? ( sys-libs/liburing:=[static-libs(+)] )
jack? ( virtual/jack )
jemalloc? ( dev-libs/jemalloc )
jpeg? ( virtual/jpeg:0=[static-libs(+)] )
jpeg? ( media-libs/libjpeg-turbo:=[static-libs(+)] )
lzo? ( dev-libs/lzo:2[static-libs(+)] )
multipath? ( sys-fs/multipath-tools )
ncurses? (
@ -207,34 +233,44 @@ SOFTMMU_TOOLS_DEPEND="
zstd? ( >=app-arch/zstd-1.4.0[static-libs(+)] )
"
EDK2_OVMF_VERSION="202105"
SEABIOS_VERSION="1.14.0"
EDK2_OVMF_VERSION="202202"
SEABIOS_VERSION="1.16.0"
X86_FIRMWARE_DEPEND="
pin-upstream-blobs? (
~sys-firmware/edk2-ovmf-${EDK2_OVMF_VERSION}[binary]
~sys-firmware/edk2-ovmf-bin-${EDK2_OVMF_VERSION}
~sys-firmware/ipxe-1.21.1[binary,qemu]
~sys-firmware/seabios-${SEABIOS_VERSION}[binary,seavgabios]
~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-${SEABIOS_VERSION}[binary,seavgabios]
~sys-firmware/seabios-bin-${SEABIOS_VERSION}
)
!pin-upstream-blobs? (
|| (
>=sys-firmware/seabios-${SEABIOS_VERSION}[seavgabios]
>=sys-firmware/seabios-bin-${SEABIOS_VERSION}
)
)
"
BDEPEND="
$(python_gen_impl_dep)
dev-lang/perl
dev-util/meson
sys-apps/texinfo
virtual/pkgconfig
doc? (
@ -272,11 +308,10 @@ RDEPEND="${CDEPEND}
)"
PATCHES=(
"${FILESDIR}"/${PN}-2.11.1-capstone_include_path.patch
"${FILESDIR}"/${PN}-5.2.0-disable-keymap.patch
"${FILESDIR}"/${PN}-6.0.0-make.patch
"${FILESDIR}"/${PN}-6.1.0-strings.patch
"${FILESDIR}"/${PN}-7.0.0-also-build-virtfs-proxy-helper.patch
"${FILESDIR}"/${PN}-7.1.0-also-build-virtfs-proxy-helper.patch
"${FILESDIR}"/${PN}-7.1.0-capstone-include-path.patch
)
QA_PREBUILT="
@ -416,8 +451,13 @@ src_prepare() {
# Verbose builds
MAKEOPTS+=" V=1"
# Remove bundled copy of libfdt
rm -r dtc || die
# We already force -D_FORTIFY_SOURCE=2 (or 3) in our toolchain, but
# this setting (-U then -D..=2) will prevent us from trying out 3, so
# drop it. No change to level of protection b/c we patch our toolchain.
sed -i -e 's/-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2//' configure || die
# Remove bundled modules
rm -r dtc meson roms/*/ || die
}
##
@ -430,7 +470,7 @@ qemu_src_configure() {
local buildtype=$1
local builddir="${S}/${buildtype}-build"
mkdir "${builddir}"
mkdir "${builddir}" || die
local conf_opts=(
--prefix=/usr
@ -462,10 +502,10 @@ qemu_src_configure() {
# are enabled), but it's not really worth the hassle. Disable it
# all the time to avoid automatically detecting it. #568856
--disable-gcrypt
--python="${PYTHON}"
--cc="$(tc-getCC)"
--cxx="$(tc-getCXX)"
--host-cc="$(tc-getBUILD_CC)"
$(use_enable alsa)
$(use_enable debug debug-info)
$(use_enable debug debug-tcg)
@ -516,7 +556,6 @@ qemu_src_configure() {
$(conf_softmmu bpf)
$(conf_notuser bzip2)
$(conf_notuser capstone)
$(conf_notuser caps cap-ng)
$(conf_notuser curl)
$(conf_tools doc docs)
$(conf_notuser fdt)
@ -538,13 +577,13 @@ qemu_src_configure() {
$(conf_notuser numa)
$(conf_notuser opengl)
$(conf_notuser pam auth-pam)
$(conf_notuser png vnc-png)
$(conf_notuser png)
$(conf_notuser rbd)
$(conf_notuser sasl vnc-sasl)
$(conf_notuser sdl)
$(conf_softmmu sdl-image)
$(conf_notuser seccomp)
$(conf_notuser slirp slirp system)
$(conf_notuser slirp)
$(conf_notuser smartcard)
$(conf_notuser snappy)
$(conf_notuser spice)
@ -554,8 +593,6 @@ qemu_src_configure() {
$(conf_notuser usbredir usb-redir)
$(conf_notuser vde)
$(conf_notuser vhost-net)
$(conf_notuser vhost-user-fs)
$(conf_tools vhost-user-fs virtiofsd)
$(conf_notuser virgl virglrenderer)
$(conf_softmmu virtfs)
$(conf_notuser vnc)
@ -590,6 +627,8 @@ qemu_src_configure() {
--disable-system
--disable-blobs
--disable-tools
--disable-cap-ng
--disable-seccomp
)
local static_flag="static-user"
;;
@ -598,6 +637,8 @@ qemu_src_configure() {
--disable-linux-user
--enable-system
--disable-tools
--enable-cap-ng
--enable-seccomp
)
local static_flag="static"
;;
@ -607,6 +648,7 @@ qemu_src_configure() {
--disable-system
--disable-blobs
--enable-tools
--enable-cap-ng
)
local static_flag="static"
;;
@ -671,22 +713,22 @@ src_configure() {
src_compile() {
if [[ -n ${user_targets} ]]; then
cd "${S}/user-build"
cd "${S}/user-build" || die
default
fi
if [[ -n ${softmmu_targets} ]]; then
cd "${S}/softmmu-build"
cd "${S}/softmmu-build" || die
default
fi
cd "${S}/tools-build"
cd "${S}/tools-build" || die
default
}
src_test() {
if [[ -n ${softmmu_targets} ]]; then
cd "${S}/softmmu-build"
cd "${S}/softmmu-build" || die
pax-mark m */qemu-system-* #515550
emake check
fi
@ -783,19 +825,24 @@ src_install() {
fi
fi
cd "${S}/tools-build"
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
pushd "${ED}"/usr/bin >/dev/null || die
pax-mark mr "${softmmu_bins[@]}" "${user_bins[@]}" # bug 575594
popd >/dev/null
popd >/dev/null || die
# Install config file example for qemu-bridge-helper
insinto "/etc/qemu"
doins "${FILESDIR}/bridge.conf"
cd "${S}"
cd "${S}" || die
dodoc MAINTAINERS docs/specs/pci-ids.txt
newdoc pc-bios/README README.pc-bios
@ -804,10 +851,7 @@ src_install() {
if [[ -n ${softmmu_targets} ]]; then
# Remove SeaBIOS since we're using the SeaBIOS packaged one
rm "${ED}/usr/share/qemu/bios.bin"
rm "${ED}/usr/share/qemu/bios-256k.bin"
if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
dosym ../seabios/bios.bin /usr/share/qemu/bios.bin
dosym ../seabios/bios-256k.bin /usr/share/qemu/bios-256k.bin
fi
@ -818,6 +862,7 @@ src_install() {
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
@ -829,13 +874,11 @@ src_install() {
fi
# Remove sgabios since we're using the sgabios packaged one
rm "${ED}/usr/share/qemu/sgabios.bin"
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
rm "${ED}"/usr/share/qemu/pxe-*.rom
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
@ -868,16 +911,27 @@ pkg_postinst() {
xdg_icon_cache_update
[[ -z ${EPREFIX} ]] && [[ -f ${EROOT}/usr/libexec/qemu-bridge-helper ]] && \
fcaps cap_net_admin ${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)"
ewarn " $(best_version sys-firmware/ipxe)"
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"
@ -891,22 +945,24 @@ pkg_postinst() {
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)"
if has_version 'sys-firmware/edk2-ovmf[binary]'; then
echo " USE=binary"
else
echo " USE=''"
fi
echo " $(best_version sys-firmware/ipxe)"
if has_version 'sys-firmware/seabios-bin'; then
echo " $(best_version sys-firmware/seabios-bin)"
else
echo " $(best_version sys-firmware/seabios)"
if has_version 'sys-firmware/seabios[binary]'; then
echo " USE=binary"
else
echo " USE=''"
fi
echo " $(best_version sys-firmware/ipxe)"
echo " $(best_version sys-firmware/sgabios)"
}
pkg_postrm() {
xdg_icon_cache_update
udev_reload
}

View File

@ -1,3 +1,2 @@
DIST elt-patches-20201205.tar.xz 39240 BLAKE2B aa2e2377f0d0cba14f38c59664174d066eff04c9d2a71346c998c4324987fbce25cfd91b79e8e40bde0d81bf7d3c43126bffd0a6b0b219aaad11f4f9f22abde4 SHA512 67e199f060e2c93e01b7a7809f52c0a18d82e86f1b1eb34b965c2acd24e5538a874b820028e363d3002cf58b43c2fe3376ae28d2bef0ca81feabb90c83ae47c2
DIST elt-patches-20210924.tar.xz 40140 BLAKE2B 81970936e9a362cb9ee51a381e4fd2f888c62df2fdcf7af419c3574d37857988c92daa3b1b90530f453aa532161dd0bdd3697d4c3b0a0a47a05a7546e7fd5052 SHA512 3a55d053e488590a78bbfe0a4eb3153ea51ca70784708e0131016771a1c1dab591a42442b2d97d1a335c9a209fc03410df3cd56741d6f7cffb92d0737c5944c2
DIST elt-patches-20211104.tar.xz 41608 BLAKE2B 971ec0f6753267d49a64ab65645ac547322fa4cfe64b3102bbaa4419c0ed0973c0ee44e40c15b2d34e94979cbe9c64b027f4bb7c5adf3d3acee07f3f98bd7704 SHA512 c583bfa45eb16835f83a881eb587c81f0fb2cfd3eff5239e794efb83c046f5cecceeee3f5387585b9d7f68efe5f439344d2cdfc83c9fad5b207e82dff3d8cc67
DIST elt-patches-20220831.tar.xz 41696 BLAKE2B c328faac2bc837fff5b9ec7dd2a891d3ab08ee30fb38d838fa6aeebbb832eb30db1f3d3b05e64c14f9cef27a21516cb6d960d7afe2314f37e25a0f77ef5d2862 SHA512 3cced1f515533ce65cef42a3c697ad0686a6c41a1b734c4558690cbdee4ebe60214b3d7f8dbb81974fc100a6882d83599f2dc77c206d9beea2449b2614319d1c
DIST elt-patches-20221210.tar.xz 42080 BLAKE2B abcdae6dedac89bd913d6809d335c13cd59b675c4b68198925bf758013e988a9bf82e9f6ccc3a70ac1c49775bb7579addda6c0bb7ea4ceea3c4b8e4acf0d65ea SHA512 3dad3c0be8d69de731bb10d5a6007539c2966f8a370a3dee27faf9655a38e39f272a9059cd98c8b6f32c2495143667f8b28a6a3425f22c0c5421f3969b417cf7

View File

@ -1,23 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
DESCRIPTION="Collection of patches for libtool.eclass"
HOMEPAGE="https://gitweb.gentoo.org/proj/elt-patches.git/"
SRC_URI="https://dev.gentoo.org/~grobian/distfiles/${P}.tar.xz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~arm64-linux ~ppc64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
RDEPEND="sys-apps/gentoo-functions"
BDEPEND="app-arch/xz-utils"
src_compile() {
emake rootprefix="${EPREFIX}" libdirname="$(get_libdir)"
}
src_install() {
emake DESTDIR="${D}" rootprefix="${EPREFIX}" install
}

View File

@ -1,7 +1,7 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
EAPI=8
DESCRIPTION="Collection of patches for libtool.eclass"
HOMEPAGE="https://gitweb.gentoo.org/proj/elt-patches.git/"
@ -11,7 +11,7 @@ SRC_URI="https://dev.gentoo.org/~grobian/distfiles/${P}.tar.xz
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~arm64-linux ~ppc64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~arm64-linux ~ppc64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
RDEPEND="sys-apps/gentoo-functions"
BDEPEND="app-arch/xz-utils"

View File

@ -1,16 +1,17 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
EAPI=8
DESCRIPTION="Collection of patches for libtool.eclass"
HOMEPAGE="https://gitweb.gentoo.org/proj/elt-patches.git/"
SRC_URI="https://dev.gentoo.org/~grobian/distfiles/${P}.tar.xz
https://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
https://dev.gentoo.org/~vapier/dist/${P}.tar.xz
https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}.tar.xz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~arm64-linux ~ppc64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~arm64-linux ~ppc64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
RDEPEND="sys-apps/gentoo-functions"
BDEPEND="app-arch/xz-utils"

View File

@ -4,4 +4,8 @@
<maintainer type="project">
<email>base-system@gentoo.org</email>
</maintainer>
<upstream>
<remote-id type="gentoo">proj/elt-patches</remote-id>
<remote-id type="github">gentoo/elt-patches</remote-id>
</upstream>
</pkgmetadata>

View File

@ -0,0 +1 @@
- SDK: qemu ([CVE-2020-14394](https://nvd.nist.gov/vuln/detail/CVE-2020-14394), [CVE-2022-0216](https://nvd.nist.gov/vuln/detail/CVE-2022-0216), [CVE-2022-35414](https://nvd.nist.gov/vuln/detail/CVE-2022-35414), [CVE-2022-3872](https://nvd.nist.gov/vuln/detail/CVE-2022-3872))

View File

@ -0,0 +1,5 @@
- libcap-ng ([0.8.3](https://people.redhat.com/sgrubb/libcap-ng/ChangeLog))
- elfutils ([0.188](https://sourceware.org/pipermail/elfutils-devel/2022q4/005561.html) (includes [0.187](https://sourceware.org/pipermail/elfutils-devel/2022q2/004978.html))
- nettle ([3.8.1](https://git.lysator.liu.se/nettle/nettle/-/blob/990abad16ceacd070747dcc76ed16a39c129321e/ChangeLog))
- SDK: libpng ([1.6.39](http://www.libpng.org/pub/png/src/libpng-1.6.39-README.txt) (includes [1.6.38](http://www.libpng.org/pub/png/src/libpng-1.6.38-README.txt)))
- SDK: qemu ([7.1.0](https://wiki.qemu.org/ChangeLog/7.1))

View File

@ -1,4 +1,3 @@
DIST elfutils-0.185-patches.tar.gz 7625 BLAKE2B 92aff147aa7e45976863e8129e25ecad74ad9bca231c9223897094c5933c3b350eb525a203b492d80c1eabee3b3808b43e30bdb879d7173eac968afa2005e97c SHA512 3f253c4de97190731ac157044572912b76df80f9473f3df335f0383dad6409f987593a749c5284672cf1b20241ac3ed9d77b126f730aaf594725703b6a426906
DIST elfutils-0.185.tar.bz2 9187627 BLAKE2B 57cfa7e4060975c4bf6170dbd354687a19a92f7069c060db1ac2fa4da5a9d34e8bddd07c7ce376b5c28b5670ad5b8c1df795164cbcfb600a44cf1db60c20c4af SHA512 34de0de1355b11740e036e0fc64f2fc063587c8eb121b19216ee5548d3f0f268d8fc3995176c47190466b9d881007cfa11a9d01e9a50e38af6119492bf8bb47f
DIST elfutils-0.186-patches.tar.gz 3323 BLAKE2B 360365597d3a08d6f4fe843d04bcddd07a44ca93dae2034615abc450517e1be21c81a55aa379c409902e134ae795b38bb7461c65cdba3934ac7ef1e4e0e53091 SHA512 e2d427be505fdc416751a1fbc3bb4f39577859d94ce43990faa83c135fe36be2ddb3a2ef0f1020cfa37060e6d43dc7b8cf3db0d07d62b31bf29cb9a4a5945ce1
DIST elfutils-0.186.tar.bz2 9230491 BLAKE2B 49573d0a1f3519eab81d1ba3e94354cbc0935a36a94a3fdb22fe223a47b78cca8fd6e322870b0e335a809529fa6f54180b13c67936dec0242123c54ba20c9fc9 SHA512 c9180b27ec62935f18b9431268d176f6023d1bb938731d2af6e7626ae460af6608a70ba68483aa1ec7e6cb0fa0528b661ca8b68bc4f58ea8e18af527c5950c78
DIST elfutils-0.187-patches.tar.xz 2804 BLAKE2B 77cbd0666d8da3d5229baaba6605c84e7990200f39bfb72b2008eb2527e4567abd90c93c291cc0c8f3c10bbf97758ccf5877cbdae823780cf8dc97ff4ff2f932 SHA512 d056fdd6ae0e71471087af472a72384d6e73ff2d7fe1b708b5ec9f091a913c8327197660132b7a6619a0db86534715507ef67ee91691a00a591c1d24c55a99f4
DIST elfutils-0.188.tar.bz2 9112977 BLAKE2B 6b0474f1436eaf6af73b735b9b2ddd5448ab9c03fbaa0be745a31c89ae8f15b0e21a651409c38643ca125794ce82c19d7b46db4a079f3e72cb919d643560e7a4 SHA512 585551b2d937d19d1becfc2f28935db1dd1a3d25571a62f322b70ac8da98c1a741a55d070327705df6c3e2ee026652e0b9a3c733b050a0b0ec5f2fc75d5b74b5
DIST elfutils-0.188.tar.bz2.sig 310 BLAKE2B c8d9135cffde3b1dd337b692d5351855cf799915d3ebd553327febaac192bd2f108b3f45a6376d458e179390a1ceaf4809762cdc40ea1e05fed0214ac33ed56e SHA512 4cc8a7417d244e319a1650d71b1831660cfe41afc7c73e9c83d1f076f4013fe15247e8b4f5e12a5396d83c4f1c7663ca4be5ea42bff3dc23263f85331fd9d566

View File

@ -1,95 +0,0 @@
# Copyright 2003-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit flag-o-matic multilib-minimal
DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)"
HOMEPAGE="http://elfutils.org/"
SRC_URI="https://sourceware.org/elfutils/ftp/${PV}/${P}.tar.bz2"
SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${PN}-0.185-patches.tar.gz"
LICENSE="|| ( GPL-2+ LGPL-3+ ) utils? ( GPL-3+ )"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
IUSE="bzip2 lzma nls static-libs test +threads +utils valgrind zstd"
RDEPEND=">=sys-libs/zlib-1.2.8-r1[static-libs?,${MULTILIB_USEDEP}]
bzip2? ( >=app-arch/bzip2-1.0.6-r4[static-libs?,${MULTILIB_USEDEP}] )
lzma? ( >=app-arch/xz-utils-5.0.5-r1[static-libs?,${MULTILIB_USEDEP}] )
zstd? ( app-arch/zstd:=[static-libs?,${MULTILIB_USEDEP}] )
elibc_musl? (
dev-libs/libbsd
sys-libs/argp-standalone
sys-libs/fts-standalone
sys-libs/obstack-standalone
)
!dev-libs/libelf
"
DEPEND="${RDEPEND}
valgrind? ( dev-util/valgrind )
"
BDEPEND="nls? ( sys-devel/gettext )
>=sys-devel/flex-2.5.4a
sys-devel/m4
"
RESTRICT="!test? ( test )"
PATCHES=(
"${WORKDIR}"/${PN}-0.185-patches/
)
src_prepare() {
default
if use elibc_musl; then
eapply "${WORKDIR}"/${PN}-0.185-patches/musl/
fi
if ! use static-libs; then
sed -i -e '/^lib_LIBRARIES/s:=.*:=:' -e '/^%.os/s:%.o$::' lib{asm,dw,elf}/Makefile.in || die
fi
# https://sourceware.org/PR23914
sed -i 's:-Werror::' */Makefile.in || die
}
src_configure() {
use test && append-flags -g #407135
# Symbol aliases are implemented as asm statements.
# Will require porting: https://gcc.gnu.org/PR48200
filter-flags '-flto*'
multilib-minimal_src_configure
}
multilib_src_configure() {
ECONF_SOURCE="${S}" econf \
$(use_enable nls) \
$(use_enable threads thread-safety) \
$(use_enable valgrind) \
--disable-debuginfod \
--disable-libdebuginfod \
--program-prefix="eu-" \
--with-zlib \
$(use_with bzip2 bzlib) \
$(use_with lzma) \
$(use_with zstd)
}
multilib_src_test() {
env LD_LIBRARY_PATH="${BUILD_DIR}/libelf:${BUILD_DIR}/libebl:${BUILD_DIR}/libdw:${BUILD_DIR}/libasm" \
LC_ALL="C" \
emake check VERBOSE=1
}
multilib_src_install_all() {
einstalldocs
dodoc NOTES
# These build quick, and are needed for most tests, so don't
# disable their building when the USE flag is disabled.
if ! use utils; then
rm -rf "${ED}"/usr/bin || die
fi
}

View File

@ -1,21 +1,26 @@
# Copyright 2003-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EAPI=8
inherit flag-o-matic multilib-minimal
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/elfutils.gpg
inherit flag-o-matic multilib-minimal verify-sig
DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)"
HOMEPAGE="https://elfutils.org/"
HOMEPAGE="https://sourceware.org/elfutils/"
SRC_URI="https://sourceware.org/elfutils/ftp/${PV}/${P}.tar.bz2"
SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${PN}-0.186-patches.tar.gz"
SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${PN}-0.187-patches.tar.xz"
SRC_URI+=" verify-sig? ( https://sourceware.org/elfutils/ftp/${PV}/${P}.tar.bz2.sig )"
LICENSE="|| ( GPL-2+ LGPL-3+ ) utils? ( GPL-3+ )"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
IUSE="bzip2 lzma nls static-libs test +threads +utils valgrind zstd"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
IUSE="bzip2 lzma nls static-libs test +utils valgrind zstd"
RESTRICT="!test? ( test )"
RDEPEND=">=sys-libs/zlib-1.2.8-r1[static-libs?,${MULTILIB_USEDEP}]
RDEPEND="
!dev-libs/libelf
>=sys-libs/zlib-1.2.8-r1[static-libs?,${MULTILIB_USEDEP}]
bzip2? ( >=app-arch/bzip2-1.0.6-r4[static-libs?,${MULTILIB_USEDEP}] )
lzma? ( >=app-arch/xz-utils-5.0.5-r1[static-libs?,${MULTILIB_USEDEP}] )
zstd? ( app-arch/zstd:=[static-libs?,${MULTILIB_USEDEP}] )
@ -25,26 +30,36 @@ RDEPEND=">=sys-libs/zlib-1.2.8-r1[static-libs?,${MULTILIB_USEDEP}]
sys-libs/fts-standalone
sys-libs/obstack-standalone
)
!dev-libs/libelf
"
DEPEND="${RDEPEND}
DEPEND="
${RDEPEND}
valgrind? ( dev-util/valgrind )
"
BDEPEND="nls? ( sys-devel/gettext )
BDEPEND="
>=sys-devel/flex-2.5.4a
sys-devel/m4
nls? ( sys-devel/gettext )
verify-sig? ( sec-keys/openpgp-keys-elfutils )
"
RESTRICT="!test? ( test )"
PATCHES=(
"${WORKDIR}"/${PN}-0.186-patches/
"${WORKDIR}"/${PN}-0.187-patches/
)
src_unpack() {
if use verify-sig ; then
# Needed for downloaded patch (which is unsigned, which is fine)
verify-sig_verify_detached "${DISTDIR}"/${P}.tar.bz2{,.sig}
fi
default
}
src_prepare() {
default
if use elibc_musl; then
eapply "${WORKDIR}"/${PN}-0.186-patches/musl/
eapply "${WORKDIR}"/${PN}-0.187-patches/musl/
fi
if ! use static-libs; then
@ -56,7 +71,8 @@ src_prepare() {
}
src_configure() {
use test && append-flags -g #407135
# bug #407135
use test && append-flags -g
# Symbol aliases are implemented as asm statements.
# Will require porting: https://gcc.gnu.org/PR48200
@ -66,17 +82,26 @@ src_configure() {
}
multilib_src_configure() {
ECONF_SOURCE="${S}" econf \
$(use_enable nls) \
$(use_enable threads thread-safety) \
$(use_enable valgrind) \
--disable-debuginfod \
--disable-libdebuginfod \
--program-prefix="eu-" \
--with-zlib \
$(use_with bzip2 bzlib) \
$(use_with lzma) \
local myeconfargs=(
$(use_enable nls)
--disable-debuginfod
--disable-libdebuginfod
# explicitly disable thread safety, it's not recommended by upstream
# doesn't build either on musl.
--disable-thread-safety
# Valgrind option is just for running tests under it; dodgy under sandbox
# and indeed even w/ glibc with newer instructions.
--disable-valgrind
--program-prefix="eu-"
--with-zlib
$(use_with bzip2 bzlib)
$(use_with lzma)
$(use_with zstd)
)
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
}
multilib_src_test() {
@ -87,7 +112,9 @@ multilib_src_test() {
multilib_src_install_all() {
einstalldocs
dodoc NOTES
# These build quick, and are needed for most tests, so don't
# disable their building when the USE flag is disabled.
if ! use utils; then

View File

@ -7,7 +7,6 @@
</maintainer>
<use>
<flag name="lzma">Support automatic decompression of LZMA-compressed files and kernel images</flag>
<flag name="threads">Build the libraries with thread safe support</flag>
<flag name="utils">Install command-line utilities (all the eu-* programs)</flag>
<flag name="valgrind">Add support for memory debugging using <pkg>dev-util/valgrind</pkg></flag>
</use>

View File

@ -1,2 +1,3 @@
DIST gmp-6.2.1-arm64-darwin.patch.bz2 2520 BLAKE2B 3d4e9dbd29dc9aa81f0c9e0de4a5904c989d54148c9e3dcc5097a43b3fb1ecd17802dacfc71ee131c0805a345f5dce9009e88439758d3a0ed8b3a88526353b4a SHA512 72d49f09c3facd75036c945e076207e72e5673ba9605999c32a122e43e8b970ed646c8ca8f07acbb62bff5e7c387d4c8e1f73ca73e50ac3f574b5f6471d66d56
DIST gmp-6.2.1.tar.xz 2027316 BLAKE2B c0d85f175392a50cfa01bc6b0a312b235946ad8b4f6f84f6dabd33d7a6f2cc75c9b0e1e33057be07750bfa0145b7c4cf3b6188a5be6ca9d7271ec2276c84ebcb SHA512 c99be0950a1d05a0297d65641dd35b75b74466f7bf03c9e8a99895a3b2f9a0856cd17887738fa51cf7499781b65c049769271cbcb77d057d2e9f1ec52e07dd84
DIST gmp-man-6.2.1.pdf 827583 BLAKE2B 9aa25457a3c488e37cc7d54d825253ab749a3780919570579b319cf607001de50b212ca387b70213abcc5ab428b4525bdb9cd8ae932798a2d7928da98ce3f353 SHA512 f2d9d02e97975355ef490e921fedc94fb7687c3661eec8fa2e94a1622b6e59b17b3879eb3ec1f2df8edac100f727175144d107f4c49c602b773c43bc9e91dbcb

View File

@ -0,0 +1,17 @@
https://bugs.gentoo.org/823804
https://gmplib.org/repo/gmp-6.2/rev/561a9c25298e
--- a/mpz/inp_raw.c
+++ b/mpz/inp_raw.c
@@ -88,8 +88,11 @@ mpz_inp_raw (mpz_ptr x, FILE *fp)
abs_csize = ABS (csize);
+ if (UNLIKELY (abs_csize > ~(mp_bitcnt_t) 0 / 8))
+ return 0; /* Bit size overflows */
+
/* round up to a multiple of limbs */
- abs_xsize = BITS_TO_LIMBS (abs_csize*8);
+ abs_xsize = BITS_TO_LIMBS ((mp_bitcnt_t) abs_csize * 8);
if (abs_xsize != 0)
{

View File

@ -1,9 +1,9 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit flag-o-matic libtool multilib-minimal toolchain-funcs
inherit libtool multilib-minimal toolchain-funcs
MY_PV=${PV/_p*}
MY_PV=${MY_PV/_/-}
@ -13,14 +13,17 @@ MY_P=${PN}-${MY_PV}
PLEVEL=${PV/*p}
DESCRIPTION="Library for arbitrary-precision arithmetic on different type of numbers"
HOMEPAGE="https://gmplib.org/"
SRC_URI="ftp://ftp.gmplib.org/pub/${MY_P}/${MY_P}.tar.xz
SRC_URI="
https://gmplib.org/download/gmp/${MY_P}.tar.xz
mirror://gnu/${PN}/${MY_P}.tar.xz
doc? ( https://gmplib.org/${PN}-man-${MANUAL_PV}.pdf )"
doc? ( https://gmplib.org/${PN}-man-${MANUAL_PV}.pdf )
"
SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-arm64-darwin.patch.bz2"
LICENSE="|| ( LGPL-3+ GPL-2+ )"
# The subslot reflects the C & C++ SONAMEs.
SLOT="0/10.4"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="+asm doc +cxx pic static-libs"
BDEPEND="sys-devel/m4
@ -35,6 +38,8 @@ MULTILIB_WRAPPED_HEADERS=( /usr/include/gmp.h )
PATCHES=(
"${FILESDIR}"/${PN}-6.1.0-noexecstack-detect.patch
"${FILESDIR}"/${PN}-6.2.1-no-zarch.patch
"${WORKDIR}"/${P}-arm64-darwin.patch
"${FILESDIR}"/${P}-CVE-2021-43618.patch
)
src_prepare() {
@ -75,11 +80,6 @@ multilib_src_configure() {
esac
export GMPABI
# bug #367719
if [[ ${CHOST} == *-mint* ]]; then
filter-flags -O?
fi
tc-export CC
# --with-pic forces static libraries to be built as PIC

View File

@ -0,0 +1,178 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit gnuconfig libtool multilib-minimal toolchain-funcs
MY_PV=${PV/_p*}
MY_PV=${MY_PV/_/-}
MANUAL_PV=${MY_PV}
MANUAL_PV=6.2.1
MY_P=${PN}-${MY_PV}
PLEVEL=${PV/*p}
DESCRIPTION="Library for arbitrary-precision arithmetic on different type of numbers"
HOMEPAGE="https://gmplib.org/"
SRC_URI="
https://gmplib.org/download/gmp/${MY_P}.tar.xz
mirror://gnu/${PN}/${MY_P}.tar.xz
doc? ( https://gmplib.org/${PN}-man-${MANUAL_PV}.pdf )
"
SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-arm64-darwin.patch.bz2"
S="${WORKDIR}"/${MY_P%a}
LICENSE="|| ( LGPL-3+ GPL-2+ )"
# The subslot reflects the C & C++ SONAMEs.
SLOT="0/10.4"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="+asm doc +cpudetection +cxx pic static-libs"
REQUIRED_USE="cpudetection? ( asm )"
RESTRICT="!cpudetection? ( bindist )"
BDEPEND="
app-arch/xz-utils
sys-devel/m4
"
DOCS=( AUTHORS ChangeLog NEWS README doc/configuration doc/isa_abi_headache )
HTML_DOCS=( doc )
MULTILIB_WRAPPED_HEADERS=( /usr/include/gmp.h )
PATCHES=(
"${FILESDIR}"/${PN}-6.1.0-noexecstack-detect.patch
"${FILESDIR}"/${PN}-6.2.1-no-zarch.patch
"${WORKDIR}"/${P}-arm64-darwin.patch
"${FILESDIR}"/${P}-CVE-2021-43618.patch
)
pkg_pretend() {
if use cpudetection && ! use amd64 && ! use x86 ; then
elog "Using generic C implementation on non-amd64/x86 with USE=cpudetection"
elog "--enable-fat is a no-op on alternative arches."
elog "To obtain an optimized build, set USE=-cpudetection, but binpkgs should not then be made."
fi
}
src_prepare() {
default
# We cannot run autotools here as gcc depends on this package
elibtoolize
# bug #536894
if [[ ${CHOST} == *-darwin* ]] ; then
eapply "${FILESDIR}"/${PN}-6.1.2-gcc-apple-4.0.1.patch
fi
# GMP uses the "ABI" env var during configure as does Gentoo (econf).
# So, to avoid patching the source constantly, wrap things up.
mv configure configure.wrapped || die
cat <<-\EOF > configure
#!/usr/bin/env sh
exec env ABI="${GMPABI}" "$0.wrapped" "$@"
EOF
# Patches to original configure might have lost the +x bit.
chmod a+rx configure{,.wrapped} || die
# Save the upstream files named config.{guess,sub} which are
# wrappers around the gnuconfig versions.
mkdir "${T}"/gmp-gnuconfig || die
mv config.guess "${T}"/gmp-gnuconfig/config.guess || die
mv config.sub "${T}"/gmp-gnuconfig/config.sub || die
# Grab fresh copies from gnuconfig.
touch config.guess config.sub || die
gnuconfig_update
# Rename the fresh copies to the filenames the wrappers from GMP
# expect.
mv config.guess configfsf.guess || die
mv config.sub configfsf.sub || die
}
multilib_src_configure() {
# Because of our 32-bit userland, 1.0 is the only HPPA ABI that works
# https://gmplib.org/manual/ABI-and-ISA.html#ABI-and-ISA (bug #344613)
if [[ ${CHOST} == hppa2.0-* ]] ; then
GMPABI="1.0"
fi
# ABI mappings (needs all architectures supported)
case ${ABI} in
32|x86) GMPABI=32;;
64|amd64|n64) GMPABI=64;;
[onx]32) GMPABI=${ABI};;
esac
export GMPABI
tc-export CC
# https://gmplib.org/manual/Notes-for-Package-Builds
local myeconfargs=(
CC_FOR_BUILD="$(tc-getBUILD_CC)"
--localstatedir="${EPREFIX}"/var/state/gmp
--enable-shared
$(use_enable asm assembly)
# fat is needed to avoid gmp installing either purely generic
# or specific-to-used-CPU (which our config.guess refresh prevents at the moment).
# Both Fedora and opensuse use this option to tackle the issue, bug #883201.
#
# This only works for amd64/x86, so to get accelerated performance
# (i.e. not using the generic C), one needs USE=-cpudetection if
# on non-amd64/x86.
#
# (We do not mask USE=cpudetection on !amd64/x86 because we want
# the flag to be useful on other arches to allow opting out of the
# config.guess logic below.)
$(use_enable cpudetection fat)
$(use_enable cxx)
$(use_enable static-libs static)
# --with-pic forces static libraries to be built as PIC
# and without TEXTRELs. musl does not support TEXTRELs: bug #707332
$(use pic && echo --with-pic)
)
# Move the wrappers from GMP back into place (may have been destroyed by previous econf run)
cp "${T}"/gmp-gnuconfig/config.guess "${S}"/config.guess || die
cp "${T}"/gmp-gnuconfig/config.sub "${S}"/config.sub || die
# See bug #883201 again.
if ! use cpudetection && ! tc-is-cross-compiler ; then
local gmp_host=$("${S}"/config.guess || die "failed to run config.guess")
if [[ -z ${gmp_host} ]] ; then
die "Empty result from GMP's custom config.guess!"
fi
einfo "GMP guessed processor type: ${gmp_host}"
ewarn "This build will only work on this machine. Enable USE=cpudetection for binary packages!"
export ac_cv_build="${gmp_host}"
export ac_cv_host="${gmp_host}"
fi
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
}
multilib_src_install() {
emake DESTDIR="${D}" install
# Should be a standalone lib
rm -f "${ED}"/usr/$(get_libdir)/libgmp.la
# This requires libgmp
local la="${ED}/usr/$(get_libdir)/libgmpxx.la"
if ! use static-libs ; then
rm -f "${la}" || die
fi
}
multilib_src_install_all() {
einstalldocs
use doc && cp "${DISTDIR}"/gmp-man-${MANUAL_PV}.pdf "${ED}"/usr/share/doc/${PF}/
}

View File

@ -1,15 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<maintainer type="project">
<email>toolchain@gentoo.org</email>
<name>Gentoo Toolchain Project</name>
</maintainer>
<use>
</maintainer>
<use>
<flag name="asm">Enable use of hand optimized assembly routines (faster execution)</flag>
<flag name="cpudetection">
Enables runtime CPU detection (useful for binpkgs, compatibility on other CPUs).
This only works on amd64/x86 at present.
If this flag is enabled, GMP will work on a variety of amd64/x86 CPUs and load accelerated
routines for use at runtime depending on the CPU in use. This makes it suitable
for binary packages (binpkgs).
If this flag is disabled, GMP will be tuned for the CPU being used at build-time
and may not be usable on other machines.
</flag>
<flag name="pic">Force static libraries to be built as PIC to avoid TEXTRELs.</flag>
</use>
<upstream>
</use>
<upstream>
<remote-id type="cpe">cpe:/a:gmplib:gmp</remote-id>
</upstream>
</upstream>
</pkgmetadata>

View File

@ -1 +1 @@
DIST libaio-0.3.112.tar.gz 46977 BLAKE2B 088f3b195a65bdc97ae2318e47af17c65259ed3208dca7bfef93c81a800602085e5b2078dbd436c740be316d0ebd923a1b3b7c0808257e2e7c7fb0f7ae1e0dba SHA512 5f984529c9f747a6c82f1e4457fc0832bb1fc299ae6e700f2ac5a8ea7b9bfc6ea1e75809728cc115a020cff6685ed1f4e38c6aeacc1ea98dfccce04dd19dafaa
DIST libaio-0.3.113.tar.gz 49980 BLAKE2B 2379c88670310b36942563d10f29dfcba0f49391952ffe7fe18b0c917f33ef610405fe13297d1dbb34b7ad1d3066d4a32587a7fb20babba2f264cfc2ab289e57 SHA512 65c30a102433bf8386581b03fc706d84bd341be249fbdee11a032b237a7b239e8c27413504fef15e2797b1acd67f752526637005889590ecb380e2e120ab0b71

View File

@ -1,30 +0,0 @@
From ebe62b178f3e5fcde8a311e64aaffe62099204a5 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Sun, 21 Apr 2019 12:44:26 +0200
Subject: [PATCH] make -Werror into an optional flag
This lets distros disable the flag as random errors might come up with
different compiler flags and older/newer toolchain versions.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
harness/Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/harness/Makefile b/harness/Makefile
index f477737..a155c4b 100644
--- a/harness/Makefile
+++ b/harness/Makefile
@@ -6,7 +6,8 @@ PROGS:=$(PARTPROGS) $(EXTRAPROGS)
HARNESS_SRCS:=main.c
# io_queue.c
-CFLAGS+=-Wall -Werror -I../src -g -O2 -DPAGE_SIZE=$(shell getconf PAGESIZE)
+CFLAGS_WERROR?=-Werror
+CFLAGS+=-Wall $(CFLAGS_WERROR) -I../src -g -O2 -DPAGE_SIZE=$(shell getconf PAGESIZE)
#-lpthread -lrt
all: $(PROGS)
--
2.21.0

View File

@ -0,0 +1,31 @@
https://pagure.io/libaio/pull-request/22.patch
https://pagure.io/libaio/pull-request/22
https://pagure.io/libaio/issue/21
From b8eadc9f89e8f7ab0338eacda9f98a6caea76883 Mon Sep 17 00:00:00 2001
From: Andreas Baumann <mail@andreasbaumann.cc>
Date: Jun 02 2022 11:33:11 +0000
Subject: harness: use off64_t instead of off_t in test 23.t (EINVAL on 32-bit)
--- a/harness/cases/23.t
+++ b/harness/cases/23.t
@@ -72,7 +72,7 @@ static void fail_errno(const char *format, ...)
static void *thrproc2(void *arg)
{
for (;;) {
- off_t offset = 0;
+ off64_t offset = 0;
pthread_barrier_wait(&barrier);
if (exiting)
@@ -92,7 +92,7 @@ static void *thrproc3(void *arg)
{
for (;;) {
char c;
- off_t offset = 0;
+ off64_t offset = 0;
pthread_barrier_wait(&barrier);
if (exiting)

View File

@ -2,12 +2,11 @@ We need to place LDFLAGS earlier to ensure e.g. as-needed works correctly.
--- a/src/Makefile
+++ b/src/Makefile
@@ -56,7 +56,7 @@ libaio.a: $(libaio_objs)
$(RANLIB) libaio.a
$(libname): $(libaio_sobjs) libaio.map
$(CC) $(CFLAGS) -c struct_offsets.c
- $(CC) $(SO_CFLAGS) -Wl,--version-script=libaio.map -Wl,-soname=$(soname) -o $@ $(libaio_sobjs) $(LINK_FLAGS)
+ $(CC) $(SO_CFLAGS) $(LINK_FLAGS) -Wl,--version-script=libaio.map -Wl,-soname=$(soname) -o $@ $(libaio_sobjs)
install: $(all_targets)
install -D -m 644 libaio.h $(includedir)/libaio.h

View File

@ -1,18 +1,18 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
EAPI=7
inherit multilib-minimal toolchain-funcs flag-o-matic usr-ldscript
DESCRIPTION="Asynchronous input/output library that uses the kernels native interface"
HOMEPAGE="https://pagure.io/libaio"
if [[ "${PV}" == 9999 ]] ; then
if [[ ${PV} == 9999 ]] ; then
inherit git-r3
EGIT_REPO_URI="https://pagure.io/libaio.git"
else
SRC_URI="https://releases.pagure.org/${PN}/${P}.tar.gz"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
fi
LICENSE="LGPL-2"
SLOT="0"
@ -21,8 +21,8 @@ RESTRICT="!test? ( test )"
PATCHES=(
"${FILESDIR}"/${PN}-0.3.112-cppflags.patch
"${FILESDIR}"/${PN}-0.3.111-optional-werror.patch
"${FILESDIR}"/${PN}-0.3.112-respect-LDFLAGS.patch
"${FILESDIR}"/${PN}-0.3.113-respect-LDFLAGS.patch
"${FILESDIR}"/${PN}-0.3.113-32-bit-tests.patch
)
src_prepare() {
@ -31,18 +31,22 @@ src_prepare() {
local sed_args=(
-e "/^prefix=/s:/usr:${EPREFIX}/usr:"
-e '/^libdir=/s:lib$:$(ABI_LIBDIR):'
-e 's:-Werror ::'
)
if ! use static-libs; then
sed_args+=( -e '/\tinstall .*\/libaio.a/d' )
# Tests require the static library to be built.
use test || sed_args+=( -e '/^all_targets +=/s/ libaio.a//' )
fi
sed -i "${sed_args[@]}" src/Makefile Makefile || die
sed -i "${sed_args[@]}" src/Makefile harness/Makefile Makefile || die
multilib_copy_sources
}
multilib_src_configure() {
# Upstream aren't interested in fixing: bug #855698
filter-lto
if use arm ; then
# When building for thumb, we can't allow frame pointers.
# http://crbug.com/464517
@ -53,10 +57,10 @@ multilib_src_configure() {
}
_emake() {
CC=$(tc-getCC) \
AR=$(tc-getAR) \
RANLIB=$(tc-getRANLIB) \
ABI_LIBDIR=$(get_libdir) \
CC="$(tc-getCC)" \
AR="$(tc-getAR)" \
RANLIB="$(tc-getRANLIB)" \
ABI_LIBDIR="$(get_libdir)" \
CFLAGS_WERROR= \
emake "$@"
}
@ -67,6 +71,7 @@ multilib_src_compile() {
multilib_src_test() {
mkdir -p testdir || die
# 'make check' breaks with sandbox, 'make partcheck' works
_emake partcheck prefix="${S}/src" libdir="${S}/src"
}
@ -79,7 +84,7 @@ multilib_src_install_all() {
doman man/*
dodoc ChangeLog TODO
# move crap to / for multipath-tools #325355
# move to / for multipath-tools, bug #325355
gen_usr_ldscript -a aio
# This lib is a bare minimal shim on top of kernel syscalls.

View File

@ -1,18 +1,18 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
EAPI=7
inherit multilib-minimal toolchain-funcs flag-o-matic usr-ldscript
DESCRIPTION="Asynchronous input/output library that uses the kernels native interface"
HOMEPAGE="https://pagure.io/libaio"
if [[ "${PV}" == 9999 ]] ; then
if [[ ${PV} == 9999 ]] ; then
inherit git-r3
EGIT_REPO_URI="https://pagure.io/libaio.git"
else
SRC_URI="https://releases.pagure.org/${PN}/${P}.tar.gz"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
fi
LICENSE="LGPL-2"
SLOT="0"
@ -21,8 +21,7 @@ RESTRICT="!test? ( test )"
PATCHES=(
"${FILESDIR}"/${PN}-0.3.112-cppflags.patch
"${FILESDIR}"/${PN}-0.3.111-optional-werror.patch
"${FILESDIR}"/${PN}-0.3.112-respect-LDFLAGS.patch
"${FILESDIR}"/${PN}-0.3.113-respect-LDFLAGS.patch
)
src_prepare() {
@ -31,18 +30,22 @@ src_prepare() {
local sed_args=(
-e "/^prefix=/s:/usr:${EPREFIX}/usr:"
-e '/^libdir=/s:lib$:$(ABI_LIBDIR):'
-e 's:-Werror ::'
)
if ! use static-libs; then
sed_args+=( -e '/\tinstall .*\/libaio.a/d' )
# Tests require the static library to be built.
use test || sed_args+=( -e '/^all_targets +=/s/ libaio.a//' )
fi
sed -i "${sed_args[@]}" src/Makefile Makefile || die
sed -i "${sed_args[@]}" src/Makefile harness/Makefile Makefile || die
multilib_copy_sources
}
multilib_src_configure() {
# Upstream aren't interested in fixing: bug #855698
filter-lto
if use arm ; then
# When building for thumb, we can't allow frame pointers.
# http://crbug.com/464517
@ -53,10 +56,10 @@ multilib_src_configure() {
}
_emake() {
CC=$(tc-getCC) \
AR=$(tc-getAR) \
RANLIB=$(tc-getRANLIB) \
ABI_LIBDIR=$(get_libdir) \
CC="$(tc-getCC)" \
AR="$(tc-getAR)" \
RANLIB="$(tc-getRANLIB)" \
ABI_LIBDIR="$(get_libdir)" \
CFLAGS_WERROR= \
emake "$@"
}
@ -67,6 +70,7 @@ multilib_src_compile() {
multilib_src_test() {
mkdir -p testdir || die
# 'make check' breaks with sandbox, 'make partcheck' works
_emake partcheck prefix="${S}/src" libdir="${S}/src"
}
@ -79,7 +83,7 @@ multilib_src_install_all() {
doman man/*
dodoc ChangeLog TODO
# move crap to / for multipath-tools #325355
# move to / for multipath-tools, bug #325355
gen_usr_ldscript -a aio
# This lib is a bare minimal shim on top of kernel syscalls.

View File

@ -5,6 +5,9 @@
<email>base-system@gentoo.org</email>
<name>Gentoo Base System</name>
</maintainer>
<upstream>
<remote-id type="cpe">cpe:/a:libaio_project:libaio</remote-id>
</upstream>
<longdescription>
Library to provide user-level kernel Asynchronous I/O (AIO)
support for Linux (needs kernel patches as of 2.6.12)

View File

@ -1 +1,2 @@
DIST nettle-3.7.3.tar.gz 2383985 BLAKE2B 8d8efbbff98fc1f3eff3296681d3d72346e78392f356aebfe80138ae6ae1ebf3695bd7f74b906beef0cf3625ba6d84bdb43c0f6707f54f4d98870d50c90ac9a3 SHA512 9901eba305421adff6d551ac7f478dff3f68a339d444c776724ab0b977fe6be792b1d2950c8705acbe76bd924fd6d898a65eded546777884be3b436d0e052437
DIST nettle-3.8.1.tar.gz 2406251 BLAKE2B 22b4ec81645b579504356597ba87b637e46285682020c90e03ecaea386ac9b48eaf91ee76ae3b86b6060be355de20c320ab3b74958074ad23fc08ad9ab6a4cbb SHA512 a405da3438d185d96917b03b00abb9ab43e04f58f770f657f716c25d64bb258ee170a71328e74736caa7121f50c0c89d3cc840c1201d2a92cfaf1357d24bdc6a
DIST nettle-3.8.1.tar.gz.sig 374 BLAKE2B e2bfce4aaa1be114fb9bf8724f25db75c69c3b98538df46e9b1428ce615f7db3b9e9f9240d232fddac195db4568439b3f58989c20beca82aa6db79f4956db547 SHA512 978304b1faa5adc3b0d6ea7e9597af6154ad5d6e328913ac19184ece94771fdb2a7d5ce0af535ae8d28cb6ccd94fb3d4ef2613c0356df9e08b5d4c26ea646e09

View File

@ -7,6 +7,7 @@
</maintainer>
<upstream>
<remote-id type="cpe">cpe:/a:nettle_project:nettle</remote-id>
<remote-id type="github">gnutls/nettle</remote-id>
</upstream>
<use>
<flag name="asm">Support assembly hand optimized crypto functions (i.e. faster run time)</flag>

View File

@ -1,67 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit autotools multilib-build multilib-minimal toolchain-funcs
DESCRIPTION="Low-level cryptographic library"
HOMEPAGE="http://www.lysator.liu.se/~nisse/nettle/"
SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
LICENSE="|| ( LGPL-3 LGPL-2.1 )"
SLOT="0/8-6" # subslot = libnettle - libhogweed soname version
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="+asm doc +gmp static-libs test cpu_flags_x86_aes cpu_flags_arm_neon cpu_flags_x86_sha"
RESTRICT="!test? ( test )"
DEPEND="gmp? ( >=dev-libs/gmp-6.1:0=[static-libs?,${MULTILIB_USEDEP}] )"
RDEPEND="${DEPEND}"
BDEPEND="doc? ( sys-apps/texinfo )"
MULTILIB_WRAPPED_HEADERS=(
/usr/include/nettle/version.h
)
DOCS=()
HTML_DOCS=()
pkg_setup() {
use doc && DOCS+=(
nettle.pdf
)
use doc && HTML_DOCS+=(
nettle.html
)
}
src_prepare() {
default
# I do not see in config.sub reference to sunldsolaris.
# if someone complains readd
# -e 's/solaris\*)/sunldsolaris*)/' \
sed -e '/CFLAGS=/s: -ggdb3::' \
-i configure.ac || die
eautoreconf
}
multilib_src_configure() {
local myeconfargs=(
CC_FOR_BUILD="$(tc-getBUILD_CC)"
$(tc-is-static-only && echo --disable-shared)
$(use_enable cpu_flags_x86_aes x86-aesni)
$(use_enable cpu_flags_x86_sha x86-sha-ni)
$(use_enable asm assembler)
$(use_enable doc documentation)
$(use_enable gmp public-key)
$(use_enable cpu_flags_arm_neon arm-neon)
$(use_enable static-libs static)
--disable-fat
# --disable-openssl bug #427526
--disable-openssl
--libdir="${EPREFIX}"/usr/$(get_libdir)
)
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
}

View File

@ -0,0 +1,84 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/nettle.asc
inherit multilib-build multilib-minimal toolchain-funcs verify-sig
DESCRIPTION="Low-level cryptographic library"
HOMEPAGE="http://www.lysator.liu.se/~nisse/nettle/"
SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
SRC_URI+=" verify-sig? ( mirror://gnu/${PN}/${P}.tar.gz.sig )"
LICENSE="|| ( LGPL-3 LGPL-2.1 )"
# Subslot = libnettle - libhogweed soname version
SLOT="0/8-6"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="+asm doc +gmp static-libs cpu_flags_arm_neon cpu_flags_arm_aes cpu_flags_arm_sha1 cpu_flags_arm_sha2 cpu_flags_ppc_altivec cpu_flags_x86_aes cpu_flags_x86_sha cpu_flags_x86_pclmul"
# The arm64 crypto option controls AES, SHA1, and SHA2 usage.
REQUIRED_USE="cpu_flags_arm_aes? ( cpu_flags_arm_sha1 cpu_flags_arm_sha2 )
cpu_flags_arm_sha1? ( cpu_flags_arm_aes cpu_flags_arm_sha2 )
cpu_flags_arm_sha2? ( cpu_flags_arm_aes cpu_flags_arm_sha1 )"
DEPEND="gmp? ( >=dev-libs/gmp-6.1:0=[static-libs?,${MULTILIB_USEDEP}] )"
RDEPEND="${DEPEND}"
BDEPEND="
sys-devel/m4
doc? ( sys-apps/texinfo )
verify-sig? ( sec-keys/openpgp-keys-nettle )
"
MULTILIB_WRAPPED_HEADERS=(
/usr/include/nettle/version.h
)
DOCS=()
HTML_DOCS=()
src_prepare() {
default
# I do not see in config.sub reference to sunldsolaris.
# if someone complains readd
# -e 's/solaris\*)/sunldsolaris*)/' \
sed -e '/CFLAGS=/s: -ggdb3::' \
-i configure.ac configure || die
if use doc ; then
DOCS+=( nettle.pdf )
HTML_DOCS+=( nettle.html )
fi
}
multilib_src_configure() {
local myeconfargs=(
CC_FOR_BUILD="$(tc-getBUILD_CC)"
$(tc-is-static-only && echo --disable-shared)
# Intrinsics
$(use_enable cpu_flags_arm_neon arm-neon)
$(use_enable cpu_flags_arm_aes arm64-crypto)
$(use_enable cpu_flags_ppc_altivec power-altivec)
$(use_enable cpu_flags_x86_aes x86-aesni)
$(use_enable cpu_flags_x86_sha x86-sha-ni)
$(use_enable cpu_flags_x86_pclmul x86-pclmul)
# TODO: PPC crypto flag?
--disable-power-crypto-ext
# TODO: cpu_flags_s390?
--disable-s390x-vf
--disable-s390x-msa
$(use_enable asm assembler)
$(multilib_native_use_enable doc documentation)
$(use_enable gmp public-key)
$(use_enable static-libs static)
--disable-fat
# openssl is just used for benchmarks (bug #427526)
--disable-openssl
)
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
}

View File

@ -1,11 +1,17 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: desktop.eclass
# @MAINTAINER:
# base-system@gentoo.org
# @SUPPORTED_EAPIS: 6 7 8
# @BLURB: support for desktop files, menus, and icons
case ${EAPI} in
6|7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ -z ${_DESKTOP_ECLASS} ]]; then
_DESKTOP_ECLASS=1
@ -156,19 +162,18 @@ make_desktop_entry() {
;;
esac
fi
local slot=${SLOT%/*}
if [[ ${slot} == "0" ]] ; then
local desktop_name="${PN}"
else
local desktop_name="${PN}-${slot}"
fi
local desktop_exec="${exec%%[[:space:]]*}"
desktop_exec="${desktop_exec##*/}"
local desktop_suffix="-${PN}"
[[ ${SLOT%/*} != 0 ]] && desktop_suffix+="-${SLOT%/*}"
# Replace foo-foo.desktop by foo.desktop
[[ ${desktop_suffix#-} == "${desktop_exec}" ]] && desktop_suffix=""
# Prevent collisions if a file with the same name already exists #771708
local desktop="${desktop_exec}-${desktop_name}" count=0
local desktop="${desktop_exec}${desktop_suffix}" count=0
while [[ -e ${ED}/usr/share/applications/${desktop}.desktop ]]; do
desktop="${desktop_exec}-$((++count))-${desktop_name}"
desktop="${desktop_exec}-$((++count))${desktop_suffix}"
done
desktop="${T}/${desktop}.desktop"
@ -308,7 +313,7 @@ _iconins() {
case ${size} in
16|22|24|32|36|48|64|72|96|128|192|256|512)
size=${size}x${size};;
scalable)
symbolic|scalable)
;;
*)
eerror "${size} is an unsupported icon size!"

View File

@ -1,10 +1,10 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: epatch.eclass
# @MAINTAINER:
# base-system@gentoo.org
# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6
# @SUPPORTED_EAPIS: 6
# @BLURB: easy patch application functions
# @DEPRECATED: eapply from EAPI 7
# @DESCRIPTION:
@ -13,11 +13,9 @@
if [[ -z ${_EPATCH_ECLASS} ]]; then
case ${EAPI:-0} in
0|1|2|3|4|5|6)
;;
*)
die "${ECLASS}: banned in EAPI=${EAPI}; use eapply* instead";;
case ${EAPI} in
6) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
inherit estack
@ -52,10 +50,6 @@ EPATCH_COMMON_OPTS="-g0 -E --no-backup-if-mismatch"
# List of patches not to apply. Note this is only file names,
# and not the full path. Globs accepted.
EPATCH_EXCLUDE=""
# @VARIABLE: EPATCH_SINGLE_MSG
# @DESCRIPTION:
# Change the printed message for a single patch.
EPATCH_SINGLE_MSG=""
# @VARIABLE: EPATCH_MULTI_MSG
# @DESCRIPTION:
# Change the printed message for multiple patches.
@ -235,13 +229,9 @@ epatch() {
fi
if [[ ${SINGLE_PATCH} == "yes" ]] ; then
if [[ -n ${EPATCH_SINGLE_MSG} ]] ; then
einfo "${EPATCH_SINGLE_MSG}"
ebegin "Applying ${patchname}"
else
einfo "Applying ${patchname} ..."
fi
else
einfo " ${patchname} ..."
ebegin " ${patchname}"
fi
# Handle aliased patch command #404447 #461568
@ -285,13 +275,13 @@ epatch() {
# people could (accidently) patch files in the root filesystem.
# Or trigger other unpleasantries #237667. So disallow -p0 on
# such patches.
local abs_paths=$(egrep -n '^[-+]{3} /' "${PATCH_TARGET}" | awk '$2 != "/dev/null" { print }')
local abs_paths=$(grep -E -n '^[-+]{3} /' "${PATCH_TARGET}" | awk '$2 != "/dev/null" { print }')
if [[ -n ${abs_paths} ]] ; then
count=1
printf "NOTE: skipping -p0 due to absolute paths in patch:\n%s\n" "${abs_paths}" >> "${STDERR_TARGET}"
fi
# Similar reason, but with relative paths.
local rel_paths=$(egrep -n '^[-+]{3} [^ ]*[.][.]/' "${PATCH_TARGET}")
local rel_paths=$(grep -E -n '^[-+]{3} [^ ]*[.][.]/' "${PATCH_TARGET}")
if [[ -n ${rel_paths} ]] ; then
echo
eerror "Rejected Patch: ${patchname}!"
@ -386,85 +376,5 @@ epatch() {
: # everything worked
}
case ${EAPI:-0} in
0|1|2|3|4|5)
# @ECLASS_VARIABLE: EPATCH_USER_SOURCE
# @USER_VARIABLE
# @DESCRIPTION:
# Location for user patches, see the epatch_user function.
# Should be set by the user. Don't set this in ebuilds.
: ${EPATCH_USER_SOURCE:=${PORTAGE_CONFIGROOT%/}/etc/portage/patches}
# @FUNCTION: epatch_user
# @USAGE:
# @DESCRIPTION:
# Applies user-provided patches to the source tree. The patches are
# taken from /etc/portage/patches/<CATEGORY>/<P-PR|P|PN>[:SLOT]/, where the first
# of these three directories to exist will be the one to use, ignoring
# any more general directories which might exist as well. They must end
# in ".patch" to be applied.
#
# User patches are intended for quick testing of patches without ebuild
# modifications, as well as for permanent customizations a user might
# desire. Obviously, there can be no official support for arbitrarily
# patched ebuilds. So whenever a build log in a bug report mentions that
# user patches were applied, the user should be asked to reproduce the
# problem without these.
#
# Not all ebuilds do call this function, so placing patches in the
# stated directory might or might not work, depending on the package and
# the eclasses it inherits and uses. It is safe to call the function
# repeatedly, so it is always possible to add a call at the ebuild
# level. The first call is the time when the patches will be
# applied.
#
# Ideally, this function should be called after gentoo-specific patches
# have been applied, so that their code can be modified as well, but
# before calls to e.g. eautoreconf, as the user patches might affect
# autotool input files as well.
epatch_user() {
[[ $# -ne 0 ]] && die "epatch_user takes no options"
# Allow multiple calls to this function; ignore all but the first
local applied="${T}/epatch_user.log"
[[ -e ${applied} ]] && return 2
# don't clobber any EPATCH vars that the parent might want
local EPATCH_SOURCE check
for check in ${CATEGORY}/{${P}-${PR},${P},${PN}}{,:${SLOT%/*}}; do
EPATCH_SOURCE=${EPATCH_USER_SOURCE}/${CTARGET}/${check}
[[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${EPATCH_USER_SOURCE}/${CHOST}/${check}
[[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${EPATCH_USER_SOURCE}/${check}
if [[ -d ${EPATCH_SOURCE} ]] ; then
local old_n_applied_patches=${EPATCH_N_APPLIED_PATCHES:-0}
EPATCH_SOURCE=${EPATCH_SOURCE} \
EPATCH_SUFFIX="patch" \
EPATCH_FORCE="yes" \
EPATCH_MULTI_MSG="Applying user patches from ${EPATCH_SOURCE} ..." \
epatch
echo "${EPATCH_SOURCE}" > "${applied}"
if [[ ${old_n_applied_patches} -lt ${EPATCH_N_APPLIED_PATCHES} ]]; then
has epatch_user_death_notice ${EBUILD_DEATH_HOOKS} || \
EBUILD_DEATH_HOOKS+=" epatch_user_death_notice"
fi
return 0
fi
done
echo "none" > "${applied}"
return 1
}
# @FUNCTION: epatch_user_death_notice
# @INTERNAL
# @DESCRIPTION:
# Include an explicit notice in the die message itself that user patches were
# applied to this build.
epatch_user_death_notice() {
ewarn "!!! User patches were applied to this build!"
}
esac
_EPATCH_ECLASS=1
fi #_EPATCH_ECLASS

View File

@ -0,0 +1,26 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: eqawarn.eclass
# @MAINTAINER:
# base-system@gentoo.org
# @SUPPORTED_EAPIS: 6
# @BLURB: output a QA warning
case ${EAPI} in
6) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
# @FUNCTION: eqawarn
# @USAGE: [message]
# @DESCRIPTION:
# Proxy to ewarn for package managers that don't provide eqawarn and
# use the PM implementation if available. Reuses PORTAGE_ELOG_CLASSES
# as set by the dev profile.
if ! declare -F eqawarn >/dev/null ; then
eqawarn() {
has qa ${PORTAGE_ELOG_CLASSES} && ewarn "$@"
:
}
fi

View File

@ -1,72 +1,28 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: eutils.eclass
# @MAINTAINER:
# base-system@gentoo.org
# @SUPPORTED_EAPIS: 5 6 7
# @SUPPORTED_EAPIS: 6 7
# @BLURB: many extra (but common) functions that are used in ebuilds
# @DESCRIPTION:
# The eutils eclass contains a suite of functions that complement
# the ones that ebuild.sh already contain. The idea is that the functions
# are not required in all ebuilds but enough utilize them to have a common
# home rather than having multiple ebuilds implementing the same thing.
#
# Due to the nature of this eclass, some functions may have maintainers
# different from the overall eclass!
#
# This eclass is DEPRECATED and must not be inherited by any new ebuilds
# or eclasses. Use the more specific split eclasses instead, or native
# package manager functions when available.
# @DEPRECATED: native package manager functions, more specific eclasses
if [[ -z ${_EUTILS_ECLASS} ]]; then
_EUTILS_ECLASS=1
# implicitly inherited (now split) eclasses
case ${EAPI} in
5|6)
inherit desktop edos2unix epatch estack ltprune multilib \
preserve-libs strip-linguas toolchain-funcs vcs-clean wrapper
;;
6) inherit desktop edos2unix epatch eqawarn estack ltprune multilib \
preserve-libs strip-linguas toolchain-funcs vcs-clean wrapper ;;
7) inherit edos2unix strip-linguas wrapper ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
# @FUNCTION: emktemp
# @USAGE: [temp dir]
# @DESCRIPTION:
# Cheap replacement for when coreutils (and thus mktemp) does not exist
# on the user's system.
emktemp() {
eqawarn "emktemp is deprecated. Create a temporary file in \${T} instead."
local exe="touch"
[[ $1 == -d ]] && exe="mkdir" && shift
local topdir=$1
if [[ -z ${topdir} ]] ; then
[[ -z ${T} ]] \
&& topdir="/tmp" \
|| topdir=${T}
fi
if ! type -P mktemp > /dev/null ; then
# system lacks `mktemp` so we have to fake it
local tmp=/
while [[ -e ${tmp} ]] ; do
tmp=${topdir}/tmp.${RANDOM}.${RANDOM}.${RANDOM}
done
${exe} "${tmp}" || ${exe} -p "${tmp}"
echo "${tmp}"
else
# the args here will give slightly wierd names on BSD,
# but should produce a usable file on all userlands
if [[ ${exe} == "touch" ]] ; then
TMPDIR="${topdir}" mktemp -t tmp.XXXXXXXXXX
else
TMPDIR="${topdir}" mktemp -dt tmp.XXXXXXXXXX
fi
fi
eerror "emktemp has been removed."
eerror "Create a temporary file in \${T} instead."
die "emktemp is banned"
}
path_exists() {
@ -76,119 +32,11 @@ path_exists() {
die "path_exists is banned"
}
# @FUNCTION: use_if_iuse
# @USAGE: <flag>
# @DESCRIPTION:
# Return true if the given flag is in USE and IUSE.
#
# Note that this function should not be used in the global scope.
use_if_iuse() {
eqawarn "use_if_iuse is deprecated."
eqawarn "Define it as a local function, or inline it:"
eqawarn " in_iuse foo && use foo"
in_iuse $1 || return 1
use $1
eerror "use_if_iuse has been removed."
eerror "Define it as a local function, or inline it:"
eerror " in_iuse foo && use foo"
die "use_if_iuse is banned"
}
if [[ ${EAPI} == 5 ]] ; then
# @FUNCTION: einstalldocs
# @DESCRIPTION:
# Install documentation using DOCS and HTML_DOCS, in EAPIs that do not
# provide this function. When available (i.e., in EAPI 6 or later),
# the package manager implementation should be used instead.
#
# If DOCS is declared and non-empty, all files listed in it are
# installed. The files must exist, otherwise the function will fail.
# In EAPI 4 and 5, DOCS may specify directories as well; in earlier
# EAPIs using directories is unsupported.
#
# If DOCS is not declared, the files matching patterns given
# in the default EAPI implementation of src_install will be installed.
# If this is undesired, DOCS can be set to empty value to prevent any
# documentation from being installed.
#
# If HTML_DOCS is declared and non-empty, all files and/or directories
# listed in it are installed as HTML docs (using dohtml).
#
# Both DOCS and HTML_DOCS can either be an array or a whitespace-
# separated list. Whenever directories are allowed, '<directory>/.' may
# be specified in order to install all files within the directory
# without creating a sub-directory in docdir.
#
# Passing additional options to dodoc and dohtml is not supported.
# If you needed such a thing, you need to call those helpers explicitly.
einstalldocs() {
debug-print-function ${FUNCNAME} "${@}"
local dodoc_opts=-r
if ! declare -p DOCS &>/dev/null ; then
local d
for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \
THANKS BUGS FAQ CREDITS CHANGELOG ; do
if [[ -s ${d} ]] ; then
dodoc "${d}" || die
fi
done
elif [[ $(declare -p DOCS) == "declare -a"* ]] ; then
if [[ ${DOCS[@]} ]] ; then
dodoc ${dodoc_opts} "${DOCS[@]}" || die
fi
else
if [[ ${DOCS} ]] ; then
dodoc ${dodoc_opts} ${DOCS} || die
fi
fi
if [[ $(declare -p HTML_DOCS 2>/dev/null) == "declare -a"* ]] ; then
if [[ ${HTML_DOCS[@]} ]] ; then
dohtml -r "${HTML_DOCS[@]}" || die
fi
else
if [[ ${HTML_DOCS} ]] ; then
dohtml -r ${HTML_DOCS} || die
fi
fi
return 0
}
# @FUNCTION: in_iuse
# @USAGE: <flag>
# @DESCRIPTION:
# Determines whether the given flag is in IUSE. Strips IUSE default
# prefixes as necessary. In EAPIs where it is available (i.e., EAPI 6
# or later), the package manager implementation should be used instead.
#
# Note that this function must not be used in the global scope.
in_iuse() {
debug-print-function ${FUNCNAME} "${@}"
[[ ${#} -eq 1 ]] || die "Invalid args to ${FUNCNAME}()"
local flag=${1}
local liuse=( ${IUSE} )
has "${flag}" "${liuse[@]#[+-]}"
}
fi # EAPI 5
if [[ ${EAPI} == [56] ]] ; then
# @FUNCTION: eqawarn
# @USAGE: [message]
# @DESCRIPTION:
# Proxy to ewarn for package managers that don't provide eqawarn and use the PM
# implementation if available. Reuses PORTAGE_ELOG_CLASSES as set by the dev
# profile.
if ! declare -F eqawarn >/dev/null ; then
eqawarn() {
has qa ${PORTAGE_ELOG_CLASSES} && ewarn "$@"
:
}
fi
fi # EAPI [56]
fi

View File

@ -1,4 +1,4 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: kernel-2.eclass
@ -8,7 +8,7 @@
# John Mylchreest <johnm@gentoo.org>
# Mike Pagano <mpagano@gentoo.org>
# <so many, many others, please add yourself>
# @SUPPORTED_EAPIS: 6 7 8
# @SUPPORTED_EAPIS: 7 8
# @BLURB: Eclass for kernel packages
# @DESCRIPTION:
# This is the kernel.eclass rewrite for a clean base regarding the 2.6
@ -17,40 +17,144 @@
# added functionality:
# unipatch - a flexible, singular method to extract, add and remove patches.
# @ECLASS-VARIABLE: K_USEPV
# @ECLASS_VARIABLE: CTARGET
# @INTERNAL
# @DESCRIPTION:
# Utilized for 32-bit userland on ppc64.
# @ECLASS_VARIABLE: CKV
# @DEFAULT_UNSET
# @DESCRIPTION:
# When setting the EXTRAVERSION variable, it should
# add PV to the end.
# this is useful for things like wolk. IE:
# EXTRAVERSION would be something like : -wolk-4.19-r1
# Used as a comparison kernel version, which is used when
# PV doesnt reflect the genuine kernel version.
# This gets set to the portage style versioning. ie:
# CKV=2.6.11_rc4
# @ECLASS-VARIABLE: K_NODRYRUN
# @ECLASS_VARIABLE: EXTRAVERSION
# @DEFAULT_UNSET
# @DESCRIPTION:
# The additional version appended to OKV (-gentoo/-gentoo-r1)
# @ECLASS_VARIABLE: H_SUPPORTEDARCH
# @DEFAULT_UNSET
# @DESCRIPTION:
# this should be a space separated list of ARCH's which
# can be supported by the headers ebuild
# @ECLASS_VARIABLE: K_BASE_VER
# @DEFAULT_UNSET
# @DESCRIPTION:
# for git-sources, declare the base version this patch is
# based off of.
# @ECLASS_VARIABLE: K_DEBLOB_AVAILABLE
# @DEFAULT_UNSET
# @DESCRIPTION:
# A value of "0" will disable all of the optional deblob
# code. If empty, will be set to "1" if deblobbing is
# possible. Test ONLY for "1".
# @ECLASS_VARIABLE: K_DEBLOB_TAG
# @DEFAULT_UNSET
# @DESCRIPTION:
# This will be the version of deblob script. It's a upstream SVN tag
# such asw -gnu or -gnu1.
# @ECLASS_VARIABLE: K_DEFCONFIG
# @DEFAULT_UNSET
# @DESCRIPTION:
# Allow specifying a different defconfig target.
# If length zero, defaults to "defconfig".
# @ECLASS_VARIABLE: K_EXP_GENPATCHES_PULL
# @DEFAULT_UNSET
# @DESCRIPTION:
# If set, we pull "experimental" regardless of the USE FLAG
# but expect the ebuild maintainer to use K_EXP_GENPATCHES_LIST.
# @ECLASS_VARIABLE: K_EXP_GENPATCHES_NOUSE
# @DEFAULT_UNSET
# @DESCRIPTION:
# If set, no USE flag will be provided for "experimental";
# as a result the user cannot choose to apply those patches.
# @ECLASS_VARIABLE: K_EXP_GENPATCHES_LIST
# @DEFAULT_UNSET
# @DESCRIPTION:
# A list of patches to pick from "experimental" to apply when
# the USE flag is unset and K_EXP_GENPATCHES_PULL is set.
# @ECLASS_VARIABLE: K_EXTRAEINFO
# @DEFAULT_UNSET
# @DESCRIPTION:
# this is a new-line seperated list of einfo displays in
# postinst and can be used to carry additional postinst
# messages
# @ECLASS_VARIABLE: K_EXTRAELOG
# @DEFAULT_UNSET
# @DESCRIPTION:
# same as K_EXTRAEINFO except using elog instead of einfo
# @ECLASS_VARIABLE: K_EXTRAEWARN
# @DEFAULT_UNSET
# @DESCRIPTION:
# same as K_EXTRAEINFO except using ewarn instead of einfo
# @ECLASS_VARIABLE: K_FROM_GIT
# @DEFAULT_UNSET
# @DESCRIPTION:
# If set, this variable signals that the kernel sources derives
# from a git tree and special handling will be applied so that
# any patches that are applied will actually apply.
# @ECLASS_VARIABLE: K_GENPATCHES_VER
# @DEFAULT_UNSET
# @DESCRIPTION:
# The version of the genpatches tarball(s) to apply.
# A value of "5" would apply genpatches-2.6.12-5 to
# my-sources-2.6.12.ebuild
# @ECLASS_VARIABLE: K_LONGTERM
# @DEFAULT_UNSET
# @DESCRIPTION:
# If set, the eclass will search for the kernel source
# in the long term directories on the upstream servers
# as the location has been changed by upstream
# @ECLASS_VARIABLE: K_NODRYRUN
# @DEFAULT_UNSET
# @DESCRIPTION:
# if this is set then patch --dry-run will not
# be run. Certain patches will fail with this parameter
# See bug #507656
# @ECLASS-VARIABLE: K_NOSETEXTRAVERSION
# @ECLASS_VARIABLE: K_NOSETEXTRAVERSION
# @DEFAULT_UNSET
# @DESCRIPTION:
# if this is set then EXTRAVERSION will not be
# automatically set within the kernel Makefile
# @ECLASS-VARIABLE: K_NOUSENAME
# @ECLASS_VARIABLE: K_NOUSENAME
# @DEFAULT_UNSET
# @DESCRIPTION:
# if this is set then EXTRAVERSION will not include the
# first part of ${PN} in EXTRAVERSION
# @ECLASS-VARIABLE: K_NOUSEPR
# @ECLASS_VARIABLE: K_NOUSEPR
# @DEFAULT_UNSET
# @DESCRIPTION:
# if this is set then EXTRAVERSION will not include the
# anything based on ${PR}.
# @ECLASS-VARIABLE: K_PREPATCHED
# @ECLASS_VARIABLE: K_PREDEBLOBBED
# @DEFAULT_UNSET
# @DESCRIPTION:
# This kernel was already deblobbed elsewhere.
# If false, either optional deblobbing will be available
# or the license will note the inclusion of linux-firmware code.
# @ECLASS_VARIABLE: K_PREPATCHED
# @DEFAULT_UNSET
# @DESCRIPTION:
# if the patchset is prepatched (ie: pf-sources,
@ -58,123 +162,93 @@
# patchset version for and not use it as a true package
# revision
# @ECLASS-VARIABLE: K_EXTRAEINFO
# @DEFAULT_UNSET
# @DESCRIPTION:
# this is a new-line seperated list of einfo displays in
# postinst and can be used to carry additional postinst
# messages
# @ECLASS-VARIABLE: K_EXTRAELOG
# @DEFAULT_UNSET
# @DESCRIPTION:
# same as K_EXTRAEINFO except using elog instead of einfo
# @ECLASS-VARIABLE: K_EXTRAEWARN
# @DEFAULT_UNSET
# @DESCRIPTION:
# same as K_EXTRAEINFO except using ewarn instead of einfo
# @ECLASS-VARIABLE: K_SYMLINK
# @DEFAULT_UNSET
# @DESCRIPTION:
# if this is set, then forcably create symlink anyway
# @ECLASS-VARIABLE: K_BASE_VER
# @DEFAULT_UNSET
# @DESCRIPTION:
# for git-sources, declare the base version this patch is
# based off of.
# @ECLASS-VARIABLE: K_DEFCONFIG
# @DEFAULT_UNSET
# @DESCRIPTION:
# Allow specifying a different defconfig target.
# If length zero, defaults to "defconfig".
# @ECLASS-VARIABLE: K_WANT_GENPATCHES
# @DEFAULT_UNSET
# @DESCRIPTION:
# Apply genpatches to kernel source. Provide any
# combination of "base", "extras" or "experimental".
# @ECLASS-VARIABLE: K_EXP_GENPATCHES_PULL
# @DEFAULT_UNSET
# @DESCRIPTION:
# If set, we pull "experimental" regardless of the USE FLAG
# but expect the ebuild maintainer to use K_EXP_GENPATCHES_LIST.
# @ECLASS-VARIABLE: K_EXP_GENPATCHES_NOUSE
# @DEFAULT_UNSET
# @DESCRIPTION:
# If set, no USE flag will be provided for "experimental";
# as a result the user cannot choose to apply those patches.
# @ECLASS-VARIABLE: K_EXP_GENPATCHES_LIST
# @DEFAULT_UNSET
# @DESCRIPTION:
# A list of patches to pick from "experimental" to apply when
# the USE flag is unset and K_EXP_GENPATCHES_PULL is set.
# @ECLASS-VARIABLE: K_FROM_GIT
# @DEFAULT_UNSET
# @DESCRIPTION:
# If set, this variable signals that the kernel sources derives
# from a git tree and special handling will be applied so that
# any patches that are applied will actually apply.
# @ECLASS-VARIABLE: K_GENPATCHES_VER
# @DEFAULT_UNSET
# @DESCRIPTION:
# The version of the genpatches tarball(s) to apply.
# A value of "5" would apply genpatches-2.6.12-5 to
# my-sources-2.6.12.ebuild
# @ECLASS-VARIABLE: K_SECURITY_UNSUPPORTED
# @ECLASS_VARIABLE: K_SECURITY_UNSUPPORTED
# @DEFAULT_UNSET
# @DESCRIPTION:
# If set, this kernel is unsupported by Gentoo Security
# to the current eclass maintainer :)
# @ECLASS-VARIABLE: K_DEBLOB_AVAILABLE
# @ECLASS_VARIABLE: K_SYMLINK
# @DEFAULT_UNSET
# @DESCRIPTION:
# A value of "0" will disable all of the optional deblob
# code. If empty, will be set to "1" if deblobbing is
# possible. Test ONLY for "1".
# if this is set, then forcably create symlink anyway
# @ECLASS-VARIABLE: K_DEBLOB_TAG
# @ECLASS_VARIABLE: K_USEPV
# @DEFAULT_UNSET
# @DESCRIPTION:
# This will be the version of deblob script. It's a upstream SVN tag
# such asw -gnu or -gnu1.
# When setting the EXTRAVERSION variable, it should
# add PV to the end.
# this is useful for things like wolk. IE:
# EXTRAVERSION would be something like : -wolk-4.19-r1
# @ECLASS-VARIABLE: K_PREDEBLOBBED
# @ECLASS_VARIABLE: K_WANT_GENPATCHES
# @DEFAULT_UNSET
# @DESCRIPTION:
# This kernel was already deblobbed elsewhere.
# If false, either optional deblobbing will be available
# or the license will note the inclusion of linux-firmware code.
# Apply genpatches to kernel source. Provide any
# combination of "base", "extras" or "experimental".
# @ECLASS-VARIABLE: K_LONGTERM
# @ECLASS_VARIABLE: KERNEL_URI
# @DEFAULT_UNSET
# @DESCRIPTION:
# If set, the eclass will search for the kernel source
# in the long term directories on the upstream servers
# as the location has been changed by upstream
# Upstream kernel src URI
# @ECLASS-VARIABLE: H_SUPPORTEDARCH
# @ECLASS_VARIABLE: KV
# @DEFAULT_UNSET
# @OUTPUT_VARIABLE
# @DESCRIPTION:
# Kernel Version (2.6.0-gentoo/2.6.0-test11-gentoo-r1)
# @ECLASS_VARIABLE: KV_FULL
# @DEFAULT_UNSET
# @OUTPUT_VARIABLE
# @DESCRIPTION:
# Kernel full version
# @ECLASS_VARIABLE: KV_MAJOR
# @DEFAULT_UNSET
# @OUTPUT_VARIABLE
# @DESCRIPTION:
# Kernel major version from <KV_MAJOR>.<KV_MINOR>.<KV_PATCH
# @ECLASS_VARIABLE: KV_MINOR
# @DEFAULT_UNSET
# @OUTPUT_VARIABLE
# @DESCRIPTION:
# Kernel minor version from <KV_MAJOR>.<KV_MINOR>.<KV_PATCH
# @ECLASS_VARIABLE: KV_PATCH
# @DEFAULT_UNSET
# @OUTPUT_VARIABLE
# @DESCRIPTION:
# Kernel patch version from <KV_MAJOR>.<KV_MINOR>.<KV_PATCH
# @ECLASS_VARIABLE: LINUX_HOSTCFLAGS
# @DEFAULT_UNSET
# @DESCRIPTION:
# this should be a space separated list of ARCH's which
# can be supported by the headers ebuild
# Default cflags if not already set
# @ECLASS-VARIABLE: UNIPATCH_LIST
# @ECLASS_VARIABLE: OKV
# @DEFAULT_UNSET
# @DESCRIPTION:
# space delimetered list of patches to be applied to the kernel
# Original Kernel Version (2.6.0/2.6.0-test11)
# @ECLASS-VARIABLE: UNIPATCH_EXCLUDE
# @ECLASS_VARIABLE: RELEASE
# @DEFAULT_UNSET
# @DESCRIPTION:
# Representative of the kernel release tag (-rc3/-git3)
# @ECLASS_VARIABLE: RELEASETYPE
# @DEFAULT_UNSET
# @DESCRIPTION:
# The same as RELEASE but with its numerics stripped (-rc/-git)
# @ECLASS_VARIABLE: UNIPATCH_DOCS
# @DEFAULT_UNSET
# @DESCRIPTION:
# space delimemeted list of docs to be installed to
# the doc dir
# @ECLASS_VARIABLE: UNIPATCH_EXCLUDE
# @DEFAULT_UNSET
# @DESCRIPTION:
# An addition var to support exlusion based completely
@ -182,13 +256,22 @@
# this should _NOT_ be used from the ebuild as this is
# reserved for end users passing excludes from the cli
# @ECLASS-VARIABLE: UNIPATCH_DOCS
# @ECLASS_VARIABLE: UNIPATCH_LIST
# @DEFAULT_UNSET
# @DESCRIPTION:
# space delimemeted list of docs to be installed to
# the doc dir
# space delimetered list of patches to be applied to the kernel
# @ECLASS-VARIABLE: UNIPATCH_STRICTORDER
# @ECLASS_VARIABLE: UNIPATCH_LIST_DEFAULT
# @INTERNAL
# @DESCRIPTION:
# Upstream kernel patch archive
# @ECLASS_VARIABLE: UNIPATCH_LIST_GENPATCHES
# @INTERNAL
# @DESCRIPTION:
# List of genpatches archives to apply to the kernel
# @ECLASS_VARIABLE: UNIPATCH_STRICTORDER
# @DEFAULT_UNSET
# @DESCRIPTION:
# if this is set places patches into directories of
@ -198,11 +281,10 @@
# If you do change them, there is a chance that we will not fix resulting bugs;
# that of course does not mean we're not willing to help.
inherit estack toolchain-funcs
[[ ${EAPI} == 6 ]] && inherit eapi7-ver
inherit estack multiprocessing toolchain-funcs
case ${EAPI} in
6|7|8) ;;
7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
@ -295,7 +377,7 @@ handle_genpatches() {
UNIPATCH_LIST_GENPATCHES+=" ${DISTDIR}/${tarball}"
debug-print "genpatches tarball: ${tarball}"
fi
GENPATCHES_URI+=" ${use_cond_start}$(echo https://dev.gentoo.org/~{alicef,mpagano,whissi}/dist/genpatches/${tarball})${use_cond_end}"
GENPATCHES_URI+=" ${use_cond_start}$(echo https://dev.gentoo.org/~{alicef,mpagano}/dist/genpatches/${tarball})${use_cond_end}"
done
}
@ -564,7 +646,7 @@ kernel_is() {
eq) operator="-eq"; shift;;
*) operator="-eq";;
esac
[[ $# -gt 3 ]] && die "Error in kernel-2_kernel_is(): too many parameters"
[[ $# -gt 3 ]] && die "Error in ${ECLASS}_${FUNCNAME}(): too many parameters"
ver_test \
"${KV_MAJOR:-0}.${KV_MINOR:-0}.${KV_PATCH:-0}" \
@ -574,8 +656,6 @@ kernel_is() {
# Capture the sources type and set DEPENDs
if [[ ${ETYPE} == sources ]]; then
[[ ${EAPI} == 6 ]] && DEPEND="!build? ( sys-apps/sed )" ||
BDEPEND="!build? ( sys-apps/sed )"
RDEPEND="!build? (
app-arch/cpio
dev-lang/perl
@ -589,20 +669,12 @@ if [[ ${ETYPE} == sources ]]; then
)"
SLOT="${PVR}"
DESCRIPTION="Sources based on the Linux Kernel."
DESCRIPTION="Sources based on the Linux Kernel"
IUSE="symlink build"
# Bug #266157, deblob for libre support
if [[ -z ${K_PREDEBLOBBED} ]]; then
# deblob less than 5.10 require python 2.7
if kernel_is lt 5 10; then
K_DEBLOB_AVAILABLE=0
fi
if [[ ${K_DEBLOB_AVAILABLE} == 1 ]]; then
PYTHON_COMPAT=( python3_{6..10} )
inherit python-any-r1
IUSE="${IUSE} deblob"
# Reflect that kernels contain firmware blobs unless otherwise
@ -610,8 +682,6 @@ if [[ ${ETYPE} == sources ]]; then
# tree has been dropped from the kernel.
kernel_is lt 4 14 && LICENSE+=" !deblob? ( linux-firmware )"
BDEPEND+=" deblob? ( ${PYTHON_DEPS} )"
if [[ -n KV_MINOR ]]; then
DEBLOB_PV="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}"
else
@ -692,7 +762,7 @@ env_setup_xmakeopts() {
elif type -p ${CHOST}-ar >/dev/null; then
xmakeopts="${xmakeopts} CROSS_COMPILE=${CHOST}-"
fi
xmakeopts="${xmakeopts} HOSTCC=$(tc-getBUILD_CC)"
xmakeopts="${xmakeopts} HOSTCC=$(tc-getBUILD_CC) CC=$(tc-getCC) LD=$(tc-getLD) AR=$(tc-getAR) NM=$(tc-getNM) OBJCOPY=$(tc-getOBJCOPY) READELF=$(tc-getREADELF) STRIP=$(tc-getSTRIP)"
export xmakeopts
}
@ -780,10 +850,10 @@ install_headers() {
local ddir=$(kernel_header_destdir)
env_setup_xmakeopts
emake headers_install INSTALL_HDR_PATH="${ED%/}"${ddir}/.. ${xmakeopts}
emake headers_install INSTALL_HDR_PATH="${ED}"${ddir}/.. ${xmakeopts}
# let other packages install some of these headers
rm -rf "${ED%/}"${ddir}/scsi || die #glibc/uclibc/etc...
rm -rf "${ED}"${ddir}/scsi || die #glibc/uclibc/etc...
return 0
}
@ -810,7 +880,7 @@ install_sources() {
done
fi
mv "${WORKDIR}"/linux* "${ED%/}"/usr/src || die
mv "${WORKDIR}"/linux* "${ED}"/usr/src || die
if [[ -n ${UNIPATCH_DOCS} ]]; then
for i in ${UNIPATCH_DOCS}; do
@ -850,15 +920,15 @@ postinst_sources() {
# if we are to forcably symlink, delete it if it already exists first.
if [[ ${K_SYMLINK} -gt 0 ]]; then
if [[ -e ${EROOT%/}/usr/src/linux && ! -L ${EROOT%/}/usr/src/linux ]] ; then
die "${EROOT%/}/usr/src/linux exist and is not a symlink"
if [[ -e ${EROOT}/usr/src/linux && ! -L ${EROOT}/usr/src/linux ]] ; then
die "${EROOT}/usr/src/linux exists and is not a symlink"
fi
ln -snf linux-${KV_FULL} "${EROOT%/}"/usr/src/linux || die
ln -snf linux-${KV_FULL} "${EROOT}"/usr/src/linux || die
fi
# Don't forget to make directory for sysfs
[[ ! -d ${EROOT%/}/sys ]] && kernel_is 2 6 && { mkdir "${EROOT%/}"/sys || die ; }
[[ ! -d ${EROOT}/sys ]] && kernel_is 2 6 && { mkdir "${EROOT}"/sys || die ; }
elog "If you are upgrading from a previous kernel, you may be interested"
elog "in the following document:"
@ -994,7 +1064,7 @@ unipatch() {
extention=${extention/:*/}
PIPE_CMD=""
case ${extention} in
xz) PIPE_CMD="xz -dc";;
xz) PIPE_CMD="xz -T$(makeopts_jobs) -dc";;
lzma) PIPE_CMD="lzma -dc";;
bz2) PIPE_CMD="bzip2 -dc";;
patch*) PIPE_CMD="cat";;
@ -1074,7 +1144,7 @@ unipatch() {
UNIPATCH_DROP+=" 5011_enable-cpu-optimizations-for-gcc8.patch"
UNIPATCH_DROP+=" 5012_enable-cpu-optimizations-for-gcc91.patch"
UNIPATCH_DROP+=" 5013_enable-cpu-optimizations-for-gcc10.patch"
if [[ ${GCC_MAJOR_VER} -lt 9 ]]; then
if [[ ${GCC_MAJOR_VER} -lt 9 ]] && ! tc-is-clang; then
UNIPATCH_DROP+=" 5010_enable-cpu-optimizations-universal.patch"
fi
# this legacy section should be targeted for removal
@ -1120,14 +1190,14 @@ unipatch() {
fi
done
#populate KPATCH_DIRS so we know where to look to remove the excludes
# Populate KPATCH_DIRS so we know where to look to remove the excludes
x=${KPATCH_DIR}
KPATCH_DIR=""
for i in $(find ${x} -type d | sort -n); do
KPATCH_DIR="${KPATCH_DIR} ${i}"
done
#so now lets get rid of the patchno's we want to exclude
# So now lets get rid of the patch numbers we want to exclude
UNIPATCH_DROP="${UNIPATCH_EXCLUDE} ${UNIPATCH_DROP}"
for i in ${UNIPATCH_DROP}; do
ebegin "Excluding Patch #${i}"
@ -1154,7 +1224,7 @@ unipatch() {
# addition of a file with the same name as the symlink in the #
# same location; this causes the dry-run to fail, see bug #507656. #
# #
# https://bugs.gentoo.org/show_bug.cgi?id=507656 #
# https://bugs.gentoo.org/507656 #
####################################################################
if [[ -n ${K_NODRYRUN} ]]; then
ebegin "Applying ${i/*\//} (-p1)"
@ -1330,7 +1400,16 @@ kernel-2_src_unpack() {
# allow ebuilds to massage the source tree after patching but before
# we run misc `make` functions below
[[ $(type -t kernel-2_hook_premake) == "function" ]] && kernel-2_hook_premake
if [[ $(type -t kernel-2_hook_premake) == "function" ]]; then
ewarn "The function name: kernel-2_hook_premake is being deprecated and"
ewarn "being changed to: kernel-2_insert_premake to comply with pms policy."
ewarn "See bug #843686 "
ewarn "The call to the old function name will be removed on or about July 1st, 2022 "
ewarn "Please update your ebuild before this date."
kernel-2_hook_premake
else
[[ $(type -t kernel-2_insert_premake) == "function" ]] && kernel-2_insert_premake
fi
debug-print "Doing unpack_set_extraversion"
@ -1380,8 +1459,10 @@ kernel-2_src_compile() {
cd "${S}" || die
if [[ ${K_DEBLOB_AVAILABLE} == 1 ]] && use deblob; then
einfo ">>> Patching deblob script for forcing awk ..."
sed -i '/check="\/bin\/sh $check"/a \ check="$check --use-awk"' \
"${T}/${DEBLOB_A}" || die "Failed to patch ${DEBLOB_A}"
einfo ">>> Running deblob script ..."
python_setup
sh "${T}/${DEBLOB_A}" --force || die "Deblob script failed to run!!!"
fi
}
@ -1454,10 +1535,10 @@ kernel-2_pkg_postrm() {
[[ ${ETYPE} == headers ]] && return 0
# If there isn't anything left behind, then don't complain.
[[ -e ${EROOT%/}/usr/src/linux-${KV_FULL} ]] || return 0
[[ -e ${EROOT}/usr/src/linux-${KV_FULL} ]] || return 0
ewarn "Note: Even though you have successfully unmerged "
ewarn "your kernel package, directories in kernel source location: "
ewarn "${EROOT%/}/usr/src/linux-${KV_FULL}"
ewarn "${EROOT}/usr/src/linux-${KV_FULL}"
ewarn "with modified files will remain behind. By design, package managers"
ewarn "will not remove these modified files and the directories they reside in."
ewarn "For more detailed kernel removal instructions, please see: "

View File

@ -8,6 +8,7 @@
# Michał Górny <mgorny@gentoo.org>
# Matt Turner <mattst88@gentoo.org>
# @SUPPORTED_EAPIS: 7 8
# @PROVIDES: meson multilib-minimal
# @BLURB: meson wrapper for multilib builds
# @DESCRIPTION:
# The meson-multilib.eclass provides a glue between meson.eclass(5)

View File

@ -1,4 +1,4 @@
# Copyright 1999-2022 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: multibuild.eclass
@ -14,7 +14,10 @@
# implementations).
case ${EAPI} in
6|7|8) ;;
6|7|8)
# backwards compatibility for run_in_build_dir
inherit out-of-source-utils
;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
@ -175,26 +178,6 @@ multibuild_copy_sources() {
multibuild_foreach_variant _multibuild_create_source_copy
}
# @FUNCTION: run_in_build_dir
# @USAGE: <argv>...
# @DESCRIPTION:
# Run the given command in the directory pointed by BUILD_DIR.
run_in_build_dir() {
debug-print-function ${FUNCNAME} "${@}"
local ret
[[ ${#} -ne 0 ]] || die "${FUNCNAME}: no command specified."
[[ ${BUILD_DIR} ]] || die "${FUNCNAME}: BUILD_DIR not set."
mkdir -p "${BUILD_DIR}" || die
pushd "${BUILD_DIR}" >/dev/null || die
"${@}"
ret=${?}
popd >/dev/null || die
return ${ret}
}
# @FUNCTION: multibuild_merge_root
# @USAGE: <src-root> <dest-root>
# @DESCRIPTION:

View File

@ -0,0 +1,43 @@
# Copyright 2022-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: out-of-source-utils.eclass
# @MAINTAINER:
# Michał Górny <mgorny@gentoo.org>
# @AUTHOR:
# Michał Górny <mgorny@gentoo.org>
# @SUPPORTED_EAPIS: 6 7 8
# @BLURB: Utility functions for building packages out-of-source
# @DESCRIPTION:
# This eclass provides a run_in_build_dir() helper that can be used
# to execute specified command inside BUILD_DIR.
case ${EAPI} in
6|7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ ! ${_OUT_OF_SOURCE_UTILS_ECLASS} ]]; then
_OUT_OF_SOURCE_UTILS_ECLASS=1
# @FUNCTION: run_in_build_dir
# @USAGE: <argv>...
# @DESCRIPTION:
# Run the given command in the directory pointed by BUILD_DIR.
run_in_build_dir() {
debug-print-function ${FUNCNAME} "${@}"
local ret
[[ ${#} -eq 0 ]] && die "${FUNCNAME}: no command specified."
[[ -z ${BUILD_DIR} ]] && die "${FUNCNAME}: BUILD_DIR not set."
mkdir -p "${BUILD_DIR}" || die
pushd "${BUILD_DIR}" >/dev/null || die
"${@}"
ret=${?}
popd >/dev/null || die
return ${ret}
}
fi

View File

@ -1,4 +1,4 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: perl-module.eclass
@ -7,7 +7,7 @@
# @AUTHOR:
# Seemant Kulleen <seemant@gentoo.org>
# Andreas K. Hüttel <dilfridge@gentoo.org>
# @SUPPORTED_EAPIS: 5 6 7 8
# @SUPPORTED_EAPIS: 7 8
# @PROVIDES: perl-functions
# @BLURB: eclass for installing Perl module distributions
# @DESCRIPTION:
@ -19,12 +19,8 @@
# ExtUtils::MakeMaker or Module::Build), we recommend to use perl-functions.eclass
# instead.
case ${EAPI:-0} in
5)
inherit eutils multiprocessing unpacker perl-functions
PERL_EXPF="src_unpack src_prepare src_configure src_compile src_test src_install"
;;
6|7)
case ${EAPI} in
7)
inherit multiprocessing perl-functions
PERL_EXPF="src_prepare src_configure src_compile src_test src_install"
;;
@ -33,79 +29,22 @@ case ${EAPI:-0} in
PERL_EXPF="src_prepare src_configure src_compile src_test src_install"
;;
*)
die "EAPI=${EAPI} is not supported by perl-module.eclass"
die "${ECLASS}: EAPI ${EAPI:-0} not supported"
;;
esac
# @ECLASS-VARIABLE: GENTOO_DEPEND_ON_PERL
# @ECLASS_VARIABLE: GENTOO_DEPEND_ON_PERL
# @DEFAULT_UNSET
# @DESCRIPTION:
# This variable controls whether a runtime and build time dependency on
# dev-lang/perl is automatically added by the eclass. It defaults to yes.
# Set to no to disable, set to noslotop to add a perl dependency without
# slot operator (EAPI=6). All packages installing into the vendor_perl
# slot operator. All packages installing into the vendor_perl
# path must use yes here. (EAPI=8 and later) Also adds a test useflag,
# a use-conditional build time dependency on virtual/perl-Test-Simple, and
# the required RESTRICT setting.
case ${EAPI:-0} in
5)
[[ ${CATEGORY} == perl-core ]] && \
PERL_EXPF+=" pkg_postinst pkg_postrm"
case "${GENTOO_DEPEND_ON_PERL:-yes}" in
yes)
case "${GENTOO_DEPEND_ON_PERL_SUBSLOT:-yes}" in
yes)
DEPEND="dev-lang/perl:=[-build(-)]"
;;
*)
DEPEND="dev-lang/perl[-build(-)]"
;;
esac
RDEPEND="${DEPEND}"
;;
esac
case "${PERL_EXPORT_PHASE_FUNCTIONS:-yes}" in
yes)
EXPORT_FUNCTIONS ${PERL_EXPF}
;;
no)
debug-print "PERL_EXPORT_PHASE_FUNCTIONS=no"
;;
*)
die "PERL_EXPORT_PHASE_FUNCTIONS=${PERL_EXPORT_PHASE_FUNCTIONS} is not supported by perl-module.eclass"
;;
esac
;;
6)
[[ ${CATEGORY} == perl-core ]] && \
PERL_EXPF+=" pkg_postinst pkg_postrm"
case "${GENTOO_DEPEND_ON_PERL:-yes}" in
yes)
DEPEND="dev-lang/perl"
RDEPEND="dev-lang/perl:="
;;
noslotop)
DEPEND="dev-lang/perl"
RDEPEND="dev-lang/perl"
;;
esac
if [[ "${GENTOO_DEPEND_ON_PERL_SUBSLOT:-yes}" != "yes" ]]; then
eerror "GENTOO_DEPEND_ON_PERL_SUBSLOT=no is banned in EAPI=6 and later. If you don't want a slot operator"
die "set GENTOO_DEPEND_ON_PERL=noslotop instead."
fi
if [[ "${PERL_EXPORT_PHASE_FUNCTIONS}" ]]; then
eerror "PERL_EXPORT_PHASE_FUNCTIONS is banned in EAPI=6 and later. Use perl-module.eclass if you need"
die "phase functions, perl-functions.eclass if not."
fi
EXPORT_FUNCTIONS ${PERL_EXPF}
;;
case ${EAPI} in
7)
[[ ${CATEGORY} == perl-core ]] && \
PERL_EXPF+=" pkg_postinst pkg_postrm"
@ -124,11 +63,11 @@ case ${EAPI:-0} in
esac
if [[ "${GENTOO_DEPEND_ON_PERL_SUBSLOT:-yes}" != "yes" ]]; then
die "GENTOO_DEPEND_ON_PERL_SUBSLOT=no is banned in EAPI=6 and later."
die "GENTOO_DEPEND_ON_PERL_SUBSLOT=no is banned."
fi
if [[ "${PERL_EXPORT_PHASE_FUNCTIONS}" ]]; then
die "PERL_EXPORT_PHASE_FUNCTIONS is banned in EAPI=6 and later."
die "PERL_EXPORT_PHASE_FUNCTIONS is banned."
fi
EXPORT_FUNCTIONS ${PERL_EXPF}
@ -154,11 +93,11 @@ case ${EAPI:-0} in
esac
if [[ "${GENTOO_DEPEND_ON_PERL_SUBSLOT:-yes}" != "yes" ]]; then
die "GENTOO_DEPEND_ON_PERL_SUBSLOT=no is banned in EAPI=6 and later."
die "GENTOO_DEPEND_ON_PERL_SUBSLOT=no is banned."
fi
if [[ "${PERL_EXPORT_PHASE_FUNCTIONS}" ]]; then
die "PERL_EXPORT_PHASE_FUNCTIONS is banned in EAPI=6 and later."
die "PERL_EXPORT_PHASE_FUNCTIONS is banned."
fi
EXPORT_FUNCTIONS ${PERL_EXPF}
@ -167,54 +106,51 @@ esac
LICENSE="${LICENSE:-|| ( Artistic GPL-1+ )}"
# @ECLASS-VARIABLE: DIST_NAME
# @ECLASS_VARIABLE: DIST_NAME
# @DEFAULT_UNSET
# @DESCRIPTION:
# (EAPI=6 and later) This variable provides a way to override PN for the calculation of S,
# This variable provides a way to override PN for the calculation of S,
# SRC_URI, and HOMEPAGE. If unset, defaults to PN.
# @ECLASS-VARIABLE: DIST_VERSION
# @ECLASS_VARIABLE: DIST_VERSION
# @DEFAULT_UNSET
# @DESCRIPTION:
# (EAPI=6 and later) This variable provides a way to override PV for the calculation of S and SRC_URI.
# This variable provides a way to override PV for the calculation of S and SRC_URI.
# Use it to provide the non-normalized, upstream version number. If unset, defaults to PV.
# Named MODULE_VERSION in EAPI=5.
# @ECLASS-VARIABLE: DIST_A_EXT
# @ECLASS_VARIABLE: DIST_A_EXT
# @DEFAULT_UNSET
# @DESCRIPTION:
# (EAPI=6 and later) This variable provides a way to override the distfile extension for the calculation of
# SRC_URI. If unset, defaults to tar.gz. Named MODULE_A_EXT in EAPI=5.
# This variable provides a way to override the distfile extension for the calculation of
# SRC_URI. If unset, defaults to tar.gz.
# @ECLASS-VARIABLE: DIST_A
# @ECLASS_VARIABLE: DIST_A
# @DEFAULT_UNSET
# @DESCRIPTION:
# (EAPI=6 and later) This variable provides a way to override the distfile name for the calculation of
# SRC_URI. If unset, defaults to ${DIST_NAME}-${DIST_VERSION}.${DIST_A_EXT} Named MODULE_A in EAPI=5.
# This variable provides a way to override the distfile name for the calculation of
# SRC_URI. If unset, defaults to ${DIST_NAME}-${DIST_VERSION}.${DIST_A_EXT}.
# @ECLASS-VARIABLE: DIST_AUTHOR
# @ECLASS_VARIABLE: DIST_AUTHOR
# @DEFAULT_UNSET
# @DESCRIPTION:
# (EAPI=6 and later) This variable sets the module author name for the calculation of
# SRC_URI. Named MODULE_AUTHOR in EAPI=5.
# This variable sets the module author name for the calculation of SRC_URI.
# @ECLASS-VARIABLE: DIST_SECTION
# @ECLASS_VARIABLE: DIST_SECTION
# @DEFAULT_UNSET
# @DESCRIPTION:
# (EAPI=6 and later) This variable sets the module section for the calculation of
# This variable sets the module section for the calculation of
# SRC_URI. Only required in rare cases for very special snowflakes.
# Named MODULE_SECTION in EAPI=5.
# @ECLASS-VARIABLE: DIST_EXAMPLES
# @ECLASS_VARIABLE: DIST_EXAMPLES
# @PRE_INHERIT
# @DEFAULT_UNSET
# @DESCRIPTION:
# (EAPI=6 and later) This Bash array allows passing a list of example files to be installed
# This Bash array allows passing a list of example files to be installed
# in /usr/share/doc/${PF}/examples. If set before inherit, automatically adds
# a use-flag examples, if not you'll have to add the useflag in your ebuild.
# Examples are installed only if the useflag examples exists and is activated.
# @ECLASS-VARIABLE: DIST_WIKI
# @ECLASS_VARIABLE: DIST_WIKI
# @DEFAULT_UNSET
# @DESCRIPTION:
# (EAPI=8 and later) This variable can be set to contain space-separated keywords
@ -224,7 +160,7 @@ LICENSE="${LICENSE:-|| ( Artistic GPL-1+ )}"
# * features: Notes about additional dependencies for optional features
# * tests: Notes about additional dependencies and preparations needed for testing
# @ECLASS-VARIABLE: DIST_MAKE
# @ECLASS_VARIABLE: DIST_MAKE
# @DESCRIPTION:
# (EAPI=8 and later) This Bash array contains parameters to the make call
# from ExtUtils::MakeMaker. Replaces mymake in EAPI=7 and earlier.
@ -233,67 +169,31 @@ if [[ $(declare -p DIST_MAKE 2>&-) != "declare -a DIST_MAKE="* ]]; then
DIST_MAKE=( OPTIMIZE="${CFLAGS}" )
fi
DIST_NAME=${DIST_NAME:-${PN}}
DIST_P=${DIST_NAME}-${DIST_VERSION:-${PV}}
S=${WORKDIR}/${DIST_P}
if [[ ${EAPI:-0} == 5 ]]; then
if [[ -n ${MY_PN} || -n ${MY_PV} || -n ${MODULE_VERSION} ]] ; then
: ${MY_P:=${MY_PN:-${PN}}-${MY_PV:-${MODULE_VERSION:-${PV}}}}
S=${MY_S:-${WORKDIR}/${MY_P}}
fi
MODULE_NAME=${MY_PN:-${PN}}
MODULE_P=${MY_P:-${P}}
[[ -z "${SRC_URI}" && -z "${MODULE_A}" ]] && \
MODULE_A="${MODULE_P}.${MODULE_A_EXT:-tar.gz}"
[[ -z "${SRC_URI}" && -n "${MODULE_AUTHOR}" ]] && \
SRC_URI="mirror://cpan/authors/id/${MODULE_AUTHOR:0:1}/${MODULE_AUTHOR:0:2}/${MODULE_AUTHOR}/${MODULE_SECTION:+${MODULE_SECTION}/}${MODULE_A}"
[[ -z "${HOMEPAGE}" ]] && \
HOMEPAGE="https://metacpan.org/release/${MODULE_NAME}"
SRC_TEST="skip"
else
DIST_NAME=${DIST_NAME:-${PN}}
DIST_P=${DIST_NAME}-${DIST_VERSION:-${PV}}
S=${WORKDIR}/${DIST_P}
[[ -z "${SRC_URI}" && -z "${DIST_A}" ]] && \
[[ -z "${SRC_URI}" && -z "${DIST_A}" ]] &&
DIST_A="${DIST_P}.${DIST_A_EXT:-tar.gz}"
[[ -z "${SRC_URI}" && -n "${DIST_AUTHOR}" ]] && \
[[ -z "${SRC_URI}" && -n "${DIST_AUTHOR}" ]] &&
SRC_URI="mirror://cpan/authors/id/${DIST_AUTHOR:0:1}/${DIST_AUTHOR:0:2}/${DIST_AUTHOR}/${DIST_SECTION:+${DIST_SECTION}/}${DIST_A}"
[[ -z "${HOMEPAGE}" ]] && \
[[ -z "${HOMEPAGE}" ]] &&
HOMEPAGE="https://metacpan.org/release/${DIST_NAME}"
[[ -z "${DIST_EXAMPLES}" ]] || IUSE+=" examples"
fi
[[ -z "${DIST_EXAMPLES}" ]] || IUSE+=" examples"
SRC_PREP="no"
PREFER_BUILDPL="yes"
pm_echovar=""
# @FUNCTION: perl-module_src_unpack
# @DESCRIPTION:
# Unpack the ebuild tarball(s).
# This function is to be called during the ebuild src_unpack() phase.
perl-module_src_unpack() {
debug-print-function $FUNCNAME "$@"
[[ ${EAPI:-0} == 5 ]] || die "perl-module_src_unpack is banned in EAPI=6 or later"
unpacker_src_unpack
}
# @FUNCTION: perl-module_src_prepare
# @DESCRIPTION:
# Get the ebuild sources ready.
# This function is to be called during the ebuild src_prepare() phase.
perl-module_src_prepare() {
debug-print-function $FUNCNAME "$@"
debug-print-function ${FUNCNAME} "$@"
if [[ ${EAPI:-0} == 5 ]] ; then
[[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
debug-print "$FUNCNAME: applying user patches"
epatch_user
else
default
fi
if [[ ${PERL_RM_FILES[@]} ]]; then
debug-print "$FUNCNAME: stripping unneeded files"
@ -307,12 +207,7 @@ perl-module_src_prepare() {
# Configure the ebuild sources.
# This function is to be called during the ebuild src_configure() phase.
perl-module_src_configure() {
debug-print-function $FUNCNAME "$@"
if [[ ${EAPI:-0} == 5 && ${SRC_PREP} == yes ]]; then
return 0
fi
SRC_PREP="yes"
debug-print-function ${FUNCNAME} "$@"
perl_check_env
@ -329,23 +224,6 @@ perl-module_src_configure() {
fi
if [[ ( ${PREFER_BUILDPL} == yes || ! -f Makefile.PL ) && -f Build.PL ]] ; then
case ${EAPI:-0} in
5|6)
if grep -q '\(use\|require\)\s*Module::Build::Tiny' Build.PL ; then
einfo "Using Module::Build::Tiny"
if [[ ${DEPEND} != *dev-perl/Module-Build-Tiny* && ${PN} != Module-Build-Tiny ]]; then
eerror "QA Notice: The ebuild uses Module::Build::Tiny but doesn't depend on it."
die " Add dev-perl/Module-Build-Tiny to DEPEND!"
fi
else
einfo "Using Module::Build"
if [[ ${DEPEND} != *virtual/perl-Module-Build* && ${DEPEND} != *dev-perl/Module-Build* && ${PN} != Module-Build ]] ; then
eerror "QA Notice: The ebuild uses Module::Build but doesn't depend on it."
die " Add dev-perl/Module-Build to DEPEND!"
fi
fi
;;
*)
if grep -q '\(use\|require\)\s*Module::Build::Tiny' Build.PL ; then
einfo "Using Module::Build::Tiny"
if [[ ${BDEPEND} != *dev-perl/Module-Build-Tiny* && ${PN} != Module-Build-Tiny ]]; then
@ -359,8 +237,7 @@ perl-module_src_configure() {
eerror " Add dev-perl/Module-Build to BDEPEND!"
fi
fi
;;
esac
set -- \
--installdirs=vendor \
--libdoc= \
@ -393,11 +270,12 @@ perl-module_src_configure() {
# Compile the ebuild sources.
# This function is to be called during the ebuild src_compile() phase.
perl-module_src_compile() {
debug-print-function $FUNCNAME "$@"
debug-print-function ${FUNCNAME} "$@"
perl_set_version
case ${EAPI} in
5|6|7)
7)
if [[ $(declare -p mymake 2>&-) != "declare -a mymake="* ]]; then
local mymake_local=(${mymake})
else
@ -416,60 +294,43 @@ perl-module_src_compile() {
set -- \
OTHERLDFLAGS="${LDFLAGS}" \
"${mymake_local[@]}"
einfo "emake" "$@"
emake "$@" \
|| die "Compilation failed"
# OPTIMIZE="${CFLAGS}" \
emake "$@"
fi
}
# @ECLASS-VARIABLE: DIST_TEST
# @ECLASS_VARIABLE: DIST_TEST
# @DEFAULT_UNSET
# @DESCRIPTION:
# (EAPI=6 and later) Variable that controls if tests are run in the test phase
# Variable that controls if tests are run in the test phase
# at all, and if yes under which conditions. If unset, defaults to "do parallel"
# If neither "do" nor "parallel" is recognized, tests are skipped.
# (In EAPI=5 the variable is called SRC_TEST, defaults to "skip", and
# recognizes fewer options.)
# The following space-separated keywords are recognized:
# do : run tests
# parallel : run tests in parallel
# verbose : increase test verbosity
# network : do not try to disable network tests
# @ECLASS-VARIABLE: DIST_TEST_OVERRIDE
# @ECLASS_VARIABLE: DIST_TEST_OVERRIDE
# @USER_VARIABLE
# @DEFAULT_UNSET
# @DESCRIPTION:
# (EAPI=6 and later) Variable that controls if tests are run in the test phase
# Variable that controls if tests are run in the test phase
# at all, and if yes under which conditions. It is intended for use in
# make.conf or the environment by ebuild authors during testing, and
# accepts the same values as DIST_TEST. If set, it overrides DIST_TEST
# completely. DO NOT USE THIS IN EBUILDS!
# @FUNCTION: perl-module_src-test
# @FUNCTION: perl-module_src_test
# @DESCRIPTION:
# This code attempts to work out your threadingness and runs tests
# according to the settings of DIST_TEST using Test::Harness.
perl-module_src_test() {
debug-print-function $FUNCNAME "$@"
debug-print-function ${FUNCNAME} "$@"
local my_test_control
local my_test_verbose
if [[ ${EAPI} == 5 ]] ; then
my_test_control=${SRC_TEST}
my_test_verbose=${TEST_VERBOSE:-0}
if has 'do' ${my_test_control} || has 'parallel' ${my_test_control} ; then
if has "${my_test_verbose}" 0 && has 'parallel' ${my_test_control} ; then
export HARNESS_OPTIONS=j$(makeopts_jobs)
einfo "Test::Harness Jobs=$(makeopts_jobs)"
fi
else
einfo Skipping tests due to SRC_TEST=${SRC_TEST}
return 0
fi
else
[[ -n "${DIST_TEST_OVERRIDE}" ]] && ewarn DIST_TEST_OVERRIDE is set to ${DIST_TEST_OVERRIDE}
[[ -n "${DIST_TEST_OVERRIDE}" ]] && ewarn "DIST_TEST_OVERRIDE is set to ${DIST_TEST_OVERRIDE}"
my_test_control=${DIST_TEST_OVERRIDE:-${DIST_TEST:-do parallel}}
if ! has 'do' ${my_test_control} && ! has 'parallel' ${my_test_control} ; then
@ -492,10 +353,9 @@ perl-module_src_test() {
if ! has network ${my_test_control} ; then
export NO_NETWORK_TESTING=1
fi
fi
case ${EAPI} in
5|6|7)
7)
;;
*)
if has 'tests' ${DIST_WIKI} ; then
@ -510,7 +370,7 @@ perl-module_src_test() {
if [[ -f Build ]] ; then
./Build test verbose=${my_test_verbose} || die "test failed"
elif [[ -f Makefile ]] ; then
emake test TEST_VERBOSE=${my_test_verbose} || die "test failed"
emake test TEST_VERBOSE=${my_test_verbose}
fi
}
@ -519,7 +379,7 @@ perl-module_src_test() {
# Install a Perl ebuild.
# This function is to be called during the ebuild src_install() phase.
perl-module_src_install() {
debug-print-function $FUNCNAME "$@"
debug-print-function ${FUNCNAME} "$@"
perl_set_version
@ -541,12 +401,11 @@ perl-module_src_install() {
else
local myinst_local=("${myinst[@]}")
fi
emake "${myinst_local[@]}" ${mytargets} \
|| die "emake ${myinst_local[@]} ${mytargets} failed"
emake "${myinst_local[@]}" ${mytargets}
fi
case ${EAPI} in
5|6|7)
7)
;;
*)
perl_fix_permissions
@ -555,28 +414,22 @@ perl-module_src_install() {
perl_delete_module_manpages
perl_delete_localpod
if [[ ${EAPI} == 5 ]] ; then
perl_delete_packlist
else
perl_fix_packlist
perl_delete_emptybsdir
fi
perl_remove_temppath
for f in Change* CHANGES README* TODO FAQ ${mydoc}; do
[[ -s ${f} ]] && dodoc ${f}
done
if [[ ${EAPI} != 5 ]] ; then
if in_iuse examples && use examples ; then
[[ ${#DIST_EXAMPLES[@]} -eq 0 ]] || perl_doexamples "${DIST_EXAMPLES[@]}"
fi
fi
perl_link_duallife_scripts
case ${EAPI} in
5|6|7)
7)
;;
*)
if has 'features' ${DIST_WIKI} ; then
@ -599,7 +452,8 @@ perl-module_src_install() {
# links that prevent file collisions for dual-life packages installing scripts.
# In any other category it immediately exits.
perl-module_pkg_postinst() {
debug-print-function $FUNCNAME "$@"
debug-print-function ${FUNCNAME} "$@"
if [[ ${CATEGORY} != perl-core ]] ; then
eerror "perl-module.eclass: You are calling perl-module_pkg_postinst outside the perl-core category."
die " This does not do anything; the call can be removed."
@ -614,7 +468,8 @@ perl-module_pkg_postinst() {
# links that prevent file collisions for dual-life packages installing scripts.
# In any other category it immediately exits.
perl-module_pkg_postrm() {
debug-print-function $FUNCNAME "$@"
debug-print-function ${FUNCNAME} "$@"
if [[ ${CATEGORY} != perl-core ]] ; then
eerror "perl-module.eclass: You are calling perl-module_pkg_postrm outside the perl-core category."
die " This does not do anything; the call can be removed."

View File

@ -1,4 +1,4 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: portability.eclass
@ -6,11 +6,11 @@
# base-system@gentoo.org
# @AUTHOR:
# Diego Pettenò <flameeyes@gentoo.org>
# @SUPPORTED_EAPIS: 5 6 7
# @SUPPORTED_EAPIS: 6 7 8
# @BLURB: This eclass is created to avoid using non-portable GNUisms inside ebuilds
case ${EAPI:-0} in
[567]) ;;
case ${EAPI} in
6|7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
@ -153,7 +153,4 @@ get_mounts() {
done
}
_dead_portability_user_funcs() { die "if you really need this, please file a bug for base-system@gentoo.org"; }
is-login-disabled() { _dead_portability_user_funcs; }
fi

View File

@ -25,24 +25,24 @@ case ${EAPI} in
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
# @ECLASS-VARIABLE: DOC_CONTENTS
# @ECLASS_VARIABLE: DOC_CONTENTS
# @DEFAULT_UNSET
# @DESCRIPTION:
# The information that is used to create the README.gentoo file.
# @ECLASS-VARIABLE: DISABLE_AUTOFORMATTING
# @ECLASS_VARIABLE: DISABLE_AUTOFORMATTING
# @DEFAULT_UNSET
# @DESCRIPTION:
# If non-empty, DOC_CONTENTS information will be strictly respected,
# not getting it automatically formatted by fmt. If empty, it will
# rely on fmt for formatting and 'echo -e' options to tweak lines a bit.
# @ECLASS-VARIABLE: FORCE_PRINT_ELOG
# @ECLASS_VARIABLE: FORCE_PRINT_ELOG
# @DEFAULT_UNSET
# @DESCRIPTION:
# If non-empty this variable forces elog messages to be printed.
# @ECLASS-VARIABLE: README_GENTOO_SUFFIX
# @ECLASS_VARIABLE: README_GENTOO_SUFFIX
# @DESCRIPTION:
# If you want to specify a suffix for README.gentoo file please export it.
: ${README_GENTOO_SUFFIX:=""}

View File

@ -1,10 +1,10 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: savedconfig.eclass
# @MAINTAINER:
# base-system@gentoo.org
# @SUPPORTED_EAPIS: 5 6 7
# @SUPPORTED_EAPIS: 6 7 8
# @BLURB: common API for saving/restoring complex configuration files
# @DESCRIPTION:
# It is not uncommon to come across a package which has a very fine
@ -35,7 +35,7 @@ inherit portability
IUSE="savedconfig"
case ${EAPI} in
[5-7]) ;;
6|7|8) ;;
*) die "EAPI=${EAPI:-0} is not supported" ;;
esac

View File

@ -1,4 +1,4 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: udev.eclass
@ -26,6 +26,14 @@
# # udev_dorules contrib/99-foomatic
# # udev_newrules contrib/98-foomatic 99-foomatic
# }
#
# pkg_postinst() {
# udev_reload
# }
#
# pkg_postrm() {
# udev_reload
# }
# @CODE
case ${EAPI} in
@ -53,7 +61,7 @@ _udev_get_udevdir() {
local -x PKG_CONFIG_FDO_SYSROOT_RULES=1
if $($(tc-getPKG_CONFIG) --exists udev); then
local udevdir="$($(tc-getPKG_CONFIG) --variable=udevdir udev)"
echo "${udevdir#${EPREFIX%/}}"
echo "${udevdir#${EPREFIX}}"
else
echo /lib/udev
fi
@ -110,7 +118,9 @@ udev_newrules() {
# @FUNCTION: udev_reload
# @DESCRIPTION:
# Run udevadm control --reload to refresh rules and databases
# Run "udevadm control --reload" to refresh rules and databases.
# Should be called from pkg_postinst and pkg_postrm in packages which install
# udev rules or hwdb data.
udev_reload() {
if [[ -n ${ROOT%/} ]]; then
return 0

View File

@ -1,535 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: unpacker.eclass
# @MAINTAINER:
# base-system@gentoo.org
# @SUPPORTED_EAPIS: 5 6 7 8
# @BLURB: helpers for extraneous file formats and consistent behavior across EAPIs
# @DESCRIPTION:
# Some extraneous file formats are not part of PMS, or are only in certain
# EAPIs. Rather than worrying about that, support the crazy cruft here
# and for all EAPI versions.
# Possible todos:
# - merge rpm unpacking
# - support partial unpacks?
case ${EAPI:-0} in
[5678]) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ -z ${_UNPACKER_ECLASS} ]]; then
_UNPACKER_ECLASS=1
inherit toolchain-funcs
# @ECLASS-VARIABLE: UNPACKER_BZ2
# @USER_VARIABLE
# @DEFAULT_UNSET
# @DESCRIPTION:
# Utility to use to decompress bzip2 files. Will dynamically pick between
# `pbzip2` and `bzip2`. Make sure your choice accepts the "-dc" options.
# Note: this is meant for users to set, not ebuilds.
# @ECLASS-VARIABLE: UNPACKER_LZIP
# @USER_VARIABLE
# @DEFAULT_UNSET
# @DESCRIPTION:
# Utility to use to decompress lzip files. Will dynamically pick between
# `plzip`, `pdlzip` and `lzip`. Make sure your choice accepts the "-dc" options.
# Note: this is meant for users to set, not ebuilds.
# for internal use only (unpack_pdv and unpack_makeself)
find_unpackable_file() {
local src=$1
if [[ -z ${src} ]] ; then
src=${DISTDIR}/${A}
else
if [[ ${src} == ./* ]] ; then
: # already what we want
elif [[ -e ${DISTDIR}/${src} ]] ; then
src=${DISTDIR}/${src}
elif [[ -e ${PWD}/${src} ]] ; then
src=${PWD}/${src}
elif [[ -e ${src} ]] ; then
src=${src}
fi
fi
[[ ! -e ${src} ]] && return 1
echo "${src}"
}
unpack_banner() {
echo ">>> Unpacking ${1##*/} to ${PWD}"
}
# @FUNCTION: unpack_pdv
# @USAGE: <file to unpack> <size of off_t>
# @DESCRIPTION:
# Unpack those pesky pdv generated files ...
# They're self-unpacking programs with the binary package stuffed in
# the middle of the archive. Valve seems to use it a lot ... too bad
# it seems to like to segfault a lot :(. So lets take it apart ourselves.
#
# You have to specify the off_t size ... I have no idea how to extract that
# information out of the binary executable myself. Basically you pass in
# the size of the off_t type (in bytes) on the machine that built the pdv
# archive.
#
# One way to determine this is by running the following commands:
#
# @CODE
# strings <pdv archive> | grep lseek
# strace -elseek <pdv archive>
# @CODE
#
# Basically look for the first lseek command (we do the strings/grep because
# sometimes the function call is _llseek or something) and steal the 2nd
# parameter. Here is an example:
#
# @CODE
# $ strings hldsupdatetool.bin | grep lseek
# lseek
# $ strace -elseek ./hldsupdatetool.bin
# lseek(3, -4, SEEK_END) = 2981250
# @CODE
#
# Thus we would pass in the value of '4' as the second parameter.
unpack_pdv() {
local src=$(find_unpackable_file "$1")
local sizeoff_t=$2
[[ -z ${src} ]] && die "Could not locate source for '$1'"
[[ -z ${sizeoff_t} ]] && die "No idea what off_t size was used for this pdv :("
unpack_banner "${src}"
local metaskip=$(tail -c ${sizeoff_t} "${src}" | hexdump -e \"%i\")
local tailskip=$(tail -c $((${sizeoff_t}*2)) "${src}" | head -c ${sizeoff_t} | hexdump -e \"%i\")
# grab metadata for debug reasons
local metafile="${T}/${FUNCNAME}.meta"
tail -c +$((${metaskip}+1)) "${src}" > "${metafile}"
# rip out the final file name from the metadata
local datafile=$(tail -c +$((${metaskip}+1)) "${src}" | strings | head -n 1)
datafile=$(basename "${datafile}")
# now lets uncompress/untar the file if need be
local tmpfile="${T}/${FUNCNAME}"
tail -c +$((${tailskip}+1)) ${src} 2>/dev/null | head -c 512 > "${tmpfile}"
local iscompressed=$(file -b "${tmpfile}")
if [[ ${iscompressed:0:8} == "compress" ]] ; then
iscompressed=1
mv "${tmpfile}"{,.Z}
gunzip "${tmpfile}"
else
iscompressed=0
fi
local istar=$(file -b "${tmpfile}")
if [[ ${istar:0:9} == "POSIX tar" ]] ; then
istar=1
else
istar=0
fi
#for some reason gzip dies with this ... dd cant provide buffer fast enough ?
#dd if=${src} ibs=${metaskip} count=1 \
# | dd ibs=${tailskip} skip=1 \
# | gzip -dc \
# > ${datafile}
if [ ${iscompressed} -eq 1 ] ; then
if [ ${istar} -eq 1 ] ; then
tail -c +$((${tailskip}+1)) "${src}" 2>/dev/null \
| head -c $((${metaskip}-${tailskip})) \
| tar -xzf -
else
tail -c +$((${tailskip}+1)) "${src}" 2>/dev/null \
| head -c $((${metaskip}-${tailskip})) \
| gzip -dc \
> ${datafile}
fi
else
if [ ${istar} -eq 1 ] ; then
tail -c +$((${tailskip}+1)) "${src}" 2>/dev/null \
| head -c $((${metaskip}-${tailskip})) \
| tar --no-same-owner -xf -
else
tail -c +$((${tailskip}+1)) "${src}" 2>/dev/null \
| head -c $((${metaskip}-${tailskip})) \
> ${datafile}
fi
fi
true
#[ -s "${datafile}" ] || die "failure unpacking pdv ('${metaskip}' '${tailskip}' '${datafile}')"
#assert "failure unpacking pdv ('${metaskip}' '${tailskip}' '${datafile}')"
}
# @FUNCTION: unpack_makeself
# @USAGE: [file to unpack] [offset] [tail|dd]
# @DESCRIPTION:
# Unpack those pesky makeself generated files ...
# They're shell scripts with the binary package tagged onto
# the end of the archive. Loki utilized the format as does
# many other game companies.
#
# If the file is not specified, then ${A} is used. If the
# offset is not specified then we will attempt to extract
# the proper offset from the script itself.
unpack_makeself() {
local src_input=${1:-${A}}
local src=$(find_unpackable_file "${src_input}")
local skip=$2
local exe=$3
[[ -z ${src} ]] && die "Could not locate source for '${src_input}'"
unpack_banner "${src}"
if [[ -z ${skip} ]] ; then
local ver=$(grep -m1 -a '#.*Makeself' "${src}" | awk '{print $NF}')
local skip=0
exe=tail
case ${ver} in
1.5.*|1.6.0-nv*) # tested 1.5.{3,4,5} ... guessing 1.5.x series is same
skip=$(grep -a ^skip= "${src}" | cut -d= -f2)
;;
2.0|2.0.1)
skip=$(grep -a ^$'\t'tail "${src}" | awk '{print $2}' | cut -b2-)
;;
2.1.1)
skip=$(grep -a ^offset= "${src}" | awk '{print $2}' | cut -b2-)
(( skip++ ))
;;
2.1.2)
skip=$(grep -a ^offset= "${src}" | awk '{print $3}' | head -n 1)
(( skip++ ))
;;
2.1.3)
skip=`grep -a ^offset= "${src}" | awk '{print $3}'`
(( skip++ ))
;;
2.1.4|2.1.5|2.1.6|2.2.0|2.4.0)
skip=$(grep -a offset=.*head.*wc "${src}" | awk '{print $3}' | head -n 1)
skip=$(head -n ${skip} "${src}" | wc -c)
exe="dd"
;;
*)
eerror "I'm sorry, but I was unable to support the Makeself file."
eerror "The version I detected was '${ver}'."
eerror "Please file a bug about the file ${src##*/} at"
eerror "https://bugs.gentoo.org/ so that support can be added."
die "makeself version '${ver}' not supported"
;;
esac
debug-print "Detected Makeself version ${ver} ... using ${skip} as offset"
fi
case ${exe} in
tail) exe=( tail -n +${skip} "${src}" );;
dd) exe=( dd ibs=${skip} skip=1 if="${src}" );;
*) die "makeself cant handle exe '${exe}'"
esac
# lets grab the first few bytes of the file to figure out what kind of archive it is
local filetype tmpfile="${T}/${FUNCNAME}"
"${exe[@]}" 2>/dev/null | head -c 512 > "${tmpfile}"
filetype=$(file -b "${tmpfile}") || die
case ${filetype} in
*tar\ archive*)
"${exe[@]}" | tar --no-same-owner -xf -
;;
bzip2*)
"${exe[@]}" | bzip2 -dc | tar --no-same-owner -xf -
;;
gzip*)
"${exe[@]}" | tar --no-same-owner -xzf -
;;
compress*)
"${exe[@]}" | gunzip | tar --no-same-owner -xf -
;;
XZ*)
"${exe[@]}" | unxz | tar --no-same-owner -xf -
;;
*)
eerror "Unknown filetype \"${filetype}\" ?"
false
;;
esac
assert "failure unpacking (${filetype}) makeself ${src##*/} ('${ver}' +${skip})"
}
# @FUNCTION: unpack_deb
# @USAGE: <one deb to unpack>
# @DESCRIPTION:
# Unpack a Debian .deb archive in style.
unpack_deb() {
[[ $# -eq 1 ]] || die "Usage: ${FUNCNAME} <file>"
local deb=$(find_unpackable_file "$1")
unpack_banner "${deb}"
# on AIX ar doesn't work out as their ar used a different format
# from what GNU ar (and thus what .deb files) produce
if [[ -n ${EPREFIX} ]] ; then
{
read # global header
[[ ${REPLY} = "!<arch>" ]] || die "${deb} does not seem to be a deb archive"
local f timestamp uid gid mode size magic
while read f timestamp uid gid mode size magic ; do
[[ -n ${f} && -n ${size} ]] || continue # ignore empty lines
if [[ ${f} = "data.tar"* ]] ; then
head -c "${size}" > "${f}"
else
head -c "${size}" > /dev/null # trash it
fi
done
} < "${deb}"
else
$(tc-getBUILD_AR) x "${deb}" || die
fi
unpacker ./data.tar*
# Clean things up #458658. No one seems to actually care about
# these, so wait until someone requests to do something else ...
rm -f debian-binary {control,data}.tar*
}
# @FUNCTION: unpack_cpio
# @USAGE: <one cpio to unpack>
# @DESCRIPTION:
# Unpack a cpio archive, file "-" means stdin.
unpack_cpio() {
[[ $# -eq 1 ]] || die "Usage: ${FUNCNAME} <file>"
# needed as cpio always reads from stdin
local cpio_cmd=( cpio --make-directories --extract --preserve-modification-time )
if [[ $1 == "-" ]] ; then
unpack_banner "stdin"
"${cpio_cmd[@]}"
else
local cpio=$(find_unpackable_file "$1")
unpack_banner "${cpio}"
"${cpio_cmd[@]}" <"${cpio}"
fi
}
# @FUNCTION: unpack_zip
# @USAGE: <zip file>
# @DESCRIPTION:
# Unpack zip archives.
# This function ignores all non-fatal errors (i.e. warnings).
# That is useful for zip archives with extra crap attached
# (e.g. self-extracting archives).
unpack_zip() {
[[ $# -eq 1 ]] || die "Usage: ${FUNCNAME} <file>"
local zip=$(find_unpackable_file "$1")
unpack_banner "${zip}"
unzip -qo "${zip}"
[[ $? -le 1 ]] || die "unpacking ${zip} failed (arch=unpack_zip)"
}
# @FUNCTION: unpack_7z
# @USAGE: <7z file>
# @DESCRIPTION:
# Unpack 7z archives.
unpack_7z() {
[[ $# -eq 1 ]] || die "Usage: ${FUNCNAME} <file>"
local p7z=$(find_unpackable_file "$1")
unpack_banner "${p7z}"
local output="$(7z x -y "${p7z}")"
if [ $? -ne 0 ]; then
echo "${output}" >&2
die "unpacking ${p7z} failed (arch=unpack_7z)"
fi
}
# @FUNCTION: unpack_rar
# @USAGE: <rar file>
# @DESCRIPTION:
# Unpack RAR archives.
unpack_rar() {
[[ $# -eq 1 ]] || die "Usage: ${FUNCNAME} <file>"
local rar=$(find_unpackable_file "$1")
unpack_banner "${rar}"
unrar x -idq -o+ "${rar}" || die "unpacking ${rar} failed (arch=unpack_rar)"
}
# @FUNCTION: unpack_lha
# @USAGE: <lha file>
# @DESCRIPTION:
# Unpack LHA/LZH archives.
unpack_lha() {
[[ $# -eq 1 ]] || die "Usage: ${FUNCNAME} <file>"
local lha=$(find_unpackable_file "$1")
unpack_banner "${lha}"
lha xfq "${lha}" || die "unpacking ${lha} failed (arch=unpack_lha)"
}
# @FUNCTION: _unpacker
# @USAGE: <one archive to unpack>
# @INTERNAL
# @DESCRIPTION:
# Unpack the specified archive. We only operate on one archive here
# to keep down on the looping logic (that is handled by `unpacker`).
_unpacker() {
[[ $# -eq 1 ]] || die "Usage: ${FUNCNAME} <file>"
local a=$1
local m=$(echo "${a}" | tr '[:upper:]' '[:lower:]')
a=$(find_unpackable_file "${a}")
# first figure out the decompression method
local comp=""
case ${m} in
*.bz2|*.tbz|*.tbz2)
local bzcmd=${PORTAGE_BZIP2_COMMAND:-$(type -P pbzip2 || type -P bzip2)}
local bzuncmd=${PORTAGE_BUNZIP2_COMMAND:-${bzcmd} -d}
: ${UNPACKER_BZ2:=${bzuncmd}}
comp="${UNPACKER_BZ2} -c"
;;
*.z|*.gz|*.tgz)
comp="gzip -dc" ;;
*.lzma|*.xz|*.txz)
comp="xz -dc" ;;
*.lz)
: ${UNPACKER_LZIP:=$(type -P plzip || type -P pdlzip || type -P lzip)}
comp="${UNPACKER_LZIP} -dc" ;;
*.zst)
comp="zstd -dfc" ;;
esac
# then figure out if there are any archiving aspects
local arch=""
case ${m} in
*.tgz|*.tbz|*.tbz2|*.txz|*.tar.*|*.tar)
arch="tar --no-same-owner -xof" ;;
*.cpio.*|*.cpio)
arch="unpack_cpio" ;;
*.deb)
arch="unpack_deb" ;;
*.run)
arch="unpack_makeself" ;;
*.sh)
# Not all shell scripts are makeself
if head -n 30 "${a}" | grep -qs '#.*Makeself' ; then
arch="unpack_makeself"
fi
;;
*.bin)
# Makeself archives can be annoyingly named
if head -c 100 "${a}" | grep -qs '#.*Makeself' ; then
arch="unpack_makeself"
fi
;;
*.zip)
arch="unpack_zip" ;;
esac
# 7z, rar and lha/lzh are handled by package manager in EAPI < 8
if [[ ${EAPI} != [567] ]]; then
case ${m} in
*.7z)
arch="unpack_7z" ;;
*.rar|*.RAR)
arch="unpack_rar" ;;
*.LHA|*.LHa|*.lha|*.lzh)
arch="unpack_lha" ;;
esac
fi
# finally do the unpack
if [[ -z ${arch}${comp} ]] ; then
unpack "$1"
return $?
fi
[[ ${arch} != unpack_* ]] && unpack_banner "${a}"
if [[ -z ${arch} ]] ; then
# Need to decompress the file into $PWD #408801
local _a=${a%.*}
${comp} "${a}" > "${_a##*/}"
elif [[ -z ${comp} ]] ; then
${arch} "${a}"
else
${comp} "${a}" | ${arch} -
fi
assert "unpacking ${a} failed (comp=${comp} arch=${arch})"
}
# @FUNCTION: unpacker
# @USAGE: [archives to unpack]
# @DESCRIPTION:
# This works in the same way that `unpack` does. If you don't specify
# any files, it will default to ${A}.
unpacker() {
local a
[[ $# -eq 0 ]] && set -- ${A}
for a ; do _unpacker "${a}" ; done
}
# @FUNCTION: unpacker_src_unpack
# @DESCRIPTION:
# Run `unpacker` to unpack all our stuff.
unpacker_src_unpack() {
unpacker
}
# @FUNCTION: unpacker_src_uri_depends
# @USAGE: [archives that we will unpack]
# @RETURN: Dependencies needed to unpack all the archives
# @DESCRIPTION:
# Walk all the specified files (defaults to $SRC_URI) and figure out the
# dependencies that are needed to unpack things.
#
# Note: USE flags are not yet handled.
unpacker_src_uri_depends() {
local uri deps d
if [[ $# -eq 0 ]] ; then
# Disable path expansion for USE conditionals. #654960
set -f
set -- ${SRC_URI}
set +f
fi
for uri in "$@" ; do
case ${uri} in
*.cpio.*|*.cpio)
d="app-arch/cpio" ;;
*.rar|*.RAR)
d="app-arch/unrar" ;;
*.7z)
d="app-arch/p7zip" ;;
*.xz)
d="app-arch/xz-utils" ;;
*.zip)
d="app-arch/unzip" ;;
*.lz)
d="|| ( app-arch/plzip app-arch/pdlzip app-arch/lzip )" ;;
*.zst)
d="app-arch/zstd" ;;
*.LHA|*.LHa|*.lha|*.lzh)
d="app-arch/lha" ;;
esac
deps+=" ${d}"
done
echo "${deps}"
}
EXPORT_FUNCTIONS src_unpack
fi

View File

@ -1,4 +1,4 @@
# Copyright 2004-2021 Gentoo Authors
# Copyright 2004-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: xdg-utils.eclass
@ -42,9 +42,10 @@ xdg_environment_reset() {
export XDG_DATA_HOME="${HOME}/.local/share"
export XDG_CONFIG_HOME="${HOME}/.config"
export XDG_CACHE_HOME="${HOME}/.cache"
export XDG_STATE_HOME="${HOME}/.local/state"
export XDG_RUNTIME_DIR="${T}/run"
mkdir -p "${XDG_DATA_HOME}" "${XDG_CONFIG_HOME}" "${XDG_CACHE_HOME}" \
"${XDG_RUNTIME_DIR}" || die
"${XDG_STATE_HOME}" "${XDG_RUNTIME_DIR}" || die
# This directory needs to be owned by the user, and chmod 0700
# https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
chmod 0700 "${XDG_RUNTIME_DIR}" || die

View File

@ -1,2 +1,2 @@
DIST libpng-1.6.37-apng.patch.gz 10334 BLAKE2B 98660f2c13a78c93f937adf2859447cb0e6fa014b2ef6f0571c910593d94cc0a50137d271dbded0b571a3bc0ce4e9f765be48130ee4ae89884fb7292a1b0cf6e SHA512 a9365257a33d67d7e7284494a37747bb1f3ab89f42a1730f2745c604538f59861828dc91d9bc1d08a5b79ab2f4eef1bb9e438dda1774b3548a1c56be77f8435f
DIST libpng-1.6.37.tar.xz 1012272 BLAKE2B 48e8f48a88e0db6fcbc0c0f1a4d5bda6e6c8b03255bacdc60e353256ae41ccc01b5b2a7e0e7b0dea236c53a3b9d1dd89d4bb19445afbebc37bf0f92691452424 SHA512 59e8c1059013497ae616a14c3abbe239322d3873c6ded0912403fc62fb260561768230b6ab997e2cccc3b868c09f539fd13635616b9fa0dd6279a3f63ec7e074
DIST libpng-1.6.38-apng.patch.gz 10766 BLAKE2B 3aa4bf28f5854f3dbafd1b1e92a1b80b23b59279286f730babcb091369c266ab93427223f79c8797139a6624bd41a3485064faedde47680048804ef6d41f892a SHA512 e8cb74d9be6bcbc474b6bbd6200ab5d5111e91d3ab601e5fda04213d2800a4051f04152fa5d47db690612ed06a488ff3b2608a8f0bac0cf207d486107d98da1f
DIST libpng-1.6.39.tar.xz 1020552 BLAKE2B f0a2e643e921587334349f48758e61e69b4708ebc36575567767087878d262d134eeeb98fea7f0b6ff1493ea954910ca1608b10fea57196aad770eb807a9006e SHA512 ce233bb58d70b391b7dc858a132a8f9f66a9e30f5b387426317fdd5e76e8395e00ec36324e5e2caec8fda49a3f2b13fe27594a3466fdf2020ec7520e79a608c9

View File

@ -1,18 +1,19 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EAPI=8
inherit libtool multilib-minimal
APNG_VERSION="1.6.38"
DESCRIPTION="Portable Network Graphics library"
HOMEPAGE="http://www.libpng.org/"
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.xz
apng? ( mirror://sourceforge/apng/${P}-apng.patch.gz )"
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.xz"
SRC_URI+=" apng? ( mirror://sourceforge/libpng-apng/${PN}$(ver_rs 1-2 '' $(ver_cut 1-2 ${APNG_VERSION}))/${PV}/${PN}-${APNG_VERSION}-apng.patch.gz )"
LICENSE="libpng2"
SLOT="0/16"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
IUSE="apng cpu_flags_arm_neon cpu_flags_x86_sse static-libs"
RDEPEND=">=sys-libs/zlib-1.2.8-r1:=[${MULTILIB_USEDEP}]"
@ -22,20 +23,24 @@ DOCS=( ANNOUNCE CHANGES libpng-manual.txt README TODO )
src_prepare() {
default
if use apng; then
eapply -p0 "${WORKDIR}"/${PN}-*-apng.patch
# Don't execute symbols check with apng patch wrt #378111
eapply "${WORKDIR}"/${PN}-*-apng.patch
# Don't execute symbols check with apng patch, bug #378111
sed -i -e '/^check/s:scripts/symbols.chk::' Makefile.in || die
fi
elibtoolize
}
multilib_src_configure() {
local myeconfargs=(
$(use_enable cpu_flags_arm_neon arm-neon check)
$(use_enable cpu_flags_arm_neon arm-neon)
$(use_enable cpu_flags_x86_sse intel-sse)
$(use_enable static-libs static)
)
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
}

View File

@ -15,7 +15,11 @@
<upstream>
<remote-id type="cpe">cpe:/a:libpng:libpng</remote-id>
<remote-id type="github">glennrp/libpng</remote-id>
<remote-id type="github">pnggroup/libpng-EXPERIMENTAL</remote-id>
<remote-id type="github">glennrp/libpng-releases</remote-id>
<remote-id type="sourceforge">libpng</remote-id>
<remote-id type="sourceforge">apng</remote-id>
<remote-id type="sourceforge">libpng-apng</remote-id>
</upstream>
<slots>
<subslots>Reflect ABI compatibility for libpng.so.</subslots>

View File

@ -1 +1,2 @@
DIST libslirp-4.6.1.tar.gz 135569 BLAKE2B 7a890912f2a8ce9d6820870e2d29b9c7a2253c403c2bcb127a38e02b2b81d1e262f34571c8a4c05fbf46874b9b2967cb5597cabe169ad54f12702fdd8b90bb3c SHA512 04a9dd88cd58c849a24b9cff405d951952760d99ea2bef0b070463dff088d79f44557a13c9427ba0043f58d4b9e06b68ff64a4f23a7b0d66df594e32e1521cae
DIST libslirp-4.7.0.tar.gz 143251 BLAKE2B f3e1c3a31f09462d79ca6c663a05bde02b075090f3a5f7bc69fef3c72b8517c11a123ad7b46f4b2855cbc9a7a5dbde8d1cb2d5e3e2a9d7eedbe570c200f8bcc6 SHA512 387f4a6dad240ce633df2640bb49c6cb0041c8b3afc8d0ef38186d385f00dd9e4ef4443e93e1b71dbf05e22892b6f2771a87a202e815d8ec899ab5c147a1f09f

View File

@ -1,48 +0,0 @@
From: Prasad J Pandit <pjp@fedoraproject.org>
Date: Thu, 26 Nov 2020 13:57:06 +0000
Subject: [PATCH] slirp: check pkt_len before reading protocol header
While processing ARP/NCSI packets in 'arp_input' or 'ncsi_input'
routines, ensure that pkt_len is large enough to accommodate the
respective protocol headers, lest it should do an OOB access.
Add check to avoid it.
Reported-by: Qiuhao Li @outlook.com;
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
---
src/ncsi.c | 4 ++++
src/slirp.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/src/ncsi.c b/src/ncsi.c
index 3c1dfef..75dcc08 100644
--- a/src/ncsi.c
+++ b/src/ncsi.c
@@ -148,6 +148,10 @@ void ncsi_input(Slirp *slirp, const uint8_t *pkt, int pkt_len)
uint32_t checksum;
uint32_t *pchecksum;
+ if (pkt_len < ETH_HLEN + sizeof(struct ncsi_pkt_hdr)) {
+ return; /* packet too short */
+ }
+
memset(ncsi_reply, 0, sizeof(ncsi_reply));
memset(reh->h_dest, 0xff, ETH_ALEN);
diff --git a/src/slirp.c b/src/slirp.c
index 9bead0c..abb6f9a 100644
--- a/src/slirp.c
+++ b/src/slirp.c
@@ -860,6 +860,10 @@ static void arp_input(Slirp *slirp, const uint8_t *pkt, int pkt_len)
return;
}
+ if (pkt_len < ETH_HLEN + sizeof(struct slirp_arphdr)) {
+ return; /* packet too short */
+ }
+
ar_op = ntohs(ah->ar_op);
switch (ar_op) {
case ARPOP_REQUEST:
--
2.28.0

View File

@ -1,14 +1,14 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit meson
KEYWORDS="amd64 arm64 ~ppc ppc64 x86"
KEYWORDS="amd64 arm64 ~m68k ~ppc ppc64 ~riscv x86"
MY_P="${PN}-v${PV}"
SRC_URI="https://gitlab.freedesktop.org/slirp/libslirp/-/archive/v${PV}/${MY_P}.tar.gz -> ${P}.tar.gz"
DESCRIPTION="A TCP-IP emulator used to provide virtual networking services."
DESCRIPTION="A TCP-IP emulator used to provide virtual networking services"
HOMEPAGE="https://gitlab.freedesktop.org/slirp/libslirp"
LICENSE="BSD"

View File

@ -0,0 +1,35 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit meson
KEYWORDS="~amd64 ~arm64 ~loong ~m68k ~ppc ~ppc64 ~riscv ~x86"
MY_P="${PN}-v${PV}"
SRC_URI="https://gitlab.freedesktop.org/slirp/libslirp/-/archive/v${PV}/${MY_P}.tar.gz -> ${P}.tar.gz"
DESCRIPTION="A TCP-IP emulator used to provide virtual networking services"
HOMEPAGE="https://gitlab.freedesktop.org/slirp/libslirp"
LICENSE="BSD"
SLOT="0"
IUSE="static-libs"
RDEPEND="dev-libs/glib:="
DEPEND="${RDEPEND}"
S=${WORKDIR}/${MY_P}
src_prepare() {
echo "${PV}" > .tarball-version || die
echo -e "#!${BASH}\necho -n \$(cat '${S}/.tarball-version')" > build-aux/git-version-gen || die
default
}
src_configure() {
local emesonargs=(
-Ddefault_library=$(usex static-libs both shared)
)
meson_src_configure
}

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<name>Zac Medico</name>

View File

@ -1 +1 @@
DIST attr-2.5.1.tar.gz 465714 BLAKE2B 05928f8274b0b4beee31b329c8459436c5b9019ebd2f937667b7beb8df7a455c48742a90d9c4faca5c0b38c9c3812043d3d66f9587108d3424c6184fef494b56 SHA512 8b4c043d61f8f3e0cd098e701181069f51117b85fd6ba18bfe9af77d894ea671232377d4793ffc822e9259ceee6ac71d75732eb93b2830c6cb5d0d918ba2d21b
DIST attr-2.5.1.tar.xz 318188 BLAKE2B 876dcbd802ea79b7851640f208820ffdfb73dc46065af673037c6dd50ad2af158f9f74b34cf45728baf9d0cc5572b40c3f102aa2907245a877db0d3879e38f04 SHA512 9e5555260189bb6ef2440c76700ebb813ff70582eb63d446823874977307d13dfa3a347dfae619f8866943dfa4b24ccf67dadd7e3ea2637239fdb219be5d2932

View File

@ -1,28 +1,33 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
EAPI=8
inherit flag-o-matic libtool toolchain-funcs multilib-minimal usr-ldscript
inherit toolchain-funcs multilib-minimal usr-ldscript
if [[ ${PV} == 9999 ]] ; then
EGIT_REPO_URI="https://git.savannah.gnu.org/git/${PN}.git"
inherit autotools git-r3
else
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
SRC_URI="mirror://nongnu/${PN}/${P}.tar.gz"
inherit libtool
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
SRC_URI="mirror://nongnu/${PN}/${P}.tar.xz"
fi
DESCRIPTION="Extended attributes tools"
HOMEPAGE="https://savannah.nongnu.org/projects/attr"
LICENSE="LGPL-2.1"
SLOT="0"
IUSE="debug nls static-libs"
BDEPEND="nls? ( sys-devel/gettext )"
PATCHES=(
"${FILESDIR}"/${PN}-2.5.1-r2-fix-symver.patch
)
src_prepare() {
default
@ -31,35 +36,28 @@ src_prepare() {
eautopoint
eautoreconf
else
elibtoolize #580792
# bug #580792
elibtoolize
fi
}
src_configure() {
# Remove -flto* from flags as this breaks binaries (bug #644048)
filter-flags -flto*
append-ldflags "-Wl,--no-gc-sections" #700116
tc-ld-force-bfd #644048
append-lfs-flags #760857
multilib-minimal_src_configure
}
multilib_src_configure() {
local myeconfargs=(
--bindir="${EPREFIX}"/bin
--libexecdir="${EPREFIX}"/usr/$(get_libdir)
--enable-shared
$(use_enable static-libs static)
$(use_enable nls)
--libexecdir="${EPREFIX}"/usr/$(get_libdir)
$(use_enable debug)
)
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
}
multilib_src_install() {
emake DESTDIR="${D}" install
# Sanity check until we track down why this is happening. #644048
# Sanity check until we track down why this is happening. bug #644048
local lib="${ED}/usr/$(get_libdir)/libattr.so.1"
if [[ -e ${lib} ]] ; then
local versions=$($(tc-getREADELF) -V "${lib}")
@ -73,18 +71,19 @@ multilib_src_install() {
echo "${versions}"
echo "# readelf -sW ${lib}"
echo "${symbols}"
die "symbol version sanity check failed; please comment on https://bugs.gentoo.org/644048"
die "Symbol version sanity check failed; please comment on https://bugs.gentoo.org/644048"
else
einfo "${lib} passed symbol checks"
fi
fi
if multilib_is_native_abi; then
# we install attr into /bin, so we need the shared lib with it
# We install attr into /bin, so we need the shared lib with it
gen_usr_ldscript -a attr
fi
# Add a wrapper until people upgrade.
# TODO: figure out when this was added & when we can drop it!
insinto /usr/include/attr
newins "${FILESDIR}"/xattr-shim.h xattr.h
}

View File

@ -1,28 +1,33 @@
# Copyright 1999-2020 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
EAPI=8
inherit flag-o-matic libtool toolchain-funcs multilib-minimal usr-ldscript
inherit toolchain-funcs multilib-minimal usr-ldscript
if [[ ${PV} == 9999 ]] ; then
EGIT_REPO_URI="https://git.savannah.gnu.org/git/${PN}.git"
inherit autotools git-r3
else
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
SRC_URI="mirror://nongnu/${PN}/${P}.tar.gz"
inherit libtool
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
SRC_URI="mirror://nongnu/${PN}/${P}.tar.xz"
fi
DESCRIPTION="Extended attributes tools"
HOMEPAGE="https://savannah.nongnu.org/projects/attr"
LICENSE="LGPL-2.1"
SLOT="0"
IUSE="debug nls static-libs"
BDEPEND="nls? ( sys-devel/gettext )"
PATCHES=(
"${FILESDIR}"/${PN}-2.5.1-r2-fix-symver.patch
)
src_prepare() {
default
@ -31,35 +36,28 @@ src_prepare() {
eautopoint
eautoreconf
else
elibtoolize #580792
# bug #580792
elibtoolize
fi
}
src_configure() {
# Remove -flto* from flags as this breaks binaries (bug #644048)
filter-flags -flto*
append-ldflags "-Wl,--no-gc-sections" #700116
tc-ld-force-bfd #644048
append-lfs-flags #760857
multilib-minimal_src_configure
}
multilib_src_configure() {
local myeconfargs=(
--bindir="${EPREFIX}"/bin
--libexecdir="${EPREFIX}"/usr/$(get_libdir)
--enable-shared
$(use_enable static-libs static)
$(use_enable nls)
--libexecdir="${EPREFIX}"/usr/$(get_libdir)
$(use_enable debug)
)
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
}
multilib_src_install() {
emake DESTDIR="${D}" install
# Sanity check until we track down why this is happening. #644048
# Sanity check until we track down why this is happening. bug #644048
local lib="${ED}/usr/$(get_libdir)/libattr.so.1"
if [[ -e ${lib} ]] ; then
local versions=$($(tc-getREADELF) -V "${lib}")
@ -73,18 +71,19 @@ multilib_src_install() {
echo "${versions}"
echo "# readelf -sW ${lib}"
echo "${symbols}"
die "symbol version sanity check failed; please comment on https://bugs.gentoo.org/644048"
die "Symbol version sanity check failed; please comment on https://bugs.gentoo.org/644048"
else
einfo "${lib} passed symbol checks"
fi
fi
if multilib_is_native_abi; then
# we install attr into /bin, so we need the shared lib with it
# We install attr into /bin, so we need the shared lib with it
gen_usr_ldscript -a attr
fi
# Add a wrapper until people upgrade.
# TODO: figure out when this was added & when we can drop it!
insinto /usr/include/attr
newins "${FILESDIR}"/xattr-shim.h xattr.h
}

View File

@ -0,0 +1,206 @@
https://lists.nongnu.org/archive/html/acl-devel/2022-05/msg00000.html
Bug: https://bugs.gentoo.org/644048
Bug: https://bugs.gentoo.org/700116
From a9ca51afd2b9f68f57de3a4c3d962d1d763572ca Mon Sep 17 00:00:00 2001
From: Alexander Miller <alex.miller@gmx.de>
Date: Thu, 28 Nov 2019 22:17:24 +0100
Subject: [PATCH] Better supported way to set symbol versions for legacy
syscalls
Using a linker script to set a symbol versions is an undocumented
hack and doesn't work reliably in many cases. It works (to some
degree) with the bfd linker, but fails with gold or lld. And even
with bfd it can break when using --gc-sections or LTO.
The result may be a library where the code has been discarded and
the versioned symbols are unusable, e.g.
23: 00000000 0 NOTYPE GLOBAL DEFAULT ABS getxattr@ATTR_1.0
instead of
23: 000033c0 0 FUNC GLOBAL DEFAULT 11 getxattr@ATTR_1.0
Remove the linker script entirely and set symbol versions with the
symver attribute if available (in gcc >= 10, but not in clang),
otherwise use the traditional global asm solution with a .symver
directive.
Those are the documented ways to do it and well supported by (almost)
all configurations. (The exception is old gcc with LTO; a workaround
is included, but some versions may still need -flto-partition=none).
Signed-off-by: Alexander Miller <alex.miller@gmx.de>
--- a/libattr/Makemodule.am
+++ b/libattr/Makemodule.am
@@ -8,7 +8,7 @@ LT_CURRENT = 2
LT_AGE = 1
LTVERSION = $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
-libattr_la_DEPENDENCIES = exports libattr/libattr.lds
+libattr_la_DEPENDENCIES = exports
libattr_la_SOURCES = \
libattr/attr_copy_action.c \
libattr/attr_copy_check.c \
@@ -20,7 +20,4 @@ libattr_la_SOURCES = \
libattr_la_CFLAGS = -include libattr/libattr.h
libattr_la_LDFLAGS = \
-Wl,--version-script,$(top_srcdir)/exports \
- -Wl,$(top_srcdir)/libattr/libattr.lds \
-version-info $(LTVERSION)
-
-EXTRA_DIST += libattr/libattr.lds
--- a/Makefile.in
+++ b/Makefile.in
@@ -647,9 +647,8 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
ACLOCAL_AMFLAGS = -I m4
-EXTRA_DIST = exports examples/copyattr.c examples/Makefile \
- libattr/libattr.lds test/README test/run \
- test/sort-getfattr-output $(TESTS)
+EXTRA_DIST = exports examples/copyattr.c examples/Makefile test/README \
+ test/run test/sort-getfattr-output $(TESTS)
SUBDIRS = po
AM_CPPFLAGS = \
-I$(top_builddir)/include \
@@ -689,7 +688,7 @@ LT_CURRENT = 2
#LT_REVISION =
LT_AGE = 1
LTVERSION = $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
-libattr_la_DEPENDENCIES = exports libattr/libattr.lds
+libattr_la_DEPENDENCIES = exports
libattr_la_SOURCES = \
libattr/attr_copy_action.c \
libattr/attr_copy_check.c \
@@ -702,7 +701,6 @@ libattr_la_SOURCES = \
libattr_la_CFLAGS = -include libattr/libattr.h
libattr_la_LDFLAGS = \
-Wl,--version-script,$(top_srcdir)/exports \
- -Wl,$(top_srcdir)/libattr/libattr.lds \
-version-info $(LTVERSION)
libmisc_la_SOURCES = \
--- a/libattr/libattr.lds
+++ /dev/null
@@ -1,12 +0,0 @@
-"fgetxattr@ATTR_1.0" = libattr_fgetxattr;
-"flistxattr@ATTR_1.0" = libattr_flistxattr;
-"fremovexattr@ATTR_1.0" = libattr_fremovexattr;
-"fsetxattr@ATTR_1.0" = libattr_fsetxattr;
-"getxattr@ATTR_1.0" = libattr_getxattr;
-"lgetxattr@ATTR_1.0" = libattr_lgetxattr;
-"listxattr@ATTR_1.0" = libattr_listxattr;
-"llistxattr@ATTR_1.0" = libattr_llistxattr;
-"lremovexattr@ATTR_1.0" = libattr_lremovexattr;
-"lsetxattr@ATTR_1.0" = libattr_lsetxattr;
-"removexattr@ATTR_1.0" = libattr_removexattr;
-"setxattr@ATTR_1.0" = libattr_setxattr;
--- a/libattr/syscalls.c
+++ b/libattr/syscalls.c
@@ -26,6 +26,27 @@
#include <sys/syscall.h>
#include <sys/xattr.h>
+/*
+ * Versioning of compat symbols:
+ * prefer symver attribute if available (since gcc 10),
+ * fall back to traditional .symver asm directive otherwise.
+ */
+#ifdef __has_attribute
+# if __has_attribute(symver)
+# define SYMVER(cn, vn) __typeof(cn) cn __attribute__((symver(vn)))
+# elif __has_attribute(no_reorder)
+ /*
+ * Avoid wrong partitioning with older gcc and LTO. May not work reliably
+ * with all versions; use -flto-partition=none if you encounter problems.
+ */
+# define SYMVER(cn, vn) __typeof(cn) cn __attribute__((noreorder)); \
+ __asm__(".symver " #cn "," vn)
+# endif
+#endif
+#ifndef SYMVER
+# define SYMVER(cn, vn) __asm__(".symver " #cn "," vn)
+#endif
+
#ifdef HAVE_VISIBILITY_ATTRIBUTE
# pragma GCC visibility push(default)
#endif
@@ -35,66 +56,78 @@ int libattr_setxattr(const char *path, const char *name,
{
return syscall(__NR_setxattr, path, name, value, size, flags);
}
+SYMVER(libattr_setxattr, "setxattr@ATTR_1.0");
int libattr_lsetxattr(const char *path, const char *name,
void *value, size_t size, int flags)
{
return syscall(__NR_lsetxattr, path, name, value, size, flags);
}
+SYMVER(libattr_lsetxattr, "lsetxattr@ATTR_1.0");
int libattr_fsetxattr(int filedes, const char *name,
void *value, size_t size, int flags)
{
return syscall(__NR_fsetxattr, filedes, name, value, size, flags);
}
+SYMVER(libattr_fsetxattr, "fsetxattr@ATTR_1.0");
ssize_t libattr_getxattr(const char *path, const char *name,
void *value, size_t size)
{
return syscall(__NR_getxattr, path, name, value, size);
}
+SYMVER(libattr_getxattr, "getxattr@ATTR_1.0");
ssize_t libattr_lgetxattr(const char *path, const char *name,
void *value, size_t size)
{
return syscall(__NR_lgetxattr, path, name, value, size);
}
+SYMVER(libattr_lgetxattr, "lgetxattr@ATTR_1.0");
ssize_t libattr_fgetxattr(int filedes, const char *name,
void *value, size_t size)
{
return syscall(__NR_fgetxattr, filedes, name, value, size);
}
+SYMVER(libattr_fgetxattr, "fgetxattr@ATTR_1.0");
ssize_t libattr_listxattr(const char *path, char *list, size_t size)
{
return syscall(__NR_listxattr, path, list, size);
}
+SYMVER(libattr_listxattr, "listxattr@ATTR_1.0");
ssize_t libattr_llistxattr(const char *path, char *list, size_t size)
{
return syscall(__NR_llistxattr, path, list, size);
}
+SYMVER(libattr_llistxattr, "llistxattr@ATTR_1.0");
ssize_t libattr_flistxattr(int filedes, char *list, size_t size)
{
return syscall(__NR_flistxattr, filedes, list, size);
}
+SYMVER(libattr_flistxattr, "flistxattr@ATTR_1.0");
int libattr_removexattr(const char *path, const char *name)
{
return syscall(__NR_removexattr, path, name);
}
+SYMVER(libattr_removexattr, "removexattr@ATTR_1.0");
int libattr_lremovexattr(const char *path, const char *name)
{
return syscall(__NR_lremovexattr, path, name);
}
+SYMVER(libattr_lremovexattr, "lremovexattr@ATTR_1.0");
int libattr_fremovexattr(int filedes, const char *name)
{
return syscall(__NR_fremovexattr, filedes, name);
}
+SYMVER(libattr_fremovexattr, "fremovexattr@ATTR_1.0");
#ifdef HAVE_VISIBILITY_ATTRIBUTE
# pragma GCC visibility pop

View File

@ -7,5 +7,6 @@
</maintainer>
<upstream>
<remote-id type="cpe">cpe:/a:attr_project:attr</remote-id>
<remote-id type="savannah-nongnu">attr</remote-id>
</upstream>
</pkgmetadata>

View File

@ -1,2 +1 @@
DIST dtc-1.5.0.tar.xz 152936 BLAKE2B 4ad9cf8f8fd0ccde0c7b8b66c0039eb9b012ed26e51387c06c03fa7950ca194878bbb23b50be5b80c4d4e18140d6316092a9f0eea87e5d713856635dcfc1b0ec SHA512 fd1e692a1b7bf7987f921ad17d9be6719f7b3aa7915873b45fa86f4ecb1398a0a62cdf53c1fddf98a0f7fed9bf34a79f684018bd01a2b5e88746b50879bf7102
DIST dtc-1.6.0.tar.xz 158584 BLAKE2B 47b15b5df7f5d87369d6daaad87f2989a80865f2fab19f89d050d390a9f8319bcd86a36e12f7cc8d62947bb4d1335769071d0e3ea0a6e16861aea163e78f4696 SHA512 15433b24f1d6b7ed1f8066d050bd1bcbf988731aa38147564e3dd04b5f69af8d69e03befdc621a768526c620425a9bdd24aad4f9ff135930d6a1eeb0625f7de3

View File

@ -1,87 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit multilib toolchain-funcs
if [[ ${PV} == "9999" ]] ; then
EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/dtc/dtc.git"
inherit git-r3
else
SRC_URI="https://www.kernel.org/pub/software/utils/${PN}/${P}.tar.xz"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
fi
DESCRIPTION="Open Firmware device tree compiler"
HOMEPAGE="https://devicetree.org/ https://git.kernel.org/cgit/utils/dtc/dtc.git/"
LICENSE="GPL-2"
SLOT="0"
IUSE="static-libs yaml"
BDEPEND="
sys-devel/bison
sys-devel/flex
virtual/pkgconfig
"
RDEPEND="yaml? ( dev-libs/libyaml )"
DEPEND="${RDEPEND}"
DOCS="
Documentation/dt-object-internal.txt
Documentation/dts-format.txt
Documentation/manual.txt
"
PATCHES=(
"${FILESDIR}"/${PN}-1.4.4-posix-shell.patch
"${FILESDIR}"/${PN}-1.5.0-fdt_check_full-visibility.patch
"${FILESDIR}"/${PN}-1.5.0-gcc-10.patch
)
_emake() {
# valgrind is used only in 'make checkm'
emake \
NO_PYTHON=1 \
NO_VALGRIND=1 \
NO_YAML=$(usex !yaml 1 0) \
\
AR="$(tc-getAR)" \
CC="$(tc-getCC)" \
PKG_CONFIG="$(tc-getPKG_CONFIG)" \
\
V=1 \
\
PREFIX="${EPREFIX}/usr" \
\
LIBDIR="\$(PREFIX)/$(get_libdir)" \
\
"$@"
}
src_prepare() {
default
sed -i \
-e '/^CFLAGS =/s:=:+=:' \
-e '/^CPPFLAGS =/s:=:+=:' \
-e 's:-Werror::' \
-e 's:-g -Os::' \
Makefile || die
tc-export AR CC PKG_CONFIG
}
src_compile() {
_emake
}
src_test() {
_emake check
}
src_install() {
_emake DESTDIR="${D}" install
use static-libs || find "${ED}" -name '*.a' -delete
}

View File

@ -1,59 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit multilib toolchain-funcs
if [[ ${PV} == "9999" ]] ; then
EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/dtc/dtc.git"
inherit git-r3
else
SRC_URI="https://www.kernel.org/pub/software/utils/${PN}/${P}.tar.xz"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
fi
DESCRIPTION="Open Firmware device tree compiler"
HOMEPAGE="https://devicetree.org/ https://git.kernel.org/cgit/utils/dtc/dtc.git/"
LICENSE="GPL-2"
SLOT="0"
IUSE="static-libs"
DEPEND="
sys-devel/bison
sys-devel/flex
virtual/pkgconfig
"
DOCS="
Documentation/dt-object-internal.txt
Documentation/dts-format.txt
Documentation/manual.txt
"
PATCHES=(
"${FILESDIR}"/${PN}-1.4.4-posix-shell.patch
"${FILESDIR}"/${PN}-1.5.0-fdt_check_full-visibility.patch
"${FILESDIR}"/${PN}-1.5.0-gcc-10.patch
)
src_prepare() {
default
sed -i \
-e '/^CFLAGS =/s:=:+=:' \
-e '/^CPPFLAGS =/s:=:+=:' \
-e 's:-Werror::' \
-e 's:-g -Os::' \
-e "/^PREFIX =/s:=.*:= ${EPREFIX}/usr:" \
-e "/^LIBDIR =/s:=.*:= \$(PREFIX)/$(get_libdir):" \
Makefile || die
tc-export AR CC PKG_CONFIG
export V=1
}
src_install() {
default
use static-libs || find "${ED}" -name '*.a' -delete
}

View File

@ -1,15 +1,16 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit multilib toolchain-funcs
inherit toolchain-funcs
if [[ ${PV} == "9999" ]] ; then
EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/dtc/dtc.git"
inherit git-r3
else
SRC_URI="https://www.kernel.org/pub/software/utils/${PN}/${P}.tar.xz"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
fi
DESCRIPTION="Open Firmware device tree compiler"

View File

@ -1,8 +1,9 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit multilib toolchain-funcs
inherit toolchain-funcs
if [[ ${PV} == "9999" ]] ; then
EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/dtc/dtc.git"

View File

@ -1,48 +0,0 @@
From 4d9522764985462741c7bb4af1ab231b9251476b Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@chromium.org>
Date: Wed, 10 Jan 2018 00:41:43 -0500
Subject: [PATCH] dtdiff: change to POSIX shell
This changes from the bash-specific process substitution feature to
reading with pipes. It relies on /dev/fd or /proc/self/fd existing.
URL: https://crbug.com/756559
Signed-off-by: Mike Frysinger <vapier@chromium.org>
---
dtdiff | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/dtdiff b/dtdiff
index 5fa772b0ab62..4d1b71756c2f 100644
--- a/dtdiff
+++ b/dtdiff
@@ -1,8 +1,4 @@
-#! /bin/bash
-
-# This script uses the bash <(...) extension.
-# If you want to change this to work with a generic /bin/sh, make sure
-# you fix that.
+#! /bin/sh
DTC=dtc
@@ -35,4 +31,15 @@ if [ $# != 2 ]; then
exit 1
fi
-diff -u <(source_and_sort "$1") <(source_and_sort "$2")
+for dir in /dev/fd /proc/self/fd; do
+ if [ -d "${dir}" ]; then
+ break
+ fi
+done
+
+source_and_sort "$1" | (
+ # Duplicate current stdin from the first file to fd 3 so we can change fd 0
+ # to the second file.
+ exec 3<&0
+ source_and_sort "$2" | diff -u "${dir}/3" "${dir}/0"
+)
--
2.15.1

View File

@ -1,12 +0,0 @@
diff --git a/libfdt/version.lds b/libfdt/version.lds
index 9f5d708..6b0f6d8 100644
--- a/libfdt/version.lds
+++ b/libfdt/version.lds
@@ -1,6 +1,7 @@
LIBFDT_1.2 {
global:
fdt_next_node;
+ fdt_check_full;
fdt_check_header;
fdt_move;
fdt_string;

View File

@ -1,50 +0,0 @@
https://bugs.gentoo.org/706660
https://git.kernel.org/pub/scm/utils/dtc/dtc.git/patch/?id=0e9225eb0dfec51def612b928d2f1836b092bc7e
From 0e9225eb0dfec51def612b928d2f1836b092bc7e Mon Sep 17 00:00:00 2001
From: Dirk Mueller <dmueller@suse.com>
Date: Tue, 14 Jan 2020 18:53:41 +0100
Subject: Remove redundant YYLOC global declaration
gcc 10 will default to -fno-common, which causes this error at link
time:
(.text+0x0): multiple definition of `yylloc'; dtc-lexer.lex.o (symbol from plugin):(.text+0x0): first defined here
This is because both dtc-lexer as well as dtc-parser define the same
global symbol yyloc. Before with -fcommon those were merged into one
defintion. The proper solution would be to to mark this as "extern",
however that leads to:
dtc-lexer.l:26:16: error: redundant redeclaration of 'yylloc' [-Werror=redundant-decls]
26 | extern YYLTYPE yylloc;
| ^~~~~~
In file included from dtc-lexer.l:24:
dtc-parser.tab.h:127:16: note: previous declaration of 'yylloc' was here
127 | extern YYLTYPE yylloc;
| ^~~~~~
cc1: all warnings being treated as errors
which means the declaration is completely redundant and can just be
dropped.
Signed-off-by: Dirk Mueller <dmueller@suse.com>
Message-Id: <20200114175341.2994-1-dmueller@suse.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
dtc-lexer.l | 1 -
1 file changed, 1 deletion(-)
--- a/dtc-lexer.l
+++ b/dtc-lexer.l
@@ -23,7 +23,6 @@ LINECOMMENT "//".*\n
#include "srcpos.h"
#include "dtc-parser.tab.h"
-YYLTYPE yylloc;
extern bool treesource_error;
/* CAUTION: this will stop working if we ever use yyless() or yyunput() */
--
cgit 1.2-0.3.lf.el7

View File

@ -0,0 +1 @@
DIST edk2-ovmf-202202-1.xpak 2672386 BLAKE2B 75c15d4379610ab2af85b78166e350d52f4f1bc1fff5b2eb693ad0d7b1f6648e65d8ae3e2c5467f93f1557ad3b4fa664ab2d76ff10794667de22c2ea8cca6b2d SHA512 06783b89c96bada0fd025ff39eaee501a027abcb03c0bdcf3ff497d52be22927ab03013d90f145ee94a8662cfffe4f8c154dcd06db1bb1acef8a85ae43de14a3

View File

@ -0,0 +1,69 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit readme.gentoo-r1
BINPKG="${P/-bin/}-1"
DESCRIPTION="UEFI firmware for 64-bit x86 virtual machines"
HOMEPAGE="https://github.com/tianocore/edk2"
SRC_URI="https://dev.gentoo.org/~ajak/distfiles/${BINPKG}.xpak"
S="${WORKDIR}"
# TODO: the binary 202105 package currently lacks the preseeded
# OVMF_VARS.secboot.fd file (that we typically get from fedora)
LICENSE="BSD-2 MIT"
SLOT="0"
KEYWORDS="amd64 arm64 ~loong ~ppc ppc64 ~riscv x86"
RDEPEND="!sys-firmware/edk2-ovmf"
DISABLE_AUTOFORMATTING=true
DOC_CONTENTS="This package contains the tianocore edk2 UEFI firmware for 64-bit x86
virtual machines. The firmware is located under
/usr/share/edk2-ovmf/OVMF_CODE.fd
/usr/share/edk2-ovmf/OVMF_VARS.fd
/usr/share/edk2-ovmf/OVMF_CODE.secboot.fd
If USE=binary is enabled, we also install an OVMF variables file (coming from
fedora) that contains secureboot default keys
/usr/share/edk2-ovmf/OVMF_VARS.secboot.fd
If you have compiled this package by hand, you need to either populate all
necessary EFI variables by hand by booting
/usr/share/edk2-ovmf/UefiShell.(iso|img)
or creating OVMF_VARS.secboot.fd by hand:
https://github.com/puiterwijk/qemu-ovmf-secureboot
The firmware does not support csm (due to no free csm implementation
available). If you need a firmware with csm support you have to download
one for yourself. Firmware blobs are commonly labeled
OVMF{,_CODE,_VARS}-with-csm.fd
In order to use the firmware you can run qemu the following way
$ qemu-system-x86_64 \
-drive file=/usr/share/edk2-ovmf/OVMF.fd,if=pflash,format=raw,unit=0,readonly=on \
..."
src_unpack() {
tar -xf - < <(xz -c -d --single-stream "${DISTDIR}/${BINPKG}.xpak") || die "unpacking binpkg failed"
}
src_install() {
mv "usr/share/doc/${P/-bin/}" "usr/share/doc/${PF}" || die
# Don't want to try to install the readme from the source package
rm "usr/share/doc/${PF}/README.gentoo.bz2"
mv usr "${ED}" || die
readme.gentoo_create_doc
}
pkg_postinst() {
readme.gentoo_print_elog
}

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>virtualization@gentoo.org</email>
<name>Gentoo Virtualization Project</name>
</maintainer>
</pkgmetadata>

View File

@ -1,8 +0,0 @@
DIST brotli-666c3280cc11dc433c303d79a83d4ffbdd12cc8d.tar.gz 23855739 BLAKE2B 7406ec5b29ac66afbcd7c1376bb3208f298d19b6592b2869c52173aa64947d58bd443f9a61c67deaf046be910a0e31c0b843e5508e97e0e1f5e7bce100d86904 SHA512 df8e90562c4fd7f0e787949df6bc4f5a165b39bd333f442d27874fe65640fbba268f9350d7113e6761a5acceb66d78e75f1a296e5a89b94574edf28109cdc812
DIST edk2-ovmf-202008-bin.tar.xz 3486024 BLAKE2B 8283db554ad7024e3a55b62ed0a560ed9f729d728f1dee3806814b1eb8d89dabc4fd70433f7f77656b65d9af7919d036074a53a95190a1aa8b65ab7d73495ffc SHA512 d0c8b249a7a2124e8bb63a4358466e86a3a837e76586565dd4762351998d8561374eabb8a1303dbf71ac269c15552d9e8cff71d65bc6fe8a3a81fb4fb032e0d8
DIST edk2-ovmf-202008-qemu-firmware.tar.xz 680 BLAKE2B 176f8e94a3f605acc72850634cbf155619490f5998125521a392a8e9c7d2b78841b841f0cb5ea860f14645b124cf1921256bbe46960efbe3401805d89bbfbed6 SHA512 b72f248ab4d49503c3e8e686e22beb77f0e48d2c6c9523f389f20504e0c30fa11fa0fcb5607d7d5bb1ba2433894fa458864c5761335e39de4b2a40b01203f043
DIST edk2-ovmf-202008.tar.gz 13172590 BLAKE2B 10acf77d0e70e21ca425ea41c0062f8cebe2cc607b93a2a253bcd87cea1546e791776a34d43fbf4f1040f4fc32e3ee413d44873d0f00b9e523816519cfed634e SHA512 c32340104f27b9b85f79e934cc9eeb739d47b01e13975c88f39b053e9bc5a1ecfe579ab3b63fc7747cc328e104b337b53d41deb4470c3f20dbbd5552173a4666
DIST edk2-ovmf-202105-qemu-firmware.tar.xz 672 BLAKE2B e87845a84c83f65db836fd054c81a4f3062d5e0fcc51aa0ecf9c2d23c8741f218d38ef737d140f5935ce8d9c34508e5f3b9f54bf9c547a391fa63cdc2ecf1233 SHA512 6100502f26db26e407dacce57c96b1abfd372bcb31767a068332afa09ac435a092fd2a73db27670d27c6e927c26e88315346bbac70578571108434b9683bd00c
DIST edk2-ovmf-202105-r1-bin.tar.xz 2633188 BLAKE2B 93b4bd1c75da69406b5d27ac32d8b7c63dc8248bcd5d54832e520a4b009be4b7f215eb7d489ecb7cb16d31e02452dfa06b8fa709f37c44e59b4ff70a550076c7 SHA512 356c2110abce43da9c0654324e222cbbab7085e3aa23d1ba4c98011e4d4992a37d61fa45394305b748d119dba12f65d7c7d630b9f8038065ba4672d758c702be
DIST edk2-ovmf-202105.tar.gz 13702868 BLAKE2B 3ec01d467562380ca2fd3bd807d2f6c55e4637c1afd71533f8f5b22cc634dc4c8cb63dab921677f8b315d17b3c9d0b6b00a0e2f3f8da61107033e9e81bf5a64d SHA512 c263345cbb243c63985f974a61f37c577a139d6a7099d2b8c9e1a553e5ebf16de12fb711b72624081c6bf637f8084bbf71731ab99e5747d81da460388ac25791
DIST openssl-e2e09d9fba1187f8d6aafaa34d4172f56f1ffb72.tar.gz 9981169 BLAKE2B 33aac7364cdd45fec5654ab6caef84e1a829464380419c8a6bb311055c5a01c0aaff6e046a7c541a87e908fa9d26bae652f5be901461d03df36f2522f9c34b0c SHA512 db2087c04f0b428b3f4e1c8b3ac53cce69e0fd331ed2b86ba00facafd1685864d73f71c13eee48f4fe0af2bddad848f84a2b8ed2a17fabdf7fa2ed7d9eb39371

View File

@ -1,186 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_REQ_USE="sqlite"
PYTHON_COMPAT=( python3_{7,8,9} )
inherit python-any-r1 readme.gentoo-r1
DESCRIPTION="UEFI firmware for 64-bit x86 virtual machines"
HOMEPAGE="https://github.com/tianocore/edk2"
NON_BINARY_DEPEND="
app-emulation/qemu
>=dev-lang/nasm-2.0.7
>=sys-power/iasl-20160729
${PYTHON_DEPS}
"
DEPEND=""
RDEPEND=""
if [[ ${PV} == "999999" ]] ; then
inherit git-r3
EGIT_REPO_URI="https://github.com/tianocore/edk2"
DEPEND+="
${NON_BINARY_DEPEND}
"
else
BUNDLED_OPENSSL_SUBMODULE_SHA="e2e09d9fba1187f8d6aafaa34d4172f56f1ffb72"
BUNDLED_BROTLI_SUBMODULE_SHA="666c3280cc11dc433c303d79a83d4ffbdd12cc8d"
# Binary versions taken from fedora:
# http://download.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/Packages/e/
# edk2-ovmf-20200801stable-1.fc34.noarch.rpm
# TODO: talk with tamiko about unbundling
SRC_URI="
!binary? (
https://github.com/tianocore/edk2/archive/edk2-stable${PV}.tar.gz -> ${P}.tar.gz
https://github.com/openssl/openssl/archive/${BUNDLED_OPENSSL_SUBMODULE_SHA}.tar.gz -> openssl-${BUNDLED_OPENSSL_SUBMODULE_SHA}.tar.gz
https://github.com/google/brotli/archive/${BUNDLED_BROTLI_SUBMODULE_SHA}.tar.gz -> brotli-${BUNDLED_BROTLI_SUBMODULE_SHA}.tar.gz
)
binary? ( https://dev.gentoo.org/~mva/distfiles/${P}-bin.tar.xz )
https://dev.gentoo.org/~mva/distfiles/${P}-qemu-firmware.tar.xz
"
KEYWORDS="amd64 arm64 ~ppc ppc64 x86"
IUSE="+binary"
REQUIRED_USE+="
!amd64? ( binary )
"
DEPEND+="
!binary? (
amd64? (
${NON_BINARY_DEPEND}
)
)"
PATCHES=(
)
fi
LICENSE="BSD-2 MIT"
SLOT="0"
S="${WORKDIR}/edk2-edk2-stable${PV}"
DISABLE_AUTOFORMATTING=true
DOC_CONTENTS="This package contains the tianocore edk2 UEFI firmware for 64-bit x86
virtual machines. The firmware is located under
/usr/share/edk2-ovmf/OVMF_CODE.fd
/usr/share/edk2-ovmf/OVMF_VARS.fd
/usr/share/edk2-ovmf/OVMF_CODE.secboot.fd
If USE=binary is enabled, we also install an OVMF variables file (coming from
fedora) that contains secureboot default keys
/usr/share/edk2-ovmf/OVMF_VARS.secboot.fd
If you have compiled this package by hand, you need to either populate all
necessary EFI variables by hand by booting
/usr/share/edk2-ovmf/UefiShell.(iso|img)
or creating OVMF_VARS.secboot.fd by hand:
https://github.com/puiterwijk/qemu-ovmf-secureboot
The firmware does not support csm (due to no free csm implementation
available). If you need a firmware with csm support you have to download
one for yourself. Firmware blobs are commonly labeled
OVMF{,_CODE,_VARS}-with-csm.fd
In order to use the firmware you can run qemu the following way
$ qemu-system-x86_64 \
-drive file=/usr/share/edk2-ovmf/OVMF.fd,if=pflash,format=raw,unit=0,readonly=on \
...
You can register the firmware for use in libvirt by adding to /etc/libvirt/qemu.conf:
nvram = [
\"/usr/share/edk2-ovmf/OVMF_CODE.fd:/usr/share/edk2-ovmf/OVMF_VARS.fd\"
\"/usr/share/edk2-ovmf/OVMF_CODE.secboot.fd:/usr/share/edk2-ovmf/OVMF_VARS.fd\"
]"
pkg_setup() {
[[ ${PV} != "999999" ]] && use binary || python-any-r1_pkg_setup
}
src_prepare() {
if ! use binary; then
sed -i -r \
-e "/function SetupPython3/,/\}/{s,\\\$\(whereis python3\),${EPYTHON},g}" \
"${S}"/edksetup.sh || die "Fixing for correct Python3 support failed"
fi
if [[ ${PV} != "999999" ]]; then
if use binary; then
eapply_user
return
else
# Bundled submodules
cp -rl "${WORKDIR}/openssl-${BUNDLED_OPENSSL_SUBMODULE_SHA}"/* "CryptoPkg/Library/OpensslLib/openssl/"
cp -rl "${WORKDIR}/brotli-${BUNDLED_BROTLI_SUBMODULE_SHA}"/* "BaseTools/Source/C/BrotliCompress/brotli/"
cp -rl "${WORKDIR}/brotli-${BUNDLED_BROTLI_SUBMODULE_SHA}"/* "MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/"
fi
fi
default
}
src_compile() {
TARGET_ARCH=X64
TARGET_NAME=RELEASE
TARGET_TOOLS=GCC49
BUILD_FLAGS="-D TLS_ENABLE \
-D HTTP_BOOT_ENABLE \
-D NETWORK_IP6_ENABLE \
-D FD_SIZE_2MB"
SECUREBOOT_BUILD_FLAGS="${BUILD_FLAGS} \
-D SECURE_BOOT_ENABLE \
-D SMM_REQUIRE \
-D EXCLUDE_SHELL_FROM_FD"
[[ ${PV} != "999999" ]] && use binary && return
emake ARCH=${TARGET_ARCH} -C BaseTools
. ./edksetup.sh
# Build all EFI firmware blobs:
mkdir -p ovmf
./OvmfPkg/build.sh \
-a "${TARGET_ARCH}" -b "${TARGET_NAME}" -t "${TARGET_TOOLS}" \
${BUILD_FLAGS} || die "OvmfPkg/build.sh failed"
cp Build/OvmfX64/*/FV/OVMF_*.fd ovmf/
rm -rf Build/OvmfX64
./OvmfPkg/build.sh \
-a "${TARGET_ARCH}" -b "${TARGET_NAME}" -t "${TARGET_TOOLS}" \
${SECUREBOOT_BUILD_FLAGS} || die "OvmfPkg/build.sh failed"
cp Build/OvmfX64/*/FV/OVMF_CODE.fd ovmf/OVMF_CODE.secboot.fd || die "cp failed"
cp Build/OvmfX64/*/X64/Shell.efi ovmf/ || die "cp failed"
cp Build/OvmfX64/*/X64/EnrollDefaultKeys.efi ovmf || die "cp failed"
# Build a convenience UefiShell.img:
mkdir -p iso_image/efi/boot || die "mkdir failed"
cp ovmf/Shell.efi iso_image/efi/boot/bootx64.efi || die "cp failed"
cp ovmf/EnrollDefaultKeys.efi iso_image || die "cp failed"
qemu-img convert --image-opts \
driver=vvfat,floppy=on,fat-type=12,label=UEFI_SHELL,dir=iso_image \
ovmf/UefiShell.img || die "qemu-img failed"
}
src_install() {
insinto /usr/share/${PN}
doins ovmf/*
insinto /usr/share/qemu/firmware
doins qemu/*
readme.gentoo_create_doc
}
pkg_postinst() {
readme.gentoo_print_elog
}

View File

@ -1,176 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_REQ_USE="sqlite"
PYTHON_COMPAT=( python3_{8,9,10} )
inherit python-any-r1 readme.gentoo-r1
DESCRIPTION="UEFI firmware for 64-bit x86 virtual machines"
HOMEPAGE="https://github.com/tianocore/edk2"
BUNDLED_OPENSSL_SUBMODULE_SHA="e2e09d9fba1187f8d6aafaa34d4172f56f1ffb72"
BUNDLED_BROTLI_SUBMODULE_SHA="666c3280cc11dc433c303d79a83d4ffbdd12cc8d"
# TODO: talk with tamiko about unbundling (mva)
# TODO: the binary 202105 package currently lacks the preseeded
# OVMF_VARS.secboot.fd file (that we typically get from fedora)
SRC_URI="
!binary? (
https://github.com/tianocore/edk2/archive/edk2-stable${PV}.tar.gz -> ${P}.tar.gz
https://github.com/openssl/openssl/archive/${BUNDLED_OPENSSL_SUBMODULE_SHA}.tar.gz -> openssl-${BUNDLED_OPENSSL_SUBMODULE_SHA}.tar.gz
https://github.com/google/brotli/archive/${BUNDLED_BROTLI_SUBMODULE_SHA}.tar.gz -> brotli-${BUNDLED_BROTLI_SUBMODULE_SHA}.tar.gz
)
binary? ( https://dev.gentoo.org/~tamiko/distfiles/${PF}-bin.tar.xz )
https://dev.gentoo.org/~tamiko/distfiles/${P}-qemu-firmware.tar.xz
"
LICENSE="BSD-2 MIT"
SLOT="0"
KEYWORDS="amd64 arm64 ~ppc ppc64 x86"
IUSE="+binary"
REQUIRED_USE+="
!amd64? ( binary )
"
NON_BINARY_DEPEND="
app-emulation/qemu
>=dev-lang/nasm-2.0.7
>=sys-power/iasl-20160729
${PYTHON_DEPS}
"
DEPEND+="
!binary? (
amd64? (
${NON_BINARY_DEPEND}
)
)"
RDEPEND=""
PATCHES=(
"${FILESDIR}/${PN}-202105-werror.patch"
)
S="${WORKDIR}/edk2-edk2-stable${PV}"
DISABLE_AUTOFORMATTING=true
DOC_CONTENTS="This package contains the tianocore edk2 UEFI firmware for 64-bit x86
virtual machines. The firmware is located under
/usr/share/edk2-ovmf/OVMF_CODE.fd
/usr/share/edk2-ovmf/OVMF_VARS.fd
/usr/share/edk2-ovmf/OVMF_CODE.secboot.fd
If USE=binary is enabled, we also install an OVMF variables file (coming from
fedora) that contains secureboot default keys
/usr/share/edk2-ovmf/OVMF_VARS.secboot.fd
If you have compiled this package by hand, you need to either populate all
necessary EFI variables by hand by booting
/usr/share/edk2-ovmf/UefiShell.(iso|img)
or creating OVMF_VARS.secboot.fd by hand:
https://github.com/puiterwijk/qemu-ovmf-secureboot
The firmware does not support csm (due to no free csm implementation
available). If you need a firmware with csm support you have to download
one for yourself. Firmware blobs are commonly labeled
OVMF{,_CODE,_VARS}-with-csm.fd
In order to use the firmware you can run qemu the following way
$ qemu-system-x86_64 \
-drive file=/usr/share/edk2-ovmf/OVMF.fd,if=pflash,format=raw,unit=0,readonly=on \
..."
pkg_setup() {
[[ ${PV} != "999999" ]] && use binary || python-any-r1_pkg_setup
}
src_prepare() {
if use binary; then
eapply_user
else
# Bundled submodules
cp -rl "${WORKDIR}/openssl-${BUNDLED_OPENSSL_SUBMODULE_SHA}"/* "CryptoPkg/Library/OpensslLib/openssl/"
cp -rl "${WORKDIR}/brotli-${BUNDLED_BROTLI_SUBMODULE_SHA}"/* "BaseTools/Source/C/BrotliCompress/brotli/"
cp -rl "${WORKDIR}/brotli-${BUNDLED_BROTLI_SUBMODULE_SHA}"/* "MdeModulePkg/Library/BrotliCustomDecompressLib/brotli/"
sed -i -r \
-e "/function SetupPython3/,/\}/{s,\\\$\(whereis python3\),${EPYTHON},g}" \
"${S}"/edksetup.sh || die "Fixing for correct Python3 support failed"
default
fi
}
src_compile() {
TARGET_ARCH=X64
TARGET_NAME=RELEASE
TARGET_TOOLS=GCC49
BUILD_FLAGS="-D TLS_ENABLE \
-D HTTP_BOOT_ENABLE \
-D NETWORK_IP6_ENABLE \
-D TPM_ENABLE \
-D TPM2_ENABLE -D TPM2_CONFIG_ENABLE \
-D FD_SIZE_2MB"
SECUREBOOT_BUILD_FLAGS="${BUILD_FLAGS} \
-D SECURE_BOOT_ENABLE \
-D SMM_REQUIRE \
-D EXCLUDE_SHELL_FROM_FD"
[[ ${PV} != "999999" ]] && use binary && return
emake ARCH=${TARGET_ARCH} -C BaseTools
. ./edksetup.sh
# Build all EFI firmware blobs:
mkdir -p ovmf
./OvmfPkg/build.sh \
-a "${TARGET_ARCH}" -b "${TARGET_NAME}" -t "${TARGET_TOOLS}" \
${BUILD_FLAGS} || die "OvmfPkg/build.sh failed"
cp Build/OvmfX64/*/FV/OVMF_*.fd ovmf/
rm -rf Build/OvmfX64
./OvmfPkg/build.sh \
-a "${TARGET_ARCH}" -b "${TARGET_NAME}" -t "${TARGET_TOOLS}" \
${SECUREBOOT_BUILD_FLAGS} || die "OvmfPkg/build.sh failed"
cp Build/OvmfX64/*/FV/OVMF_CODE.fd ovmf/OVMF_CODE.secboot.fd || die "cp failed"
cp Build/OvmfX64/*/X64/Shell.efi ovmf/ || die "cp failed"
cp Build/OvmfX64/*/X64/EnrollDefaultKeys.efi ovmf || die "cp failed"
# Build a convenience UefiShell.img:
mkdir -p iso_image/efi/boot || die "mkdir failed"
cp ovmf/Shell.efi iso_image/efi/boot/bootx64.efi || die "cp failed"
cp ovmf/EnrollDefaultKeys.efi iso_image || die "cp failed"
qemu-img convert --image-opts \
driver=vvfat,floppy=on,fat-type=12,label=UEFI_SHELL,dir=iso_image \
ovmf/UefiShell.img || die "qemu-img failed"
}
src_install() {
insinto /usr/share/${PN}
doins ovmf/*
insinto /usr/share/qemu/firmware
doins qemu/*
readme.gentoo_create_doc
}
pkg_postinst() {
readme.gentoo_print_elog
}

View File

@ -1,38 +0,0 @@
diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
index 498696e..8a360f4 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -1863,7 +1863,7 @@ NOOPT_*_*_OBJCOPY_ADDDEBUGFLAG = --add-gnu-debuglink=$(DEBUG_DIR)/$(MODULE_N
*_*_*_DTCPP_PATH = DEF(DTCPP_BIN)
*_*_*_DTC_PATH = DEF(DTC_BIN)
-DEFINE GCC_ALL_CC_FLAGS = -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common
+DEFINE GCC_ALL_CC_FLAGS = -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Wno-array-bounds -include AutoGen.h -fno-common
DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe
DEFINE GCC_X64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe
DEFINE GCC_ARM_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -mabi=aapcs -fno-short-enums -funsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address -mthumb -mfloat-abi=soft -fno-pic -fno-pie
diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile
index 0df728f..49f9706 100644
--- a/BaseTools/Source/C/Makefiles/header.makefile
+++ b/BaseTools/Source/C/Makefiles/header.makefile
@@ -82,17 +82,17 @@ BUILD_OPTFLAGS = -O2 $(EXTRA_OPTFLAGS)
ifeq ($(DARWIN),Darwin)
# assume clang or clang compatible flags on OS X
-BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror \
+BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall \
-Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -g
else
ifeq ($(CXX), llvm)
BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fwrapv \
--fno-delete-null-pointer-checks -Wall -Werror \
+-fno-delete-null-pointer-checks -Wall \
-Wno-deprecated-declarations -Wno-self-assign \
-Wno-unused-result -nostdlib -g
else
BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fwrapv \
--fno-delete-null-pointer-checks -Wall -Werror \
+-fno-delete-null-pointer-checks -Wall \
-Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict \
-Wno-unused-result -nostdlib -g
endif

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>tamiko@gentoo.org</email>
<name>Matthias Maier</name>
</maintainer>
<maintainer type="project">
<email>virtualization@gentoo.org</email>
<name>Gentoo Virtualization Project</name>
</maintainer>
<use>
<flag name="binary">Use pre-built binaries</flag>
</use>
</pkgmetadata>

View File

@ -1,6 +1,2 @@
DIST ipxe-1.0.0_p20180211-546dd51-bin.tar.xz 1748228 BLAKE2B 5ed2ce71c7dbc41d5cbef6e263abd230b9831c945a8edb33a29d408bd4262e370a2f73c8d2eb3cb20e08c61ece83af1fb1bb4c5694098cb29c44628dbd18def8 SHA512 af2778c925a6e4c374ddae85f3db983c83e7a4e5bb2cf35e356d277b87d4c89bf63cc2c061ec31d608ff2160c13297232fa131da2b9dd0b580d93e1b0efd6532
DIST ipxe-1.0.0_p20180211-546dd51.tar.bz2 2954305 BLAKE2B 8232b1afe017ff5d0389534e4efea3209ea0330d66e4d3d429abf81da66639b19488911d85bf2da200ff8cb0d49c5dda438074c4538303335419ea080ef80a16 SHA512 45d7f80f15a1c5ff1daa31b132065d38013a51127795ad81308b468940a455edcb40cde7601475039a7c977d732817203bbc627c642d3d10146a480da603f1dd
DIST ipxe-1.0.0_p20190728-a4f8c6e-bin.tar.xz 1839688 BLAKE2B b28772b928690646e1b0cb1c27ef56e2cb1c0637a43c6174dea7c8ca401d8c8819938fa358a0bed5d57b8cf992b8c2060b52e32a970ef813f1cf705fb0805beb SHA512 1e5838b8c530257dc544f6e25f80e6e223480917db393ca3ff8c577f07e60180e18f2eed4e71f7b1965157d6e7001f65e224d3c8b56a98f84739e2504ca38985
DIST ipxe-1.0.0_p20190728-a4f8c6e.tar.bz2 2985776 BLAKE2B 5a85505404978d51f80e30332f6eb0417d6d97eb9b3bc05eec5ad649c446c7d17dc841f8cd34a1b29c31dc6f5cf08baa69191de9c8dd4bcdb098c5d7f13a7824 SHA512 3af0da9058b39966bfd8f9d7dfe518ae7b26e18f58d1a3fa2cba8922ec3c50775b82dd9f23bf51be3ca3f69b705f92bcf80988a1817b30f7ab1826a4b159c5a6
DIST ipxe-1.21.1-bin.tar.xz 1860424 BLAKE2B 9d621c92be1058389758f885a02b601169d645335bba366a18d16326a7616345e44eb0cd5007d32ac034e7e3c8f8eecd90ade3346e34ca0df899622321f38017 SHA512 85afacfb70e562a935380b7d14ab7328e418478a6f6124eaec7cd0fefb9ba13b8a3f04833fab7b724ceb4c94897a7be2c67faa8be59373719a972ad51e6a5ab3
DIST ipxe-1.21.1.tar.gz 3934045 BLAKE2B 03871b5f89c6228a9082bb89c7b102d85e5f3afcd5fe0d93762e220fe162c9c3037a9918f30251fd103835d949335f99109a12559f560a5b686e65a7c24c6501 SHA512 47400975110ed4ab95835aa1b7c8d5a6917c19c5713c6ab88bc0741a3adcd62245a9c4251d1f46fffc45289c6b18bf893f86dbc3b67d3189c41b7f198367ecaa

View File

@ -1,119 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="6"
inherit toolchain-funcs savedconfig
GIT_REV="546dd51de8459d4d09958891f426fa2c73ff090d"
GIT_SHORT=${GIT_REV:0:7}
DESCRIPTION="Open source network boot (PXE) firmware"
HOMEPAGE="https://ipxe.org/"
SRC_URI="
!binary? ( https://git.ipxe.org/ipxe.git/snapshot/${GIT_REV}.tar.bz2 -> ${P}-${GIT_SHORT}.tar.bz2 )
binary? ( https://dev.gentoo.org/~tamiko/distfiles/${P}-${GIT_SHORT}-bin.tar.xz )"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 x86"
IUSE="+binary efi ipv6 iso lkrn +qemu undi usb vmware"
REQUIRED_USE="!amd64? ( !x86? ( binary ) )"
SOURCE_DEPEND="app-arch/xz-utils
dev-lang/perl
sys-libs/zlib
iso? (
app-cdr/cdrtools
sys-boot/syslinux
)"
DEPEND="
!binary? (
amd64? ( ${SOURCE_DEPEND} )
x86? ( ${SOURCE_DEPEND} )
)"
RDEPEND=""
S="${WORKDIR}/ipxe-${GIT_SHORT}/src"
src_configure() {
use binary && return
cat <<-EOF > "${S}"/config/local/general.h
#undef BANNER_TIMEOUT
#define BANNER_TIMEOUT 0
EOF
use ipv6 && echo "#define NET_PROTO_IPV6" >> "${S}"/config/local/general.h
if use vmware; then
cat <<-EOF >> "${S}"/config/local/general.h
#define VMWARE_SETTINGS
#define CONSOLE_VMWARE
EOF
fi
restore_config config/local/general.h
tc-ld-disable-gold
}
ipxemake() {
# Q='' makes the build verbose since that's what everyone loves now
emake Q='' \
CC="$(tc-getCC)" \
LD="$(tc-getLD)" \
AS="$(tc-getAS)" \
AR="$(tc-getAR)" \
NM="$(tc-getNM)" \
OBJCOPY="$(tc-getOBJCOPY)" \
RANLIB="$(tc-getRANLIB)" \
OBJDUMP="$(tc-getOBJDUMP)" \
HOST_CC="$(tc-getBUILD_CC)" \
"$@"
}
src_compile() {
use binary && return
export NO_WERROR=1
if use qemu; then
ipxemake bin/808610de.rom # pxe-e1000.rom (old)
ipxemake bin/8086100e.rom # pxe-e1000.rom
ipxemake bin/80861209.rom # pxe-eepro100.rom
ipxemake bin/10500940.rom # pxe-ne2k_pci.rom
ipxemake bin/10222000.rom # pxe-pcnet.rom
ipxemake bin/10ec8139.rom # pxe-rtl8139.rom
ipxemake bin/1af41000.rom # pxe-virtio.rom
fi
if use vmware; then
ipxemake bin/8086100f.mrom # e1000
ipxemake bin/808610d3.mrom # e1000e
ipxemake bin/10222000.mrom # vlance
ipxemake bin/15ad07b0.rom # vmxnet3
fi
use efi && ipxemake PLATFORM=efi BIN=bin-efi bin-efi/ipxe.efi
use iso && ipxemake bin/ipxe.iso
use undi && ipxemake bin/undionly.kpxe
use usb && ipxemake bin/ipxe.usb
use lkrn && ipxemake bin/ipxe.lkrn
}
src_install() {
insinto /usr/share/ipxe/
if use qemu || use vmware; then
doins bin/*.rom
fi
use vmware && doins bin/*.mrom
use efi && doins bin-efi/*.efi
use iso && doins bin/*.iso
use undi && doins bin/*.kpxe
use usb && doins bin/*.usb
use lkrn && doins bin/*.lkrn
save_config config/local/general.h
}

View File

@ -1,119 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="6"
inherit toolchain-funcs savedconfig
GIT_REV="a4f8c6e31f6c62522cfc633bbbffa81b22f9d6f3"
GIT_SHORT=${GIT_REV:0:7}
DESCRIPTION="Open source network boot (PXE) firmware"
HOMEPAGE="https://ipxe.org/"
SRC_URI="
!binary? ( https://git.ipxe.org/ipxe.git/snapshot/${GIT_REV}.tar.bz2 -> ${P}-${GIT_SHORT}.tar.bz2 )
binary? ( https://dev.gentoo.org/~tamiko/distfiles/${P}-${GIT_SHORT}-bin.tar.xz )"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~mips ~ppc ppc64 x86"
IUSE="+binary efi ipv6 iso lkrn +qemu undi usb vmware"
REQUIRED_USE="!amd64? ( !x86? ( binary ) )"
SOURCE_DEPEND="app-arch/xz-utils
dev-lang/perl
sys-libs/zlib
iso? (
app-cdr/cdrtools
sys-boot/syslinux
)"
DEPEND="
!binary? (
amd64? ( ${SOURCE_DEPEND} )
x86? ( ${SOURCE_DEPEND} )
)"
RDEPEND=""
S="${WORKDIR}/ipxe-${GIT_SHORT}/src"
src_configure() {
use binary && return
cat <<-EOF > "${S}"/config/local/general.h
#undef BANNER_TIMEOUT
#define BANNER_TIMEOUT 0
EOF
use ipv6 && echo "#define NET_PROTO_IPV6" >> "${S}"/config/local/general.h
if use vmware; then
cat <<-EOF >> "${S}"/config/local/general.h
#define VMWARE_SETTINGS
#define CONSOLE_VMWARE
EOF
fi
restore_config config/local/general.h
tc-ld-disable-gold
}
ipxemake() {
# Q='' makes the build verbose since that's what everyone loves now
emake Q='' \
CC="$(tc-getCC)" \
LD="$(tc-getLD)" \
AS="$(tc-getAS)" \
AR="$(tc-getAR)" \
NM="$(tc-getNM)" \
OBJCOPY="$(tc-getOBJCOPY)" \
RANLIB="$(tc-getRANLIB)" \
OBJDUMP="$(tc-getOBJDUMP)" \
HOST_CC="$(tc-getBUILD_CC)" \
"$@"
}
src_compile() {
use binary && return
export NO_WERROR=1
if use qemu; then
ipxemake bin/808610de.rom # pxe-e1000.rom (old)
ipxemake bin/8086100e.rom # pxe-e1000.rom
ipxemake bin/80861209.rom # pxe-eepro100.rom
ipxemake bin/10500940.rom # pxe-ne2k_pci.rom
ipxemake bin/10222000.rom # pxe-pcnet.rom
ipxemake bin/10ec8139.rom # pxe-rtl8139.rom
ipxemake bin/1af41000.rom # pxe-virtio.rom
fi
if use vmware; then
ipxemake bin/8086100f.mrom # e1000
ipxemake bin/808610d3.mrom # e1000e
ipxemake bin/10222000.mrom # vlance
ipxemake bin/15ad07b0.rom # vmxnet3
fi
use efi && ipxemake PLATFORM=efi BIN=bin-efi bin-efi/ipxe.efi
use iso && ipxemake bin/ipxe.iso
use undi && ipxemake bin/undionly.kpxe
use usb && ipxemake bin/ipxe.usb
use lkrn && ipxemake bin/ipxe.lkrn
}
src_install() {
insinto /usr/share/ipxe/
if use qemu || use vmware; then
doins bin/*.rom
fi
use vmware && doins bin/*.mrom
use efi && doins bin-efi/*.efi
use iso && doins bin/*.iso
use undi && doins bin/*.kpxe
use usb && doins bin/*.usb
use lkrn && doins bin/*.lkrn
save_config config/local/general.h
}

View File

@ -1,4 +1,4 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@ -14,7 +14,7 @@ S="${WORKDIR}/${P}/src"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~mips ~ppc ppc64 x86"
KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv x86"
IUSE="+binary efi ipv6 iso lkrn +qemu undi usb vmware"
REQUIRED_USE="!amd64? ( !x86? ( binary ) )"

View File

@ -0,0 +1 @@
DIST seabios-1.16.0-1.xpak 141506 BLAKE2B b2d0cc367ea7ba958604f95dc2a7ab92fd76768e6133552b76d651755cab225eed3e1a6bd350b7f3b5058212390c073e9ca37896412797ac224fb1ce4b5f641a SHA512 4007a6cd40b7c82d1f53450a4151a19d5020ca4c3258b4502f9bfb1c3eacfef1a934794b58d38439e41884cd7a962aa436e22b9194b5731585383fd1476dd688

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>virtualization@gentoo.org</email>
<name>Gentoo Virtualization Project</name>
</maintainer>
</pkgmetadata>

View File

@ -0,0 +1,25 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
BINPKG="${P/-bin/}-1"
DESCRIPTION="Open Source implementation of a 16-bit x86 BIOS"
HOMEPAGE="https://www.seabios.org/"
SRC_URI="https://dev.gentoo.org/~ajak/distfiles/${BINPKG}.xpak"
S="${WORKDIR}"
LICENSE="LGPL-3 GPL-3"
SLOT="0"
KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ppc64 ~riscv ~s390 ~sparc x86"
RDEPEND="!sys-firmware/seabios"
src_unpack() {
tar -xf - < <(xz -c -d --single-stream "${DISTDIR}/${BINPKG}.xpak") || die "unpacking binpkg failed"
}
src_install() {
mv usr "${ED}" || die
}

View File

@ -1,5 +0,0 @@
DIST seabios-1.12.0-bin.tar.xz 162492 BLAKE2B 9a5a349226ed7efbed328493dc057e232203b251677a23f1f09c133743ff0ca6b05270c9d27460be1d8897888fe23ff7bdfa122023fa8ddb23af03d5b9b6f8dd SHA512 f7a0395d621245093bb9a278d95ecc3d4e8d23f620058cd4fddaf885c8b86256f6258f3fd8173c1d24c03306f44d180e768bf8005ee123bc4b699b9f0ca371be
DIST seabios-1.12.0.tar.gz 613542 BLAKE2B f145c2db716996bfa9e5c014086ccfaa8ae96ebc158f34303b122b7bf209408c567665d8691364df8d8e886f63e0e72a3f3cd319dfa86ef581023201b5d94e53 SHA512 e52c5363e5bb37b5286e55545aa06bd126218f9d0e3a06ac2e189de68fe3de3256c11ca1bb13357a9c384d7e3af6284083ff3aa587688b5de04ef11b97bdfa27
DIST seabios-1.14.0-bin.tar.xz 170160 BLAKE2B 1ab471ce0c6e27633ec42a66e3069496be84de713baab5de4f297821bd0da26404f7f70abc82e223ec5aa317a878889ae92b019988c72d24f77e7dcc5865f916 SHA512 7964e9bb7dff4fd6593f5d6d64efc4b1460750461b86635dbe5255d2086d619f51711d7a35e4dc20e556f705091c0950afabeddcd2e8876f05ce14f9ca73ed71
DIST seabios-1.14.0-r2-bin.tar.xz 132256 BLAKE2B 7d38949de254d6e3699d463a66c363156aa36bfe16c18bea48c55a61bdc423184175fd5427d3246a78d9c6335e61e5baa982f67e7406c5525e405b4383530d41 SHA512 5ce0e407b97e878842fbd7ad2f9e8a65f2565a5aa43d08e01cff024352780f55f8669958c58d20770db7f90e87cc52c860af831cefe3846227e7b45cd9dc33ee
DIST seabios-1.14.0.tar.gz 628985 BLAKE2B cc1126925dab1551a655680d20d06ebf28c12c386500d1ee4df9e1a99403b4c5bc6a66c2cc5ef58b4c3d6d7226f35007506a6a1855c2cf2742469dcb7aba05bb SHA512 215c42f59425f8abd062be7b11fc0e39c977cee5001a2381551b0f851ac337d0dd53c065267e6dee0e710ffd700fa635f9007b89da8dfce0f47122c984ee8146

View File

@ -1,2 +0,0 @@
The configuration files config.vga-xxx are based on the variants found in
the qemu/roms/ tree.

View File

@ -1,9 +0,0 @@
--- a/vgasrc/vgalayout.lds.S
+++ b/vgasrc/vgalayout.lds.S
@@ -19,5 +19,5 @@ SECTIONS
// Discard regular data sections to force a link error if
// 16bit code attempts to access data not marked with VAR16.
- /DISCARD/ : { *(.text*) *(.rodata*) *(.data*) *(.bss*) *(COMMON) }
+ /DISCARD/ : { *(.text*) *(.rodata*) *(.data*) *(.bss*) *(COMMON) *(.note.gnu.property) }
}

Some files were not shown because too many files have changed in this diff Show More