aboutsummaryrefslogblamecommitdiffstats
path: root/community/olm/APKBUILD
blob: c3849164b6a9bc2cf6717b1407d1ee3188715465 (plain) (tree)
1
2
3
4
5
6
7
8
9


                                                  
            
        
                                                                     
                                                 

                                              





                      






                            
                                                                                      
                                      

         
                        
                                         

                                             
                           



                                            


         
                                  
                                          






                                                                      


           
                                                              
 




                                                                       
                                                                                                                                                               
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=olm
pkgver=3.1.5
pkgrel=2
pkgdesc="Implementation of the olm and megolm cryptographic ratchets"
arch="all !mips64" # pytest-benchmark unavailable
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-pytest-benchmark
	py3-future
	py3-aspectlib
	"
source="https://gitlab.matrix.org/matrix-org/olm/-/archive/$pkgver/olm-$pkgver.tar.gz"
subpackages="$pkgname-dev py3-olm:py3"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build

	# hack to make the python build work
	ln -s lib/libolm.so build/libolm.so
	make -C python olm-python3
}

check() {
	cd "$builddir"/build/tests
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest

	cd "$builddir"/python
	# the tests also have trouble with lib path
	# give the ffi it just built with a link,
	# and the C libolm with the ld environment variable
	ln build/lib.linux-*/_libolm*.so tests/_libolm.so
	LD_LIBRARY_PATH="$builddir/build/lib" PYTHONPATH="$PWD" 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="2adb55cbed27f15db78a5ebd86ed78183a6d093e41b57d18cd8d046ceeb114993cf0b1c4f1a0e363aa9701cea580ec80797251db5f812fe088e3ea107f453563  olm-3.1.5.tar.gz"