conky: avoid commons, from Ryan Boggs

while there, switch from sourceforge to github upstream (there are many
new versions since this one, but the patches to get it to work on newer
openbsd versions haven't been fed upstream and upstream aren't keeping this
building themselves, so updating is a bit challenging, I made a start in
openbsd-wip but am not likely to finish it myself)
This commit is contained in:
sthen 2021-02-11 16:11:14 +00:00
parent f4a5b833ad
commit 55d4035f03
6 changed files with 105 additions and 26 deletions

View File

@ -1,15 +1,19 @@
# $OpenBSD: Makefile,v 1.60 2020/07/17 08:36:04 tb Exp $
# $OpenBSD: Makefile,v 1.61 2021/02/11 16:11:14 sthen Exp $
ONLY_FOR_ARCHS= ${APM_ARCHS}
COMMENT= light-weight system monitor
DISTNAME= conky-1.9.0
CATEGORIES= sysutils
HOMEPAGE= http://conky.sourceforge.net/
REVISION= 20
# there's a start of an attempt to update to a recent version in openbsd-wip
GH_ACCOUNT= brndnmtthws
GH_PROJECT= conky
GH_TAGNAME= 1.9.0
REVISION= 21
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=conky/}
# remove after updating:
DISTFILES= conky_0-{}${GH_TAGNAME}.tar.gz
CATEGORIES= sysutils
# mostly GPLv3; see COPYING
PERMIT_PACKAGE= Yes
@ -29,6 +33,24 @@ LIB_DEPENDS= devel/glib2 \
FLAVORS= no_x11 xmms2
FLAVOR?=
CONFIGURE_STYLE= autoreconf
AUTOCONF_VERSION= 2.69
AUTOMAKE_VERSION= 1.16
BUILD_DEPENDS= textproc/docbook2x
AUTORECONF= ${WRKSRC}/autogen.sh
CONFIGURE_ARGS= --enable-mpd \
--enable-rss \
--disable-config-output \
--disable-moc \
--disable-portmon \
--enable-lua \
--enable-curl \
--with-libiconv-prefix="${LOCALBASE}"
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" LDFLAGS="-L${LOCALBASE}/lib" \
LUA_CFLAGS="`pkg-config --cflags ${MODLUA_DEP}`" \
LUA_LIBS="`pkg-config --libs ${MODLUA_DEP}`"
.if ${FLAVOR:Mno_x11}
. if ${FLAVOR:Mxmms2}
ERRORS+="Fatal: nonsense combination of flavors"
@ -52,19 +74,6 @@ 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 \
--with-libiconv-prefix="${LOCALBASE}"
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" LDFLAGS="-L${LOCALBASE}/lib" \
LUA_CFLAGS="`pkg-config --cflags ${MODLUA_DEP}`" \
LUA_LIBS="`pkg-config --libs ${MODLUA_DEP}`"
post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/conky
${INSTALL_DATA} ${WRKSRC}/doc/*.html ${PREFIX}/share/doc/conky

View File

@ -1,2 +1,2 @@
SHA256 (conky-1.9.0.tar.gz) = HedU13smcfaHlf25/FBjKKFmjdbKAJhMP0l5CmbTaMo=
SIZE (conky-1.9.0.tar.gz) = 800797
SHA256 (conky_0-1.9.0.tar.gz) = ERHFiC2PVTBZkKKhkhA9BdPY76Htyr2HFMQdg6+b8kQ=
SIZE (conky_0-1.9.0.tar.gz) = 314143

View File

@ -0,0 +1,20 @@
$OpenBSD: patch-doc_Makefile_am,v 1.1 2021/02/11 16:11:14 sthen Exp $
Index: doc/Makefile.am
--- doc/Makefile.am.orig
+++ doc/Makefile.am
@@ -10,14 +10,6 @@ conky.1: command_options.xml config_settings.xml docs.
${db2x_xsltproc_cmd} -s man ${srcdir}/docs.xml -o docs.mxml
${db2x_manxml_cmd} docs.mxml
${xsltproc_cmd} http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl ${srcdir}/docs.xml > docs.html
- man -P 'less -is' ./conky.1 > README
- sed -i "s/[[:cntrl:]]\[[0-9]*m//g" README
- sed -i "s/\xE2//g" README
- sed -i "s/\x80//g" README
- sed -i "s/\x90/-/g" README
- sed -i "s/\x94/-/g" README
- sed -i "s/\x9f/-/g" README
- mv README ${top_srcdir}
xsltproc ${srcdir}/variables.xsl ${srcdir}/variables.xml > variables.html
xsltproc ${srcdir}/config_settings.xsl ${srcdir}/config_settings.xml > config_settings.html
xsltproc ${srcdir}/lua.xsl ${srcdir}/lua.xml > lua.html

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-src_common_c,v 1.1 2021/02/11 16:11:14 sthen Exp $
Index: src/common.c
--- src/common.c.orig
+++ src/common.c
@@ -387,8 +387,6 @@ static void *run_update_callback(void *data)
}
}
-int no_buffers;
-
void update_stuff(void)
{
int i;

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-src_conky_c,v 1.7 2018/09/23 21:00:17 sthen Exp $
$OpenBSD: patch-src_conky_c,v 1.8 2021/02/11 16:11:14 sthen Exp $
Correctly change update_interval based on whether AC is plugged in
or on battery for OpenBSD.
@ -26,7 +26,22 @@ Index: src/conky.c
long color0, color1, color2, color3, color4, color5, color6, color7, color8,
color9;
@@ -1015,7 +1011,7 @@ void generate_text_internal(char *p, int p_max_size,
@@ -418,11 +414,13 @@ unsigned int text_buffer_size = DEFAULT_TEXT_BUFFER_SI
int utf8_mode = 0;
/* no buffers in used memory? */
-int no_buffers;
+int no_buffers = 0;
/* pad percentages to decimals? */
static int pad_percents = 0;
+enum IFUP_STRICTNESS ifup_strictness = IFUP_UP;
+
static char *global_text = 0;
char *get_global_text(void)
@@ -1015,7 +1013,7 @@ void generate_text_internal(char *p, int p_max_size,
get_powerbook_batt_info(p, p_max_size, obj->data.i);
}
#endif /* __linux__ */
@ -35,7 +50,7 @@ Index: src/conky.c
OBJ(if_up) {
if (!interface_up(obj)) {
DO_JUMP;
@@ -1899,7 +1895,7 @@ void generate_text_internal(char *p, int p_max_size,
@@ -1899,7 +1897,7 @@ void generate_text_internal(char *p, int p_max_size,
}
#endif /* __linux__ */
#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \
@ -44,7 +59,7 @@ Index: src/conky.c
OBJ(apm_adapter) {
char *msg;
@@ -3494,6 +3490,7 @@ static void main_loop(void)
@@ -3494,6 +3492,7 @@ static void main_loop(void)
info.looped = 0;
while (terminate == 0 && (total_run_times == 0 || info.looped < total_run_times)) {
if(update_interval_bat != NOBATTERY && update_interval_bat != update_interval_old) {
@ -52,7 +67,7 @@ Index: src/conky.c
char buf[max_user_text];
get_battery_short_status(buf, max_user_text, "BAT0");
@@ -3502,6 +3499,18 @@ static void main_loop(void)
@@ -3502,6 +3501,18 @@ static void main_loop(void)
} else {
update_interval = update_interval_old;
}

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-src_conky_h,v 1.3 2021/02/11 16:11:14 sthen Exp $
Index: src/conky.h
--- src/conky.h.orig
+++ src/conky.h
@@ -206,11 +206,13 @@ enum {
/* if_up strictness selector
* needed by conky.c and linux.c (and potentially others) */
-enum {
+enum IFUP_STRICTNESS {
IFUP_UP,
IFUP_LINK,
IFUP_ADDR
-} ifup_strictness;
+};
+
+extern enum IFUP_STRICTNESS ifup_strictness;
struct information {
unsigned int mask;