1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-06 06:30:19 +00:00

- Update to 0.52

PR:             ports/150261
Submitted by:   Jase Thew <freebsd@beardz.net>
Approved by:    Terry Sposato <terry@sucked-in.com> (maintainer)
This commit is contained in:
Philip M. Gollucci 2010-09-10 03:49:34 +00:00
parent f490e4ce2b
commit 85642065db
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=260910
3 changed files with 40 additions and 61 deletions

View File

@ -6,7 +6,7 @@
#
PORTNAME= Sys-CPU
PORTVERSION= 0.40
PORTVERSION= 0.52
CATEGORIES= devel perl5
MASTER_SITES= CPAN
PKGNAMEPREFIX= p5-

View File

@ -1,3 +1,3 @@
MD5 (Sys-CPU-0.40.tar.gz) = c2731716e5c1eaa4e88860ccc09791e2
SHA256 (Sys-CPU-0.40.tar.gz) = 48efce686727f6529a555c3a6f7c57f91285e364675370007bb462174e773558
SIZE (Sys-CPU-0.40.tar.gz) = 4696
MD5 (Sys-CPU-0.52.tar.gz) = 34305423e86cfca9a631b6f91217f90f
SHA256 (Sys-CPU-0.52.tar.gz) = ca0ec47ab24070e3040e5075337cfc69721362d9bef50f6992072efe644d4d26
SIZE (Sys-CPU-0.52.tar.gz) = 5932

View File

@ -1,57 +1,36 @@
--- CPU.xs.orig 2008-07-25 09:06:35.000000000 +0200
+++ CPU.xs 2008-07-25 09:24:13.000000000 +0200
@@ -35,6 +35,9 @@
#define _have_cpu_clock
#define _have_cpu_type
#endif
+#ifdef __FreeBSD__
+ #include <sys/sysctl.h>
+#endif
#ifdef WINDOWS
/* Registry Functions */
@@ -237,6 +240,10 @@
{
int clock = 0;
int retcode = 0;
+#ifdef __FreeBSD__
+ size_t len = sizeof(clock);
+ sysctlbyname("hw.clockrate", &clock, &len, NULL, 0);
+#else
#ifdef __linux__
int value = proc_cpuinfo_clock();
if (value) clock = value;
@@ -263,12 +270,13 @@
}
}
#endif
+#endif
if (clock) {
ST(0) = sv_newmortal();
sv_setiv (ST(0), clock);
} else {
ST(0) = &PL_sv_undef;
- }
+ }
}
SV *
@@ -277,6 +285,10 @@
{
char *value = malloc(MAX_IDENT_SIZE);
int retcode = 0;
+#ifdef __FreeBSD__
+ size_t len = MAX_IDENT_SIZE;
+ sysctlbyname("hw.model", value, &len, NULL, 0);
+#else
#ifdef __linux__
value = proc_cpuinfo_field ("model name");
if (!value) value = proc_cpuinfo_field ("machine");
@@ -296,6 +308,7 @@
value = infop->pi_processor_type;
}
#endif
+#endif
if (value) {
ST(0) = sv_newmortal();
sv_setpv (ST(0), value);
--- CPU.xs.orig 2010-09-03 23:30:18.000000000 +0100
+++ CPU.xs 2010-09-03 23:57:31.000000000 +0100
@@ -40,6 +40,11 @@
#define _have_cpu_clock
#define _have_cpu_type
#endif
+#ifdef __FreeBSD__
+ #include <sys/sysctl.h>
+ #define _have_cpu_type
+ #define _have_cpu_clock
+#endif
#ifdef WINDOWS
/* Registry Functions */
@@ -317,6 +322,10 @@
int value = proc_cpuinfo_clock();
if (value) clock = value;
#endif
+#ifdef __FreeBSD__
+ size_t len = sizeof(clock);
+ sysctlbyname("hw.clockrate", &clock, &len, NULL, 0);
+#endif
#ifdef WINDOWS
char *clock_str = malloc(MAX_IDENT_SIZE);
/*!! untested !!*/
@@ -356,6 +365,10 @@
{
char *value = malloc(MAX_IDENT_SIZE);
int retcode = 0;
+#ifdef __FreeBSD__
+ size_t len = MAX_IDENT_SIZE;
+ sysctlbyname("hw.model", value, &len, NULL, 0);
+#endif
#ifdef __linux__
value = proc_cpuinfo_field ("model name");
if (!value) value = proc_cpuinfo_field ("machine");