From f958b3da727851d8e03aa9f9aa802013627e9767 Mon Sep 17 00:00:00 2001 From: Alfred Wingate Date: Fri, 21 May 2021 21:44:15 +0300 Subject: [PATCH] dev-libs/olm: add tests and docs to new revision of 3.2.2 Package-Manager: Portage-3.0.18, Repoman-3.0.2 Signed-off-by: Alfred Wingate --- dev-libs/olm/olm-3.2.2-r1.ebuild | 109 +++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 dev-libs/olm/olm-3.2.2-r1.ebuild diff --git a/dev-libs/olm/olm-3.2.2-r1.ebuild b/dev-libs/olm/olm-3.2.2-r1.ebuild new file mode 100644 index 0000000..7256f29 --- /dev/null +++ b/dev-libs/olm/olm-3.2.2-r1.ebuild @@ -0,0 +1,109 @@ +# Copyright 2020-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{8..9} ) +DISTUTILS_OPTIONAL=1 + +inherit cmake distutils-r1 + +DESCRIPTION="An implementation of the Double Ratchet cryptographic ratchet in C++" +HOMEPAGE="https://git.matrix.org/git/olm/about/" + +if [[ "${PV}" == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://gitlab.matrix.org/matrix-org/${PN}.git" +else + SRC_URI="https://gitlab.matrix.org/matrix-org/${PN}/-/archive/${PV}/${P}.tar.bz2" + KEYWORDS="~amd64" +fi + +LICENSE="Apache-2.0" +SLOT="0/$(ver_cut 1)" +IUSE="doc python test" +REQUIRED_USE="doc? ( python )" + +DEPEND=" + python? ( + >=dev-python/cffi-1.0.0[${PYTHON_USEDEP}] + dev-python/future[${PYTHON_USEDEP}] + test? ( + dev-python/aspectlib[${PYTHON_USEDEP}] + dev-python/pytest-benchmark[${PYTHON_USEDEP}] + dev-python/pytest-cov[${PYTHON_USEDEP}] + dev-python/pytest-flake8[${PYTHON_USEDEP}] + dev-python/pytest-isort[${PYTHON_USEDEP}] + ) + ) +" +BDEPEND=" + doc? ( dev-python/sphinx ) +" + +distutils_enable_tests pytest + +DOCS=( "${S}/docs/" ) + +src_prepare() { + cmake_src_prepare + if use python; then + pushd python || die + distutils-r1_src_prepare + popd || die + fi +} + +src_configure() { + local mycmakeargs=( + -DBUILD_SHARED_LIBS=ON + -DOLM_TESTS=$(usex test ON OFF) + ) + cmake_src_configure + if use python; then + pushd python || die + distutils-r1_src_configure + popd || die + fi +} + +python_compile_all() { + if use doc; then + pushd "${S}/python/docs" || die + emake html || die + popd || die + fi +} + +src_compile() { + cmake_src_compile + if use python; then + pushd python || die + # Let python build find the already built libolm + export LIBRARY_PATH="${BUILD_DIR}/" + distutils-r1_src_compile + popd || die + fi +} + +src_install() { + cmake_src_install + if use python; then + pushd python || die + distutils-r1_src_install + if use doc; then + HTML_DOCS=( "${S}/python/docs/html/." ) + fi + popd || die + fi + einstalldocs +} + +src_test() { + emake test + if use python; then + pushd python || die + distutils-r1_src_test + popd || die + fi +}