# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=vidstab
pkgver=1.1.1
pkgrel=0
arch="all"
url="http://public.hronopik.de/vid.stab/"
pkgdesc="Video stabilization library"
license="GPL-2.0-or-later"
makedepends="cmake samurai"
source="https://github.com/georgmartius/vid.stab/archive/v$pkgver/vid.stab-v$pkgver.tar.gz"
subpackages="$pkgname-dev"
options="!check" # No tests
builddir="$srcdir/vid.stab-$pkgver"

build() {
	[ "$CARCH" = "riscv64" ] && _sse2="-DSSE2_FOUND=false"

	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		$_sse2
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

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

sha512sums="
b27ac95ab5302e9500af5a52cb09f557b9dacbdc4dc57a9781e2f9ae65a6ffea396f9819bca1f6a103f9d1896bf3061f1cb647166b14b8de8e89a1b15f010e5c  vid.stab-v1.1.1.tar.gz
"
