blob: 4ebe06c325c780d33f3f3669c7b81427943398ad [file] [log] [blame]
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI="4"
CROS_WORKON_COMMIT="bbba7036234f14eb3559e639045f6c88b1c670a4"
CROS_WORKON_TREE="2a3fc4ce271d9798ef9b41481a29d68e8c248aa9"
CROS_WORKON_PROJECT="chromiumos/platform2"
CROS_WORKON_LOCALNAME="platform2"
CROS_WORKON_DESTDIR="${S}"
CROS_WORKON_OUTOFTREE_BUILD=1
inherit toolchain-funcs cros-debug cros-workon
DESCRIPTION="Chrome OS platform boot mode utility"
HOMEPAGE="http://www.chromium.org/"
SRC_URI=""
LICENSE="BSD-Google"
SLOT="0"
KEYWORDS="*"
IUSE="-asan -clang test valgrind"
REQUIRED_USE="asan? ( clang )"
LIBCHROME_VERS="271506"
RDEPEND="test? ( chromeos-base/libchrome:${LIBCHROME_VERS}[cros-debug=] )"
# qemu use isn't reflected as it is copied into the target
# from the build host environment.
DEPEND="${RDEPEND}
test? ( dev-cpp/gmock )
test? ( dev-cpp/gtest )
valgrind? ( dev-util/valgrind )"
src_unpack() {
cros-workon_src_unpack
S+="/cros_boot_mode"
}
src_prepare() {
cros-workon_src_prepare
}
src_configure() {
clang-setup-env
cros-workon_src_configure
}
src_compile() {
cros-workon_src_compile
}
src_test() {
# Needed for `cros_run_unit_tests`.
cros-workon_src_test
}
src_install() {
cros-workon_src_install
into /
dobin "${OUT}"/cros_boot_mode
into /usr
dolib.so "${OUT}"/libcros_boot_mode.so
insinto /usr/include/cros_boot_mode
doins \
active_main_firmware.h \
bootloader_type.h \
boot_mode.h \
developer_switch.h \
helpers.h \
platform_reader.h \
platform_switch.h
}