Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Aug 2013 16:14:03 +0000 (UTC)
From:      Hajimu UMEMOTO <ume@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r324775 - in head/sysutils/gkfreq: . files
Message-ID:  <201308151614.r7FGE3kK002227@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ume
Date: Thu Aug 15 16:14:02 2013
New Revision: 324775
URL: http://svnweb.freebsd.org/changeset/ports/324775

Log:
  Update to 2.2.
  
  Spotted by:	portscout

Added:
  head/sysutils/gkfreq/files/patch-gkrellm-gkfreq.c   (contents, props changed)
Deleted:
  head/sysutils/gkfreq/files/patch-gkfreq.c
Modified:
  head/sysutils/gkfreq/Makefile
  head/sysutils/gkfreq/distinfo
  head/sysutils/gkfreq/files/patch-Makefile
  head/sysutils/gkfreq/pkg-descr

Modified: head/sysutils/gkfreq/Makefile
==============================================================================
--- head/sysutils/gkfreq/Makefile	Thu Aug 15 16:00:39 2013	(r324774)
+++ head/sysutils/gkfreq/Makefile	Thu Aug 15 16:14:02 2013	(r324775)
@@ -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>

Modified: head/sysutils/gkfreq/distinfo
==============================================================================
--- head/sysutils/gkfreq/distinfo	Thu Aug 15 16:00:39 2013	(r324774)
+++ head/sysutils/gkfreq/distinfo	Thu Aug 15 16:14:02 2013	(r324775)
@@ -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

Modified: head/sysutils/gkfreq/files/patch-Makefile
==============================================================================
--- head/sysutils/gkfreq/files/patch-Makefile	Thu Aug 15 16:00:39 2013	(r324774)
+++ head/sysutils/gkfreq/files/patch-Makefile	Thu Aug 15 16:14:02 2013	(r324775)
@@ -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/

Added: head/sysutils/gkfreq/files/patch-gkrellm-gkfreq.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/gkfreq/files/patch-gkrellm-gkfreq.c	Thu Aug 15 16:14:02 2013	(r324775)
@@ -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;
+       }
+     }

Modified: head/sysutils/gkfreq/pkg-descr
==============================================================================
--- head/sysutils/gkfreq/pkg-descr	Thu Aug 15 16:00:39 2013	(r324774)
+++ head/sysutils/gkfreq/pkg-descr	Thu Aug 15 16:14:02 2013	(r324775)
@@ -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/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308151614.r7FGE3kK002227>