blob: 495fb308284dfa32df8b828f025d2a90ee1d12a2 [file] [log] [blame]
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI="6"
CROS_WORKON_COMMIT="5e04a5edbd9cb77b99dfae6d9f135a8c8f989c68"
CROS_WORKON_TREE="e76992e281f739e8f3dc6aff9e0e60c1a00b2ec3"
CROS_WORKON_LOCALNAME="../platform2"
CROS_WORKON_PROJECT="chromiumos/platform2"
CROS_WORKON_OUTOFTREE_BUILD=1
CROS_WORKON_SUBTREE="libchromeos-rs"
inherit cros-workon cros-rust
DESCRIPTION="A Rust utility library for Chrome OS"
HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform2/+/master/libchromeos-rs/"
LICENSE="BSD-Google"
SLOT="${PV}/${PR}"
KEYWORDS="*"
IUSE="test"
DEPEND="chromeos-base/system_api
sys-apps/dbus
=dev-rust/dbus-0.6*:=
=dev-rust/libc-0.2*:=
=dev-rust/log-0.4*:=
>=dev-rust/protobuf-2.1:=
!>=dev-rust/protobuf-3.0:=
"
src_unpack() {
cros-workon_src_unpack
S+="/libchromeos-rs"
cros-rust_src_unpack
}
src_compile() {
use test && ecargo_test --no-run
}
src_test() {
if ! use x86 && ! use amd64 ; then
elog "Skipping unit tests on non-x86 platform"
else
ecargo_test
fi
}
src_install() {
cros-rust_publish "${PN}" "$(cros-rust_get_crate_version)"
}