# Contributor: Jakub Jirutka # Maintainer: Jakub Jirutka pkgname=libcpuid pkgver=0.6.3 pkgrel=0 pkgdesc="C library for x86 CPU detection and feature extraction" url="https://github.com/anrieff/libcpuid" arch="x86 x86_64" license="BSD-2-Clause" makedepends="cmake samurai" checkdepends="python3" subpackages="$pkgname-dev $pkgname-tool" source="https://github.com/anrieff/libcpuid/releases/download/v$pkgver/libcpuid-$pkgver.tar.gz" build() { if [ "$CBUILD" != "$CHOST" ]; then crossopts="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux" fi cmake -B build -G Ninja \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE=MinSizeRel \ -DLIBCPUID_TESTS="$(want_check && echo ON || echo OFF)" \ $crossopts cmake --build build } check() { ninja -C build test-old } package() { DESTDIR="$pkgdir" cmake --install build } tool() { pkgdesc="$pkgdesc (CLI tool)" amove usr/bin } sha512sums=" 900594fe5cf04a64a94b4509549f5a2cc7ff7485d680c8dfc12cdd0b50e39472b0506a81a8fa6b45d371830894c8c5c54a54f66de2d4f6d9fff7a7b9af827694 libcpuid-0.6.3.tar.gz "