blob: f18ac7dd4b1c7cb9bddb932b814509c823560b80 [file] [log] [blame]
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
CROS_WORKON_COMMIT="70c7e1ddd140ec61f622104f86d253996dfc0d85"
CROS_WORKON_TREE="43eadf441b4d60610d3a026d893e7cb221bae3d3"
CROS_WORKON_LOCALNAME="adhd"
CROS_WORKON_PROJECT="chromiumos/third_party/adhd"
# We don't use CROS_WORKON_OUTOFTREE_BUILD here since cras-sys/Cargo.toml is
# using "provided by ebuild" macro which supported by cros-rust.
CROS_WORKON_INCREMENTAL_BUILD=1
CROS_WORKON_SUBTREE="cras/client/cras-sys"
inherit cros-workon cros-rust
DESCRIPTION="Crate for CRAS C-structures generated by bindgen"
HOMEPAGE="https://chromium.googlesource.com/chromiumos/third_party/adhd/+/master/cras/client/cras-sys"
LICENSE="BSD-Google"
KEYWORDS="*"
IUSE="test"
DEPEND="
dev-rust/data_model:=
media-sound/audio_streams:=
"
RDEPEND="!<=media-sound/cras-sys-0.1.0-r10"
src_unpack() {
cros-workon_src_unpack
S+="/cras/client/cras-sys"
cros-rust_src_unpack
}
src_compile() {
use test && ecargo_test --no-run
}
src_test() {
if use x86 || use amd64; then
ecargo_test
else
elog "Skipping rust unit tests on non-x86 platform"
fi
}
src_install() {
cros-rust_publish "${PN}" "$(cros-rust_get_crate_version)"
}