blob: ab8471da12d5fcafd8ba918b75a2773aab14389c [file] [log] [blame] [edit]
# Copyright 2019 The ChromiumOS Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
CROS_WORKON_COMMIT="7524d7f4c89293c6a75353220036ddabaa844383"
CROS_WORKON_TREE=("4ee5e9fed585d026416d714c1e382babead3e559" "4b50eae180b046663625ef84698c88a1d175fcd7" "30be527243b50817fe644449d8e15bc80e788a8e" "501a9f28a45e758e7e9314460a1d77b78012f399")
CROS_RUST_SUBDIR="util/flashrom_tester"
CROS_WORKON_USE_VCSID="1"
CROS_WORKON_PROJECT="chromiumos/third_party/flashrom"
CROS_WORKON_EGIT_BRANCH="master"
CROS_WORKON_LOCALNAME="flashrom"
CROS_WORKON_SUBTREE="${CROS_RUST_SUBDIR} bindings/rust/libflashrom bindings/rust/libflashrom-sys include"
inherit cros-workon cros-rust
DESCRIPTION="Utility for AVL qualification of SPI flash chips with flashrom"
HOMEPAGE="https://www.flashrom.org/Flashrom"
LICENSE="GPL-2"
KEYWORDS="*"
DEPEND="
dev-rust/third-party-crates-src:=
sys-apps/flashrom
"
RDEPEND="!<=sys-apps/flashrom-tester-1.60-r41
sys-apps/flashrom
"
BDEPEND=""
src_compile() {
# Override HOST_CFLAGS so that build dependencies use the correct
# flags on cross-compiled targets using cc-rs.
tc-export_build_env
# ignore missing BUILD_CFLAGS definition lint
# shellcheck disable=2154
export HOST_CFLAGS="${BUILD_CFLAGS}"
ecargo_build
if use test; then
ecargo_test --no-run --workspace
fi
}
src_test() {
cros-rust_src_test --workspace -- --test-threads=1
}
src_install() {
dobin "$(cros-rust_get_build_dir)/flashrom_tester"
}