blob: 76bf2569652678026ea24883f11267de041b669a [file] [log] [blame]
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI=6
CROS_WORKON_COMMIT="3e10da53529f0bbd3a08dd4474c5e24a5b5e33fb"
CROS_WORKON_TREE=("310a710d6c1f02a93504b35b3d8371875f253b6a" "bc17a7c7ba087825297982248dded84291956727" "496a75adbc926f5addb5a0f5fb5f8dc1c6a66cfc" "dc1506ef7c8cfd2c5ffd1809dac05596ec18773c")
CROS_WORKON_INCREMENTAL_BUILD=1
CROS_WORKON_LOCALNAME="platform2"
CROS_WORKON_PROJECT="chromiumos/platform2"
CROS_WORKON_OUTOFTREE_BUILD=1
# TODO(crbug.com/809389): Avoid directly including headers from other packages.
CROS_WORKON_SUBTREE="common-mk libtpmcrypto trunks .gn"
PLATFORM_SUBDIR="libtpmcrypto"
inherit cros-workon platform
DESCRIPTION="Encrypts/Decrypts data to a serialized proto with TPM sealed key."
HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform2/+/master/libtpmcrypto/"
LICENSE="BSD-Google"
SLOT="0"
KEYWORDS="*"
IUSE="tpm tpm2"
REQUIRED_USE="tpm2? ( !tpm )"
RDEPEND="
tpm2? (
chromeos-base/trunks
)
!tpm2? (
app-crypt/trousers
)
chromeos-base/libbrillo:=
"
DEPEND="
${RDEPEND}
"
src_install() {
dolib.so "${OUT}/lib/libtpmcrypto.so"
"${S}"/platform2_preinstall.sh "${PV}" "/usr/include/chromeos" "${OUT}"
insinto "/usr/$(get_libdir)/pkgconfig"
doins "${OUT}/libtpmcrypto.pc"
insinto "/usr/include/libtpmcrypto"
doins *.h
}
platform_pkg_test() {
local tests=(
tpmcrypto_test
)
local test_bin
for test_bin in "${tests[@]}"; do
platform_test "run" "${OUT}/${test_bin}"
done
}