Allen Webb | 3949eebe | 2019-09-25 13:40:37 -0700 | [diff] [blame^] | 1 | # Copyright 2019 The Chromium OS Authors. All rights reserved. |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | |
| 4 | EAPI=6 |
| 5 | |
| 6 | CROS_WORKON_PROJECT="chromiumos/platform2" |
| 7 | CROS_WORKON_LOCALNAME="platform2" |
| 8 | CROS_WORKON_SUBTREE="authpolicy/dbus_bindings debugd/dbus_bindings login_manager/dbus_bindings system_api" |
| 9 | |
| 10 | START_DIR="system_api" |
| 11 | |
| 12 | inherit cros-workon cros-rust |
| 13 | |
| 14 | RUST_CRATE="system_api" |
| 15 | DESCRIPTION="Chrome OS system API D-Bus bindings for Rust." |
| 16 | HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform2/+/master/system_api/" |
| 17 | |
| 18 | LICENSE="BSD-Google" |
| 19 | SLOT="0/${PVR}" |
| 20 | KEYWORDS="~*" |
| 21 | |
| 22 | RDEPEND="" |
| 23 | |
| 24 | DEPEND="${RDEPEND} |
| 25 | chromeos-base/chromeos-dbus-bindings-rust:= |
| 26 | =dev-rust/dbus-0.6*:= |
| 27 | " |
| 28 | |
| 29 | src_unpack() { |
| 30 | cros-workon_src_unpack |
| 31 | S+="/${START_DIR}" |
| 32 | |
| 33 | cros-rust_src_unpack |
| 34 | } |
| 35 | |
| 36 | src_compile() { |
| 37 | ecargo_build |
| 38 | use test && ecargo_test --no-run |
| 39 | } |
| 40 | |
| 41 | src_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 | |
| 49 | src_install() { |
| 50 | cros-rust_publish "${RUST_CRATE}" "$(cros-rust_get_crate_version)" |
| 51 | } |