# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=spdk
pkgver=24.05
pkgrel=0
pkgdesc="Storage Performance Development Kit"
url="https://spdk.io/"
# only supports 64bit
arch="aarch64 loongarch64 ppc64le riscv64 x86_64"
license="BSD-3-Clause"
makedepends="
	bash
	bsd-compat-headers
	coreutils
	cunit-dev
	dpdk-dev
	fuse3-dev
	isa-l-dev
	libaio-dev
	linux-headers
	ncurses-dev
	openssl-dev>3
	patchelf
	python3
	py3-pip
	py3-setuptools
	util-linux-dev
	"
subpackages="$pkgname-static $pkgname-dev $pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/spdk/spdk/archive/v$pkgver.tar.gz
	isal.patch
	remove-stupid.patch
	"
case "$CARCH" in
	aarch64|x86_64) makedepends="$makedepends isa-l_crypto-dev"
	;;
esac

build() {
	# this is not a GNU autoconf script
	./configure \
		--prefix=/usr \
		--with-shared \
		--with-dpdk \
		--with-system-isal \
		--without-crypto
	make
}

check() {
	./test/unit/unittest.sh
}

package() {
	DESTDIR="$pkgdir" make install
}

sha512sums="
cbf77cc239a735e3e48f4c77bd3094368d277f639c2777605e599520af22e6c7a33e78c333fa4610879dbe2720052cf09d0a2ccdcfc6e7e986e2218bded2fc30  spdk-24.05.tar.gz
0cf4eacc165de03dbf1cf4c0dff994eea5d1ab4ec49a169dba9169d7eabcd2420e88ef978b7a5956891888ed98d3ff7ed1352cb03850f8483f61bdb0c8b6e238  isal.patch
087f189776699685791900014beb0ab5d8fc369133b205368100aea4e6ea4d1c85061bb1719bffa21b6a949639180cb8966e85f553efc85eaeb608a7940ffc3b  remove-stupid.patch
"
