mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-26 16:11:56 +02:00
sys-boot/gnu-efi: Sync with Gentoo
It's from Gentoo commit b9b6b79955981a40ff0b582f6015e9b077fea135.
This commit is contained in:
parent
a1d573c185
commit
13eb6e96eb
@ -1,3 +1,5 @@
|
||||
DIST gnu-efi-3.0.15.tar.bz2 159399 BLAKE2B 0df93d8cacfa1e6d4b7731e32287d4386da9375c5e5c5847df8a29c99d70f5c24b14abc5e44ab9d0a39a6ec96682eb2b5e84d81a5a142d44a50a522a4ae0e3c2 SHA512 64d408b6d115bdc6eebae12fbd6cd907ed5f847f54e506c1e8f8ea5de38a95cf6fac66ab1009bd1d0bd2d54ad45ad598d29bcc303926a5899bf5cc25448cbb2f
|
||||
DIST gnu-efi-3.0.17.tar.bz2 165568 BLAKE2B 27f8171b411a6a8a138d44d91c7e4e4291aa399562825d51a398913572119482ffeb303d7508ae13eacd2cd10b8f5098405ab16eb56243587efe93235f661285 SHA512 0893ca234272584f889b1ae1c75341a9ceee60acfd32765daa5d704191ba00450536a287b949304c6d055d1bf125cc29e24fc41df8e5230e0da4f9d944876512
|
||||
DIST gnu-efi-3.0.18.tar.bz2 167567 BLAKE2B e080fa4c57a281452a6473304871304d1b5c30d42ee728b4c0c084258ed2f6f2099c068ec5841cee81ecf664dd658dee3b94d68324ebaa498cb49cec4f7f7df9 SHA512 39f9fa14b880441a94a04400ff8850efdd9474929e5501dfd05af06e7747b4d0f7cb742ac811c7026cf52d00508efb73018be4d61d63a1211de0cd931cbc473d
|
||||
DIST gnu-efi-3.0.19.tar.gz 218588 BLAKE2B 78db87904e644406ce2eb1a0ef0f325e7ad0f004dd56199e319985c5d035b4755d545c1a6bcf749da08c7670132de28a3e53ba059956b841034c6b059e39042b SHA512 78a79f51bd271043edbf534427d8fbba3d8099e831a9643019899453e8363ebd4d43f6e5448cdde31d43a6bdb94ec32e73425138bfb614617b8886df90fc1665
|
||||
DIST gnu-efi-4.0.0.tar.gz 228852 BLAKE2B 30a22785b43b586596e9b4cfd281815715529185fbfdb800947ee08a94b3dac80ee13e9f2a8f5cf4acc46b7844cef9e92de97e97801d085249dce3afb2b0fcf0 SHA512 737fda41a45a63ab652f3e8dd5c035bc40dd66e839218c33478fe2ce81346f004b1bed79a5ec29cc282f0d699ad21256e0915482a3fa04b880dea21cae9e2b7f
|
||||
|
@ -0,0 +1,14 @@
|
||||
https://bugs.gentoo.org/888829
|
||||
|
||||
--- a/apps/Makefile
|
||||
+++ b/apps/Makefile
|
||||
@@ -41,9 +41,7 @@
|
||||
|
||||
include $(SRCDIR)/../Make.defaults
|
||||
|
||||
-LINUX_HEADERS = /usr/src/sys/build
|
||||
APPSDIR = $(LIBDIR)/gnuefi/apps
|
||||
-CPPFLAGS += -D__KERNEL__ -I$(LINUX_HEADERS)/include
|
||||
|
||||
ifneq ($(HAVE_EFI_OBJCOPY),)
|
||||
ifeq ($(SYSTEM_HAS_EFI_OBJCOPY),0)
|
143
sdk_container/src/third_party/portage-stable/sys-boot/gnu-efi/gnu-efi-3.0.19.ebuild
vendored
Normal file
143
sdk_container/src/third_party/portage-stable/sys-boot/gnu-efi/gnu-efi-3.0.19.ebuild
vendored
Normal file
@ -0,0 +1,143 @@
|
||||
# Copyright 2004-2024 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
inherit flag-o-matic toolchain-funcs
|
||||
|
||||
DESCRIPTION="Library for build EFI Applications"
|
||||
HOMEPAGE="https://sourceforge.net/projects/gnu-efi/"
|
||||
SRC_URI="https://github.com/ncroxon/gnu-efi/archive/${PV}.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
# inc/, lib/ dirs (README.efilib)
|
||||
# - BSD-2
|
||||
# gnuefi dir:
|
||||
# - BSD (3-cluase): crt0-efi-ia32.S
|
||||
# - GPL-2+ : setjmp_ia32.S
|
||||
LICENSE="GPL-2+ BSD BSD-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="-* ~amd64 ~arm ~arm64 ~riscv ~x86"
|
||||
IUSE="abi_x86_32 abi_x86_64 custom-cflags"
|
||||
REQUIRED_USE="
|
||||
amd64? ( || ( abi_x86_32 abi_x86_64 ) )
|
||||
x86? ( || ( abi_x86_32 abi_x86_64 ) )
|
||||
"
|
||||
|
||||
# for ld.bfd and objcopy
|
||||
BDEPEND="sys-devel/binutils"
|
||||
|
||||
# These objects get run early boot (i.e. not inside of Linux),
|
||||
# so doing these QA checks on them doesn't make sense.
|
||||
QA_EXECSTACK="usr/*/lib*efi.a:* usr/*/crt*.o"
|
||||
RESTRICT="strip"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${PN}-3.0.18-clang.patch
|
||||
"${FILESDIR}"/${PN}-3.0.18-remove-linux-headers.patch
|
||||
)
|
||||
|
||||
check_and_set_objcopy() {
|
||||
if [[ ${MERGE_TYPE} != "binary" ]]; then
|
||||
# bug #931792
|
||||
# llvm-objcopy does not support EFI target, try to use binutils objcopy or fail
|
||||
tc-export OBJCOPY
|
||||
OBJCOPY="${OBJCOPY/llvm-/}"
|
||||
# Test OBJCOPY to see if it supports EFI targets, and return if it does
|
||||
LC_ALL=C "${OBJCOPY}" --help | grep -q '\<pei-' && return 0
|
||||
# If OBJCOPY does not support EFI targets, it is possible that the 'objcopy' on our path is
|
||||
# still LLVM if the 'binutils-plugin' USE flag is set. In this case, we check to see if the
|
||||
# '(prefix)/usr/bin/objcopy' binary is available (it should be, it's a dependency), and if
|
||||
# so, we use the absolute path explicitly.
|
||||
local binutils_objcopy="${EPREFIX}"/usr/bin/"${OBJCOPY}"
|
||||
if [[ -e "${binutils_objcopy}" ]]; then
|
||||
OBJCOPY="${binutils_objcopy}"
|
||||
fi
|
||||
if ! use arm && ! use riscv; then
|
||||
# bug #939338
|
||||
# objcopy does not understand PE/COFF on these arches: arm32, riscv64 and mips64le
|
||||
# gnu-efi containes a workaround
|
||||
LC_ALL=C "${OBJCOPY}" --help | grep -q '\<pei-' || die "${OBJCOPY} (objcopy) does not support EFI target"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
check_compiler() {
|
||||
if [[ ${MERGE_TYPE} != "binary" ]]; then
|
||||
tc-is-gcc || tc-is-clang || die "Unsupported compiler"
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_pretend() {
|
||||
check_compiler
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
check_compiler
|
||||
check_and_set_objcopy
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
sed -i -e "s/-Werror//" Make.defaults || die
|
||||
}
|
||||
|
||||
efimake() {
|
||||
local arch=
|
||||
case ${CHOST} in
|
||||
arm*) arch=arm ;;
|
||||
aarch64*) arch=aarch64 ;;
|
||||
ia64*) arch=ia64 ;;
|
||||
i?86*) arch=ia32 ;;
|
||||
riscv64*) arch=riscv64;;
|
||||
x86_64*) arch=x86_64 ;;
|
||||
*) die "Unknown CHOST" ;;
|
||||
esac
|
||||
|
||||
local args=(
|
||||
ARCH="${arch}"
|
||||
HOSTCC="${BUILD_CC}"
|
||||
CC="${CC}"
|
||||
AS="${AS}"
|
||||
LD="${LD}"
|
||||
AR="${AR}"
|
||||
OBJCOPY="${OBJCOPY}"
|
||||
PREFIX="${EPREFIX}/usr"
|
||||
LIBDIR='$(PREFIX)'/$(get_libdir)
|
||||
)
|
||||
emake -j1 "${args[@]}" "$@"
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
tc-export BUILD_CC AR AS CC LD OBJCOPY
|
||||
|
||||
if ! use custom-cflags; then
|
||||
unset CFLAGS CPPFLAGS LDFLAGS
|
||||
fi
|
||||
|
||||
# work around musl: include first the compiler include dir, then the system one
|
||||
# bug #933080, #938012
|
||||
local CPPINCLUDEDIR
|
||||
if tc-is-gcc; then
|
||||
CPPINCLUDEDIR=$(LC_ALL=C ${CC} -print-search-dirs 2> /dev/null | grep ^install: | cut -f2 -d' ')/include
|
||||
elif tc-is-clang; then
|
||||
CPPINCLUDEDIR=$(LC_ALL=C ${CC} -print-resource-dir 2> /dev/null)/include
|
||||
fi
|
||||
append-cflags "-nostdinc -isystem ${CPPINCLUDEDIR} -isystem ${ESYSROOT}/usr/include"
|
||||
|
||||
if use amd64 || use x86; then
|
||||
use abi_x86_32 && CHOST=i686 ABI=x86 efimake
|
||||
use abi_x86_64 && CHOST=x86_64 ABI=amd64 efimake
|
||||
else
|
||||
efimake
|
||||
fi
|
||||
}
|
||||
|
||||
src_install() {
|
||||
if use amd64 || use x86; then
|
||||
use abi_x86_32 && CHOST=i686 ABI=x86 efimake INSTALLROOT="${D}" install
|
||||
use abi_x86_64 && CHOST=x86_64 ABI=amd64 efimake INSTALLROOT="${D}" install
|
||||
else
|
||||
efimake INSTALLROOT="${D}" install
|
||||
fi
|
||||
einstalldocs
|
||||
}
|
144
sdk_container/src/third_party/portage-stable/sys-boot/gnu-efi/gnu-efi-4.0.0.ebuild
vendored
Normal file
144
sdk_container/src/third_party/portage-stable/sys-boot/gnu-efi/gnu-efi-4.0.0.ebuild
vendored
Normal file
@ -0,0 +1,144 @@
|
||||
# Copyright 2004-2024 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
inherit flag-o-matic toolchain-funcs
|
||||
|
||||
DESCRIPTION="Library for build EFI Applications"
|
||||
HOMEPAGE="https://sourceforge.net/projects/gnu-efi/"
|
||||
SRC_URI="https://github.com/ncroxon/gnu-efi/archive/${PV}.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
# inc/, lib/ dirs (README.efilib)
|
||||
# - BSD-2
|
||||
# gnuefi dir:
|
||||
# - BSD (3-cluase): crt0-efi-ia32.S
|
||||
# - GPL-2+ : setjmp_ia32.S
|
||||
LICENSE="GPL-2+ BSD BSD-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="-* ~amd64 ~arm ~arm64 ~riscv ~x86"
|
||||
IUSE="abi_x86_32 abi_x86_64 custom-cflags"
|
||||
REQUIRED_USE="
|
||||
amd64? ( || ( abi_x86_32 abi_x86_64 ) )
|
||||
x86? ( || ( abi_x86_32 abi_x86_64 ) )
|
||||
"
|
||||
|
||||
# for ld.bfd and objcopy
|
||||
BDEPEND="sys-devel/binutils"
|
||||
|
||||
# These objects get run early boot (i.e. not inside of Linux),
|
||||
# so doing these QA checks on them doesn't make sense.
|
||||
QA_EXECSTACK="usr/*/lib*efi.a:* usr/*/crt*.o"
|
||||
RESTRICT="strip"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${PN}-4.0.0-remove-linux-headers.patch
|
||||
)
|
||||
|
||||
DOCS="README* SECURITY* docs/*"
|
||||
|
||||
check_and_set_objcopy() {
|
||||
if [[ ${MERGE_TYPE} != "binary" ]]; then
|
||||
# bug #931792
|
||||
# llvm-objcopy does not support EFI target, try to use binutils objcopy or fail
|
||||
tc-export OBJCOPY
|
||||
OBJCOPY="${OBJCOPY/llvm-/}"
|
||||
# Test OBJCOPY to see if it supports EFI targets, and return if it does
|
||||
LC_ALL=C "${OBJCOPY}" --help | grep -q '\<pei-' && return 0
|
||||
# If OBJCOPY does not support EFI targets, it is possible that the 'objcopy' on our path is
|
||||
# still LLVM if the 'binutils-plugin' USE flag is set. In this case, we check to see if the
|
||||
# '(prefix)/usr/bin/objcopy' binary is available (it should be, it's a dependency), and if
|
||||
# so, we use the absolute path explicitly.
|
||||
local binutils_objcopy="${EPREFIX}"/usr/bin/"${OBJCOPY}"
|
||||
if [[ -e "${binutils_objcopy}" ]]; then
|
||||
OBJCOPY="${binutils_objcopy}"
|
||||
fi
|
||||
if ! use arm && ! use riscv; then
|
||||
# bug #939338
|
||||
# objcopy does not understand PE/COFF on these arches: arm32, riscv64 and mips64le
|
||||
# gnu-efi containes a workaround
|
||||
LC_ALL=C "${OBJCOPY}" --help | grep -q '\<pei-' || die "${OBJCOPY} (objcopy) does not support EFI target"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
check_compiler() {
|
||||
if [[ ${MERGE_TYPE} != "binary" ]]; then
|
||||
tc-is-gcc || tc-is-clang || die "Unsupported compiler"
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_pretend() {
|
||||
check_compiler
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
check_compiler
|
||||
check_and_set_objcopy
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
sed -i -e "s/-Werror//" Make.defaults || die
|
||||
}
|
||||
|
||||
efimake() {
|
||||
local arch=
|
||||
case ${CHOST} in
|
||||
arm*) arch=arm ;;
|
||||
aarch64*) arch=aarch64 ;;
|
||||
ia64*) arch=ia64 ;;
|
||||
i?86*) arch=ia32 ;;
|
||||
riscv64*) arch=riscv64;;
|
||||
x86_64*) arch=x86_64 ;;
|
||||
*) die "Unknown CHOST" ;;
|
||||
esac
|
||||
|
||||
local args=(
|
||||
ARCH="${arch}"
|
||||
HOSTCC="${BUILD_CC}"
|
||||
CC="${CC}"
|
||||
AS="${AS}"
|
||||
LD="${LD}"
|
||||
AR="${AR}"
|
||||
OBJCOPY="${OBJCOPY}"
|
||||
PREFIX="${EPREFIX}/usr"
|
||||
LIBDIR='$(PREFIX)'/$(get_libdir)
|
||||
)
|
||||
emake -j1 "${args[@]}" "$@"
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
tc-export BUILD_CC AR AS CC LD OBJCOPY
|
||||
|
||||
if ! use custom-cflags; then
|
||||
unset CFLAGS CPPFLAGS LDFLAGS
|
||||
fi
|
||||
|
||||
# work around musl: include first the compiler include dir, then the system one
|
||||
# bug #933080, #938012
|
||||
local CPPINCLUDEDIR
|
||||
if tc-is-gcc; then
|
||||
CPPINCLUDEDIR=$(LC_ALL=C ${CC} -print-search-dirs 2> /dev/null | grep ^install: | cut -f2 -d' ')/include
|
||||
elif tc-is-clang; then
|
||||
CPPINCLUDEDIR=$(LC_ALL=C ${CC} -print-resource-dir 2> /dev/null)/include
|
||||
fi
|
||||
append-cflags "-nostdinc -isystem ${CPPINCLUDEDIR} -isystem ${ESYSROOT}/usr/include"
|
||||
|
||||
if use amd64 || use x86; then
|
||||
use abi_x86_32 && CHOST=i686 ABI=x86 efimake
|
||||
use abi_x86_64 && CHOST=x86_64 ABI=amd64 efimake
|
||||
else
|
||||
efimake
|
||||
fi
|
||||
}
|
||||
|
||||
src_install() {
|
||||
if use amd64 || use x86; then
|
||||
use abi_x86_32 && CHOST=i686 ABI=x86 efimake INSTALLROOT="${D}" install
|
||||
use abi_x86_64 && CHOST=x86_64 ABI=amd64 efimake INSTALLROOT="${D}" install
|
||||
else
|
||||
efimake INSTALLROOT="${D}" install
|
||||
fi
|
||||
einstalldocs
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user