pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/devel/cpu_features



Module Name:    pkgsrc
Committed By:   tnn
Date:           Mon Dec 14 15:07:49 UTC 2020

Added Files:
        pkgsrc/devel/cpu_features: DESCR Makefile PLIST buildlink3.mk distinfo
        pkgsrc/devel/cpu_features/patches:
            patch-include_cpu__features__macros.h patch-src_cpuinfo__x86.c

Log Message:
devel/cpu_features: import cpu_features-0.6.0

A cross-platform C library to retrieve CPU features
(such as available instructions) at runtime.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/devel/cpu_features/DESCR \
    pkgsrc/devel/cpu_features/Makefile pkgsrc/devel/cpu_features/PLIST \
    pkgsrc/devel/cpu_features/buildlink3.mk \
    pkgsrc/devel/cpu_features/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/devel/cpu_features/patches/patch-include_cpu__features__macros.h \
    pkgsrc/devel/cpu_features/patches/patch-src_cpuinfo__x86.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: pkgsrc/devel/cpu_features/DESCR
diff -u /dev/null pkgsrc/devel/cpu_features/DESCR:1.1
--- /dev/null   Mon Dec 14 15:07:49 2020
+++ pkgsrc/devel/cpu_features/DESCR     Mon Dec 14 15:07:49 2020
@@ -0,0 +1,2 @@
+A cross-platform C library to retrieve CPU features
+(such as available instructions) at runtime.
Index: pkgsrc/devel/cpu_features/Makefile
diff -u /dev/null pkgsrc/devel/cpu_features/Makefile:1.1
--- /dev/null   Mon Dec 14 15:07:49 2020
+++ pkgsrc/devel/cpu_features/Makefile  Mon Dec 14 15:07:49 2020
@@ -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"
Index: pkgsrc/devel/cpu_features/PLIST
diff -u /dev/null pkgsrc/devel/cpu_features/PLIST:1.1
--- /dev/null   Mon Dec 14 15:07:49 2020
+++ pkgsrc/devel/cpu_features/PLIST     Mon Dec 14 15:07:49 2020
@@ -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
Index: pkgsrc/devel/cpu_features/buildlink3.mk
diff -u /dev/null pkgsrc/devel/cpu_features/buildlink3.mk:1.1
--- /dev/null   Mon Dec 14 15:07:49 2020
+++ pkgsrc/devel/cpu_features/buildlink3.mk     Mon Dec 14 15:07:49 2020
@@ -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
Index: pkgsrc/devel/cpu_features/distinfo
diff -u /dev/null pkgsrc/devel/cpu_features/distinfo:1.1
--- /dev/null   Mon Dec 14 15:07:49 2020
+++ pkgsrc/devel/cpu_features/distinfo  Mon Dec 14 15:07:49 2020
@@ -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

Index: pkgsrc/devel/cpu_features/patches/patch-include_cpu__features__macros.h
diff -u /dev/null pkgsrc/devel/cpu_features/patches/patch-include_cpu__features__macros.h:1.1
--- /dev/null   Mon Dec 14 15:07:49 2020
+++ pkgsrc/devel/cpu_features/patches/patch-include_cpu__features__macros.h     Mon Dec 14 15:07:49 2020
@@ -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
Index: pkgsrc/devel/cpu_features/patches/patch-src_cpuinfo__x86.c
diff -u /dev/null pkgsrc/devel/cpu_features/patches/patch-src_cpuinfo__x86.c:1.1
--- /dev/null   Mon Dec 14 15:07:49 2020
+++ pkgsrc/devel/cpu_features/patches/patch-src_cpuinfo__x86.c  Mon Dec 14 15:07:49 2020
@@ -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