Files
haikuports/dev-libs/libcpuid/libcpuid-0.6.5.recipe
2024-05-22 17:06:54 +02:00

87 lines
2.0 KiB
Bash

SUMMARY="A small C library for x86 (and x86_64) CPU detection and feature extraction"
DESCRIPTION="libcpuid provides CPU identification for the x86 (and x86_64).
For details about the programming API, you might want to take a look at the project's website \
on sourceforge:
* http://libcpuid.sourceforge.net/.
There you'd find a short tutorial:
* http://libcpuid.sf.net/documentation.html
As well as the full API reference:
* http://libcpuid.sf.net/doxy."
HOMEPAGE="http://libcpuid.sourceforge.net/"
COPYRIGHT="2008 Veselin Georgiev"
LICENSE="BSD (2-clause)"
REVISION="2"
SOURCE_URI="https://github.com/anrieff/libcpuid/archive/refs/tags/v$portVersion.tar.gz"
CHECKSUM_SHA256="4d106d66d211f2bfaf876eb62c84d4b54664e1c2b47eb6138161d3c608c0bc5e"
SOURCE_FILENAME="libcpuid-$portVersion.tar.gz"
PATCHES="libcpuid-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
commandBinDir=$binDir
commandSuffix=$secondaryArchSuffix
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
libVersion="16.0.5"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
PROVIDES="
libcpuid$secondaryArchSuffix = $portVersion
cmd:cpuid_tool$commandSuffix
lib:libcpuid$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
"
PROVIDES_devel="
libcpuid${secondaryArchSuffix}_devel = $portVersion
devel:libcpuid$secondaryArchSuffix = $libVersionCompat
"
REQUIRES_devel="
libcpuid$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:doxygen
cmd:gcc$secondaryArchSuffix
cmd:make
"
TEST_REQUIRES="
cmd:python3
"
BUILD()
{
cmake -Bbuild -S. -DCMAKE_BUILD_TYPE=Release \
$cmakeDirArgs \
-DCMAKE_INSTALL_BINDIR=$commandBinDir -DLIBCPUID_TESTS=ON
make -C build
}
INSTALL()
{
make -C build install
prepareInstalledDevelLib libcpuid
fixPkgconfig
packageEntries devel \
$developDir \
$libDir/cmake
}
TEST()
{
make -Cbuild test
}