Hi again,
Integrating latest suggestions:
remove manpage patching during post-install as schwarze@ said.
added a @sample for conky_no_x11.conf
Someone who wants to give a ok?
Keep in mind that my other patch for audacious is a prerequisite
for this, so ok that one too ;)
Saluti,
David
Index: Makefile
===================================================================
RCS file: /cvs/ports/sysutils/conky/Makefile,v
retrieving revision 1.20
diff -u -p -r1.20 Makefile
--- Makefile 20 Nov 2010 17:22:40 -0000 1.20
+++ Makefile 22 Apr 2011 08:20:15 -0000
@@ -4,8 +4,7 @@ ONLY_FOR_ARCHS= ${APM_ARCHS}
COMMENT= light-weight system monitor
-DISTNAME= conky-1.7.2
-REVISION= 1
+DISTNAME= conky-1.8.1
CATEGORIES= sysutils
HOMEPAGE= http://conky.sourceforge.net/
@@ -14,13 +13,13 @@ MAINTAINER= Benoit Lecocq <benoit@openbs
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=conky/}
-# GPL
+# BSD / GPLv3
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
-WANTLIB= c crypto kvm idn m ossaudio pthread ssl z \
+WANTLIB= c crypto kvm idn m ncurses ossaudio pthread ssl z \
glib-2.0 pcre curl xml2 lua>=5.1
MODULES= devel/gettext
@@ -32,31 +31,59 @@ LIB_DEPENDS= devel/glib2 \
lang/lua
USE_LIBTOOL= Yes
-USE_GROFF = Yes
-FLAVORS= no_x11
+FLAVORS= no_x11 audacious imlib2 xmms2
FLAVOR?=
.if ${FLAVOR:L:Mno_x11}
+. if ${FLAVOR:L:Maudacious} || ${FLAVOR:L:Mimlib2}
+ERRORS+="Fatal: nonsense combination of flavors"
+. else
CONFIGURE_ARGS+=--disable-double-buffer \
--disable-x11 \
--disable-own-window
+. endif
.else
WANTLIB+= X11 Xau Xdamage Xdmcp Xext Xfixes Xft Xrender \
expat fontconfig freetype pthread-stubs xcb
.endif
+.if ${FLAVOR:L:Maudacious}
+CONFIGURE_ARGS+=--enable-audacious=yes
+LIB_DEPENDS+= audio/audacious
+WANTLIB += GL Xcomposite Xcursor Xi Xinerama Xrandr Xxf86vm \
+ atk-1.0 audclient audcore audgui cairo dbus-1 \
+ dbus-glib-1 drm execinfo gdk-x11-2.0 \
+ gdk_pixbuf-2.0 gio-2.0 gmodule-2.0 gobject-2.0 \
+ gthread-2.0 gtk-x11-2.0 mcs mowgli pango-1.0 \
+ pangocairo-1.0 pangoft2-1.0 pixman-1 png \
+ xcb-render xcb-shm
+.endif
+
+.if ${FLAVOR:L:Mimlib2}
+CONFIGURE_ARGS+=--enable-imlib2
+LIB_DEPENDS+= graphics/imlib2
+WANTLIB+= Imlib2
+.endif
+
+.if ${FLAVOR:L:Mxmms2}
+CONFIGURE_ARGS+=--enable-xmms2
+LIB_DEPENDS+= audio/xmms2
+WANTLIB+= xmmsclient
+.endif
+
CONFIGURE_STYLE=gnu
CONFIGURE_ARGS+=--enable-mpd \
--enable-rss \
--disable-config-output \
+ --disable-moc \
--disable-portmon \
--enable-lua \
- --enable-curl
+ --enable-curl \
+ --with-libiconv-prefix="${LOCALBASE}"
+CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" LDFLAGS="-L${LOCALBASE}/lib"
post-install:
- #fix garbage in manpage
- @perl -pi -e 's,\\\*\(T.,,g' ${PREFIX}/man/man1/conky.1
${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.5
diff -u -p -r1.5 distinfo
--- distinfo 23 Nov 2009 16:46:20 -0000 1.5
+++ distinfo 22 Apr 2011 08:20:15 -0000
@@ -1,5 +1,5 @@
-MD5 (conky-1.7.2.tar.gz) = +l2c98vvYftczwVx5zOcNw==
-RMD160 (conky-1.7.2.tar.gz) = jCophlBxQAMgx0ctSivIHuL2QUA=
-SHA1 (conky-1.7.2.tar.gz) = ij2hW5ixtnWTmMMiF+a/hEubMdo=
-SHA256 (conky-1.7.2.tar.gz) = o/4qL9KpYRjnObaMf0ByXgqjr/hoODnwy44cCnjPFyU=
-SIZE (conky-1.7.2.tar.gz) = 733132
+MD5 (conky-1.8.1.tar.gz) = mzMPfQAcvZ+Bjkhd78GQKQ==
+RMD160 (conky-1.8.1.tar.gz) = 7OQw+Jy0uF9mr244Ylam2KHN628=
+SHA1 (conky-1.8.1.tar.gz) = Brvpt+7YYD+nqXGyfFxh84QkrG8=
+SHA256 (conky-1.8.1.tar.gz) = x5aGmd6zkP4ru9TiujEo/BOrIu5QP5Uj5JRjwDlzyq0=
+SIZE (conky-1.8.1.tar.gz) = 775162
Index: patches/patch-configure
===================================================================
RCS file: /cvs/ports/sysutils/conky/patches/patch-configure,v
retrieving revision 1.2
diff -u -p -r1.2 patch-configure
--- patches/patch-configure 27 Apr 2010 20:56:11 -0000 1.2
+++ patches/patch-configure 22 Apr 2011 08:20:15 -0000
@@ -1,12 +1,12 @@
$OpenBSD: patch-configure,v 1.2 2010/04/27 20:56:11 sthen Exp $
--- configure.orig Tue Aug 25 00:01:58 2009
+++ configure Tue Apr 27 19:50:09 2010
-@@ -19845,7 +19845,7 @@ $as_echo "$ac_cv_search_clock_gettime" >&6; }
- ac_res=$ac_cv_search_clock_gettime
- if test "$ac_res" != no; then
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-- conky_LIBS="$conky_LIBS -lrt"
-+ conky_LIBS="$conky_LIBS "
+@@ -11657,7 +11657,7 @@ $as_echo "#define APCUPSD 1" >>confdefs.h
- cat >>confdefs.h <<\_ACEOF
- #define HAVE_CLOCK_GETTIME 1
+ fi
+ fi
+- if test x$want_apcupsd = xyes; then
++ if test x"$want_apcupsd" = xyes; then
+ BUILD_APCUPSD_TRUE=
+ BUILD_APCUPSD_FALSE='#'
+ else
Index: patches/patch-src_conky_c
===================================================================
RCS file: patches/patch-src_conky_c
diff -N patches/patch-src_conky_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_conky_c 22 Apr 2011 08:20:15 -0000
@@ -0,0 +1,47 @@
+$OpenBSD$
+--- src/conky.c.orig Tue Oct 5 23:29:36 2010
++++ src/conky.c Tue Apr 19 19:44:03 2011
+@@ -125,7 +125,7 @@
+
+ /* FIXME: apm_getinfo is unused here. maybe it's meant for common.c */
+ #if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \
+- || defined(__OpenBSD__)) && (defined(i386) || defined(__i386__))
++ || defined(__OpenBSD__))
+ int apm_getinfo(int fd, apm_info_t aip);
+ char *get_apm_adapter(void);
+ char *get_apm_battery_life(void);
+@@ -401,10 +401,6 @@ static int maximum_width;
+
+ #endif /* X11 */
+
+-#ifdef __OpenBSD__
+-static int sensor_device;
+-#endif
+-
+ long color0, color1, color2, color3, color4, color5, color6, color7, color8,
+ color9;
+
+@@ -1914,7 +1910,7 @@ void generate_text_internal(char *p, int p_max_size,
+ }
+ #endif /* __linux__ */
+ #if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \
+- || defined(__OpenBSD__)) && (defined(i386) || defined(__i386__))
++ || defined(__OpenBSD__))
+ OBJ(apm_adapter) {
+ char *msg;
+
+@@ -3534,12 +3530,14 @@ static void main_loop(void)
+ if(update_interval_bat != NOBATTERY && update_interval_bat !=
update_interval_old) {
+ char buf[max_user_text];
+
++#ifndef __OpenBSD__
+ get_battery_short_status(buf, max_user_text, "BAT0");
+ if(buf[0] == 'D') {
+ update_interval = update_interval_bat;
+ } else {
+ update_interval = update_interval_old;
+ }
++#endif
+ }
+ info.looped++;
+
Index: patches/patch-src_conky_h
===================================================================
RCS file: patches/patch-src_conky_h
diff -N patches/patch-src_conky_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_conky_h 22 Apr 2011 08:20:15 -0000
@@ -0,0 +1,11 @@
+$OpenBSD$
+--- src/conky.h.orig Tue Apr 19 19:05:01 2011
++++ src/conky.h Tue Apr 19 19:05:27 2011
+@@ -34,6 +34,7 @@
+ #include "config.h" /* defines */
+ #include "common.h" /* at least for struct dns_data */
+ #include <sys/utsname.h> /* struct uname_s */
++#include <netinet/in.h>
+ #include <arpa/inet.h>
+
+ #if defined(HAS_MCHECK_H)
Index: patches/patch-src_core_c
===================================================================
RCS file: patches/patch-src_core_c
diff -N patches/patch-src_core_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_core_c 22 Apr 2011 08:20:15 -0000
@@ -0,0 +1,24 @@
+$OpenBSD$
+--- src/core.c.orig Tue Oct 5 23:29:36 2010
++++ src/core.c Tue Apr 19 19:43:51 2011
+@@ -170,9 +170,9 @@ struct text_object *construct_text_object(const char *
+ #else
+ NORM_ERR("acpiacadapter: arg is only used on linux");
+ #endif
+- }
++ } END
+ #endif /* !__OpenBSD__ */
+- END OBJ(freq, 0)
++ OBJ(freq, 0)
+ get_cpu_count();
+ if (!arg || !isdigit(arg[0]) || strlen(arg) >= 2 ||
atoi(&arg[0]) == 0
+ || atoi(&arg[0]) > info.cpu_count) {
+@@ -860,7 +860,7 @@ struct text_object *construct_text_object(const char *
+ END OBJ(gw_ip, &update_gateway_info)
+ #endif /* !__linux__ */
+ #if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \
+- || defined(__OpenBSD__)) && (defined(i386) || defined(__i386__))
++ || defined(__OpenBSD__))
+ END OBJ(apm_adapter, 0)
+ END OBJ(apm_battery_life, 0)
+ END OBJ(apm_battery_time, 0)
Index: patches/patch-src_openbsd_c
===================================================================
RCS file: /cvs/ports/sysutils/conky/patches/patch-src_openbsd_c,v
retrieving revision 1.9
diff -u -p -r1.9 patch-src_openbsd_c
--- patches/patch-src_openbsd_c 25 Oct 2010 18:11:26 -0000 1.9
+++ patches/patch-src_openbsd_c 22 Apr 2011 08:20:15 -0000
@@ -1,42 +1,178 @@
-$OpenBSD: patch-src_openbsd_c,v 1.9 2010/10/25 18:11:26 sthen Exp $
---- src/openbsd.c.orig Sat Aug 8 22:05:55 2009
-+++ src/openbsd.c Mon Oct 25 20:05:06 2010
-@@ -271,7 +271,7 @@ void update_total_processes()
+$OpenBSD$
+
+declarations in common.h got changed, but upstream forgot to do the
+corresponding changes into openbsd.c
+
+--- src/openbsd.c.orig Tue Oct 5 23:29:36 2010
++++ src/openbsd.c Tue Apr 19 19:40:39 2011
+@@ -140,7 +140,7 @@ int check_mount(char *s)
+ return 0;
+ }
+
+-void update_uptime()
++int update_uptime()
+ {
+ int mib[2] = { CTL_KERN, KERN_BOOTTIME };
+ struct timeval boottime;
+@@ -155,9 +155,10 @@ void update_uptime()
+ NORM_ERR("Could not get uptime");
+ info.uptime = 0;
+ }
++ return 0;
+ }
+
+-void update_meminfo()
++int update_meminfo()
+ {
+ static int mib[2] = { CTL_VM, VM_METER };
+ struct vmtotal vmtotal;
+@@ -194,9 +195,10 @@ void update_meminfo()
+ info.swap = 0;
+ info.swapfree = 0;
+ }
++ return 0;
+ }
+
+-void update_net_stats()
++int update_net_stats()
+ {
+ struct net_stat *ns;
+ double delta;
+@@ -207,11 +209,11 @@ void update_net_stats()
+ /* get delta */
+ delta = current_update_time - last_update_time;
+ if (delta <= 0.0001) {
+- return;
++ return 0;
+ }
+
+ if (getifaddrs(&ifap) < 0) {
+- return;
++ return 0;
+ }
+
+ for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
+@@ -266,19 +268,23 @@ void update_net_stats()
+ }
+
+ freeifaddrs(ifap);
++ return 0;
+ }
+
+-void update_total_processes()
++int update_total_processes()
+ {
int n_processes;
++ int max_size = sizeof(struct kinfo_proc);
++
kvm_init();
- kvm_getprocs(kd, KERN_PROC_ALL, 0, &n_processes);
-+ kvm_getproc2(kd, KERN_PROC_ALL, 0, sizeof(n_processes), &n_processes);
++ kvm_getprocs(kd, KERN_PROC_ALL, 0, max_size, &n_processes);
info.procs = n_processes;
++ return 0;
+ }
+
+-void update_running_processes()
++int update_running_processes()
+ {
+ struct kinfo_proc2 *p;
+ int n_processes;
+@@ -295,6 +301,7 @@ void update_running_processes()
+ }
+
+ info.run_procs = cnt;
++ return 0;
+ }
+
+ /* new SMP code can be enabled by commenting the following line */
+@@ -343,7 +350,7 @@ void get_cpu_count()
+ #endif
+ }
+
+-void update_cpu_usage()
++int update_cpu_usage()
+ {
+ #ifdef OLDCPU
+ int mib[2] = { CTL_KERN, KERN_CPTIME };
+@@ -427,9 +434,10 @@ void update_cpu_usage()
+ oldtotal[i] = total;
+ }
+ #endif
++ return 0;
+ }
+
+-void update_load_average()
++int update_load_average()
+ {
+ double v[3];
+
+@@ -438,6 +446,7 @@ void update_load_average()
+ info.loadavg[0] = (float) v[0];
+ info.loadavg[1] = (float) v[1];
+ info.loadavg[2] = (float) v[2];
++ return 0;
+ }
+
+ #define OBSD_MAX_SENSORS 256
+@@ -606,10 +615,11 @@ char get_freq(char *p_client_buffer, size_t client_buf
+ return 1;
+ }
+
+-void update_top()
++int update_top()
+ {
+ kvm_init();
+ proc_find_top(info.cpu, info.memu);
++ return 0;
}
-@@ -454,14 +454,13 @@ void update_obsd_sensors()
- dev = obsd_sensors.device; // FIXME: read more than one device
+ #if 0
+@@ -665,19 +675,11 @@ cleanup:
+ }
+ #endif
+
+-void clear_diskio_stats()
++int update_diskio()
+ {
++ return 0; /* XXX: implement? hifi: not sure how */
+ }
+
+-struct diskio_stat *prepare_diskio_stat(const char *s)
+-{
+-}
+-
+-void update_diskio()
+-{
+- return; /* XXX: implement? hifi: not sure how */
+-}
+-
+ /* While topless is obviously better, top is also not bad. */
+
+ int comparecpu(const void *a, const void *b)
+@@ -784,7 +786,6 @@ inline void proc_find_top(struct process **cpu, struct
+ free(processes);
+ }
+
+-#if defined(i386) || defined(__i386__)
+ #define APMDEV "/dev/apm"
+ #define APM_UNKNOWN 255
+
+@@ -908,7 +909,6 @@ char *get_apm_battery_time()
+ return out;
+ }
-- /* for (dev = 0; dev < MAXSENSORDEVICES; dev++) { */
-+ for (dev = 0; dev < MAXSENSORDEVICES; dev++) {
- mib[2] = dev;
- if (sysctl(mib, 3, &sensordev, &sdlen, NULL, 0) == -1) {
-- if (errno != ENOENT) {
-- warn("sysctl");
-- }
-- return;
-- // continue;
-+ if (errno == ENOENT) /* end of sensors */
-+ return;
-+ if (errno == ENXIO) /* missing e.g. usb sensor that was
unplugged */
-+ continue;
- }
- for (type = 0; type < SENSOR_MAX_TYPES; type++) {
- mib[3] = type;
-@@ -496,7 +495,8 @@ void update_obsd_sensors()
- sensor_cnt++;
- }
- }
-- /* } */
-+ break; // FIXME: read more than one device
-+ }
+-#endif
- init_sensors = 1;
+ /* empty stubs so conky links */
+ void prepare_update()
+@@ -923,8 +923,4 @@ int get_entropy_avail(unsigned int *val)
+ int get_entropy_poolsize(unsigned int *val)
+ {
+ return 1;
+-}
+-
+-void free_all_processes(void)
+-{
}
Index: patches/patch-src_openbsd_h
===================================================================
RCS file: /cvs/ports/sysutils/conky/patches/patch-src_openbsd_h,v
retrieving revision 1.3
diff -u -p -r1.3 patch-src_openbsd_h
--- patches/patch-src_openbsd_h 27 Apr 2010 20:56:11 -0000 1.3
+++ patches/patch-src_openbsd_h 22 Apr 2011 08:20:15 -0000
@@ -1,45 +1,30 @@
-$OpenBSD: patch-src_openbsd_h,v 1.3 2010/04/27 20:56:11 sthen Exp $
---- src/openbsd.h.orig Sat Aug 8 21:05:55 2009
-+++ src/openbsd.h Tue Apr 27 20:38:57 2010
-@@ -11,38 +11,15 @@ 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);
+$OpenBSD$
+--- src/openbsd.h.orig Tue Oct 5 23:29:36 2010
++++ src/openbsd.h Tue Apr 19 18:44:53 2011
+@@ -3,7 +3,12 @@
+ #ifndef OPENBSD_H_
+ #define OPENBSD_H_
+#ifndef MAXSENSORDEVICES
+#define MAXSENSORDEVICES 1024
+#endif
- #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;
--
++
+ #include "common.h"
++#include "temphelper.h"
+ #include <sys/param.h>
+ #include <sys/sysctl.h>
+ #include <sys/sensors.h>
+@@ -16,11 +21,11 @@ void print_obsd_sensors_volt(struct text_object *, cha
+ void get_obsd_vendor(char *buf, size_t client_buffer_size);
+ void get_obsd_product(char *buf, size_t client_buffer_size);
+
-#if defined(i386) || defined(__i386__)
--typedef struct apm_power_info *apm_info_t;
+ typedef struct apm_power_info *apm_info_t;
-#endif
--
--#endif /*OPENBSD_H_*/
--#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;
+ int get_entropy_avail(unsigned int *);
+ int get_entropy_poolsize(unsigned int *);
++
++static int sensor_device;
+
+ #endif /*OPENBSD_H_*/
Index: patches/patch-src_text_object_h
===================================================================
RCS file: patches/patch-src_text_object_h
diff -N patches/patch-src_text_object_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_text_object_h 22 Apr 2011 08:20:15 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- src/text_object.h.orig Tue Apr 19 19:42:09 2011
++++ src/text_object.h Tue Apr 19 19:42:32 2011
+@@ -311,7 +311,7 @@ enum text_object_type {
+ OBJ_pop3_unseen,
+ OBJ_pop3_used,
+ #if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \
+- || defined(__OpenBSD__)) && (defined(i386) || defined(__i386__))
++ || defined(__OpenBSD__))
+ OBJ_apm_adapter,
+ OBJ_apm_battery_time,
+ OBJ_apm_battery_life,
Index: patches/patch-src_xmms2_c
===================================================================
RCS file: patches/patch-src_xmms2_c
diff -N patches/patch-src_xmms2_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_xmms2_c 22 Apr 2011 08:20:15 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- src/xmms2.c.orig Tue Apr 19 20:22:11 2011
++++ src/xmms2.c Tue Apr 19 20:22:30 2011
+@@ -223,7 +223,7 @@ int handle_playback_state_change(xmmsv_t *value, void
+ break;
+ case XMMS_PLAYBACK_STATUS_STOP:
+ strncpy(ptr->xmms2.status, "Stopped",
text_buffer_size - 1);
+- ptr->xmms2.elapsed = ptr->xmms2.progress =
ptr->xmms2.percent = 0;
++ ptr->xmms2.elapsed = ptr->xmms2.progress = 0;
+ break;
+ default:
+ strncpy(ptr->xmms2.status, "Unknown",
text_buffer_size - 1);
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/sysutils/conky/pkg/PLIST,v
retrieving revision 1.5
diff -u -p -r1.5 PLIST
--- pkg/PLIST 23 Nov 2009 16:46:27 -0000 1.5
+++ pkg/PLIST 22 Apr 2011 08:20:15 -0000
@@ -12,3 +12,5 @@ share/examples/conky/
@sample ${SYSCONFDIR}/conky/
share/examples/conky/conky.conf
@sample ${SYSCONFDIR}/conky/conky.conf
+share/examples/conky/conky_no_x11.conf
+@sample ${SYSCONFDIR}/conky/conky_no_x11.conf