blob: 6e4cf0702eb3e17a17d244d6ea37c5a917e47310 [file] [log] [blame]
# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI=7
CROS_WORKON_COMMIT="57779f9c27d62896f66cced9cc88443ae9585372"
CROS_WORKON_TREE=("52a8a8b6d3bbca5e90d4761aa308a5541d52b1bb" "20ed8021024637e492670d20fa5969a2ad75e4b6" "989d840598227b15d78525d5f92c806011a9c158" "560dcfaf6405fec1de4abaf84150869126113ac7" "bac582e24e715a9bb440cd200c6194a45b704591" "e7dba8c91c1f3257c34d4a7ffff0ea2537aeb6bb")
CROS_WORKON_USE_VCSID="1"
CROS_WORKON_LOCALNAME="platform2"
CROS_WORKON_PROJECT="chromiumos/platform2"
CROS_WORKON_OUTOFTREE_BUILD=1
CROS_WORKON_INCREMENTAL_BUILD=1
# TODO(crbug.com/809389): Avoid directly including headers from other packages.
CROS_WORKON_SUBTREE="common-mk trunks libhwsec metrics u2fd .gn"
PLATFORM_SUBDIR="u2fd"
inherit cros-workon platform user
DESCRIPTION="U2FHID Emulation Daemon"
HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform2/+/master/u2fhid"
LICENSE="BSD-Google"
KEYWORDS="*"
IUSE="fuzzer"
COMMON_DEPEND="
chromeos-base/attestation:=
chromeos-base/attestation-client:=
chromeos-base/cbor:=
chromeos-base/libhwsec:=
>=chromeos-base/metrics-0.0.1-r3152:=
chromeos-base/power_manager-client:=
chromeos-base/trunks:=
dev-libs/hidapi:=
"
RDEPEND="${COMMON_DEPEND}"
DEPEND="${COMMON_DEPEND}
chromeos-base/attestation-client:=
chromeos-base/system_api:=[fuzzer?]
"
pkg_setup() {
# Has to be done in pkg_setup() instead of pkg_preinst() since
# src_install() needs the u2f user and group.
enewuser "u2f"
enewgroup "u2f"
cros-workon_pkg_setup
}
src_install() {
dobin "${OUT}"/u2fd
insinto /etc/init
doins init/*.conf
insinto /etc/dbus-1/system.d
doins org.chromium.U2F.conf
local daemon_store="/etc/daemon-store/u2f"
dodir "${daemon_store}"
fperms 0700 "${daemon_store}"
fowners u2f:u2f "${daemon_store}"
platform_fuzzer_install "${S}"/OWNERS "${OUT}"/u2f_adpu_fuzzer
}
platform_pkg_test() {
platform_test "run" "${OUT}/u2fd_test_runner"
}