rand/sys-firmware/trusted-firmware-a/trusted-firmware-a-2.5.ebuild
2021-08-01 01:20:16 +02:00

50 lines
1.2 KiB
Bash

# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
DESCRIPTION="Trusted Firmware A's BL31"
HOMEPAGE="https://www.trustedfirmware.org/"
SRC_URI="https://git.trustedfirmware.org/TF-A/${PN}.git/snapshot/${P}.tar.gz -> ${P}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="-* arm64"
RDEPEND="!sys-firmware/trusted-firmware-a-bin"
TFA_ALL_PLATFORMS=( rk3288 rk3399 sun50i_a64 )
IUSE="${TFA_ALL_PLATFORMS[@]/#/tfa_platforms_}"
REQUIRED_USE="^^ ( ${IUSE} )"
PATCHES=(
"${FILESDIR}"/0001-dram-Fix-build-with-gcc-11.patch
"${FILESDIR}"/0001-Fix-build-with-gcc-11.patch
"${FILESDIR}"/0001-plat_macros.S-Use-compatible-.asciz-asm-directive.patch
"${FILESDIR}"/0001-pmu-Do-not-mark-already-defined-functions-as-weak.patch
"${FILESDIR}"/serial-console-baudrate.patch
)
tfa_get_plat() {
local plat
for plat in "${TFA_ALL_PLATFORMS[@]}"; do
if use "tfa_platforms_${plat}"; then
echo ${plat}
return 0
fi
done
die "no tfa_platforms_ set"
}
src_compile() {
which arm-none-eabi-gcc || die "arm-none-eabi toolchain not found!"
unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
emake PLAT=$(tfa_get_plat)
}
src_install() {
local plat=$(tfa_get_plat)
insinto /usr/share/${PN}/${plat}
doins build/${plat}/release/bl31/bl31.elf
}