Import of pkgsrc-2015Q1

This commit is contained in:
2016-01-21 23:40:00 +01:00
committed by sambuc
parent 9a8c06dafb
commit 4af1cdf7a9
25114 changed files with 870539 additions and 795424 deletions
+4
View File
@@ -0,0 +1,4 @@
In responce to a post on perlmonks.org, a module for counting the number of
CPU's on a system. Support has now also been added for type of CPU and clock
speed. While much of the code is from UNIX::Processors, win32 support has been
added (but not tested).
+17
View File
@@ -0,0 +1,17 @@
# $NetBSD: Makefile,v 1.1 2014/08/13 20:20:23 wiz Exp $
DISTNAME= Sys-CPU-0.61
PKGNAME= p5-${DISTNAME}
CATEGORIES= sysutils perl5
MASTER_SITES= ${MASTER_SITE_PERL_CPAN:=../../authors/id/M/MZ/MZSANFORD/}
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://search.cpan.org/~mzsanford/Sys-CPU/
COMMENT= Perl 5 module for getting CPU information
LICENSE= ${PERL5_LICENSE}
USE_LANGUAGES= c
PERL5_PACKLIST= auto/Sys/CPU/.packlist
.include "../../lang/perl5/module.mk"
.include "../../mk/bsd.pkg.mk"
+6
View File
@@ -0,0 +1,6 @@
$NetBSD: distinfo,v 1.1 2014/08/13 20:20:23 wiz Exp $
SHA1 (Sys-CPU-0.61.tar.gz) = 3bca409742fd47a06768b9ba9d8f14d73171c8c1
RMD160 (Sys-CPU-0.61.tar.gz) = 147d6f4d87d76fd15c35cbd6ebc902f416f0bec6
Size (Sys-CPU-0.61.tar.gz) = 6497 bytes
SHA1 (patch-CPU.xs) = b1f1a59ff6eb02b7d9691423b2084fccd21f74cf
+46
View File
@@ -0,0 +1,46 @@
$NetBSD: patch-CPU.xs,v 1.1 2014/08/13 20:20:23 wiz Exp $
Add NetBSD support.
https://rt.cpan.org/Public/Bug/Display.html?id=98004
--- CPU.xs.orig 2013-11-27 22:40:07.000000000 +0000
+++ CPU.xs
@@ -40,7 +40,7 @@
#define _have_cpu_clock
#define _have_cpu_type
#endif
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__NetBSD__)
#include <sys/sysctl.h>
#define _have_cpu_type
#define _have_cpu_clock
@@ -345,6 +345,17 @@ CODE:
size_t len = sizeof(clock);
sysctlbyname("hw.clockrate", &clock, &len, NULL, 0);
#endif
+#ifdef __NetBSD__
+ size_t len = sizeof(clock);
+ char const *name;
+
+ if (sysctlbyname("machdep.powernow.frequency.current", NULL, &len, NULL, 0) == 0)
+ name = "machdep.powernow.frequency.current";
+ else if (sysctlbyname("machdep.est.frequency.current", NULL, &len, NULL, 0) == 0)
+ name = "machdep.est.frequency.current";
+
+ sysctlbyname(name, &clock, &len, NULL, 0);
+#endif
#ifdef WINDOWS
char *clock_str = malloc(MAX_IDENT_SIZE);
/*!! untested !!*/
@@ -394,6 +405,11 @@ CODE:
size_t len = MAX_IDENT_SIZE;
sysctlbyname("hw.model", value, &len, NULL, 0);
#endif
+#ifdef __NetBSD__
+ value = malloc(MAX_IDENT_SIZE);
+ size_t len = MAX_IDENT_SIZE;
+ sysctlbyname("hw.model", value, &len, NULL, 0);
+#endif
#ifdef __linux__
#if defined __s390__ || defined __s390x__
value = processor_machine_field (proc_cpuinfo_field ("processor") );