# Contributor: FintasticMan <finlay.neon.kid@gmail.com>
# Maintainer: FintasticMan <finlay.neon.kid@gmail.com>
pkgname=igsc
pkgver=0.9.3
pkgrel=0
pkgdesc="Intel graphics system controller firmware update library"
url="https://github.com/intel/igsc"
arch="x86_64"
license="Apache-2.0"
makedepends="
	cmake
	eudev-dev
	linux-headers
	metee-dev
	samurai
	"
subpackages="$pkgname-dev"
source="https://github.com/intel/igsc/archive/V$pkgver/igsc-V$pkgver.tar.gz"

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 \
		-DBUILD_SHARED_LIBS=ON \
		-DCMAKE_BUILD_TYPE=None \
		$crossopts
	cmake --build build
}

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

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

sha512sums="
758059556efa6b94702291d11ca8267a3e4258299a324388c4a8fcb9efd2a2218ad354447ea32277439fc65d52f9481441d0bd699bfae1c375b7f807e21f9d94  igsc-V0.9.3.tar.gz
"
