blob: 1ca2a08c8df9cd8ce294cf5f7dd949fe86c4b1ab [file] [log] [blame]
# Copyright 2020 The ChromiumOS Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
CROS_WORKON_COMMIT="8b6e11a069e490c761cdab7ab3ff59434806cd9c"
CROS_WORKON_TREE=("41d899585b7a07ea908a0cca2944a7b8a4d13655" "26ed68e3820a14de4b041e842ea9344989c226a6" "f91b6afd5f2ae04ee9a2c19109a3a4a36f7659e6")
CROS_WORKON_INCREMENTAL_BUILD="1"
CROS_WORKON_LOCALNAME="platform2"
CROS_WORKON_PROJECT="chromiumos/platform2"
CROS_WORKON_SUBTREE="common-mk ocr .gn"
CROS_WORKON_OUTOFTREE_BUILD=1
PLATFORM_SUBDIR="ocr"
inherit cros-workon platform user
DESCRIPTION="Optical Character Recognition service for Chrome OS"
HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform2/+/HEAD/ocr/"
LICENSE="BSD-Google"
SLOT="0/0"
KEYWORDS="*"
IUSE="fuzzer"
COMMON_DEPEND="
app-text/tesseract:=
"
RDEPEND="${COMMON_DEPEND}"
DEPEND="${COMMON_DEPEND}
chromeos-base/system_api:=
"
pkg_preinst() {
enewuser ocr_service
enewgroup ocr_service
}
src_install() {
platform_src_install
dobin "${OUT}"/ocr_service
dobin "${OUT}"/ocr_tool
# Install upstart configuration except for fuzzer builds.
insinto /etc/init
use fuzzer || doins init/ocr_service.conf
# Install D-Bus configuration file.
insinto /etc/dbus-1/system.d
doins dbus_permissions/org.chromium.OpticalCharacterRecognition.conf
# Install D-Bus service activation configuration.
insinto /usr/share/dbus-1/system-services
doins dbus_permissions/org.chromium.OpticalCharacterRecognition.service
# Install the fuzzer
local comp="860616"
platform_fuzzer_install "${S}/OWNERS" "${OUT}/ocr_service_fuzzer" \
--comp "${comp}"
}
platform_pkg_test() {
local tests=(
"ocr_service_test"
)
local test_bin
for test_bin in "${tests[@]}"; do
platform_test "run" "${OUT}/${test_bin}"
done
}