blob: 948959f7cb238a6460528fce15d61e060c4307f2 [file] [log] [blame]
# Copyright 2020 The ChromiumOS Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
CROS_WORKON_COMMIT="424149d2a083ff5213897ca292ab4f986f0b58c0"
CROS_WORKON_TREE=("1647a468f15f85e89d45c799e27359e3e664c67b" "fa6f6d4bf420ee9b84e4174ac9cc48e278c06b3d" "f91b6afd5f2ae04ee9a2c19109a3a4a36f7659e6")
CROS_WORKON_LOCALNAME="../platform2"
CROS_WORKON_PROJECT="chromiumos/platform2"
CROS_WORKON_DESTDIR="${S}/platform2"
CROS_WORKON_SUBTREE="common-mk ml_core .gn"
DESCRIPTION="Chrome OS ML Core Feature Library"
PLATFORM_SUBDIR="ml_core"
inherit cros-workon platform user unpacker
LICENSE="BSD-Google"
KEYWORDS="*"
# camera_feature_effects needed as `use.camera_feature_effects` is
# referenced in BUILD.gn
IUSE="internal local_ml_core_internal camera_feature_effects"
SRC_URI="gs://chromeos-localmirror/distfiles/ml-core-headers-20230419.tar.xz"
RDEPEND="
chromeos-base/dlcservice-client:=
chromeos-base/session_manager-client:=
internal? ( chromeos-base/ml-core-internal:= )
"
DEPEND="${RDEPEND}
"
src_unpack() {
platform_src_unpack
# Unpack the headers into the srcdir
pushd "${S}" > /dev/null || die
if use local_ml_core_internal; then
# Unpack local build.
local dev_tarball="/mnt/google3_staging/ml-core-libcros_ml_core_internal-dev.tar.xz"
echo "Checking for ${dev_tarball}"
[[ ! -f "${dev_tarball}" ]] && die "Couldn't find ${dev_tarball} used by local_ml_core_internal. Did you run chromeos/ml/build_dev.sh in google3?"
echo "Unpacking ${dev_tarball}"
unpack "${dev_tarball}"
else
# Unpack SRC_URI
unpacker
fi
popd > /dev/null || die
}
src_configure() {
if use local_ml_core_internal; then
append-cppflags "-DUSE_LOCAL_ML_CORE_INTERNAL"
fi
platform_src_configure
}
platform_pkg_test() {
platform test_all
}
pkg_setup() {
# Has to be done in pkg_setup() instead of pkg_preinst() since
# src_install() needs ml-core.
enewuser "ml-core"
enewgroup "ml-core"
cros-workon_pkg_setup
}