# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=libpsl-native
pkgver=7.4.0
pkgrel=0
pkgdesc="This library provides functionality missing from .NET Core via system calls"
arch="all"
url="https://github.com/PowerShell/PowerShell-Native"
license="MIT"
makedepends="
	cmake
	gtest-dev
	samurai
	"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/PowerShell/PowerShell-Native/archive/refs/tags/v$pkgver.tar.gz
	enable-testing-on-arm.patch
	fix-testing-suite.patch
	new-gtest.patch
	"
builddir="$srcdir"/PowerShell-Native-$pkgver/src/libpsl-native

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr
	cmake --build build
}

check() {
	cd build
	ctest --output-on-failure
}

package() {
	install -Dm755 "$builddir"/../powershell-unix/libpsl-native.so "$pkgdir"/usr/lib/libpsl-native.so
}

sha512sums="
bfd1c00834bfd2a7fdba0cf5ae3bb82efb959fdc2f538d05bde150b98d417012647115c6893fc53db0b20170ea40be238ef017044a8076798c02578bd14884f9  libpsl-native-7.4.0.tar.gz
7c9dc6f13d96f7071cbfcd77c23973a48b58dd5e89cddec6884ccbafa2cc0d14e269a9582b8554c1a5a98556b7d20cf2375d958131d94d550234a41f94c06955  enable-testing-on-arm.patch
03769390757ab8abf7d31887a0cb9a3504da5e8475b2b5b8707bad570b91927ad6e743f161926a59aa85293ad1f25cf755c7d2757638328ea334b0db405dcd09  fix-testing-suite.patch
f1f08702191a3a172be0319a6d172d19bf3f09cf266d9bb7101fba24d95e416d2c4eb50635a5ebd95a0af4734d78a09ff036dae4689d0c95f3f8293a91f1ee52  new-gtest.patch
"
