system_api-rust: Add new ebuild for D-Bus bindings for Rust.

BUG=chromium:1007474
TEST=sudo emerge system_api-rust

Cq-Depend: chromium:1825641
Change-Id: If7c508f126ac650920ed6e0b601499515af1f5cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/1825861
Tested-by: Allen Webb <allenwebb@google.com>
Commit-Queue: Allen Webb <allenwebb@google.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/chromeos-base/system_api-rust/system_api-rust-9999.ebuild b/chromeos-base/system_api-rust/system_api-rust-9999.ebuild
new file mode 100644
index 0000000..e1f143f
--- /dev/null
+++ b/chromeos-base/system_api-rust/system_api-rust-9999.ebuild
@@ -0,0 +1,51 @@
+# Copyright 2019 The Chromium OS Authors. All rights reserved.
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+CROS_WORKON_PROJECT="chromiumos/platform2"
+CROS_WORKON_LOCALNAME="platform2"
+CROS_WORKON_SUBTREE="authpolicy/dbus_bindings debugd/dbus_bindings login_manager/dbus_bindings system_api"
+
+START_DIR="system_api"
+
+inherit cros-workon cros-rust
+
+RUST_CRATE="system_api"
+DESCRIPTION="Chrome OS system API D-Bus bindings for Rust."
+HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform2/+/master/system_api/"
+
+LICENSE="BSD-Google"
+SLOT="0/${PVR}"
+KEYWORDS="~*"
+
+RDEPEND=""
+
+DEPEND="${RDEPEND}
+	chromeos-base/chromeos-dbus-bindings-rust:=
+	=dev-rust/dbus-0.6*:=
+"
+
+src_unpack() {
+	cros-workon_src_unpack
+	S+="/${START_DIR}"
+
+	cros-rust_src_unpack
+}
+
+src_compile() {
+	ecargo_build
+	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 "${RUST_CRATE}" "$(cros-rust_get_crate_version)"
+}