# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Alpine Linux. `abuild checksum` fills sha512sums for a release.
pkgname=noqtis
pkgver=0.1.4
pkgrel=0
pkgdesc="Post-quantum signing, KEMs and sealed input records in C11"
url="https://github.com/rootcoder007/noqtis"
arch="all"
license="Apache-2.0 WITH LLVM-exception"
makedepends="cmake samurai"
subpackages="$pkgname-dev $pkgname-doc
	$pkgname-bash-completion
	$pkgname-zsh-completion
	$pkgname-fish-completion"
source="$pkgname-$pkgver.tar.gz::https://github.com/rootcoder007/noqtis/archive/refs/tags/v$pkgver.tar.gz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DNQSHARED=ON \
		-DNQWERROR=OFF
	cmake --build build
}

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

package() {
	DESTDIR="$pkgdir" cmake --install build
	install -Dm644 LICENSE NOTICE -t "$pkgdir"/usr/share/licenses/$pkgname
}
