diff --git a/devel/cpu_features/Makefile b/devel/cpu_features/Makefile new file mode 100644 index 0000000..e6c5311 --- /dev/null +++ b/devel/cpu_features/Makefile @@ -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 + +# LICENSE +PERMIT_PACKAGE = Yes + +MODULES = devel/cmake + +WANTLIB = c + +CONFIGURE_ARGS = -DBUILD_TESTING=OFF \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_SHARED_LIBS=ON + +.include diff --git a/devel/cpu_features/distinfo b/devel/cpu_features/distinfo new file mode 100644 index 0000000..01aee37 --- /dev/null +++ b/devel/cpu_features/distinfo @@ -0,0 +1,2 @@ +SHA256 (cpu_features-0.8.0.tar.gz) = cCFyny25eqNPIY0ScnMU8j6LEeqi1akH6EJry0HX6qw= +SIZE (cpu_features-0.8.0.tar.gz) = 102371 diff --git a/devel/cpu_features/patches/patch-CMakeLists_txt b/devel/cpu_features/patches/patch-CMakeLists_txt new file mode 100644 index 0000000..6a4d56a --- /dev/null +++ b/devel/cpu_features/patches/patch-CMakeLists_txt @@ -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 diff --git a/devel/cpu_features/patches/patch-include_cpu_features_macros_h b/devel/cpu_features/patches/patch-include_cpu_features_macros_h new file mode 100644 index 0000000..c6db46d --- /dev/null +++ b/devel/cpu_features/patches/patch-include_cpu_features_macros_h @@ -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 diff --git a/devel/cpu_features/pkg/DESCR b/devel/cpu_features/pkg/DESCR new file mode 100644 index 0000000..1c417e7 --- /dev/null +++ b/devel/cpu_features/pkg/DESCR @@ -0,0 +1,2 @@ +A cross-platform C library to retrieve CPU features (such as available +instructions) at runtime. diff --git a/devel/cpu_features/pkg/PLIST b/devel/cpu_features/pkg/PLIST new file mode 100644 index 0000000..0fa61d1 --- /dev/null +++ b/devel/cpu_features/pkg/PLIST @@ -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}