1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python3_6 )
8 inherit eutils toolchain-funcs python-any-r1
10 # SeaBIOS maintainers sometimes don't release stable tarballs or stable
11 # binaries to generate the stable tarball the following is necessary:
12 # git clone git://git.seabios.org/seabios.git && cd seabios
13 # git archive --output seabios-${PV}.tar.gz --prefix seabios-${PV}/ rel-${PV}
15 if [[ ${PV} == *9999* || -n "${EGIT_COMMIT}" ]] ; then
16 EGIT_REPO_URI="git://git.seabios.org/seabios.git"
19 KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc x86"
21 # Binary versions taken from fedora:
22 # http://download.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/Packages/s/
23 # seabios-bin-1.12.1-2.fc31.noarch.rpm
24 # seavgabios-bin-1.12.1-2.fc31.noarch.rpm
26 !binary? ( https://code.coreboot.org/p/seabios/downloads/get/${P}.tar.gz )
27 binary? ( https://dev.gentoo.org/~tamiko/distfiles/${P}-bin.tar.xz )"
30 DESCRIPTION="Open Source implementation of a 16-bit x86 BIOS"
31 HOMEPAGE="https://www.seabios.org/"
33 LICENSE="LGPL-3 GPL-3"
35 IUSE="+binary debug +seavgabios"
37 REQUIRED_USE="debug? ( !binary )
38 !amd64? ( !x86? ( binary ) )"
40 # The amd64/x86 check is needed to workaround #570892.
42 >=sys-power/iasl-20060912
46 amd64? ( ${SOURCE_DEPEND} )
47 x86? ( ${SOURCE_DEPEND} )
53 ewarn "You have decided to compile your own SeaBIOS. This is not"
54 ewarn "supported by upstream unless you use their recommended"
55 ewarn "toolchain (which you are not)."
57 ewarn "If you are intending to use this build with QEMU, realize"
58 ewarn "you will not receive any support if you have compiled your"
59 ewarn "own SeaBIOS. Virtual machines subtly fail based on changes"
65 use binary || python-any-r1_pkg_setup
71 # This simplifies the logic between binary & source builds.
78 # Ensure precompiled iasl files are never used
79 find "${WORKDIR}" -name '*.hex' -delete || die
85 tc-ld-disable-gold #438058
88 echo "CONFIG_DEBUG_LEVEL=8" >.config
100 OBJCOPY="$(tc-getOBJCOPY)" \
101 RANLIB="$(tc-getRANLIB)" \
102 OBJDUMP="$(tc-getOBJDUMP)" \
103 HOST_CC="$(tc-getBUILD_CC)" \
104 VERSION="Gentoo/${EGIT_COMMIT:-${PVR}}" \
111 cp "${FILESDIR}/seabios/config.seabios-256k" .config || die
115 mv out/bios.bin ../bios-256k.bin || die
117 if use seavgabios ; then
118 local config t targets=(
126 for t in "${targets[@]}" ; do
127 emake clean distclean
128 cp "${FILESDIR}/seavgabios/config.vga-${t}" .config || die
130 _emake out/vgabios.bin
131 cp out/vgabios.bin ../vgabios-${t}.bin || die
137 insinto /usr/share/seabios
138 use binary && doins ../bios.bin
139 doins ../bios-256k.bin
141 if use seavgabios ; then
142 insinto /usr/share/seavgabios
143 doins ../vgabios*.bin