devel/cpu_features: new port, cpu_features 0.8.0

This commit is contained in:
c0dev0id
2026-07-08 11:07:09 +02:00
parent d059121223
commit bdaeed24db
6 changed files with 67 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
COMMENT = cross platform C99 library to get cpu features at runtime.
GH_ACCOUNT = google
GH_PROJECT = cpu_features
GH_TAGNAME = v0.8.0
CATEGORIES = devel
SHARED_LIBS = cpu_features 0.0
MAINTAINER = Stefan Hagen <sh+ports@codevoid.de>
# LICENSE
PERMIT_PACKAGE = Yes
MODULES = devel/cmake
WANTLIB = c
CONFIGURE_ARGS = -DBUILD_TESTING=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON
.include <bsd.port.mk>

View File

@@ -0,0 +1,2 @@
SHA256 (cpu_features-0.8.0.tar.gz) = cCFyny25eqNPIY0ScnMU8j6LEeqi1akH6EJry0HX6qw=
SIZE (cpu_features-0.8.0.tar.gz) = 102371

View File

@@ -0,0 +1,11 @@
Compatibility with CMake < 3.5 was removed from CMake 4.
Index: CMakeLists.txt
--- CMakeLists.txt.orig
+++ CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.5)
# option() honors normal variables.
# see: https://cmake.org/cmake/help/git-stage/policy/CMP0077.html

View File

@@ -0,0 +1,16 @@
We're parsing dmesg, just like FreeBSD
Index: include/cpu_features_macros.h
--- include/cpu_features_macros.h.orig
+++ include/cpu_features_macros.h
@@ -91,6 +91,10 @@
#define CPU_FEATURES_OS_FREEBSD
#endif
+#if (defined(__openbsd__) || defined(__OpenBSD__))
+#define CPU_FEATURES_OS_FREEBSD // currently the same
+#endif
+
#if defined(__ANDROID__)
#define CPU_FEATURES_OS_ANDROID
#endif

View File

@@ -0,0 +1,2 @@
A cross-platform C library to retrieve CPU features (such as available
instructions) at runtime.

View File

@@ -0,0 +1,12 @@
@bin bin/list_cpu_features
include/cpu_features/
include/cpu_features/cpu_features_cache_info.h
include/cpu_features/cpu_features_macros.h
include/cpu_features/cpuinfo_x86.h
lib/cmake/
lib/cmake/CpuFeatures/
lib/cmake/CpuFeatures/CpuFeaturesConfig.cmake
lib/cmake/CpuFeatures/CpuFeaturesConfigVersion.cmake
lib/cmake/CpuFeatures/CpuFeaturesTargets-release.cmake
lib/cmake/CpuFeatures/CpuFeaturesTargets.cmake
@lib lib/libcpu_features.so.${LIBcpu_features_VERSION}