1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 PYTHON_COMPAT=( python2_7 )
9 inherit eutils toolchain-funcs python-any-r1
13 # SeaBIOS maintainers sometimes don't release stable tarballs or stable
14 # binaries to generate the stable tarball the following is necessary:
15 # git clone git://git.seabios.org/seabios.git && cd seabios
16 # git archive --output seabios-${PV}.tar.gz --prefix seabios-${PV}/ rel-${PV}
18 if [[ ${PV} = *9999* || ! -z "${EGIT_COMMIT}" ]]; then
19 EGIT_REPO_URI="git://git.seabios.org/seabios.git"
22 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~amd64-fbsd ~x86-fbsd"
23 SRC_URI="!binary? ( http://code.coreboot.org/p/seabios/downloads/get/${P}.tar.gz )
25 http://code.coreboot.org/p/seabios/downloads/get/bios.bin-${PV}.gz
27 mirror://debian/pool/main/s/${PN}/${PN}_${PV}-1_all.deb
30 ${BACKPORTS:+https://dev.gentoo.org/~cardoe/distfiles/${P}-${BACKPORTS}.tar.xz}"
33 DESCRIPTION="Open Source implementation of a 16-bit x86 BIOS"
34 HOMEPAGE="http://www.seabios.org"
36 LICENSE="LGPL-3 GPL-3"
38 IUSE="+binary +seavgabios"
40 REQUIRED_USE="ppc? ( binary )
45 >=sys-power/iasl-20060912
52 ewarn "You have decided to compile your own SeaBIOS. This is not"
53 ewarn "supported by upstream unless you use their recommended"
54 ewarn "toolchain (which you are not)."
56 ewarn "If you are intending to use this build with QEMU, realize"
57 ewarn "you will not receive any support if you have compiled your"
58 ewarn "own SeaBIOS. Virtual machines subtly fail based on changes"
64 use binary || python-any-r1_pkg_setup
69 if use binary && use seavgabios ; then
71 mv usr/share/seabios/vgabios*.bin ./ || die
74 # This simplifies the logic between binary & source builds.
81 if [[ -z "${EGIT_COMMIT}" ]]; then
82 sed -e "s/VERSION=.*/VERSION=${PV}/" \
85 sed -e "s/VERSION=.*/VERSION=${PV}_pre${EGIT_COMMIT}/" \
93 use binary || tc-ld-disable-gold #438058
102 OBJCOPY="$(tc-getOBJCOPY)" \
103 RANLIB="$(tc-getRANLIB)" \
104 OBJDUMP="$(tc-getOBJDUMP)" \
105 HOST_CC="$(tc-getBUILD_CC)" \
113 mv out/bios.bin ../bios.bin
115 if use seavgabios ; then
116 local config t targets=(
123 for t in "${targets[@]}" ; do
124 emake clean distclean
125 cp "${FILESDIR}/seavgabios/config.vga-${t}" .config || die
127 _emake out/vgabios.bin
128 cp out/vgabios.bin ../vgabios-${t}.bin || die
134 insinto /usr/share/seabios
135 newins ../bios.bin* bios.bin
137 if use seavgabios ; then
138 insinto /usr/share/seavgabios
139 doins ../vgabios*.bin