sys-firmware/seabios: Support USE=-binary on non-x86
authorLuke Dashjr <luke-jr+git@utopios.org>
Mon, 19 Nov 2018 05:36:16 +0000 (05:36 +0000)
committerMatthias Maier <tamiko@gentoo.org>
Sun, 22 Sep 2019 02:50:47 +0000 (21:50 -0500)
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 <luke-jr+git@utopios.org>
Signed-off-by: Matthias Maier <tamiko@gentoo.org>
15 files changed:
profiles/arch/amd64/package.use.force
profiles/arch/amd64/package.use.mask
profiles/arch/arm64/package.use.force
profiles/arch/arm64/package.use.mask
profiles/arch/arm64/package.use.stable.force [new file with mode: 0644]
profiles/arch/arm64/package.use.stable.mask
profiles/arch/base/package.use.force [new file with mode: 0644]
profiles/arch/base/package.use.mask
profiles/arch/powerpc/ppc32/package.use.force [new file with mode: 0644]
profiles/arch/powerpc/ppc32/package.use.mask
profiles/arch/powerpc/ppc64/package.use.force
profiles/arch/powerpc/ppc64/package.use.mask
profiles/arch/x86/package.use.force
profiles/arch/x86/package.use.mask
sys-firmware/seabios/seabios-1.11.0-r1.ebuild

index dddc40bc24ff812534dd8dd0be0320d67e8616bd..0f4c85a656e0f9dc24714305f2a434d6f27c6256 100644 (file)
@@ -1,6 +1,10 @@
 # Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+# Luke Dashjr <luke-jr+gentoobugs@utopios.org> (2019-09-21)
+# iasl is stable on amd64
+sys-firmware/seabios -binary
+
 # Georgy Yakovlev <gyakovlev@gentoo.org> (2018-05-14)
 # Force the host target to avoid dependency hell
 dev-lang/rust llvm_targets_X86
index 758d97f26c8f7d56c135baad1cf24d121c57ddf2..82280b43d7053b76c1d9584ea5310cdf5a0a9c96 100644 (file)
 
 #--- END OF EXAMPLES ---
 
+# Luke Dashjr <luke-jr+gentoobugs@utopios.org> (2019-09-21)
+# iasl is stable on amd64
+sys-firmware/seabios -debug
+
 # Georgy Yakovlev <gyakovlev@gentoo.org> (2019-08-28)
 # upstream provides docs and tools for tier-1 arches
 dev-lang/rust-bin -doc
index ff05064b9ef2f9975b53dcf200c432aba18da139..4648105ebeb2c7f628d92829755b09647d8a80d5 100644 (file)
@@ -1,6 +1,10 @@
 # Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+# Luke Dashjr <luke-jr+gentoobugs@utopios.org> (2019-09-21)
+# iasl is keyworded ~arm64
+sys-firmware/seabios -binary
+
 # Georgy Yakovlev <gyakovlev@gentoo.org> (2018-05-14)
 # Force the host target to avoid dependency hell
 dev-lang/rust llvm_targets_AArch64
index 250a9f78ce22aee750bb4b2dc51fe409dd570feb..ae5f9bc1c7981bdd58a13fcb56335ac1c693004a 100644 (file)
@@ -1,6 +1,10 @@
 # Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+# Luke Dashjr <luke-jr+gentoobugs@utopios.org> (2019-09-21)
+# iasl is keyworded ~arm64
+sys-firmware/seabios -debug
+
 # Aaron Bauman <bman@gentoo.org> (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 (file)
index 0000000..cee7fba
--- /dev/null
@@ -0,0 +1,6 @@
+# Copyright 2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# Luke Dashjr <luke-jr+gentoobugs@utopios.org> (19 Nov 2018)
+# iasl is keyworded ~arm64
+sys-firmware/seabios binary
index dfeac18eaec84e3eefb736e0c7afcbd5b38f7441..a4b1a650640a3c49830e8262cf4631e9def2e8dc 100644 (file)
@@ -1,6 +1,10 @@
 # Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+# Luke Dashjr <luke-jr+gentoobugs@utopios.org> (2019-09-21)
+# iasl is keyworded ~arm64
+sys-firmware/seabios debug
+
 # Andreas Sturmlechner <asturm@gentoo.org> (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 (file)
index 0000000..c60d968
--- /dev/null
@@ -0,0 +1,6 @@
+# Copyright 2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# Luke Dashjr <luke-jr+gentoobugs@utopios.org> (19 Nov 2018)
+# iasl is not keyworded on many platforms yet
+sys-firmware/seabios binary
index 072dbbd336c3a1fc5e259c76f7a002e6bc74b3cb..faa9ca3ffc0d424d3714d6959281c7522133156a 100644 (file)
@@ -1,6 +1,10 @@
 # Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+# Luke Dashjr <luke-jr+gentoobugs@utopios.org> (2019-09-21)
+# Moved from arch/powerpc/ppc64 as it applies to most architectures.
+sys-firmware/seabios debug
+
 # Georgy Yakovlev <gyakovlev@gentoo.org> (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 (file)
index 0000000..262d3f8
--- /dev/null
@@ -0,0 +1,6 @@
+# Copyright 2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# Luke Dashjr <luke-jr+gentoobugs@utopios.org> (19 Nov 2018)
+# iasl is stable on ppc
+sys-firmware/seabios -binary
index 8b7962cdc8d1a13fb43ba4ec55ab51845d56879e..9f76c95f24734f2548b5935fe1a0d35c21659cd3 100644 (file)
@@ -1,6 +1,10 @@
 # Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+# Luke Dashjr <luke-jr+gentoobugs@utopios.org> (2019-09-21)
+# iasl is stable on ppc
+sys-firmware/seabios -debug
+
 # Andreas Sturmlechner <asturm@gentoo.org> (2019-05-15)
 # sys-cluster/hpx, sci-libs/silo, sci-visualization/visit not keyworded
 sci-libs/libgeodecomp hpx silo visit
index 49198bc57637d2c4f78b002a2750a298d40a219b..2ccbbdd645cc16338ab30063a1d738f9c9b86807 100644 (file)
@@ -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 <ssuominen@gentoo.org> (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
index 1c3a08553bba80c371dcf37192969519dde7a35e..aefdac00ab9a5fa55d23cc26d734c7d96f95c23d 100644 (file)
@@ -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 <mgorny@gentoo.org> (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 <mgorny@gentoo.org> (2017-06-28)
 # app-misc/dtach is not keyworded, and tests are restricted anyway, so
 # no point in pursuing it right now.
index 5d692726f06a904035c43dab0f7991385b16e9c1..1b862d289ccd5c7bb834b5d96f5ba8a8e4986451 100644 (file)
@@ -1,6 +1,10 @@
 # Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+# Luke Dashjr <luke-jr+gentoobugs@utopios.org> (2019-11-21)
+# iasl is stable on x86
+sys-firmware/seabios -binary
+
 # Georgy Yakovlev <gyakovlev@gentoo.org> (2018-05-14)
 # Force the host target to avoid dependency hell
 dev-lang/rust llvm_targets_X86
index 0ff8ea4e24098b434c0f7d103a6653a4f69a71ff..ce51c3317fa13501e92592174e1610c69afeb979 100644 (file)
@@ -3,6 +3,10 @@
 
 # This file requires >=portage-2.1.1
 
+# Luke Dashjr <luke-jr+gentoobugs@utopios.org> (2019-09-21)
+# iasl is stable on x86
+sys-firmware/seabios -debug
+
 # Andreas Sturmlechner <asturm@gentoo.org> (2019-09-06)
 # dev-qt/qtgamepad is not keyworded yet
 dev-qt/qt3d gamepad
index 268f57fb990dd312fa5b2828297609c69dd273d9..b57f37fb268112b6834bc3976b417f13f754f49f 100644 (file)
@@ -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