diff options
-rw-r--r-- | devel/p5-Sys-Cpu/Makefile | 2 | ||||
-rw-r--r-- | devel/p5-Sys-Cpu/distinfo | 6 | ||||
-rw-r--r-- | devel/p5-Sys-Cpu/files/patch-CPU.xs | 93 |
3 files changed, 40 insertions, 61 deletions
diff --git a/devel/p5-Sys-Cpu/Makefile b/devel/p5-Sys-Cpu/Makefile index 091499fb32a9..0ad6047d90b2 100644 --- a/devel/p5-Sys-Cpu/Makefile +++ b/devel/p5-Sys-Cpu/Makefile @@ -6,7 +6,7 @@ # PORTNAME= Sys-CPU -PORTVERSION= 0.40 +PORTVERSION= 0.52 CATEGORIES= devel perl5 MASTER_SITES= CPAN PKGNAMEPREFIX= p5- diff --git a/devel/p5-Sys-Cpu/distinfo b/devel/p5-Sys-Cpu/distinfo index 98a0e736a330..0e16f64ab049 100644 --- a/devel/p5-Sys-Cpu/distinfo +++ b/devel/p5-Sys-Cpu/distinfo @@ -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 diff --git a/devel/p5-Sys-Cpu/files/patch-CPU.xs b/devel/p5-Sys-Cpu/files/patch-CPU.xs index eed00a62f42c..7ab890417686 100644 --- a/devel/p5-Sys-Cpu/files/patch-CPU.xs +++ b/devel/p5-Sys-Cpu/files/patch-CPU.xs @@ -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");
|