blob: 9145714f26a594aea302c8e77b3f91a61e7c1684 [file] [log] [blame]
# Copyright 2018 The ChromiumOS Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
CROS_RUST_SUBDIR="metrics/memd"
CROS_WORKON_PROJECT="chromiumos/platform2"
CROS_WORKON_LOCALNAME="platform2"
CROS_WORKON_SUBTREE="${CROS_RUST_SUBDIR} common-mk"
CROS_WORKON_INCREMENTAL_BUILD=1
# We don't use CROS_WORKON_OUTOFTREE_BUILD here since project's Cargo.toml is
# using "provided by ebuild" macro which supported by cros-rust.
inherit cros-workon cros-rust
DESCRIPTION="Fine-grain memory metrics collector"
HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform2/+/HEAD/metrics/memd/"
LICENSE="BSD-Google"
KEYWORDS="~*"
IUSE="+seccomp"
BDEPEND="dev-libs/protobuf"
DEPEND="
cros_host? ( dev-libs/protobuf:= )
dev-rust/third-party-crates-src:=
chromeos-base/system_api:=
dev-rust/libchromeos:=
sys-apps/dbus:=
"
RDEPEND="sys-apps/dbus"
src_install() {
# cargo doesn't know how to install cross-compiled binaries. It will
# always install native binaries for the host system. Install manually
# instead.
local build_dir="$(cros-rust_get_build_dir)"
dobin "${build_dir}/memd"
insinto /etc/init
doins init/memd.conf
insinto /usr/share/policy
use seccomp && \
newins "init/memd-seccomp-${ARCH}.policy" memd-seccomp.policy
}