From: Luke Dashjr Date: Mon, 19 Nov 2018 05:36:16 +0000 (+0000) Subject: sys-firmware/seabios: Support USE=-binary on non-x86 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b10a454c447c2ff6a25851a3fbe6506649ce330f;p=gentoo.git sys-firmware/seabios: Support USE=-binary on non-x86 For non-x86 platforms, building from source can be done using a cross-compiler provided by crossdev. Also adjusts arch package.use.{force,mask} as appropriate. Tested on a Talos II / POWER9 running ppc64 Signed-off-by: Luke Dashjr Signed-off-by: Matthias Maier --- diff --git a/profiles/arch/amd64/package.use.force b/profiles/arch/amd64/package.use.force index dddc40bc24ff..0f4c85a656e0 100644 --- a/profiles/arch/amd64/package.use.force +++ b/profiles/arch/amd64/package.use.force @@ -1,6 +1,10 @@ # Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +# Luke Dashjr (2019-09-21) +# iasl is stable on amd64 +sys-firmware/seabios -binary + # Georgy Yakovlev (2018-05-14) # Force the host target to avoid dependency hell dev-lang/rust llvm_targets_X86 diff --git a/profiles/arch/amd64/package.use.mask b/profiles/arch/amd64/package.use.mask index 758d97f26c8f..82280b43d705 100644 --- a/profiles/arch/amd64/package.use.mask +++ b/profiles/arch/amd64/package.use.mask @@ -17,6 +17,10 @@ #--- END OF EXAMPLES --- +# Luke Dashjr (2019-09-21) +# iasl is stable on amd64 +sys-firmware/seabios -debug + # Georgy Yakovlev (2019-08-28) # upstream provides docs and tools for tier-1 arches dev-lang/rust-bin -doc diff --git a/profiles/arch/arm64/package.use.force b/profiles/arch/arm64/package.use.force index ff05064b9ef2..4648105ebeb2 100644 --- a/profiles/arch/arm64/package.use.force +++ b/profiles/arch/arm64/package.use.force @@ -1,6 +1,10 @@ # Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +# Luke Dashjr (2019-09-21) +# iasl is keyworded ~arm64 +sys-firmware/seabios -binary + # Georgy Yakovlev (2018-05-14) # Force the host target to avoid dependency hell dev-lang/rust llvm_targets_AArch64 diff --git a/profiles/arch/arm64/package.use.mask b/profiles/arch/arm64/package.use.mask index 250a9f78ce22..ae5f9bc1c798 100644 --- a/profiles/arch/arm64/package.use.mask +++ b/profiles/arch/arm64/package.use.mask @@ -1,6 +1,10 @@ # Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +# Luke Dashjr (2019-09-21) +# iasl is keyworded ~arm64 +sys-firmware/seabios -debug + # Aaron Bauman (2019-08-05) # dep not keyworded here media-gfx/gnome-photos upnp-av diff --git a/profiles/arch/arm64/package.use.stable.force b/profiles/arch/arm64/package.use.stable.force new file mode 100644 index 000000000000..cee7fbaa8091 --- /dev/null +++ b/profiles/arch/arm64/package.use.stable.force @@ -0,0 +1,6 @@ +# Copyright 2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# Luke Dashjr (19 Nov 2018) +# iasl is keyworded ~arm64 +sys-firmware/seabios binary diff --git a/profiles/arch/arm64/package.use.stable.mask b/profiles/arch/arm64/package.use.stable.mask index dfeac18eaec8..a4b1a650640a 100644 --- a/profiles/arch/arm64/package.use.stable.mask +++ b/profiles/arch/arm64/package.use.stable.mask @@ -1,6 +1,10 @@ # Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +# Luke Dashjr (2019-09-21) +# iasl is keyworded ~arm64 +sys-firmware/seabios debug + # Andreas Sturmlechner (2019-09-14) # media-video/pipewire is not stable yet dev-libs/weston pipewire diff --git a/profiles/arch/base/package.use.force b/profiles/arch/base/package.use.force new file mode 100644 index 000000000000..c60d96841663 --- /dev/null +++ b/profiles/arch/base/package.use.force @@ -0,0 +1,6 @@ +# Copyright 2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# Luke Dashjr (19 Nov 2018) +# iasl is not keyworded on many platforms yet +sys-firmware/seabios binary diff --git a/profiles/arch/base/package.use.mask b/profiles/arch/base/package.use.mask index 072dbbd336c3..faa9ca3ffc0d 100644 --- a/profiles/arch/base/package.use.mask +++ b/profiles/arch/base/package.use.mask @@ -1,6 +1,10 @@ # Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +# Luke Dashjr (2019-09-21) +# Moved from arch/powerpc/ppc64 as it applies to most architectures. +sys-firmware/seabios debug + # Georgy Yakovlev (2019-08-28) # upstream tarballs for tier-2 arches do not ship docs # and starting with 1.37 no longer ship extra tools diff --git a/profiles/arch/powerpc/ppc32/package.use.force b/profiles/arch/powerpc/ppc32/package.use.force new file mode 100644 index 000000000000..262d3f8001e2 --- /dev/null +++ b/profiles/arch/powerpc/ppc32/package.use.force @@ -0,0 +1,6 @@ +# Copyright 2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# Luke Dashjr (19 Nov 2018) +# iasl is stable on ppc +sys-firmware/seabios -binary diff --git a/profiles/arch/powerpc/ppc32/package.use.mask b/profiles/arch/powerpc/ppc32/package.use.mask index 8b7962cdc8d1..9f76c95f2473 100644 --- a/profiles/arch/powerpc/ppc32/package.use.mask +++ b/profiles/arch/powerpc/ppc32/package.use.mask @@ -1,6 +1,10 @@ # Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +# Luke Dashjr (2019-09-21) +# iasl is stable on ppc +sys-firmware/seabios -debug + # Andreas Sturmlechner (2019-05-15) # sys-cluster/hpx, sci-libs/silo, sci-visualization/visit not keyworded sci-libs/libgeodecomp hpx silo visit diff --git a/profiles/arch/powerpc/ppc64/package.use.force b/profiles/arch/powerpc/ppc64/package.use.force index 49198bc57637..2ccbbdd645cc 100644 --- a/profiles/arch/powerpc/ppc64/package.use.force +++ b/profiles/arch/powerpc/ppc64/package.use.force @@ -1,4 +1,7 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -sys-firmware/seabios binary +# Samuli Suominen (30 Oct 2012) +# Only gnome-base/gdm has stable keywording. If x11-misc/lightdm or kde-plasma/kdm gets +# stable keyword, this line can be removed. +x11-misc/xscreensaver gdm diff --git a/profiles/arch/powerpc/ppc64/package.use.mask b/profiles/arch/powerpc/ppc64/package.use.mask index 1c3a08553bba..aefdac00ab9a 100644 --- a/profiles/arch/powerpc/ppc64/package.use.mask +++ b/profiles/arch/powerpc/ppc64/package.use.mask @@ -23,11 +23,6 @@ media-sound/hydrogen portmidi # missing keyword on dev-python/dbusmock, bug #620024 >=gnome-base/gnome-settings-daemon-3.24 test -# Michał Górny (2017-08-08) -# package.use.force forces USE=binary, and USE=debug requires !binary, -# so it can never be enabled. -sys-firmware/seabios debug - # Michał Górny (2017-06-28) # app-misc/dtach is not keyworded, and tests are restricted anyway, so # no point in pursuing it right now. diff --git a/profiles/arch/x86/package.use.force b/profiles/arch/x86/package.use.force index 5d692726f06a..1b862d289ccd 100644 --- a/profiles/arch/x86/package.use.force +++ b/profiles/arch/x86/package.use.force @@ -1,6 +1,10 @@ # Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +# Luke Dashjr (2019-11-21) +# iasl is stable on x86 +sys-firmware/seabios -binary + # Georgy Yakovlev (2018-05-14) # Force the host target to avoid dependency hell dev-lang/rust llvm_targets_X86 diff --git a/profiles/arch/x86/package.use.mask b/profiles/arch/x86/package.use.mask index 0ff8ea4e2409..ce51c3317fa1 100644 --- a/profiles/arch/x86/package.use.mask +++ b/profiles/arch/x86/package.use.mask @@ -3,6 +3,10 @@ # This file requires >=portage-2.1.1 +# Luke Dashjr (2019-09-21) +# iasl is stable on x86 +sys-firmware/seabios -debug + # Andreas Sturmlechner (2019-09-06) # dev-qt/qtgamepad is not keyworded yet dev-qt/qt3d gamepad diff --git a/sys-firmware/seabios/seabios-1.11.0-r1.ebuild b/sys-firmware/seabios/seabios-1.11.0-r1.ebuild index 268f57fb990d..b57f37fb2681 100644 --- a/sys-firmware/seabios/seabios-1.11.0-r1.ebuild +++ b/sys-firmware/seabios/seabios-1.11.0-r1.ebuild @@ -34,20 +34,36 @@ LICENSE="LGPL-3 GPL-3" SLOT="0" IUSE="+binary debug +seavgabios" -REQUIRED_USE="debug? ( !binary ) - !amd64? ( !x86? ( binary ) )" +REQUIRED_USE="debug? ( !binary )" -# The amd64/x86 check is needed to workaround #570892. SOURCE_DEPEND=" >=sys-power/iasl-20060912 ${PYTHON_DEPS}" DEPEND=" !binary? ( - amd64? ( ${SOURCE_DEPEND} ) - x86? ( ${SOURCE_DEPEND} ) + ${SOURCE_DEPEND} )" RDEPEND="" +choose_target_chost() { + if [[ -n "${CC}" ]]; then + ${CC} -dumpmachine + return + fi + + if use amd64 || use x86; then + # Use the native compiler + echo "${CHOST}" + return + fi + + local i + for i in x86_64 i686 i586 i486 i386 ; do + i=${i}-pc-linux-gnu + type -P ${i}-gcc > /dev/null && echo ${i} && return + done +} + pkg_pretend() { if ! use binary; then ewarn "You have decided to compile your own SeaBIOS. This is not" @@ -58,6 +74,14 @@ pkg_pretend() { ewarn "you will not receive any support if you have compiled your" ewarn "own SeaBIOS. Virtual machines subtly fail based on changes" ewarn "in SeaBIOS." + if [[ -z "$(choose_target_chost)" ]]; then + elog + eerror "Before you can compile ${PN}[-binary], you need to install a x86 cross-compiler" + eerror "Run the following commands:" + eerror " emerge crossdev" + eerror " crossdev --stable -t x86_64-pc-linux-gnu" + die "cross-compiler is needed" + fi fi } @@ -108,10 +132,12 @@ _emake() { src_compile() { use binary && return + local TARGET_CHOST=$(choose_target_chost) + cp "${FILESDIR}/seabios/config.seabios-256k" .config || die _emake oldnoconfig - _emake iasl - _emake out/bios.bin + CHOST="${TARGET_CHOST}" _emake iasl + CHOST="${TARGET_CHOST}" _emake out/bios.bin mv out/bios.bin ../bios-256k.bin || die if use seavgabios ; then @@ -127,7 +153,7 @@ src_compile() { emake clean distclean cp "${FILESDIR}/seavgabios/config.vga-${t}" .config || die _emake oldnoconfig - _emake out/vgabios.bin + CHOST="${TARGET_CHOST}" _emake out/vgabios.bin cp out/vgabios.bin ../vgabios-${t}.bin || die done fi