blob: ac6d4597a5ff1dfb3cd9e3fa5caa004e6c22df1e [file] [log] [blame]
# Copyright 2018 The ChromiumOS Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
CROS_WORKON_LOCALNAME="../platform/crosvm"
CROS_WORKON_PROJECT="chromiumos/platform/crosvm"
CROS_WORKON_EGIT_BRANCH="chromeos"
CROS_WORKON_INCREMENTAL_BUILD=1
CROS_RUST_SUBDIR="common/data_model"
CROS_WORKON_SUBDIRS_TO_COPY=("${CROS_RUST_SUBDIR}" .cargo)
CROS_WORKON_SUBTREE="${CROS_WORKON_SUBDIRS_TO_COPY[*]}"
# The version of this crate is pinned. See b/229016539 for details.
CROS_WORKON_MANUAL_UPREV="1"
inherit cros-workon cros-rust
DESCRIPTION="Crates includes traits and types for safe interaction with raw memory."
HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform/crosvm/+/HEAD/data_model"
LICENSE="BSD-Google"
KEYWORDS="~*"
IUSE="test"
DEPEND="
dev-rust/third-party-crates-src:=
dev-rust/assertions:=
"
# (crbug.com/1182669): build-time only deps need to be in RDEPEND so they are pulled in when
# installing binpkgs since the full source tree is required to use the crate.
RDEPEND="${DEPEND}
!!<=dev-rust/data_model-0.1.0-r13
"
src_prepare() {
cros-rust_src_prepare
# Replace the version in the sources with the ebuild version.
# ${FILESDIR}/chromeos-version.sh sets the minor version 50 ahead to avoid
# colliding with the version included by path.
if [[ "${PV}" != 9999 ]]; then
sed -i 's/^version = .*$/version = "'"${PV}"'"/g' "${S}/Cargo.toml"
fi
}