blob: 58f306d432d04fde184782b81f06547f277f4ece [file] [log] [blame]
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
EAPI=6
CROS_WORKON_INCREMENTAL_BUILD=1
CROS_WORKON_LOCALNAME="platform2"
CROS_WORKON_PROJECT="chromiumos/platform2"
CROS_WORKON_OUTOFTREE_BUILD=1
CROS_WORKON_SUBTREE="common-mk libhwsec .gn"
PLATFORM_SUBDIR="libhwsec"
inherit cros-workon platform
DESCRIPTION="Crypto and utility functions used in TPM related daemons."
HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform2/+/master/libhwsec/"
LICENSE="BSD-Google"
SLOT="0"
KEYWORDS="~*"
IUSE="test tpm2"
RDEPEND="
!tpm2? ( app-crypt/trousers )
chromeos-base/libbrillo:=
"
DEPEND="
${RDEPEND}
"
src_install() {
insinto /usr/include/chromeos/libhwsec
doins ./*.h
insinto /usr/include/chromeos/libhwsec/overalls
doins ./overalls/overalls.h
doins ./overalls/overalls_api.h
if ! use tpm2; then
insinto /usr/include/chromeos/libhwsec/test_utils/tpm1
doins ./test_utils/tpm1/*.h
fi
dolib.so "${OUT}"/lib/libhwsec.so
dolib.a "${OUT}"/libhwsec_test.a
}
platform_pkg_test() {
local tests=(
hwsec_testrunner
)
local test_bin
for test_bin in "${tests[@]}"; do
platform_test "run" "${OUT}/${test_bin}"
done
}