diff options
author | Hajimu UMEMOTO <ume@FreeBSD.org> | 2013-08-15 16:14:02 +0000 |
---|---|---|
committer | Hajimu UMEMOTO <ume@FreeBSD.org> | 2013-08-15 16:14:02 +0000 |
commit | b8933524779e49e80683229295f4228b787adfb9 (patch) | |
tree | a7a79956354fa213a913a8fa5668c67704ffaf43 /sysutils/gkfreq | |
parent | - Update to 0.60 (diff) |
Update to 2.2.
Spotted by: portscout
Notes
Notes:
svn path=/head/; revision=324775
Diffstat (limited to 'sysutils/gkfreq')
-rw-r--r-- | sysutils/gkfreq/Makefile | 22 | ||||
-rw-r--r-- | sysutils/gkfreq/distinfo | 4 | ||||
-rw-r--r-- | sysutils/gkfreq/files/patch-Makefile | 52 | ||||
-rw-r--r-- | sysutils/gkfreq/files/patch-gkfreq.c | 70 | ||||
-rw-r--r-- | sysutils/gkfreq/files/patch-gkrellm-gkfreq.c | 66 | ||||
-rw-r--r-- | sysutils/gkfreq/pkg-descr | 6 |
6 files changed, 112 insertions, 108 deletions
diff --git a/sysutils/gkfreq/Makefile b/sysutils/gkfreq/Makefile index bbc7df75d949..330e430cbb9e 100644 --- a/sysutils/gkfreq/Makefile +++ b/sysutils/gkfreq/Makefile @@ -1,24 +1,20 @@ -# New ports collection makefile for: gkfreq -# Date Created: Jun 18 2005 -# Whom: Hajimu UMEMOTO <ume@FreeBSD.org> -# # $FreeBSD$ -# -PORTNAME= gkfreq -PORTVERSION= 1.0 -PORTREVISION= 7 +PORTNAME= gkrellm-gkfreq +PORTVERSION= 2.2 +#PORTREVISION= 0 CATEGORIES= sysutils -DISTNAME= gkrellm-gkfreq-${PORTVERSION} MASTER_SITES= SF -MASTER_SITE_SUBDIR=gkrellm-gkfreq/${PORTVERSION} +MASTER_SITE_SUBDIR=${PORTNAME}/${PORTVERSION} MAINTAINER= ume@FreeBSD.org -COMMENT= A plugin for gkrellm2 which displays the current CPU speed +COMMENT= A plugin to GKrellM that displays the current CPU frequencies -BUILD_DEPENDS= ${LOCALBASE}/include/gkrellm2/gkrellm.h:${PORTSDIR}/sysutils/gkrellm2 +BUILD_DEPENDS= ${LOCALBASE}/libdata/pkgconfig/gkrellm.pc:${PORTSDIR}/sysutils/gkrellm2 RUN_DEPENDS= gkrellm:${PORTSDIR}/sysutils/gkrellm2 -PLIST_FILES= libexec/gkrellm2/plugins/gkfreq.so +USES= pkgconfig + +PLIST_FILES= libexec/gkrellm2/plugins/gkrellm-gkfreq.so .include <bsd.port.mk> diff --git a/sysutils/gkfreq/distinfo b/sysutils/gkfreq/distinfo index c054341400ce..4c9bbc9fcb2b 100644 --- a/sysutils/gkfreq/distinfo +++ b/sysutils/gkfreq/distinfo @@ -1,2 +1,2 @@ -SHA256 (gkrellm-gkfreq-1.0.tar.gz) = a0ec044e4d7b08eb129ea2d8b5f1e0a29cd4f0c83cf28899c7d4076d8b9ce4ca -SIZE (gkrellm-gkfreq-1.0.tar.gz) = 8893 +SHA256 (gkrellm-gkfreq-2.2.tar.gz) = 0d4cfdb5ef36a412f437041c8ab0b024abfa7448069b4b6d250ec3be956049ca +SIZE (gkrellm-gkfreq-2.2.tar.gz) = 12784 diff --git a/sysutils/gkfreq/files/patch-Makefile b/sysutils/gkfreq/files/patch-Makefile index 3f55669f91c1..99cde105910a 100644 --- a/sysutils/gkfreq/files/patch-Makefile +++ b/sysutils/gkfreq/files/patch-Makefile @@ -1,30 +1,42 @@ Index: Makefile diff -u Makefile.orig Makefile ---- Makefile.orig Thu Aug 11 05:58:26 2005 -+++ Makefile Wed Nov 9 02:42:46 2005 -@@ -1,13 +1,20 @@ --all: gkfreq.so -+PREFIX?= /usr/X11R6 +--- Makefile.orig 2013-02-28 06:52:26.000000000 +0900 ++++ Makefile 2013-08-16 01:03:07.493888354 +0900 +@@ -1,30 +1,25 @@ +-all: gkrellm-gkfreq.so ++PREFIX?= /usr/local +PLUGIN_DIR?= ${PREFIX}/libexec/gkrellm2/plugins + -+GKRELLM_INCLUDE=-I${PREFIX}/include -+ -+GTK_CONFIG= pkg-config gtk+-2.0 -+GTK_CFLAGS= `${GTK_CONFIG} --cflags` ++CFLAGS+= -fPIC -Wall `pkg-config gtk+-2.0 gkrellm --cflags` --gkfreq.o: gkfreq.c -- gcc -fPIC -O2 -Wall `pkg-config gtk+-2.0 --cflags` -c gkfreq.c -+CFLAGS+= -Wall -fPIC ${GTK_CFLAGS} ${GKRELLM_INCLUDE} -+ -+all: gkfreq.so +-gkrellm-gkfreq.o: gkrellm-gkfreq.c +- gcc -fPIC -O2 -Wall `pkg-config gtk+-2.0 --cflags` -c gkrellm-gkfreq.c ++all: gkrellm-gkfreq.so + + gkrellm-gkfreq.so: gkrellm-gkfreq.o +- gcc -shared -Wall -o gkrellm-gkfreq.so gkrellm-gkfreq.o ++ ${CC} -shared -Wall -o gkrellm-gkfreq.so gkrellm-gkfreq.o + @echo " " + @echo " Compilation done!" + @echo " " + @echo " If you want to try the plugin before installing you can run" + @echo " gkrellm -p gkrellm-gkfreq.so" + @echo " " +- @echo " Install in either /usr/lib/gkrellm2/plugins/ by running" +- @echo " sudo make install" +- @echo " or in /usr/local/lib/gkrellm2/plugins/ by running" +- @echo " sudo make install-local" +- @echo " or in ~/.gkrellm2/plugins by running" +- @echo " make install-home" +- @echo " " - gkfreq.so: gkfreq.o -- gcc -shared -Wall -o gkfreq.so gkfreq.o -+ ${CC} -shared -Wall -o gkfreq.so gkfreq.o clean: - rm -rf *.o *.so + rm -rf *.o *.so *~ install: -- cp gkfreq.so ~/.gkrellm2/plugins/ -+ ${INSTALL} -s gkfreq.so ${PLUGIN_DIR} +- cp gkrellm-gkfreq.so /usr/lib/gkrellm2/plugins/ ++ ${INSTALL} -s gkrellm-gkfreq.so ${PLUGIN_DIR} + + install-local: + cp gkrellm-gkfreq.so /usr/local/lib/gkrellm2/plugins/ diff --git a/sysutils/gkfreq/files/patch-gkfreq.c b/sysutils/gkfreq/files/patch-gkfreq.c deleted file mode 100644 index 8a04acaa5fc0..000000000000 --- a/sysutils/gkfreq/files/patch-gkfreq.c +++ /dev/null @@ -1,70 +0,0 @@ -Index: gkfreq.c -diff -u -p gkfreq.c.orig gkfreq.c ---- gkfreq.c.orig Fri Aug 12 01:53:22 2005 -+++ gkfreq.c Wed Nov 9 02:28:35 2005 -@@ -10,6 +10,9 @@ - #include <sys/time.h> - #include <string.h> - #include <unistd.h> -+#ifdef __FreeBSD__ -+#include <sys/sysctl.h> -+#endif - - #define CONFIG_NAME "gkfreq" - #define STYLE_NAME "gkfreq" -@@ -18,18 +21,34 @@ static GkrellmMonitor *monitor; - static GkrellmPanel *panel; - static GkrellmDecal *decal_text1; - static gint style_id; -+#ifdef __FreeBSD__ -+static int oid_freq[CTL_MAXNAME + 2]; -+static size_t oid_freq_len = 0; -+#endif - - -+#if 0 - __inline__ unsigned long long int rdtsc() - { - unsigned long long int x; - __asm__ volatile (".byte 0x0f, 0x31" : "=A" (x)); - return x; - } -+#endif - - static - void read_MHz(char* buffer_, size_t bufsz_) - { -+#ifdef __FreeBSD__ -+ int freq; -+ size_t len = sizeof(freq); -+ -+ if (oid_freq_len <= 0 || -+ sysctl(oid_freq, oid_freq_len, &freq, &len, 0, 0) < 0) -+ snprintf(buffer_, bufsz_, "n/a MHz"); -+ else -+ snprintf(buffer_, bufsz_, "%d MHz", freq); -+#else - FILE *f; - if ( (f = fopen("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", "r")) == NULL) { - -@@ -41,6 +60,7 @@ void read_MHz(char* buffer_, size_t bufs - snprintf(buffer_, bufsz_, "%d MHz", i/1000 ); - fclose(f); - } -+#endif - } - - static gint -@@ -103,6 +123,12 @@ create_plugin(GtkWidget *vbox, gint firs - if (first_create) - g_signal_connect(G_OBJECT (panel->drawing_area), "expose_event", - G_CALLBACK (panel_expose_event), NULL); -+ -+#ifdef __FreeBSD__ -+ oid_freq_len = sizeof(oid_freq); -+ if (sysctlnametomib("dev.cpu.0.freq", oid_freq, &oid_freq_len) < 0) -+ oid_freq_len = 0; -+#endif - } - - diff --git a/sysutils/gkfreq/files/patch-gkrellm-gkfreq.c b/sysutils/gkfreq/files/patch-gkrellm-gkfreq.c new file mode 100644 index 000000000000..9ea8599ed02b --- /dev/null +++ b/sysutils/gkfreq/files/patch-gkrellm-gkfreq.c @@ -0,0 +1,66 @@ +Index: gkrellm-gkfreq.c +diff -u -p gkrellm-gkfreq.c.orig gkrellm-gkfreq.c +--- gkrellm-gkfreq.c.orig 2013-08-14 01:42:27.666135000 +0900 ++++ gkrellm-gkfreq.c 2013-08-15 16:15:30.727531073 +0900 +@@ -36,6 +36,9 @@ + #include <sys/time.h> + #include <string.h> + #include <unistd.h> ++#ifdef __FreeBSD__ ++#include <sys/sysctl.h> ++#endif + + + // Version of the plugin +@@ -87,6 +90,10 @@ struct GKFreqStruct{ + GkrellmDecal *label_cpu; + gint freq; + GkrellmDecal *label_freq; ++#ifdef __FreeBSD__ ++ int oid_freq[CTL_MAXNAME + 2]; ++ size_t oid_freq_len; ++#endif + }; + + static GkrellmMonitor *monitor; +@@ -102,6 +109,14 @@ static gint num_cpu; // number of C + // Get the CPU frequency (in MHz) for CPU number i + static gint get_cpu_freq(gint i) + { ++#ifdef __FreeBSD__ ++ int freq; ++ size_t len = sizeof(freq); ++ ++ if (sysctl(cpu[i].oid_freq, cpu[i].oid_freq_len, &freq, &len, 0, 0) < 0) ++ return -1; ++ return freq; ++#else + FILE *f; + gchar filename[100]; + sprintf(filename, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_cur_freq",i); +@@ -113,6 +128,7 @@ static gint get_cpu_freq(gint i) + fclose(f); + return freq/1000; + } ++#endif + } + + // Callback function to be run when a panel is exposed for the first time. +@@ -220,7 +236,16 @@ static void create_plugin(GtkWidget *vbo + // Count the number of CPUs + if (first_create) { + for (num_cpu=0; num_cpu<MAX_NUM_CPU; num_cpu++){ +- if (get_cpu_freq(num_cpu) < 0) { ++#ifdef __FreeBSD__ ++ gchar mib[16]; ++ snprintf(mib, sizeof(mib), "dev.cpu.%d.freq", num_cpu); ++ cpu[num_cpu].oid_freq_len = sizeof(cpu[num_cpu].oid_freq); ++ if (sysctlnametomib(mib, cpu[num_cpu].oid_freq, ++ &cpu[num_cpu].oid_freq_len) < 0) ++#else ++ if (get_cpu_freq(num_cpu) < 0) ++#endif ++ { + break; + } + } diff --git a/sysutils/gkfreq/pkg-descr b/sysutils/gkfreq/pkg-descr index d77ff78234cc..19f8f860883f 100644 --- a/sysutils/gkfreq/pkg-descr +++ b/sysutils/gkfreq/pkg-descr @@ -1,4 +1,4 @@ -GKfreq is a plugin for gkrellm2 which displays the current CPU speed -using the "dynamic" cpufrequency scheme. +GKrellM-gkfreq is a plugin to GKrellM that displays the current CPU +frequencies. -WWW: http://www.peakunix.net/gkfreq/ +WWW: http://sourceforge.net/projects/gkrellm-gkfreq/ |