diff options
author | ume <ume@FreeBSD.org> | 2009-12-22 20:34:58 +0800 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2009-12-22 20:34:58 +0800 |
commit | cd79017ab59a990e792aab1b6ddfb9375fd87274 (patch) | |
tree | c98dc6a011825e8a2530f6bd7f033fc846fecf07 | |
parent | 7d3928382c97840162ce6d8343cdc526ea932e1e (diff) | |
download | freebsd-ports-graphics-cd79017ab59a990e792aab1b6ddfb9375fd87274.tar.gz freebsd-ports-graphics-cd79017ab59a990e792aab1b6ddfb9375fd87274.tar.zst freebsd-ports-graphics-cd79017ab59a990e792aab1b6ddfb9375fd87274.zip |
Update to 2.3.3.
-rw-r--r-- | sysutils/gkrellm2/Makefile | 4 | ||||
-rw-r--r-- | sysutils/gkrellm2/distinfo | 6 | ||||
-rw-r--r-- | sysutils/gkrellm2/files/patch-src::configure | 48 | ||||
-rw-r--r-- | sysutils/gkrellm2/files/patch-src::main.c | 20 | ||||
-rw-r--r-- | sysutils/gkrellm2/files/patch-src::sysdeps::freebsd.c | 731 | ||||
-rw-r--r-- | sysutils/gkrellm2/files/patch-src:Makefile | 32 |
6 files changed, 66 insertions, 775 deletions
diff --git a/sysutils/gkrellm2/Makefile b/sysutils/gkrellm2/Makefile index 1987806aa8b..eb9486a8266 100644 --- a/sysutils/gkrellm2/Makefile +++ b/sysutils/gkrellm2/Makefile @@ -6,8 +6,8 @@ # PORTNAME= gkrellm -PORTVERSION= 2.3.2 -PORTREVISION= 4 +PORTVERSION= 2.3.3 +#PORTREVISION= 0 CATEGORIES= sysutils ipv6 MASTER_SITES= http://members.dslextreme.com/users/billw/gkrellm/ \ ${MASTER_SITE_LOCAL} diff --git a/sysutils/gkrellm2/distinfo b/sysutils/gkrellm2/distinfo index ff97592031d..b12cfff8983 100644 --- a/sysutils/gkrellm2/distinfo +++ b/sysutils/gkrellm2/distinfo @@ -1,3 +1,3 @@ -MD5 (gkrellm-2.3.2.tar.bz2) = d5543a439ee77950282d06b000048be7 -SHA256 (gkrellm-2.3.2.tar.bz2) = a102e681cbcc45f8cb225ca0a321b62772106d6f0bb372eaa026b5a2da840873 -SIZE (gkrellm-2.3.2.tar.bz2) = 747697 +MD5 (gkrellm-2.3.3.tar.bz2) = 74c5252952c08a9866a6d381b7fd7454 +SHA256 (gkrellm-2.3.3.tar.bz2) = 57f7c22ac9a4f87083d59e1731038d7b8c1dcb7d5cc3f8f0533cd1877465a254 +SIZE (gkrellm-2.3.3.tar.bz2) = 756494 diff --git a/sysutils/gkrellm2/files/patch-src::configure b/sysutils/gkrellm2/files/patch-src::configure index 4f631b365f1..338cab96e7a 100644 --- a/sysutils/gkrellm2/files/patch-src::configure +++ b/sysutils/gkrellm2/files/patch-src::configure @@ -1,19 +1,8 @@ Index: src/configure diff -u src/configure.orig src/configure ---- src/configure.orig 2008-10-04 07:44:08.000000000 +0900 -+++ src/configure 2008-10-04 23:01:57.000000000 +0900 -@@ -19,6 +19,10 @@ - then - without_libsensors=yes - fi -+ if [ "$i" = "--without-ntlm" ] -+ then -+ without_ntlm=yes -+ fi - done - - PKG_INCLUDE=`pkg-config gtk+-2.0 --cflags` -@@ -56,8 +60,8 @@ +--- src/configure.orig 2009-12-21 10:47:44.000000000 +0900 ++++ src/configure 2009-12-22 10:45:51.692711734 +0900 +@@ -60,8 +60,8 @@ } EOF @@ -24,7 +13,7 @@ diff -u src/configure.orig src/configure if [ -x ./test ] && ./test then -@@ -102,8 +106,8 @@ +@@ -106,8 +106,8 @@ } EOF @@ -35,35 +24,16 @@ diff -u src/configure.orig src/configure if [ -x ./test ] && ./test then -@@ -121,6 +125,8 @@ - - rm -f test test.exe test.o test.c - -+if [ "$without_ntlm" != "yes" ] -+then - # echo "Checking for libntlm... " 1>& 2 - echo "Checking for libntlm... " 1>& 5 - -@@ -136,7 +142,7 @@ +@@ -145,7 +145,7 @@ } EOF --$CC ${CFLAGS} ${PKG_INCLUDE} -c test.c -o test.o 2>& 5 -+$CC ${PKG_INCLUDE} -c test.c -o test.o 2>& 5 - $CC test.o -o test ${LINK_FLAGS} ${PKG_LIBS} -lntlm 2>& 5 +-$CC ${CFLAGS} ${PKG_INCLUDE} ${PKG_NTLM_INCLUDE} -c test.c -o test.o 2>& 5 ++$CC ${PKG_INCLUDE} ${PKG_NTLM_INCLUDE} -c test.c -o test.o 2>& 5 + $CC test.o -o test ${LINK_FLAGS} ${PKG_LIBS} ${PKG_NTLM_LIBS} -lntlm 2>& 5 if [ -x ./test ] && ./test -@@ -148,7 +154,8 @@ - # echo "Not found, mail check will not have ntlm support..." 1>& 2 - echo "Not found, mail check will not have ntlm support..." 1>& 5 - fi -- -+fi -+# end of ntlm check - - - rm -f test test.exe test.o test.c -@@ -181,7 +188,7 @@ +@@ -191,7 +191,7 @@ } EOF diff --git a/sysutils/gkrellm2/files/patch-src::main.c b/sysutils/gkrellm2/files/patch-src::main.c deleted file mode 100644 index 60aa08e8fbf..00000000000 --- a/sysutils/gkrellm2/files/patch-src::main.c +++ /dev/null @@ -1,20 +0,0 @@ ---- src/main.c.orig 2008-10-11 13:03:40.000000000 -0600 -+++ src/main.c 2008-10-11 13:04:17.000000000 -0600 -@@ -2050,6 +2050,8 @@ - gint i; - gchar *s; - -+ gkrellm_sys_main_init(); //FIXME: call this later or earlier? -+ - #ifdef ENABLE_NLS - gtk_set_locale(); - #endif -@@ -2189,8 +2191,6 @@ - g_debug("--- GKrellM %d.%d.%d ---\n", GKRELLM_VERSION_MAJOR, - GKRELLM_VERSION_MINOR, GKRELLM_VERSION_REV); - -- gkrellm_sys_main_init(); //FIXME: call this later or earlier? -- - _GK.w_display = gdk_screen_get_width(gdk_screen_get_default()); - _GK.h_display = gdk_screen_get_height(gdk_screen_get_default()); - diff --git a/sysutils/gkrellm2/files/patch-src::sysdeps::freebsd.c b/sysutils/gkrellm2/files/patch-src::sysdeps::freebsd.c index ed1fd26d9f7..e1ea9187a86 100644 --- a/sysutils/gkrellm2/files/patch-src::sysdeps::freebsd.c +++ b/sysutils/gkrellm2/files/patch-src::sysdeps::freebsd.c @@ -1,654 +1,25 @@ Index: src/sysdeps/freebsd.c diff -u -p src/sysdeps/freebsd.c.orig src/sysdeps/freebsd.c ---- src/sysdeps/freebsd.c.orig 2008-10-04 09:45:56.000000000 +0900 -+++ src/sysdeps/freebsd.c 2009-08-04 22:04:06.080455360 +0900 -@@ -33,14 +33,20 @@ - | as that of the covered work. - */ - -+#include <sys/param.h> -+#include <sys/sysctl.h> -+#include <osreldate.h> -+ -+#if __FreeBSD_version < 500000 - #include <kvm.h> - - kvm_t *kvmd = NULL; - char errbuf[_POSIX2_LINE_MAX]; -+#endif - - - // extern gboolean force_meminfo_update(void); --#if defined(__i386__) -+#if defined(__i386__) || defined(__amd64__) - static void scan_for_sensors(); - #endif - -@@ -51,13 +57,15 @@ gkrellm_sys_main_init(void) - /* We just ignore error, here. Even if GKrellM doesn't have - | kmem privilege, it runs with available information. - */ -+#if __FreeBSD_version < 500000 - kvmd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, errbuf); -+#endif - if (setgid(getgid()) != 0) - { - fprintf(stderr, "Can't drop setgid privileges."); - exit(1); - } --#if defined(__i386__) -+#if defined(__i386__) || defined(__amd64__) - scan_for_sensors(); - #endif - if (setuid(getuid()) != 0) -@@ -72,9 +80,6 @@ gkrellm_sys_main_cleanup(void) - { - } - --#include <sys/param.h> --#include <sys/sysctl.h> -- - static int - gk_sysctlnametomib(const char *name, int *mibp, size_t *lenp) - { -@@ -90,38 +95,43 @@ gk_sysctlnametomib(const char *name, int - /* ===================================================================== */ - /* CPU monitor interface */ - --#include <osreldate.h> - #if __FreeBSD_version >= 500101 - #include <sys/resource.h> - #else - #include <sys/dkstat.h> - #endif --#include <kvm.h> -- -- --extern kvm_t *kvmd; - - static int oid_cp_time[CTL_MAXNAME + 2]; -+static int oid_cp_times[CTL_MAXNAME + 2]; - static size_t oid_cp_time_len = sizeof(oid_cp_time); -+static size_t oid_cp_times_len = sizeof(oid_cp_times); - static gint have_cp_time; -+static gint maxid; -+static gint ncpus; -+static u_long cpumask; -+static long *cp_times; - - void - gkrellm_sys_cpu_read_data(void) - { -- long cp_time[CPUSTATES]; -- int len = sizeof(cp_time); -+ long cp_time[CPUSTATES], *cp_timep; -+ size_t len; -+#if __FreeBSD_version < 500000 - static struct nlist nl[] = { - #define N_CP_TIME 0 - { "_cp_time" }, - { "" } - }; -+#endif - - if (have_cp_time) - { -- if (sysctl(oid_cp_time, oid_cp_time_len, -- cp_time, &len, 0, 0) < 0) -+ len = sizeof(cp_time); -+ if (sysctl(oid_cp_time, oid_cp_time_len, cp_time, &len, -+ NULL, 0) < 0) - return; - } -+#if __FreeBSD_version < 500000 - else - { - if (kvmd == NULL) -@@ -133,22 +143,92 @@ gkrellm_sys_cpu_read_data(void) - sizeof(cp_time)) != sizeof(cp_time)) - return; - } -+#endif - -- /* Currently, SMP is not supported */ -- gkrellm_cpu_assign_data(0, cp_time[CP_USER], cp_time[CP_NICE], -- cp_time[CP_SYS], cp_time[CP_IDLE]); -+ if (ncpus > 1) -+ { -+ gint i, j; -+ -+ gkrellm_cpu_assign_composite_data(cp_time[CP_USER], -+ cp_time[CP_NICE], -+ cp_time[CP_SYS], -+ cp_time[CP_IDLE]); -+ -+ len = (maxid + 1) * sizeof(long) * CPUSTATES; -+ if (sysctl(oid_cp_times, oid_cp_times_len, cp_times, &len, -+ NULL, 0) < 0) -+ return; -+ for (i = j = 0; i <= maxid; ++i) -+ { -+ if ((cpumask & (1ul << i)) == 0) -+ continue; -+ cp_timep = &cp_times[i * CPUSTATES]; -+ gkrellm_cpu_assign_data(j, cp_timep[CP_USER], -+ cp_timep[CP_NICE], -+ cp_timep[CP_SYS], -+ cp_timep[CP_IDLE]); -+ ++j; -+ } -+ } -+ else -+ gkrellm_cpu_assign_data(0, cp_time[CP_USER], cp_time[CP_NICE], -+ cp_time[CP_SYS], cp_time[CP_IDLE]); - } - - gboolean - gkrellm_sys_cpu_init(void) - { -- static char *name = "kern.cp_time"; -- -- gkrellm_cpu_set_number_of_cpus(1); -+ gint have_cp_times = FALSE; -+ gint maxcpus; -+ size_t len; -+ long *p; -+ -+ if (gk_sysctlnametomib("kern.cp_time", oid_cp_time, -+ &oid_cp_time_len) >= 0) -+ have_cp_time = TRUE; -+ -+ len = sizeof(maxcpus); -+ if (sysctlbyname("kern.smp.maxcpus", &maxcpus, &len, NULL, 0) >= 0) -+ { -+ gint empty, i, j; -+ -+ if (gk_sysctlnametomib("kern.cp_times", oid_cp_times, -+ &oid_cp_times_len) < 0) -+ goto pcpu_probe_done; -+ len = maxcpus * sizeof(long) * CPUSTATES; -+ if ((cp_times = malloc(len)) == NULL) -+ goto pcpu_probe_done; -+ if (sysctl(oid_cp_times, oid_cp_times_len, cp_times, &len, -+ NULL, 0) < 0) -+ { -+ free(cp_times); -+ cp_times = NULL; -+ goto pcpu_probe_done; -+ } -+ maxid = (len / CPUSTATES / sizeof(long)) - 1; -+ cpumask = 0; -+ ncpus = 0; -+ for (i = 0; i <= maxid; ++i) -+ { -+ empty = 1; -+ for (j = 0; empty && j < CPUSTATES; ++j) -+ if (cp_times[i * CPUSTATES + j] != 0) -+ empty = 0; -+ if (!empty) -+ { -+ cpumask |= (1ul << i); -+ ++ncpus; -+ } -+ } -+ if ((p = realloc(cp_times, len)) != NULL) -+ cp_times = p; -+ have_cp_times = TRUE; -+ } - -- if (gk_sysctlnametomib(name, oid_cp_time, &oid_cp_time_len) < 0) -- return TRUE; -- ++have_cp_time; -+pcpu_probe_done: -+ if (!have_cp_times) -+ ncpus = 1; -+ gkrellm_cpu_set_number_of_cpus(ncpus); - return TRUE; - } - -@@ -156,8 +236,6 @@ gkrellm_sys_cpu_init(void) - /* ===================================================================== */ - /* Proc monitor interface */ - --#include <osreldate.h> --#include <sys/sysctl.h> - #if __FreeBSD_version >= 400000 - #include <sys/user.h> - #endif -@@ -175,13 +253,10 @@ gkrellm_sys_cpu_init(void) - #undef KERNEL - #endif - --#include <kvm.h> - #include <limits.h> - #include <paths.h> - #include <utmp.h> - --extern kvm_t *kvmd; -- - static int oid_v_forks[CTL_MAXNAME + 2]; - static int oid_v_vforks[CTL_MAXNAME + 2]; - static int oid_v_rforks[CTL_MAXNAME + 2]; -@@ -215,17 +290,19 @@ gkrellm_sys_proc_read_data(void) - static int oid_proc[] = { CTL_KERN, KERN_PROC, KERN_PROC_ALL }; - #endif - double avenrun; -- static u_int n_processes, n_forks = 0, curpid = -1; -+ static u_int n_processes, n_forks = 0; - u_int n_vforks, n_rforks; - gint r_forks, r_vforks, r_rforks; -- gint len; -+ size_t len; -+#if __FreeBSD_version < 500000 -+ static u_int curpid = -1; - gint nextpid, nforked; - static struct nlist nl[] = { - #define N_NEXTPID 0 - { "_nextpid" }, - { "" } - }; -- -+#endif - - if (getloadavg(&avenrun, 1) <= 0) - avenrun = 0; -@@ -246,6 +323,7 @@ gkrellm_sys_proc_read_data(void) - if (r_forks >= 0 && r_vforks >= 0 && r_rforks >= 0) - n_forks = n_forks + n_vforks + n_rforks; - } -+#if __FreeBSD_version < 500000 - else - { - /* workaround: Can I get total number of processes? */ -@@ -268,6 +346,7 @@ gkrellm_sys_proc_read_data(void) - } - } - } -+#endif - - #if __FreeBSD_version >= 400000 - if (sysctl(oid_proc, 3, NULL, &len, NULL, 0) >= 0) -@@ -318,10 +397,6 @@ gkrellm_sys_proc_read_users(void) - #if __FreeBSD_version >= 300000 - #include <devstat.h> - static struct statinfo statinfo_cur; --#else --#include <kvm.h> -- --extern kvm_t *kvmd; - #endif - - gchar * -@@ -479,11 +554,7 @@ gkrellm_sys_disk_init(void) - #include <netinet6/tcp6_var.h> - #endif - --#include <kvm.h> - #include <nlist.h> -- --extern kvm_t *kvmd; --extern char errbuf[]; - #endif - - -@@ -582,7 +653,7 @@ gkrellm_sys_inet_read_tcp_data(void) - gint tcp_status; - struct xinpgen *xig, *oxig; - gchar *buf; -- gint len = 0; -+ size_t len = 0; - - if (!initialized) - { -@@ -655,17 +726,14 @@ gkrellm_sys_inet_init(void) - /* ===================================================================== */ - /* Memory/Swap monitor interface */ - --#include <osreldate.h> --#include <kvm.h> --#include <limits.h> - #include <sys/conf.h> - #if __FreeBSD_version < 400000 - #include <sys/rlist.h> - #endif - #include <sys/vmmeter.h> --#include <sys/sysctl.h> - #include <vm/vm_param.h> - -+#if __FreeBSD_version < 410000 - static struct nlist nl_mem[] = { - #define N_CNT 0 - { "_cnt" }, -@@ -687,17 +755,20 @@ static struct nlist nl_mem[] = { - #endif - { "" } - }; -- --extern kvm_t *kvmd; --extern char errbuf[]; -+#endif - - static int --swapmode(guint64 *retavail, guint64 *retfree) -+swapmode(unsigned long long *retavail, unsigned long long *retfree) - { - guint64 used, avail; - #if __FreeBSD_version >= 400000 - static int psize = -1; - struct kvm_swap kvmswap; -+#if __FreeBSD_version >= 500000 -+ struct xswdev xsw; -+ size_t mibsize, size; -+ int mib[16], n; -+#endif - #else - char *header; - int hlen, nswap, nswdev, dmmax; -@@ -734,21 +805,37 @@ swapmode(guint64 *retavail, guint64 *ret - } - warning--; /* decrease counter, see end of function */ - -+#if __FreeBSD_version >= 400000 -+#if __FreeBSD_version >= 500000 -+ mibsize = sizeof mib / sizeof mib[0]; -+ if (gk_sysctlnametomib("vm.swap_info", mib, &mibsize) == -1) -+ return(0); -+ kvmswap.ksw_total = 0; -+ kvmswap.ksw_used = 0; -+ for (n = 0; ; ++n) -+ { -+ mib[mibsize] = n; -+ size = sizeof xsw; -+ if (sysctl(mib, mibsize + 1, &xsw, &size, NULL, 0) == -1) -+ break; -+ kvmswap.ksw_total += xsw.xsw_nblks; -+ kvmswap.ksw_used += xsw.xsw_used; -+ } -+#else - if (kvmd == NULL) - return(0); --#if __FreeBSD_version >= 400000 - if (kvm_getswapinfo(kvmd, &kvmswap, 1, 0) < 0) -- { -- fprintf(stderr, "kvm_getswapinfo failed\n"); - return(0); -- } - -+#endif - if (psize < 0) -- psize = getpagesize(); -+ psize = getpagesize(); - *retavail = avail = (quad_t)kvmswap.ksw_total * psize; - used = (quad_t)kvmswap.ksw_used * psize; - *retfree = avail - used; - #else -+ if (kvmd == NULL) -+ return(0); - if (kvm_read(kvmd, nl_mem[VM_NSWAP].n_value, - &nswap, sizeof(nswap)) != sizeof(nswap)) - return(0); -@@ -898,7 +985,7 @@ get_bufspace(guint64 *bufspacep) - } - - if (sysctl(oid_bufspace, oid_bufspace_len, -- &bufspace, &bufspace_len, 0, 0) < 0) -+ &bufspace, &bufspace_len, NULL, 0) < 0) - return 0; - #endif - *bufspacep = bufspace; -@@ -942,9 +1029,9 @@ static struct mibtab mibs[] = { - #endif - - static guint64 swapin, -- swapout, -- swap_total, -- swap_used; -+ swapout; -+static unsigned long long swap_total, -+ swap_used; - - void - gkrellm_sys_mem_read_data(void) -@@ -954,15 +1041,14 @@ gkrellm_sys_mem_read_data(void) +--- src/sysdeps/freebsd.c.orig 2008-10-29 07:15:43.000000000 +0900 ++++ src/sysdeps/freebsd.c 2009-12-22 19:07:46.422456219 +0900 +@@ -1041,7 +1041,7 @@ gkrellm_sys_mem_read_data(void) static gint swappgsin = -1; static gint swappgsout = -1; gint dpagein, dpageout; -- struct vmmeter sum; - guint64 total, used, x_used, free, shared, buffers, cached; + guint64 total, used, x_used, free, shared, buffers = 0, cached; struct vmtotal vmt; size_t length_vmt = sizeof(vmt); static int oid_vmt[] = { CTL_VM, VM_TOTAL }; - #if __FreeBSD_version >= 410000 - gint i; -- FILE *f; -- gchar buf[160]; -+#else -+ struct vmmeter sum; - #endif - - #if 0 -@@ -981,60 +1067,49 @@ gkrellm_sys_mem_read_data(void) - } - - shared = 0; -- if (kvmd == NULL) -- { - #if __FreeBSD_version >= 410000 -- if (!first_time_done) -- { -- for (i = 0; mibs[i].name; ++i) -- { -- mibs[i].oid_len = sizeof(mibs[i].oid); -- if (gk_sysctlnametomib(mibs[i].name, -- mibs[i].oid, -- &mibs[i].oid_len) < 0) -- return; -- mibs[i].value_len = sizeof(mibs[i].value); -- } -- ++first_time_done; -- } -+ if (!first_time_done) -+ { - for (i = 0; mibs[i].name; ++i) -- if (sysctl(mibs[i].oid, mibs[i].oid_len, -- &mibs[i].value, -- &mibs[i].value_len, 0, 0) < 0) -- return; -- total = (mibs[MIB_V_PAGE_COUNT].value - -- mibs[MIB_V_WIRE_COUNT].value) << pshift; -- x_used = (mibs[MIB_V_ACTIVE_COUNT].value + -- mibs[MIB_V_INACTIVE_COUNT].value) << pshift; -- free = mibs[MIB_V_FREE_COUNT].value << pshift; -- if (sysctl(oid_vmt, 2, &vmt, &length_vmt, NULL, 0) == 0) -- shared = vmt.t_rmshr << pshift; -- get_bufspace(&buffers); -- cached = mibs[MIB_V_CACHE_COUNT].value << pshift; -- used = x_used - buffers - cached; -- gkrellm_mem_assign_data(total, used, free, shared, buffers, cached); -- -- swapin = mibs[MIB_V_SWAPPGSIN].value; -- swapout = mibs[MIB_V_SWAPPGSOUT].value; -- -- /* Try linprocfs for swap info */ -- if ((f = fopen(PROC_MEMINFO_FILE, "r")) == NULL) -- return; -- /* total: used: free: shared: buffers: cached: */ -- while ((fgets(buf, sizeof(buf), f)) != NULL) - { -- if (strncmp(buf, "Swap:", 5) == 0) -- { -- sscanf(buf, "Swap: %llu %llu", -- &swap_total, &swap_used); -- break; -- } -+ mibs[i].oid_len = sizeof(mibs[i].oid); -+ if (gk_sysctlnametomib(mibs[i].name, mibs[i].oid, -+ &mibs[i].oid_len) < 0) -+ return; -+ mibs[i].value_len = sizeof(mibs[i].value); - } -- fclose(f); --#endif -- return; - } -+ for (i = 0; mibs[i].name; ++i) -+ if (sysctl(mibs[i].oid, mibs[i].oid_len, &mibs[i].value, -+ &mibs[i].value_len, NULL, 0) < 0) -+ return; -+ total = (mibs[MIB_V_PAGE_COUNT].value - -+ mibs[MIB_V_WIRE_COUNT].value) << pshift; -+ x_used = (mibs[MIB_V_ACTIVE_COUNT].value + -+ mibs[MIB_V_INACTIVE_COUNT].value) << pshift; -+ free = mibs[MIB_V_FREE_COUNT].value << pshift; -+ if (sysctl(oid_vmt, 2, &vmt, &length_vmt, NULL, 0) == 0) -+ shared = vmt.t_rmshr << pshift; -+ get_bufspace(&buffers); -+ cached = mibs[MIB_V_CACHE_COUNT].value << pshift; -+ used = x_used - buffers - cached; -+ gkrellm_mem_assign_data(total, used, free, shared, buffers, cached); - -+ if (swappgsin < 0) -+ { -+ dpagein = 0; -+ dpageout = 0; -+ } -+ else -+ { -+ dpagein = (mibs[MIB_V_SWAPPGSIN].value - swappgsin) << pshift; -+ dpageout = (mibs[MIB_V_SWAPPGSOUT].value - swappgsout) << pshift; -+ } -+ swappgsin = mibs[MIB_V_SWAPPGSIN].value; -+ swappgsout = mibs[MIB_V_SWAPPGSOUT].value; -+#else -+ if (kvmd == NULL) -+ return; - if (nl_mem[0].n_type == 0) - if (kvm_nlist(kvmd, nl_mem) < 0 || nl_mem[0].n_type == 0) - return; -@@ -1051,6 +1126,7 @@ gkrellm_sys_mem_read_data(void) - cached = sum.v_cache_count << pshift; - used = x_used - buffers - cached; - gkrellm_mem_assign_data(total, used, free, shared, buffers, cached); -+ - if (swappgsin < 0) - { - dpagein = 0; -@@ -1058,11 +1134,12 @@ gkrellm_sys_mem_read_data(void) - } - else - { -- dpagein = (sum.v_swappgsin - swappgsin) << (pshift - 10); -- dpageout = (sum.v_swappgsout - swappgsout) << (pshift - 10); -+ dpagein = (sum.v_swappgsin - swappgsin) << pshift; -+ dpageout = (sum.v_swappgsout - swappgsout) << pshift; - } - swappgsin = sum.v_swappgsin; - swappgsout = sum.v_swappgsout; -+#endif - - if (dpagein > 0 || dpageout > 0 || first_time_done == 0) - { -@@ -1090,8 +1167,8 @@ gkrellm_sys_mem_init(void) - /* ===================================================================== */ - /* Battery monitor interface */ - -+#if defined(__i386__) || defined(__amd64__) - #if defined(__i386__) --#include <osreldate.h> - #include <machine/apm_bios.h> - #define APMDEV "/dev/apm" - -@@ -1099,6 +1176,7 @@ gkrellm_sys_mem_init(void) - #define L_ON_LINE 1 - #define L_CHARGING 3 - #define L_UNKNOWN 0xFF -+#endif - - /* following two definitions are taken from sys/dev/acpica/acpiio.h */ - #define ACPI_BATT_STAT_CHARGING 0x0002 -@@ -1125,16 +1203,18 @@ gkrellm_sys_battery_read_data(void) - size_t size; - int acpi_info[4]; - int i; -+#if defined(__i386__) - int f, r; - struct apm_info info; -+ gint batt_num = 0; -+#endif - gboolean available, on_line, charging; - gint percent, time_left; -- gint batt_num = 0; - - if (!first_time_done) - { - first_time_done = TRUE; --#ifdef ACPI_SUPPORTS_MULTIPLE_BATTERIES -+#if defined(ACPI_SUPPORTS_MULTIPLE_BATTERIES) || defined(__amd64__) - /* - * XXX: Disable getting battery information via ACPI - * to support multiple batteries via APM sim until -@@ -1174,6 +1254,7 @@ gkrellm_sys_battery_read_data(void) - return; - } - -+#if defined(__i386__) - if ((f = open(APMDEV, O_RDONLY)) == -1) - return; - if ((r = ioctl(f, APMIO_GETINFO, &info)) == -1) { -@@ -1231,6 +1312,7 @@ gkrellm_sys_battery_read_data(void) - #endif - - close(f); -+#endif - } - - gboolean -@@ -1258,7 +1340,7 @@ gkrellm_sys_battery_init(void) - /* ===================================================================== */ - /* Sensor monitor interface */ - --#if defined(__i386__) -+#if defined(__i386__) || defined(__amd64__) - - typedef struct - { -@@ -1286,7 +1368,6 @@ static VoltDefault voltdefault0[] = - }; - - #include <dirent.h> --#include <osreldate.h> - #include <machine/cpufunc.h> - #if __FreeBSD_version >= 500042 - #include <dev/smbus/smb.h> -@@ -1298,6 +1379,8 @@ static VoltDefault voltdefault0[] = - #define INTERFACE_IO 0 +@@ -1380,6 +1380,7 @@ static VoltDefault voltdefault0[] = #define INTERFACE_SMB 1 #define INTERFACE_ACPI 2 -+#define INTERFACE_CORETEMP 3 /* Already in Celsius */ + #define INTERFACE_CORETEMP 3 /* Already in Celsius */ +#define INTERFACE_AMDTEMP 4 /* Addresses to use for /dev/io */ #define WBIO1 0x295 -@@ -1331,7 +1414,7 @@ get_data(int iodev, u_char command, int - struct smbcmd cmd; - - bzero(&cmd, sizeof(cmd)); -- cmd.data.byte_ptr = &byte; -+ cmd.data.byte_ptr = (char *)&byte; - cmd.slave = 0x5a; - cmd.cmd = command; - if (ioctl(iodev, SMB_READB, (caddr_t)&cmd) == -1) -@@ -1357,6 +1440,8 @@ gkrellm_sys_sensors_get_temperature(gcha - - { - u_char byte; -+ int value; -+ size_t size; - - if (interface == MBMON_INTERFACE) - { -@@ -1364,17 +1449,18 @@ gkrellm_sys_sensors_get_temperature(gcha +@@ -1448,23 +1449,15 @@ gkrellm_sys_sensors_get_temperature(gcha return gkrellm_sys_sensors_mbmon_get_value(path, temp); } @@ -656,23 +27,27 @@ diff -u -p src/sysdeps/freebsd.c.orig src/sysdeps/freebsd.c + if (interface == INTERFACE_ACPI || interface == INTERFACE_CORETEMP || + interface == INTERFACE_AMDTEMP) { -- int value; -- size_t size = sizeof(value); -- -+ size = sizeof(value); + size = sizeof(value); if (sysctlbyname(path, &value, &size, NULL, 0) < 0) return FALSE; if (temp) - *temp = (gfloat) TZ_KELVTOC(value); +- return TRUE; +- } +- +- if (interface == INTERFACE_CORETEMP) +- { +- size = sizeof(value); +- if (sysctlbyname(path, &value, &size, NULL, 0) < 0) +- return FALSE; +- if (temp) +- *temp = (gfloat) value; + *temp = (interface == INTERFACE_CORETEMP) ? + (gfloat) value : (gfloat) TZ_KELVTOC(value); return TRUE; } -+ - if (get_data(iodev, LM78_TEMP, interface, &byte)) - { - if (temp) -@@ -1444,10 +1530,10 @@ static GList *freebsd_sensor_list; + +@@ -1537,10 +1530,10 @@ static GList *freebsd_sensor_list; gboolean gkrellm_sys_sensors_init(void) { @@ -680,23 +55,17 @@ diff -u -p src/sysdeps/freebsd.c.orig src/sysdeps/freebsd.c + gchar mib_name[256], label[8], buf[BUFSIZ], *fmt; gint interface, id; - int oid_acpi_temp[CTL_MAXNAME + 2]; -- size_t oid_acpi_temp_len = sizeof(oid_acpi_temp); +- size_t oid_acpi_temp_len; + int oid[CTL_MAXNAME + 2]; + size_t oid_len, len; GList *list; struct freebsd_sensor *sensor; -@@ -1455,12 +1541,13 @@ gkrellm_sys_sensors_init(void) - */ - gkrellm_sys_sensors_mbmon_check(TRUE); - -- for (id = 0;;) -- { -+ /* ACPI Thermal */ -+ for (id = 0;; id++) -+ { +@@ -1553,9 +1546,8 @@ gkrellm_sys_sensors_init(void) + { snprintf(mib_name, sizeof(mib_name), "hw.acpi.thermal.tz%d.temperature", id); +- oid_acpi_temp_len = sizeof(oid_acpi_temp); - if (gk_sysctlnametomib(mib_name, oid_acpi_temp, - &oid_acpi_temp_len) < 0) + oid_len = sizeof(oid); @@ -704,18 +73,19 @@ diff -u -p src/sysdeps/freebsd.c.orig src/sysdeps/freebsd.c break; interface = INTERFACE_ACPI; if (!gkrellm_sys_sensors_get_temperature(mib_name, 0, 0, -@@ -1470,7 +1557,33 @@ gkrellm_sys_sensors_init(void) - gkrellm_sensors_add_sensor(SENSOR_TEMPERATURE, NULL, - mib_name, 0, 0, +@@ -1567,16 +1559,22 @@ gkrellm_sys_sensors_init(void) interface, 1.0, 0.0, NULL, label); -- } -+ } -+ + } + +- /* Coretemp */ + /* Coretemp and Amdtemp */ -+ for (id = 0;; id++) -+ { -+ snprintf(mib_name, sizeof(mib_name), -+ "dev.cpu.%d.temperature", id); + for (id = 0;; id++) + { + snprintf(mib_name, sizeof(mib_name), + "dev.cpu.%d.temperature", id); +- oid_acpi_temp_len = sizeof(oid_acpi_temp); +- if (gk_sysctlnametomib(mib_name, oid_acpi_temp, +- &oid_acpi_temp_len) < 0) + oid_len = sizeof(oid) - sizeof(int) * 2; + if (gk_sysctlnametomib(mib_name, oid + 2, &oid_len) < 0) + break; @@ -723,34 +93,11 @@ diff -u -p src/sysdeps/freebsd.c.orig src/sysdeps/freebsd.c + oid[1] = 4; + len = sizeof(buf); + if (sysctl(oid, oid_len + 2, buf, &len, 0, 0) < 0) -+ break; + break; +- interface = INTERFACE_CORETEMP; + fmt = (gchar *)(buf + sizeof(u_int)); + interface = (fmt[1] == 'K') ? + INTERFACE_AMDTEMP : INTERFACE_CORETEMP; -+ if (!gkrellm_sys_sensors_get_temperature(mib_name, 0, 0, -+ interface, NULL)) -+ continue; -+ snprintf(label, sizeof(label), "cpu%d", id); -+ gkrellm_sensors_add_sensor(SENSOR_TEMPERATURE, NULL, -+ mib_name, 0, 0, -+ interface, 1.0, 0.0, NULL, label); -+ } -+ - - if (freebsd_sensor_list) - { -@@ -1504,13 +1617,7 @@ sensors_add_sensor(gint type, gchar *id_ - sensor->factor = factor; - sensor->offset = offset; - sensor->default_label = default_label ? g_strdup(default_label) : NULL; -- if (g_list_append(freebsd_sensor_list, sensor) == NULL) { -- g_free(sensor->id_name); -- if (sensor->default_label) -- g_free(sensor->default_label); -- g_free(sensor); -- return FALSE; -- } -+ freebsd_sensor_list = g_list_append(freebsd_sensor_list, sensor); - return TRUE; - } - + if (!gkrellm_sys_sensors_get_temperature(mib_name, 0, 0, + interface, NULL)) + continue; diff --git a/sysutils/gkrellm2/files/patch-src:Makefile b/sysutils/gkrellm2/files/patch-src:Makefile index 8e2082ca00b..6aa9251927f 100644 --- a/sysutils/gkrellm2/files/patch-src:Makefile +++ b/sysutils/gkrellm2/files/patch-src:Makefile @@ -1,25 +1,19 @@ Index: src/Makefile diff -u src/Makefile.orig src/Makefile ---- src/Makefile.orig 2008-10-04 09:22:09.000000000 +0900 -+++ src/Makefile 2008-10-04 23:03:23.000000000 +0900 -@@ -45,7 +45,15 @@ - ifeq ($(without-libsensors),1) - CONFIGURE_ARGS += --without-libsensors +--- src/Makefile.orig 2008-10-15 07:06:30.000000000 +0900 ++++ src/Makefile 2009-12-22 10:55:44.127838425 +0900 +@@ -51,7 +51,9 @@ + ifeq ($(without-ntlm),1) + CONFIGURE_ARGS += --without-ntlm endif -DUMMY_VAR := $(shell ./configure $(CONFIGURE_ARGS)) -+ifeq ($(without-ntlm),yes) -+ CONFIGURE_ARGS += --without-ntlm -+endif -+ifeq ($(without-ntlm),1) -+ CONFIGURE_ARGS += --without-ntlm -+endif +DUMMY_VAR := $(shell env OPENSSLINC=$(OPENSSLINC) OPENSSLLIB=$(OPENSSLLIB) \ + GNUTLSINC=$(GNUTLSINC) GNUTLSLIB=$(GNUTLSLIB) \ + ./configure $(CONFIGURE_ARGS)) HAVE_GNUTLS = $(shell grep -c HAVE_GNUTLS configure.h) HAVE_SSL = $(shell grep -c HAVE_SSL configure.h) -@@ -53,10 +61,10 @@ +@@ -59,10 +61,10 @@ HAVE_LIBSENSORS = $(shell grep -c HAVE_LIBSENSORS configure.h) ifeq ($(HAVE_GNUTLS),1) @@ -32,13 +26,13 @@ diff -u src/Makefile.orig src/Makefile else EXTRAOBJS ?= md5c.o endif -@@ -78,9 +86,17 @@ +@@ -85,9 +87,17 @@ PKG_INCLUDE = `$(PKG_CONFIG) --cflags gtk+-2.0 gthread-2.0` PKG_LIB = `$(PKG_CONFIG) --libs gtk+-2.0 gthread-2.0` -FLAGS = -O2 -I.. -I$(SHARED_PATH) $(PKG_INCLUDE) $(GTOP_INCLUDE) $(PTHREAD_INC) \ +FLAGS = -I.. -I$(SHARED_PATH) $(PKG_INCLUDE) $(GTOP_INCLUDE) $(PTHREAD_INC) \ - -DGKRELLM_CLIENT + ${NTLM_INCLUDES} -DGKRELLM_CLIENT +ifeq ($(HAVE_GNUTLS),1) + FLAGS+= -I$(GNUTLSINC) @@ -48,10 +42,10 @@ diff -u src/Makefile.orig src/Makefile +endif +endif + - LIBS = $(PKG_LIB) $(GTOP_LIBS) $(SMC_LIBS) $(SYS_LIBS) $(SSL_LIBS) $(NTLM_LIBS) $(SENSORS_LIBS) + LIBS = $(PKG_LIB) $(GTOP_LIBS) $(SMC_LIBS) $(SYS_LIBS) $(SSL_LIBS) $(SENSORS_LIBS) \ + $(NTLM_LIBS) - ifeq ($(debug),1) -@@ -113,7 +129,7 @@ +@@ -121,7 +131,7 @@ endif @@ -60,7 +54,7 @@ diff -u src/Makefile.orig src/Makefile OBJS = main.o alerts.o battery.o base64.o clock.o cpu.o disk.o fs.o \ hostname.o inet.o mail.o mem.o net.o proc.o sensors.o uptime.o \ -@@ -138,13 +154,20 @@ +@@ -146,13 +156,20 @@ $(MAKE) EXTRAOBJS= SYS_LIBS="-lkvm -lmd" gkrellm endif @@ -72,7 +66,7 @@ diff -u src/Makefile.orig src/Makefile $(MAKE) EXTRAOBJS= SYS_LIBS="-lkvm -ldevstat -lmd" gkrellm endif -+freebsd5 freebsd6 freebsd7 freebsd8 freebsd: ++freebsd5 freebsd6 freebsd7 freebsd8 freebsd9 freebsd: +ifeq ($(HAVE_SSL),1) + $(MAKE) EXTRAOBJS= SYS_LIBS="-ldevstat" gkrellm +else |