# Contributor: Leon Marz <main@lmarz.org>
# Maintainer: Leon Marz <main@lmarz.org>
pkgname=ispc
pkgver=1.25.3
pkgrel=0
pkgdesc="Intel SPMD Program Compiler"
url="https://ispc.github.io/"
arch="x86_64 aarch64" # ispc only supports these arches
license="BSD-3-Clause"
_llvmver=19
makedepends="cmake
	bison
	clang$_llvmver-dev
	flex
	llvm$_llvmver-dev
	llvm$_llvmver-test-utils
	m4
	python3
	samurai
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/ispc/ispc/archive/v$pkgver.tar.gz"
options="!check" # ctest does not find a testsuite

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_SHARED_LIBS=True \
		-DLLVM_CONFIG_EXECUTABLE="/usr/lib/llvm$_llvmver/bin/llvm-config" \
		-DISPC_INCLUDE_EXAMPLES=OFF \
		-DISPC_INCLUDE_RT=OFF \
		-DISPC_SLIM_BINARY=ON

	cmake --build build
}

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

sha512sums="
12bbf7b15d6ec97658d46d65d1c02103bdada4101dcaa2ebb5c8477c39934a588d1035371ae09636c0fa73267f4d714579b8fffcd8690d4f3d95eb12436908ab  ispc-1.25.3.tar.gz
"
