| # Copyright 2018 The Chromium OS Authors. All rights reserved. |
| # Distributed under the terms of the GNU General Public License v2 |
| |
| EAPI=7 |
| |
| CROS_WORKON_COMMIT="f408b12b563d3c78814774cecafa67ad6ea7da20" |
| CROS_WORKON_TREE=("638bfde957a502ad58d182712c1ebdf335f9a3da" "e031bc0916237739f919f53a1ec2ac5b2d3d0cdc" "d95d092dd6d107e37b5b04ea444e8304bb52dcbf" "e7dba8c91c1f3257c34d4a7ffff0ea2537aeb6bb") |
| 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" |
| KEYWORDS="*" |
| IUSE="tpm tpm2" |
| REQUIRED_USE="tpm2? ( !tpm )" |
| |
| # This depends on protobuf because it uses protoc and needs to be rebuilt |
| # whenever the protobuf library is updated since generated source files may be |
| # incompatible across different versions of the protobuf library. |
| COMMON_DEPEND=" |
| tpm2? ( |
| chromeos-base/trunks:= |
| ) |
| !tpm2? ( |
| app-crypt/trousers:= |
| ) |
| dev-libs/protobuf:= |
| " |
| |
| RDEPEND=" |
| ${COMMON_DEPEND} |
| " |
| |
| DEPEND=" |
| ${COMMON_DEPEND} |
| " |
| |
| 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 |
| } |