| # Copyright 2012 The Chromium OS Authors |
| # Distributed under the terms of the GNU General Public License v2 |
| # $Header: |
| |
| EAPI=7 |
| CROS_WORKON_COMMIT=("139ca9387937164941b91ec4ea5196ee95cd4ff5" "af02768dace900e7e62d6788b4ff81b57b3e0a79") |
| CROS_WORKON_TREE=("c9a1a3526c61c9272ccff73b39a63e01c936b388" "012e67db92ee97a61df1d6b285f309e862df5446") |
| CROS_WORKON_PROJECT=( |
| "chromiumos/third_party/coreboot" |
| "chromiumos/platform/vboot_reference" |
| ) |
| CROS_WORKON_LOCALNAME=( |
| "coreboot" |
| "../platform/vboot_reference" |
| ) |
| CROS_WORKON_DESTDIR=( |
| "${S}" |
| "${S}/3rdparty/vboot" |
| ) |
| CROS_WORKON_EGIT_BRANCH=( |
| "chromeos-2016.05" |
| "master" |
| ) |
| |
| inherit cros-workon toolchain-funcs |
| |
| DESCRIPTION="Utilities for modifying coreboot firmware images" |
| HOMEPAGE="http://coreboot.org" |
| LICENSE="GPL-2" |
| SLOT="0" |
| KEYWORDS="*" |
| IUSE="cros_host mma +pci static" |
| |
| LIB_DEPEND="sys-apps/pciutils[static-libs(+)]" |
| RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )" |
| DEPEND="${RDEPEND} |
| static? ( ${LIB_DEPEND} ) |
| " |
| |
| _emake() { |
| emake \ |
| TOOLLDFLAGS="${LDFLAGS}" \ |
| CC="${CC}" \ |
| STRIP="true" \ |
| "$@" |
| } |
| |
| src_configure() { |
| use static && append-ldflags -static |
| tc-export CC PKG_CONFIG |
| } |
| |
| is_x86() { |
| use x86 || use amd64 |
| } |
| |
| src_compile() { |
| _emake -C util/cbfstool obj="${PWD}/util/cbfstool" |
| if use cros_host; then |
| _emake -C util/archive HOSTCC="${CC}" |
| else |
| _emake -C util/cbmem |
| fi |
| if is_x86; then |
| if use cros_host; then |
| _emake -C util/ifdtool |
| else |
| _emake -C util/superiotool \ |
| CONFIG_PCI=$(usex pci) |
| _emake -C util/inteltool |
| _emake -C util/nvramtool |
| fi |
| fi |
| } |
| |
| src_install() { |
| dobin util/cbfstool/cbfstool |
| if use cros_host; then |
| dobin util/cbfstool/fmaptool |
| dobin util/cbfstool/cbfs-compression-tool |
| dobin util/archive/archive |
| else |
| dobin util/cbmem/cbmem |
| fi |
| if is_x86; then |
| if use cros_host; then |
| dobin util/ifdtool/ifdtool |
| else |
| dobin util/superiotool/superiotool |
| dobin util/inteltool/inteltool |
| dobin util/nvramtool/nvramtool |
| fi |
| if use mma; then |
| dobin util/mma/mma_setup_test.sh |
| dobin util/mma/mma_get_result.sh |
| dobin util/mma/mma_automated_test.sh |
| insinto /etc/init |
| doins util/mma/mma.conf |
| fi |
| fi |
| } |