blob: e1f143f6425c8592f1c08b88103e05c165290382 [file] [log] [blame]
Allen Webb3949eebe2019-09-25 13:40:37 -07001# Copyright 2019 The Chromium OS Authors. All rights reserved.
2# Distributed under the terms of the GNU General Public License v2
3
4EAPI=6
5
6CROS_WORKON_PROJECT="chromiumos/platform2"
7CROS_WORKON_LOCALNAME="platform2"
8CROS_WORKON_SUBTREE="authpolicy/dbus_bindings debugd/dbus_bindings login_manager/dbus_bindings system_api"
9
10START_DIR="system_api"
11
12inherit cros-workon cros-rust
13
14RUST_CRATE="system_api"
15DESCRIPTION="Chrome OS system API D-Bus bindings for Rust."
16HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform2/+/master/system_api/"
17
18LICENSE="BSD-Google"
19SLOT="0/${PVR}"
20KEYWORDS="~*"
21
22RDEPEND=""
23
24DEPEND="${RDEPEND}
25 chromeos-base/chromeos-dbus-bindings-rust:=
26 =dev-rust/dbus-0.6*:=
27"
28
29src_unpack() {
30 cros-workon_src_unpack
31 S+="/${START_DIR}"
32
33 cros-rust_src_unpack
34}
35
36src_compile() {
37 ecargo_build
38 use test && ecargo_test --no-run
39}
40
41src_test() {
42 if use x86 || use amd64; then
43 ecargo_test
44 else
45 elog "Skipping rust unit tests on non-x86 platform"
46 fi
47}
48
49src_install() {
50 cros-rust_publish "${RUST_CRATE}" "$(cros-rust_get_crate_version)"
51}