pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/sysutils libcpuid: Add version 0.5.1



details:   https://anonhg.NetBSD.org/pkgsrc/rev/fe82bbc442b8
branches:  trunk
changeset: 376741:fe82bbc442b8
user:      nikita <nikita%pkgsrc.org@localhost>
date:      Tue Apr 12 22:22:26 2022 +0000

description:
libcpuid: Add version 0.5.1

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,
as well as the full API reference.

diffstat:

 sysutils/Makefile                                        |   3 +-
 sysutils/libcpuid/DESCR                                  |   5 +
 sysutils/libcpuid/Makefile                               |  27 +++++++
 sysutils/libcpuid/PLIST                                  |   7 ++
 sysutils/libcpuid/distinfo                               |   7 ++
 sysutils/libcpuid/patches/patch-configure.ac             |  34 +++++++++
 sysutils/libcpuid/patches/patch-libcpuid_libcpuid_util.c |  56 ++++++++++++++++
 7 files changed, 138 insertions(+), 1 deletions(-)

diffs (177 lines):

diff -r 37f506711c08 -r fe82bbc442b8 sysutils/Makefile
--- a/sysutils/Makefile Tue Apr 12 22:13:36 2022 +0000
+++ b/sysutils/Makefile Tue Apr 12 22:22:26 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1000 2022/03/12 14:28:54 tnn Exp $
+# $NetBSD: Makefile,v 1.1001 2022/04/12 22:22:26 nikita Exp $
 #
 
 COMMENT=       System utilities
@@ -389,6 +389,7 @@
 SUBDIR+=       libbaloo4
 SUBDIR+=       libburn
 SUBDIR+=       libcap
+SUBDIR+=       libcpuid
 SUBDIR+=       libdevkit-gobject
 SUBDIR+=       libfm
 SUBDIR+=       libfm-extra
diff -r 37f506711c08 -r fe82bbc442b8 sysutils/libcpuid/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/libcpuid/DESCR   Tue Apr 12 22:22:26 2022 +0000
@@ -0,0 +1,5 @@
+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,
+as well as the full API reference.
diff -r 37f506711c08 -r fe82bbc442b8 sysutils/libcpuid/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/libcpuid/Makefile        Tue Apr 12 22:22:26 2022 +0000
@@ -0,0 +1,27 @@
+# $NetBSD: Makefile,v 1.1 2022/04/12 22:22:26 nikita Exp $
+
+DISTNAME=              v${VERSION}
+PKGNAME=               ${GITHUB_PROJECT}-${DISTNAME:S,^v,,}
+VERSION=               0.5.1
+GITHUB_PROJECT=                libcpuid
+GITHUB_TAG=            ${DISTNAME}
+CATEGORIES=            sysutils
+MASTER_SITES=          ${MASTER_SITE_GITHUB:=anrieff/}
+DIST_SUBDIR=           ${GITHUB_PROJECT}
+
+MAINTAINER=            pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=              https://github.com/anrieff/libcpuid/
+COMMENT=               Small x86 CPU identification library
+LICENSE=               2-clause-bsd
+
+GNU_CONFIGURE=         yes
+USE_LIBTOOL=           yes
+USE_LANGUAGES=         c
+USE_TOOLS=             autoconf automake
+
+pre-configure:
+       cd ${WRKSRC} && autoreconf --install
+
+# only for a couple of archs, specify here.
+
+.include "../../mk/bsd.pkg.mk"
diff -r 37f506711c08 -r fe82bbc442b8 sysutils/libcpuid/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/libcpuid/PLIST   Tue Apr 12 22:22:26 2022 +0000
@@ -0,0 +1,7 @@
+@comment $NetBSD: PLIST,v 1.1 2022/04/12 22:22:26 nikita Exp $
+bin/cpuid_tool
+include/libcpuid/libcpuid.h
+include/libcpuid/libcpuid_constants.h
+include/libcpuid/libcpuid_types.h
+lib/libcpuid.la
+lib/pkgconfig/libcpuid.pc
diff -r 37f506711c08 -r fe82bbc442b8 sysutils/libcpuid/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/libcpuid/distinfo        Tue Apr 12 22:22:26 2022 +0000
@@ -0,0 +1,7 @@
+$NetBSD: distinfo,v 1.1 2022/04/12 22:22:26 nikita Exp $
+
+BLAKE2s (libcpuid/v0.5.1.tar.gz) = 66c0d89cdf0350649581ff01aabaa032eafdf74f5f24d998ad4e735f81bea8cd
+SHA512 (libcpuid/v0.5.1.tar.gz) = d725bc82e5aa2db69cea7b3590afbe11d6028cf4802fde8d498b4f1cc6d823e73d71b89a453d81bf996d97b36a71f6c00d0f6e8292b72f2be8a64b5d59c01861
+Size (libcpuid/v0.5.1.tar.gz) = 166522 bytes
+SHA1 (patch-configure.ac) = 130cf88478f611b2b96f17a7040d5733eb492a5d
+SHA1 (patch-libcpuid_libcpuid_util.c) = 2b041a0829ff23acf8f6adf741d9427879cab363
diff -r 37f506711c08 -r fe82bbc442b8 sysutils/libcpuid/patches/patch-configure.ac
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/libcpuid/patches/patch-configure.ac      Tue Apr 12 22:22:26 2022 +0000
@@ -0,0 +1,34 @@
+$NetBSD: patch-configure.ac,v 1.1 2022/04/12 22:22:26 nikita Exp $
+
+Upstream commit 1acaf9980b55ae180cc08db218b9face28202519
+from Alyssa Ross.
+
+Use popcount64 from libc when available
+
+Without this, we get a compiler error on NetBSD because the one in
+libc has a slightly different prototype.
+
+libcpuid_util.c:78:12: error: conflicting types for 'popcount64'
+   78 | static int popcount64(uint64_t mask)
+      |            ^~~~~~~~~~
+In file included from /nix/store/155rj8nqh3xd80vpa8hl35p3hk7pacys-include-netbsd-8.0/include/string.h:98,
+                 from libcpuid_util.c:30:
+/nix/store/155rj8nqh3xd80vpa8hl35p3hk7pacys-include-netbsd-8.0/include/strings.h:61:14: note: previous declaration of 'popcount64' was here
+   61 | unsigned int popcount64(__uint64_t) __constfunc;
+      |              ^~~~~~~~~~
+
+* Return unsigned int from popcount64
+
+Matches NetBSD libc, where popcount64 originates.
+
+--- configure.ac.orig
++++ configure.ac
+@@ -43,6 +43,8 @@ LT_INIT
+ AM_CPPFLAGS="$CPPFLAGS"
+ 
+ AC_CHECK_HEADERS([stdint.h])
++AC_CHECK_FUNCS([popcount64])
++
+ AC_CHECK_PROGS([DOXYGEN], [doxygen])
+ AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
+ 
diff -r 37f506711c08 -r fe82bbc442b8 sysutils/libcpuid/patches/patch-libcpuid_libcpuid_util.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/libcpuid/patches/patch-libcpuid_libcpuid_util.c  Tue Apr 12 22:22:26 2022 +0000
@@ -0,0 +1,56 @@
+$NetBSD: patch-libcpuid_libcpuid_util.c,v 1.1 2022/04/12 22:22:26 nikita Exp $
+
+Upstream commit 1acaf9980b55ae180cc08db218b9face28202519
+from Alyssa Ross.
+
+Use popcount64 from libc when available
+
+Without this, we get a compiler error on NetBSD because the one in
+libc has a slightly different prototype.
+
+libcpuid_util.c:78:12: error: conflicting types for 'popcount64'
+   78 | static int popcount64(uint64_t mask)
+      |            ^~~~~~~~~~
+In file included from /nix/store/155rj8nqh3xd80vpa8hl35p3hk7pacys-include-netbsd-8.0/include/string.h:98,
+                 from libcpuid_util.c:30:
+/nix/store/155rj8nqh3xd80vpa8hl35p3hk7pacys-include-netbsd-8.0/include/strings.h:61:14: note: previous declaration of 'popcount64' was here
+   61 | unsigned int popcount64(__uint64_t) __constfunc;
+      |              ^~~~~~~~~~
+
+* Return unsigned int from popcount64
+
+Matches NetBSD libc, where popcount64 originates.
+
+--- libcpuid/libcpuid_util.c.orig
++++ libcpuid/libcpuid_util.c
+@@ -29,6 +29,9 @@
+ #include <stdarg.h>
+ #include <string.h>
+ #include <ctype.h>
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
+ #include "libcpuid.h"
+ #include "libcpuid_util.h"
+ 
+@@ -74,9 +77,10 @@ void debugf(int verboselevel, const char* format, ...)
+       _warn_fun(buff);
+ }
+ 
+-static int popcount64(uint64_t mask)
++#ifndef HAVE_POPCOUNT64
++static unsigned int popcount64(uint64_t mask)
+ {
+-      int num_set_bits = 0;
++      unsigned int num_set_bits = 0;
+ 
+       while (mask) {
+               mask &= mask - 1;
+@@ -85,6 +89,7 @@ static int popcount64(uint64_t mask)
+ 
+       return num_set_bits;
+ }
++#endif
+ 
+ static int score(const struct match_entry_t* entry, const struct cpu_id_t* data,
+                  int brand_code, uint64_t bits, int model_code)



Home | Main Index | Thread Index | Old Index