# Contributor: Michael M <mic@hael.xyz>
# Maintainer: Michael M <mic@hael.xyz>
pkgname=zycore
pkgver=1.5.0
pkgrel=0
pkgdesc="Independent types for Zyantific projects (development files)"
url="https://github.com/zyantific/zycore-c"
arch="x86 x86_64 aarch64 armhf armv7 ppc64le riscv64 loongarch64"
license="MIT"
makedepends="cmake samurai doxygen"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/zyantific/zycore-c/archive/v$pkgver/zycore-c-$pkgver.tar.gz"
builddir="$srcdir/zycore-c-$pkgver"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		local crossopts="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DZYCORE_BUILD_SHARED_LIB=ON \
		-DCMAKE_BUILD_TYPE=None \
		$crossopts
	cmake --build build
}

check() {
	ctest --test-dir build
}

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

sha512sums="
f57af4e5c6f919299e673ff4afd19a7e3cc01acaf5cde73db47063eb30881487fa33d2fd5707a3e55a8cd8df4bb4b668bc7273b8b8b5eebea1e78c1c36f715b2  zycore-1.5.0.tar.gz
"
