# Contributor: Bart Ribbers # Maintainer: Bart Ribbers pkgname=olm pkgver=3.2.2 pkgrel=0 pkgdesc="Implementation of the olm and megolm cryptographic ratchets" arch="all" url="https://gitlab.matrix.org/matrix-org/olm" license="Apache-2.0" makedepends=" cmake python3-dev py3-cffi py3-setuptools " checkdepends=" py3-pytest py3-pytest-cov py3-future py3-aspectlib " source="https://gitlab.matrix.org/matrix-org/olm/-/archive/$pkgver/olm-$pkgver.tar.gz" subpackages="$pkgname-dev py3-olm:py3" case "$CARCH" in mips*) _disable_tests=" --deselect tests/group_session_test.py::TestClass::test_encrypt \ --deselect tests/group_session_test.py::TestClass::test_decrypt" ;; *) checkdepends="$checkdepends py3-pytest-benchmark" ;; esac build() { cmake -B build \ -DCMAKE_BUILD_TYPE=None \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_LIBDIR=lib cmake --build build make -C python olm-python3 } check() { cd "$builddir"/build/tests CTEST_OUTPUT_ON_FAILURE=TRUE ctest # TODO: fix finding 'olm' module # cd "$builddir"/python # PYTHONPATH="$PWD/build/lib" pytest } package() { DESTDIR="$pkgdir" cmake --build build --target install } py3() { depends="python3 py3-future py3-cffi" DESTDIR="$subpkgdir" make -C "$builddir"/python install-python3 } sha512sums="4af945ee0a2d4c08c03e6706c7cb3d59ca0fcdd06acf9501ee2a22761153a6e2f7c12eb4d119663a8b5b2bc34556fe429d02362492938e4f1832e28cfe991ef7 olm-3.2.2.tar.gz"