# Maintainer: Michael Lehn <michael.lehn@uni-ulm.de>
pkgname=ulmblas
pkgver=0.4.1
pkgrel=0
pkgdesc="BLAS (Fortran 77 and CBLAS interface) with micro kernels selected for the CPU at load time"
url="https://github.com/michael-lehn/ulmBLAS"
arch="x86_64 aarch64"
license="BSD-3-Clause"
makedepends="linux-headers"
checkdepends="gfortran"
subpackages="$pkgname-dev"
source="ulmblas-$pkgver.tar.gz::https://github.com/michael-lehn/ulmBLAS/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/ulmBLAS-$pkgver"

_setup() {
	export ULMBLAS_VERSION=$pkgver
	export ULMBLAS_LIBDIR=/usr/lib
	export ULMBLAS_BACKENDDIR=/usr/lib/ulmblas
	export ULMBLAS_INCLUDEDIR=/usr/include/ulmblas
	export ULMBLAS_RPATH=no
	export ULMBLAS_STATIC_LIBSTDCXX=no
	export FC=none
	export MAKE="make $MAKEFLAGS"
}

build() {
	_setup
	ULMBLAS_STEP=build sh interfaces/install-shared.sh /usr
}

check() {
	FC=gfortran sh packaging/check.sh
}

package() {
	_setup
	DESTDIR="$pkgdir" sh interfaces/install-shared.sh /usr
	install -Dm644 -t "$pkgdir"/usr/share/licenses/$pkgname LICENSE NOTICE
}

sha512sums="SKIP"
