Hi,

i had an annoying crash in conky, so i fixed it first.. and jasper
prodded me to update it. So here's a slightly tested diff @i386, most
things seems to work (mpd/net/processes/cpu speed)
- their manpage is still horribly broken, so it's still not installed
- they forgot to include src/openbsd.h in their tarball, so it's taken
  from their svn repo (please someone give them a cluestick)
- it has been clearly not tested to compile on OpenBSD since ages:
  missing func implem, etc..
- there seems to be apm sensor/battery support, but i don't know if it
  should work nor how to use it.

please test on as much arches as possible, with various settings..

Landry

(Maintainer cc'ed)
? patches-old
Index: Makefile
===================================================================
RCS file: /cvs/ports/sysutils/conky/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- Makefile    21 Aug 2008 07:30:16 -0000      1.7
+++ Makefile    22 Sep 2008 20:56:17 -0000
@@ -5,8 +5,7 @@
 
 COMMENT=       light-weight system monitor
 
-DISTNAME=      conky-1.4.9
-PKGNAME=       ${DISTNAME}p0
+DISTNAME=      conky-1.6.1
 
 CATEGORIES=    sysutils
 HOMEPAGE=      http://conky.sourceforge.net/
@@ -40,9 +39,6 @@
                --disable-portmon
 
 post-install:
-       ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/conky
-       ${INSTALL_DATA} ${WRKSRC}/doc/conkyrc.sample \
-               ${PREFIX}/share/examples/conky
        ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/conky
        ${INSTALL_DATA} ${WRKSRC}/doc/*.html ${PREFIX}/share/doc/conky
        ${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/conky
Index: distinfo
===================================================================
RCS file: /cvs/ports/sysutils/conky/distinfo,v
retrieving revision 1.2
diff -u -r1.2 distinfo
--- distinfo    3 Feb 2008 16:04:09 -0000       1.2
+++ distinfo    22 Sep 2008 20:56:17 -0000
@@ -1,5 +1,5 @@
-MD5 (conky-1.4.9.tar.gz) = i75GuPdwXNGB9dqgvEgP+Q==
-RMD160 (conky-1.4.9.tar.gz) = hCbAPqZAjoUzpRdGQRyssO4cymA=
-SHA1 (conky-1.4.9.tar.gz) = Oz5QzxEfyhKXgEPoTMiaOFD6mag=
-SHA256 (conky-1.4.9.tar.gz) = cvJqWyKUMGQtel0cviCSIbHdibhTsjPihd2ox6DlQ9g=
-SIZE (conky-1.4.9.tar.gz) = 560961
+MD5 (conky-1.6.1.tar.gz) = xV5CKbcdOFbK0JPO/ozTiw==
+RMD160 (conky-1.6.1.tar.gz) = TpfpePYPHk7Ecaf3DOyn2RVfxgM=
+SHA1 (conky-1.6.1.tar.gz) = lMhZQwSBi0rQrf8luM1hTFnOsP0=
+SHA256 (conky-1.6.1.tar.gz) = PH9bKcexl4Gko8Jt7VNLZ3KsUTQ+V7LCz2W8+NNTLz0=
+SIZE (conky-1.6.1.tar.gz) = 605922
Index: patches/patch-doc_Makefile_in
===================================================================
RCS file: /cvs/ports/sysutils/conky/patches/patch-doc_Makefile_in,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 patch-doc_Makefile_in
--- patches/patch-doc_Makefile_in       10 Oct 2007 21:20:23 -0000      1.1.1.1
+++ patches/patch-doc_Makefile_in       22 Sep 2008 20:56:17 -0000
@@ -1,13 +1,13 @@
 $OpenBSD: patch-doc_Makefile_in,v 1.1.1.1 2007/10/10 21:20:23 jasper Exp $
 
---- doc/Makefile.in.orig       Fri Sep 28 20:12:41 2007
-+++ doc/Makefile.in    Fri Sep 28 20:12:52 2007
-@@ -187,7 +187,7 @@ top_builddir = @top_builddir@
+--- doc/Makefile.in.orig       Thu Aug 14 19:16:52 2008
++++ doc/Makefile.in    Mon Sep 22 22:49:34 2008
+@@ -191,7 +191,7 @@ top_builddir = @top_builddir@
  top_srcdir = @top_srcdir@
  xsltproc_cmd = @xsltproc_cmd@
  @[EMAIL PROTECTED] = conky.1 docs.html variables.html config_settings.html
 -man_MANS = conky.1
 +man_MANS =
- EXTRA_DIST = $(DOCS) conkyrc.sample command_options.xml config_settings.xml 
docgen.sh docs.xml variables.xml variables.xsl config_settings.xsl
+ sysconf_SYSCONFS = conky.conf
+ EXTRA_DIST = $(DOCS) conky.conf command_options.xml config_settings.xml 
docgen.sh docs.xml variables.xml variables.xsl config_settings.xsl
  all: all-am
- 
Index: patches/patch-src_conky_c
===================================================================
RCS file: patches/patch-src_conky_c
diff -N patches/patch-src_conky_c
--- patches/patch-src_conky_c   3 Feb 2008 16:04:09 -0000       1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,17 +0,0 @@
-$OpenBSD: patch-src_conky_c,v 1.2 2008/02/03 16:04:09 jasper Exp $
---- src/conky.c.orig   Wed Nov 14 22:41:12 2007
-+++ src/conky.c        Sun Feb  3 16:49:52 2008
-@@ -3710,7 +3710,12 @@ static void generate_text_internal(char *p, int p_max_
- #endif /* !__OpenBSD__ */
-                               OBJ(freq) {
-                                       if (obj->a) {
--                                              obj->a = get_freq(p, 
p_max_size, "%.0f", 1, obj->data.cpu_index); 
-+#ifndef __OpenBSD__
-+                                              obj->a = get_freq(p, 
p_max_size, "%'.2f", 1000, obj->data.cpu_index); 
-+#else
-+                                              /* OpenBSD has no such flag 
(SUSv2) */
-+                                              obj->a = get_freq(p, 
p_max_size, "%.2f", 1000, obj->data.cpu_index); 
-+#endif
-                                       }
-                               }
-                               OBJ(freq_g) {
Index: patches/patch-src_fs_c
===================================================================
RCS file: patches/patch-src_fs_c
diff -N patches/patch-src_fs_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_fs_c      22 Sep 2008 20:56:17 -0000
@@ -0,0 +1,21 @@
+$OpenBSD$
+--- src/fs.c.orig      Mon Sep 22 22:20:03 2008
++++ src/fs.c   Mon Sep 22 22:21:42 2008
+@@ -44,7 +44,7 @@
+ #include <sys/mount.h>
+ #endif
+ 
+-#if !defined(HAVE_STRUCT_STATFS_F_FSTYPENAME) && !defined(__FreeBSD__)
++#if !defined(HAVE_STRUCT_STATFS_F_FSTYPENAME) && !defined (__OpenBSD__) && 
!defined(__FreeBSD__)
+ #include <mntent.h>
+ #endif
+ 
+@@ -124,7 +124,7 @@ static void update_fs_stat(struct fs_stat *fs)
+ void get_fs_type(const char *path, char *result)
+ {
+ 
+-#if defined(HAVE_STRUCT_STATFS_F_FSTYPENAME) || defined(__FreeBSD__)
++#if defined(HAVE_STRUCT_STATFS_F_FSTYPENAME) || defined(__FreeBSD__) || 
defined (__OpenBSD__)
+ 
+       struct statfs s;
+       if (statfs(path, &s) == 0) {
Index: patches/patch-src_openbsd_c
===================================================================
RCS file: /cvs/ports/sysutils/conky/patches/patch-src_openbsd_c,v
retrieving revision 1.4
diff -u -r1.4 patch-src_openbsd_c
--- patches/patch-src_openbsd_c 28 Feb 2008 18:28:56 -0000      1.4
+++ patches/patch-src_openbsd_c 22 Sep 2008 20:56:17 -0000
@@ -1,38 +1,59 @@
-$OpenBSD: patch-src_openbsd_c,v 1.4 2008/02/28 18:28:56 okan Exp $
---- src/openbsd.c.orig Wed Nov 14 16:29:26 2007
-+++ src/openbsd.c      Thu Feb 28 10:56:22 2008
-@@ -685,16 +685,20 @@ proc_find_top(struct process **cpu, struct process **m
+$OpenBSD$
+--- src/openbsd.c.orig Tue Jul 29 20:01:18 2008
++++ src/openbsd.c      Mon Sep 22 22:38:31 2008
+@@ -598,6 +598,7 @@ char get_freq(char *p_client_buffer, size_t client_buf
+ 
+ void update_top()
+ {
++      kvm_init();
+       proc_find_top(info.cpu, info.memu);
+ }
+ 
+@@ -654,6 +655,10 @@ cleanup:
+ }
+ #endif
+ 
++void clear_diskio_stats()
++{
++}
++
+ void update_diskio()
+ {
+       return; /* XXX: implement? hifi: not sure how */
+@@ -695,18 +700,22 @@ inline void proc_find_top(struct process **cpu, struct
        struct process *processes;
        int mib[2];
  
 -      int total_pages;
-+      int64_t usermem;
 +      u_int total_pages;
++      int64_t usermem;
        int pagesize = getpagesize();
  
        /* we get total pages count again to be sure it is up to date */
        mib[0] = CTL_HW;
 -      mib[1] = HW_USERMEM;
 -      size_t size = sizeof(total_pages);
--      if(sysctl(mib, 2, &total_pages, &size, NULL, 0) == -1)
--              ERR("error reading nmempages");
 +      mib[1] = HW_USERMEM64;
 +      size_t size = sizeof(usermem);
-+      if(sysctl(mib, 2, &usermem, &size, NULL, 0) == -1)
+ 
+-      if (sysctl(mib, 2, &total_pages, &size, NULL, 0) == -1) {
+-              ERR("error reading nmempages");
++      if (sysctl(mib, 2, &usermem, &size, NULL, 0) == -1) {
 +              ERR("error reading usermem");
+       }
  
 +      /* translate bytes into page count */
 +      total_pages = usermem / pagesize;
 +
        int max_size = sizeof(struct kinfo_proc2);
+ 
        p = kvm_getproc2(kd, KERN_PROC_ALL, 0, max_size, &n_processes);
-       processes = malloc(n_processes * sizeof (struct process));
-@@ -707,7 +711,7 @@ proc_find_top(struct process **cpu, struct process **m
-                       processes[j].name =  strdup(p[i].p_comm);
-                       processes[j].amount = 100.0 *
-                               p[i].p_pctcpu / FSCALE;
--                      processes[j].totalmem = (float)(p[i].p_vm_rssize * 
pagesize /
-+                      processes[j].totalmem = (float)(p[i].p_vm_rssize /
-                                       (float)total_pages) * 100.0;
+@@ -717,7 +726,7 @@ inline void proc_find_top(struct process **cpu, struct
+                       processes[j].pid = p[i].p_pid;
+                       processes[j].name = strndup(p[i].p_comm, 
text_buffer_size);
+                       processes[j].amount = 100.0 * p[i].p_pctcpu / FSCALE;
+-                      processes[j].totalmem = (float) (p[i].p_vm_rssize * 
pagesize /
++                      processes[j].totalmem = (float) (p[i].p_vm_rssize /
+                               (float) total_pages) * 100.0;
                        j++;
                }
Index: patches/patch-src_openbsd_h
===================================================================
RCS file: patches/patch-src_openbsd_h
diff -N patches/patch-src_openbsd_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_openbsd_h 22 Sep 2008 20:56:17 -0000
@@ -0,0 +1,30 @@
+$OpenBSD$
+--- src/openbsd.h.orig Mon Sep 22 22:16:43 2008
++++ src/openbsd.h      Mon Sep 22 22:16:24 2008
+@@ -0,0 +1,26 @@
++#ifndef OPENBSD_H_
++#define OPENBSD_H_
++
++#include "common.h"
++#include <sys/sysctl.h>
++#include <sys/sensors.h>
++#include <machine/apmvar.h>
++
++void update_obsd_sensors(void);
++void get_obsd_vendor(char *buf, size_t client_buffer_size);
++void get_obsd_product(char *buf, size_t client_buffer_size);
++
++#define OBSD_MAX_SENSORS 256
++struct obsd_sensors_struct {
++      int device;
++      float temp[MAXSENSORDEVICES][OBSD_MAX_SENSORS];
++      unsigned int fan[MAXSENSORDEVICES][OBSD_MAX_SENSORS];
++      float volt[MAXSENSORDEVICES][OBSD_MAX_SENSORS];
++};
++struct obsd_sensors_struct obsd_sensors;
++
++#if defined(i386) || defined(__i386__)
++typedef struct apm_power_info *apm_info_t;
++#endif
++
++#endif /*OPENBSD_H_*/
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/sysutils/conky/pkg/PLIST,v
retrieving revision 1.2
diff -u -r1.2 PLIST
--- pkg/PLIST   3 Feb 2008 16:04:09 -0000       1.2
+++ pkg/PLIST   22 Sep 2008 20:56:17 -0000
@@ -1,5 +1,5 @@
 @comment $OpenBSD: PLIST,v 1.2 2008/02/03 16:04:09 jasper Exp $
-bin/conky
[EMAIL PROTECTED] bin/conky
 share/doc/conky/
 share/doc/conky/README
 share/doc/conky/config_settings.html
@@ -9,4 +9,3 @@
 @sample ${SYSCONFDIR}/conky/
 share/examples/conky/conky.conf
 @sample ${SYSCONFDIR}/conky/conky.conf
-share/examples/conky/conkyrc.sample

Reply via email to