2023-06-11 15:09:41 +02:00
|
|
|
# Copyright 2020-2023 Gentoo Authors
|
2021-09-18 18:56:47 +02:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
|
|
|
EAPI="8"
|
|
|
|
|
2022-11-22 22:38:14 +01:00
|
|
|
DISTUTILS_USE_PEP517=setuptools
|
2023-06-11 15:09:41 +02:00
|
|
|
PYTHON_COMPAT=( python3_{11..12} )
|
2021-09-18 18:56:47 +02:00
|
|
|
|
|
|
|
inherit cmake distutils-r1
|
|
|
|
|
|
|
|
DESCRIPTION="Implementation of the olm and megolm cryptographic ratchets"
|
|
|
|
HOMEPAGE="https://gitlab.matrix.org/matrix-org/olm"
|
|
|
|
SRC_URI="https://gitlab.matrix.org/matrix-org/${PN}/-/archive/${PV}/${P}.tar.bz2"
|
|
|
|
|
|
|
|
LICENSE="Apache-2.0"
|
|
|
|
SLOT="0"
|
2021-09-19 11:53:39 +02:00
|
|
|
IUSE="python test"
|
2021-09-18 18:56:47 +02:00
|
|
|
KEYWORDS="~amd64"
|
|
|
|
RESTRICT="!test? ( test )"
|
2021-09-19 11:53:39 +02:00
|
|
|
DEPEND="python? ( dev-python/cffi[${PYTHON_USEDEP}] )"
|
2021-09-18 18:56:47 +02:00
|
|
|
|
2021-09-19 11:53:39 +02:00
|
|
|
DOCS=( README.md docs/{{,meg}olm,signing}.md )
|
2021-09-18 18:56:47 +02:00
|
|
|
|
|
|
|
src_prepare() {
|
|
|
|
default
|
|
|
|
|
|
|
|
cmake_src_prepare
|
|
|
|
|
|
|
|
if use python; then
|
|
|
|
pushd "${S}/python" > /dev/null || die
|
|
|
|
distutils-r1_src_prepare
|
|
|
|
popd > /dev/null || die
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
src_configure() {
|
|
|
|
local -a mycmakeargs=(
|
|
|
|
-DOLM_TESTS="$(usex test)"
|
|
|
|
)
|
|
|
|
cmake_src_configure
|
|
|
|
|
|
|
|
if use python; then
|
|
|
|
pushd python > /dev/null || die
|
|
|
|
distutils-r1_src_configure
|
|
|
|
popd > /dev/null || die
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2022-11-22 22:38:14 +01:00
|
|
|
src_compile() {
|
2021-09-18 18:56:47 +02:00
|
|
|
cmake_src_compile
|
|
|
|
|
|
|
|
if use python; then
|
|
|
|
pushd python > /dev/null || die
|
|
|
|
distutils-r1_src_compile
|
|
|
|
popd > /dev/null || die
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
|
|
|
cmake_src_install
|
|
|
|
|
|
|
|
if use python; then
|
|
|
|
pushd python > /dev/null || die
|
|
|
|
distutils-r1_src_install
|
|
|
|
popd > /dev/null || die
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
src_test() {
|
2021-09-19 11:53:39 +02:00
|
|
|
BUILD_DIR="${BUILD_DIR}/tests" cmake_src_test
|
2021-09-18 18:56:47 +02:00
|
|
|
}
|