pkgsrc-Changes archive

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

CVS commit: pkgsrc/sysutils/lscpu



Module Name:    pkgsrc
Committed By:   vins
Date:           Tue Jul 11 19:32:01 UTC 2023

Modified Files:
        pkgsrc/sysutils/lscpu: DESCR Makefile distinfo
        pkgsrc/sysutils/lscpu/patches: patch-lscpu.c

Log Message:
sysutils/lscpu: fix CPU model detection on NetBSD.

# CHANGES

* Improve CPU model detection on NetBSD, by relying on machdep.cpu_brand
  sysctl identifier.
* Mark package as x86/amd64 -only as it leverages on CPUID
  instruction.
* Clarify description.
* Bump revision.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 pkgsrc/sysutils/lscpu/DESCR \
    pkgsrc/sysutils/lscpu/distinfo
cvs rdiff -u -r1.2 -r1.3 pkgsrc/sysutils/lscpu/Makefile
cvs rdiff -u -r1.1 -r1.2 pkgsrc/sysutils/lscpu/patches/patch-lscpu.c

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

Modified files:

Index: pkgsrc/sysutils/lscpu/DESCR
diff -u pkgsrc/sysutils/lscpu/DESCR:1.1 pkgsrc/sysutils/lscpu/DESCR:1.2
--- pkgsrc/sysutils/lscpu/DESCR:1.1     Sat Jul  8 21:29:33 2023
+++ pkgsrc/sysutils/lscpu/DESCR Tue Jul 11 19:32:00 2023
@@ -1,4 +1,5 @@
-lscpu for OpenBSD, FreeBSD, NetBSD, Mac OS X & DragonFly.
-The main usage of this program should be for x86 architecture since it
+lscpu equivalent for systems based on BSD UNIX.
+This utility gathers CPU architecture information on *BSD and macOS. 
+The main usage of lscpu should be for x86 architecture since it
 leverages CPUID instructions. For other architectures, it just shows
 very limited facts.
Index: pkgsrc/sysutils/lscpu/distinfo
diff -u pkgsrc/sysutils/lscpu/distinfo:1.1 pkgsrc/sysutils/lscpu/distinfo:1.2
--- pkgsrc/sysutils/lscpu/distinfo:1.1  Sat Jul  8 21:29:33 2023
+++ pkgsrc/sysutils/lscpu/distinfo      Tue Jul 11 19:32:00 2023
@@ -1,6 +1,6 @@
-$NetBSD: distinfo,v 1.1 2023/07/08 21:29:33 vins Exp $
+$NetBSD: distinfo,v 1.2 2023/07/11 19:32:00 vins Exp $
 
 BLAKE2s (lscpu-1.2.0.tar.gz) = a4133355535f08c6f7ccda2b4451d4ae3699654cfd1ae723410ba0b8c7339c51
 SHA512 (lscpu-1.2.0.tar.gz) = 4d884c792aa2c91d3b4f860c9054c5f11644c7a91dc6bb2ffe51601348063cedfa946fb49671589d379ed04dfd96fec58a71825df0d0c3eb5a5590f21abeb155
 Size (lscpu-1.2.0.tar.gz) = 7863 bytes
-SHA1 (patch-lscpu.c) = ee8e55e865330f249f8e66a79b1e66f45b5dc0f5
+SHA1 (patch-lscpu.c) = 7d394dbe546b59e81f2185154be8322d65a6086e

Index: pkgsrc/sysutils/lscpu/Makefile
diff -u pkgsrc/sysutils/lscpu/Makefile:1.2 pkgsrc/sysutils/lscpu/Makefile:1.3
--- pkgsrc/sysutils/lscpu/Makefile:1.2  Sat Jul  8 21:39:27 2023
+++ pkgsrc/sysutils/lscpu/Makefile      Tue Jul 11 19:32:00 2023
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.2 2023/07/08 21:39:27 vins Exp $
+# $NetBSD: Makefile,v 1.3 2023/07/11 19:32:00 vins Exp $
 
 DISTNAME=      lscpu-1.2.0
+PKGREVISION=   1
 CATEGORIES=    sysutils
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=NanXiao/}
 
@@ -9,8 +10,10 @@ HOMEPAGE=     https://github.com/NanXiao/lsc
 COMMENT=       The lscpu for BSD
 LICENSE=       modified-bsd
 
-ONLY_FOR_PLATFORM+=    FreeBSD-*-* OpenBSD-*-* NetBSD-*-*
-ONLY_FOR_PLATFORM+=    DragonFly-*-* Darwin-*-*
+.for bsd in FreeBSD OpenBSD NetBSD DragonFly Darwin
+ONLY_FOR_PLATFORM+=    ${bsd}-*-i386
+ONLY_FOR_PLATFORM+=    ${bsd}-*-x86_64
+.endfor
 
 INSTALLATION_DIRS+=    bin ${PKGMANDIR}/man1
 

Index: pkgsrc/sysutils/lscpu/patches/patch-lscpu.c
diff -u pkgsrc/sysutils/lscpu/patches/patch-lscpu.c:1.1 pkgsrc/sysutils/lscpu/patches/patch-lscpu.c:1.2
--- pkgsrc/sysutils/lscpu/patches/patch-lscpu.c:1.1     Sat Jul  8 21:29:33 2023
+++ pkgsrc/sysutils/lscpu/patches/patch-lscpu.c Tue Jul 11 19:32:00 2023
@@ -1,6 +1,7 @@
-$NetBSD: patch-lscpu.c,v 1.1 2023/07/08 21:29:33 vins Exp $
+$NetBSD: patch-lscpu.c,v 1.2 2023/07/11 19:32:00 vins Exp $
 
-Fix architecture detection on FreeBSD.
+* Fix architecture detection on FreeBSD.
+* Fix CPU model detection on NetBSD.
 
 --- lscpu.c.orig       2018-05-05 02:25:31.000000000 +0000
 +++ lscpu.c
@@ -16,3 +17,18 @@ Fix architecture detection on FreeBSD.
          {HW_BYTEORDER, &(gen_info.byte_order), sizeof(gen_info.byte_order), "HW_BYTEORDER"},
          {HW_MODEL, gen_info.model, sizeof(gen_info.model), "HW_MODEL"},
          {HW_NCPU, &(gen_info.active_cpu_num), sizeof(gen_info.active_cpu_num), "HW_NCPU"},
+@@ -972,6 +976,14 @@ int main(int argc, char **argv) 
+         }
+     }
+ 
++#if defined(__NetBSD__) && (defined(__amd64__) || defined(__i386__))
++{
++       size_t sz = sizeof (gen_info.model);
++       if (sysctlbyname("machdep.cpu_brand", gen_info.model, &sz, NULL, 0) == -1)
++               err(1, "MACHDEP.CPU_BRAND");
++}
++#endif
++
+ #if defined(__amd64__) || defined(__i386__)
+     get_x86_cpu_info(&x86_info);
+ #endif



Home | Main Index | Thread Index | Old Index