# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=libomemo-c
pkgver=0.5.0
pkgrel=0
pkgdesc="Fork of libsignal-protocol-c adding support for OMEMO XEP-0384 0.5.0+ "
arch="all"
url="https://github.com/dino/libomemo-c"
license="GPL-3.0-only"
makedepends="
	cmake
	samurai
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/dino/libomemo-c/archive/refs/tags/v$pkgver.tar.gz"
subpackages="$pkgname-dev"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=ON \
		-DBUILD_EXAMPLES=OFF \
		-DBUILD_DOCUMENTATION=ON \
		-DBUILD_OMEMO=ON
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
2661ba0dea3eea308b1b71f1b46d7b8445fbe940bf52cc35f22eed110acdb8ee457841c1978e0fe9a53b9d9856c60d70c7f8f98ac182214c0ffb9ec3983240f0  libomemo-c-0.5.0.tar.gz
"
