pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/devel/cpu_features devel/cpu_features: import cpu_feat...
details: https://anonhg.NetBSD.org/pkgsrc/rev/516d25fe9612
branches: trunk
changeset: 443513:516d25fe9612
user: tnn <tnn%pkgsrc.org@localhost>
date: Mon Dec 14 15:07:49 2020 +0000
description:
devel/cpu_features: import cpu_features-0.6.0
A cross-platform C library to retrieve CPU features
(such as available instructions) at runtime.
diffstat:
devel/cpu_features/DESCR | 2 +
devel/cpu_features/Makefile | 18 ++++++
devel/cpu_features/PLIST | 10 +++
devel/cpu_features/buildlink3.mk | 14 ++++
devel/cpu_features/distinfo | 8 ++
devel/cpu_features/patches/patch-include_cpu__features__macros.h | 17 +++++
devel/cpu_features/patches/patch-src_cpuinfo__x86.c | 29 ++++++++++
7 files changed, 98 insertions(+), 0 deletions(-)
diffs (126 lines):
diff -r dbdec7b6ddea -r 516d25fe9612 devel/cpu_features/DESCR
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/cpu_features/DESCR Mon Dec 14 15:07:49 2020 +0000
@@ -0,0 +1,2 @@
+A cross-platform C library to retrieve CPU features
+(such as available instructions) at runtime.
diff -r dbdec7b6ddea -r 516d25fe9612 devel/cpu_features/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/cpu_features/Makefile Mon Dec 14 15:07:49 2020 +0000
@@ -0,0 +1,18 @@
+# $NetBSD: Makefile,v 1.1 2020/12/14 15:07:49 tnn Exp $
+
+GITHUB_TAG= v${PKGVERSION_NOREV}
+DISTNAME= cpu_features-0.6.0
+CATEGORIES= devel
+MASTER_SITES= ${MASTER_SITE_GITHUB:=google/}
+
+MAINTAINER= pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE= https://github.com/google/cpu_features/
+COMMENT= Cross platform C99 library to get CPU features at runtime
+LICENSE= apache-2.0
+
+USE_CMAKE= yes
+USE_LANGUAGES= c c++
+
+PLIST_SUBST+= CPU_FEATURES_ARCH=${MACHINE_ARCH:S/i386/x86/:S/x86_64/x86/}
+
+.include "../../mk/bsd.pkg.mk"
diff -r dbdec7b6ddea -r 516d25fe9612 devel/cpu_features/PLIST
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/cpu_features/PLIST Mon Dec 14 15:07:49 2020 +0000
@@ -0,0 +1,10 @@
+@comment $NetBSD: PLIST,v 1.1 2020/12/14 15:07:49 tnn Exp $
+bin/list_cpu_features
+include/cpu_features/cpu_features_cache_info.h
+include/cpu_features/cpu_features_macros.h
+include/cpu_features/cpuinfo_${CPU_FEATURES_ARCH}.h
+lib/cmake/CpuFeatures/CpuFeaturesConfig.cmake
+lib/cmake/CpuFeatures/CpuFeaturesConfigVersion.cmake
+lib/cmake/CpuFeatures/CpuFeaturesTargets-release.cmake
+lib/cmake/CpuFeatures/CpuFeaturesTargets.cmake
+lib/libcpu_features.a
diff -r dbdec7b6ddea -r 516d25fe9612 devel/cpu_features/buildlink3.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/cpu_features/buildlink3.mk Mon Dec 14 15:07:49 2020 +0000
@@ -0,0 +1,14 @@
+# $NetBSD: buildlink3.mk,v 1.1 2020/12/14 15:07:49 tnn Exp $
+
+BUILDLINK_TREE+= cpu_features
+
+.if !defined(CPU_FEATURES_BUILDLINK3_MK)
+CPU_FEATURES_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.cpu_features+= cpu_features>=0.6.0
+BUILDLINK_PKGSRCDIR.cpu_features?= ../../devel/cpu_features
+BUILDLINK_DEPMETHOD.cpu_features?= build
+
+.endif # CPU_FEATURES_BUILDLINK3_MK
+
+BUILDLINK_TREE+= -cpu_features
diff -r dbdec7b6ddea -r 516d25fe9612 devel/cpu_features/distinfo
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/cpu_features/distinfo Mon Dec 14 15:07:49 2020 +0000
@@ -0,0 +1,8 @@
+$NetBSD: distinfo,v 1.1 2020/12/14 15:07:49 tnn Exp $
+
+SHA1 (cpu_features-0.6.0.tar.gz) = bb723e78b7726359114575c3c7af80031c986b7b
+RMD160 (cpu_features-0.6.0.tar.gz) = b61c55c5e95d8e2f593271fea09d099bdfbcfdbf
+SHA512 (cpu_features-0.6.0.tar.gz) = 006a2e05253712cf605ecabccdda63dd9325445f8d145d5e2432c4342332e652f318810997321849be131082db435d88143020fdc85268fba204586cf37eef0d
+Size (cpu_features-0.6.0.tar.gz) = 63255 bytes
+SHA1 (patch-include_cpu__features__macros.h) = 4d93afe4ac314895f0823b992af463bf39d67379
+SHA1 (patch-src_cpuinfo__x86.c) = 948cba79e96fdabfe5ec48780d5f6d5077018b4e
diff -r dbdec7b6ddea -r 516d25fe9612 devel/cpu_features/patches/patch-include_cpu__features__macros.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/cpu_features/patches/patch-include_cpu__features__macros.h Mon Dec 14 15:07:49 2020 +0000
@@ -0,0 +1,17 @@
+$NetBSD: patch-include_cpu__features__macros.h,v 1.1 2020/12/14 15:07:49 tnn Exp $
+
+NetBSD support.
+
+--- include/cpu_features_macros.h.orig 2020-10-15 09:09:51.000000000 +0000
++++ include/cpu_features_macros.h
+@@ -71,6 +71,10 @@
+ #define CPU_FEATURES_OS_LINUX_OR_ANDROID
+ #endif
+
++#if defined(__NetBSD__)
++#define CPU_FEATURES_OS_NETBSD
++#endif
++
+ #if defined(__ANDROID__)
+ #define CPU_FEATURES_OS_ANDROID
+ #endif
diff -r dbdec7b6ddea -r 516d25fe9612 devel/cpu_features/patches/patch-src_cpuinfo__x86.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/cpu_features/patches/patch-src_cpuinfo__x86.c Mon Dec 14 15:07:49 2020 +0000
@@ -0,0 +1,29 @@
+$NetBSD: patch-src_cpuinfo__x86.c,v 1.1 2020/12/14 15:07:49 tnn Exp $
+
+Use /proc/cpuinfo on NetBSD/x86 for now.
+
+--- src/cpuinfo_x86.c.orig 2020-10-15 09:09:51.000000000 +0000
++++ src/cpuinfo_x86.c
+@@ -1,3 +1,4 @@
++
+ // Copyright 2017 Google LLC
+ // Copyright 2020 Intel Corporation
+ //
+@@ -97,7 +98,7 @@
+ // microarchitectures.
+ #if defined(CPU_FEATURES_OS_WINDOWS)
+ #include <windows.h> // IsProcessorFeaturePresent
+-#elif defined(CPU_FEATURES_OS_LINUX_OR_ANDROID)
++#elif defined(CPU_FEATURES_OS_LINUX_OR_ANDROID) || defined(CPU_FEATURES_OS_NETBSD)
+ #include "internal/filesystem.h" // Needed to parse /proc/cpuinfo
+ #include "internal/stack_line_reader.h" // Needed to parse /proc/cpuinfo
+ #include "internal/string_view.h" // Needed to parse /proc/cpuinfo
+@@ -1239,7 +1240,7 @@ static void DetectSseViaOs(X86Features*
+ features->ssse3 = GetDarwinSysCtlByName("hw.optional.supplementalsse3");
+ features->sse4_1 = GetDarwinSysCtlByName("hw.optional.sse4_1");
+ features->sse4_2 = GetDarwinSysCtlByName("hw.optional.sse4_2");
+-#elif defined(CPU_FEATURES_OS_LINUX_OR_ANDROID)
++#elif defined(CPU_FEATURES_OS_LINUX_OR_ANDROID) || defined(CPU_FEATURES_OS_NETBSD)
+ // Handling Linux platform through /proc/cpuinfo.
+ const int fd = CpuFeatures_OpenFile("/proc/cpuinfo");
+ if (fd >= 0) {
Home |
Main Index |
Thread Index |
Old Index