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.10.2-1.fc27.noarch.rpm
24 # seavgabios-bin-1.10.2-1.fc27.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 tc-ld-disable-gold #438058
81 echo "CONFIG_DEBUG_LEVEL=8" >.config
92 OBJCOPY="$(tc-getOBJCOPY)" \
93 RANLIB="$(tc-getRANLIB)" \
94 OBJDUMP="$(tc-getOBJDUMP)" \
95 HOST_CC="$(tc-getBUILD_CC)" \
96 VERSION="Gentoo/${EGIT_COMMIT:-${PVR}}" \
103 for t in 128k 256k ; do
104 cp "${FILESDIR}/seabios/config.seabios-${t}" .config || die
107 mv out/bios.bin ../bios-${t}.bin || die
110 if use seavgabios ; then
111 local config t targets=(
119 for t in "${targets[@]}" ; do
120 emake clean distclean
121 cp "${FILESDIR}/seavgabios/config.vga-${t}" .config || die
123 _emake out/vgabios.bin
124 cp out/vgabios.bin ../vgabios-${t}.bin || die
131 insinto /usr/share/seabios
132 use binary && doins ../bios.bin
133 use !binary && newins ../bios-128k.bin bios.bin
134 doins ../bios-256k.bin
136 if use seavgabios ; then
137 insinto /usr/share/seavgabios
138 doins ../vgabios*.bin