On Mon Apr 21, 2025 at 04:14:10PM +0200, Rafael Sadowski wrote:
> On Mon Apr 21, 2025 at 01:24:44PM +0100, Stuart Henderson wrote:
> > Firstly, no need for python.port.mk bits if you just want a BDEP on
> > pypandoc, just add the dep.
> > 
> > But, adding a pandoc dep makes it arm64/amd64 only. Can you disable the
> > cmake doc building and use the steps from
> > https://github.com/brndnmtthws/conky/tree/main/doc with a different
> > markdown->text converter (e.g. lowdown) instead?
> > 
> 
> New diff:
> 
> - Added new build dependency on gperf
> - Remove APP_SED (unused)
> - Fix man1 directory
> - Add a logic to use pypandoc or lowdown to generate the man page. (You
>   could push this upstream if you adjust the docs.)
> 

Readded python, we need it for the first docs tasks:

    add_custom_target(man.md
        ALL
        COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/render.py 
man.md.j2 > ${CMAKE_CURRENT_BINARY_DIR}/man.md
        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
        SOURCES config_settings.yaml variables.yaml lua.yaml man.md.j2
    )

diff --git a/sysutils/conky/Makefile b/sysutils/conky/Makefile
index f1a6fe43fcd..ea0a2c2c39d 100644
--- a/sysutils/conky/Makefile
+++ b/sysutils/conky/Makefile
@@ -1,83 +1,58 @@
-ONLY_FOR_ARCHS= ${APM_ARCHS}
+ONLY_FOR_ARCHS = ${APM_ARCHS}
 
-COMMENT=       light-weight system monitor
+COMMENT =      light-weight system monitor
 
-# 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=      24
+GH_ACCOUNT =   brndnmtthws
+GH_PROJECT =   conky
+GH_TAGNAME =   v1.22.1
 
-# remove after updating:
-DISTFILES=     conky_0-{}${GH_TAGNAME}.tar.gz
-
-CATEGORIES=    sysutils
+CATEGORIES =   sysutils
 
 # mostly GPLv3; see COPYING
 PERMIT_PACKAGE=        Yes
 
-WANTLIB += ${MODLUA_WANTLIB} X11-xcb c crypto curl curses glib-2.0 iconv
-WANTLIB += intl kvm lzma m nghttp2 nghttp3 ngtcp2 ngtcp2_crypto_quictls
-WANTLIB += ossaudio pcre2-8 pthread ssl xcb-shm xml2 z
+WANTLIB += ${COMPILER_LIBCXX} ${MODLUA_WANTLIB} c curses intl kvm m ossaudio
+WANTLIB += curl xml2
+
+MODULES =      devel/cmake \
+               lang/lua \
+               lang/python
+
+# dependency to build docs
+MODPY_RUNDEP = No
 
-MODULES=       lang/lua
-MODLUA_SA=     Yes
+MODLUA_VERSION =       5.3
 
-LIB_DEPENDS=   devel/glib2 \
-               net/curl \
+BUILD_DEPENDS =        textproc/lowdown \
+               devel/gperf
+
+LIB_DEPENDS =  net/curl \
                textproc/libxml \
                ${MODLUA_LIB_DEPENDS}
 
-FLAVORS=       no_x11 xmms2
+FLAVORS =      no_x11
 FLAVOR?=
 
-CONFIGURE_STYLE= autoreconf
-AUTOCONF_VERSION= 2.69
-AUTOMAKE_VERSION= 1.16
-BUILD_DEPENDS= textproc/docbook2x \
-               textproc/docbook-xsl
-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}`"
+CONFIGURE_ARGS =       -DBUILD_AUDACIOUS=OFF \
+                       -DBUILD_HDDTEMP=OFF \
+                       -DBUILD_IBM=OFF \
+                       -DBUILD_MOC=OFF \
+                       -DBUILD_IOSTATS=OFF \
+                       -DBUILD_PORT_MONITORS=OFF
+
+CONFIGURE_ARGS +=      -DBUILD_RSS=ON \
+                       -DBUILD_CURL=ON
+
+CONFIGURE_ARGS +=      -DBUILD_DOCS=ON \
+                       -DUSE_LOWDOWN=ON \
+                       -DUSE_PANDOC=OFF
 
 .if ${FLAVOR:Mno_x11}
-.  if ${FLAVOR:Mxmms2}
-ERRORS+="Fatal: nonsense combination of flavors"
-.  else
-CONFIGURE_ARGS+=--disable-double-buffer \
-               --disable-own-window \
-               --disable-xdamage \
-               --disable-xft \
-               --disable-x11
-.  endif
+CONFIGURE_ARGS +=      -DBUILD_X11=OFF
 .else
-CONFIGURE_ARGS+=--enable-imlib2
-LIB_DEPENDS+=  graphics/imlib2
-WANTLIB += Imlib2 X11 Xdamage Xext Xfixes Xft
-WANTLIB += Xrender expat fontconfig freetype xcb
-.endif
-
-.if ${FLAVOR:Mxmms2}
-CONFIGURE_ARGS+=--enable-xmms2
-LIB_DEPENDS+=  audio/xmms2
-WANTLIB+=      xmmsclient
+CONFIGURE_ARGS +=      -DBUILD_X11=ON
+LIB_DEPENDS +=         graphics/imlib2
+WANTLIB += ICE Imlib2 SM X11 Xdamage Xext Xfixes Xft Xinerama fontconfig xcb
 .endif
 
-post-install:
-       ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/conky
-       ${INSTALL_DATA} ${WRKSRC}/doc/*.html ${PREFIX}/share/doc/conky
-       ${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/conky
-
-FAKE_FLAGS=    configdir=${PREFIX}/share/examples/conky
-
 .include <bsd.port.mk>
diff --git a/sysutils/conky/distinfo b/sysutils/conky/distinfo
index 39328f418c2..17e499c3540 100644
--- a/sysutils/conky/distinfo
+++ b/sysutils/conky/distinfo
@@ -1,2 +1,2 @@
-SHA256 (conky_0-1.9.0.tar.gz) = ERHFiC2PVTBZkKKhkhA9BdPY76Htyr2HFMQdg6+b8kQ=
-SIZE (conky_0-1.9.0.tar.gz) = 314143
+SHA256 (conky-1.22.1.tar.gz) = mVn95xnT1DQKuXOq2+uXoD6fa/T5KL4N5pz7AocdUi4=
+SIZE (conky-1.22.1.tar.gz) = 2024889
diff --git a/sysutils/conky/patches/patch-CMakeLists_txt 
b/sysutils/conky/patches/patch-CMakeLists_txt
new file mode 100644
index 00000000000..751a4da5cb4
--- /dev/null
+++ b/sysutils/conky/patches/patch-CMakeLists_txt
@@ -0,0 +1,22 @@
+Index: CMakeLists.txt
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -82,12 +82,16 @@ if(BUILD_TESTING)
+ endif()
+ 
+ if(NOT DEFINED DOC_PATH)
+-  set(DOC_PATH "share/doc/${CPACK_PACKAGE_NAME}-${RELEASE_VERSION}")
++  set(DOC_PATH "share/doc/${CPACK_PACKAGE_NAME}")
+ endif(NOT DEFINED DOC_PATH)
+ 
+-set(DOC_FILES extras/convert.lua data/conky_no_x11.conf data/conky.conf)
++if(NOT DEFINED SAMPLE_PATH)
++  set(SAMPLE_PATH "share/examples/${CPACK_PACKAGE_NAME}")
++endif(NOT DEFINED SAMPLE_PATH)
++set(SAMPLE_FILES extras/convert.lua data/conky_no_x11.conf data/conky.conf)
+ 
+ install(FILES ${DOC_FILES} DESTINATION ${DOC_PATH})
++install(FILES ${SAMPLE_FILES} DESTINATION ${SAMPLE_PATH})
+ 
+ if(CHECK_CODE_QUALITY)
+   find_package(ClangTidy)
diff --git a/sysutils/conky/patches/patch-cmake_Conky_cmake 
b/sysutils/conky/patches/patch-cmake_Conky_cmake
new file mode 100644
index 00000000000..d0f8b6ceebe
--- /dev/null
+++ b/sysutils/conky/patches/patch-cmake_Conky_cmake
@@ -0,0 +1,12 @@
+Index: cmake/Conky.cmake
+--- cmake/Conky.cmake.orig
++++ cmake/Conky.cmake
+@@ -18,7 +18,7 @@
+ # along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ #
+ 
+-# set(RELEASE true)
++set(RELEASE true)
+ 
+ # Set system vars
+ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
diff --git a/sysutils/conky/patches/patch-data_conky_no_x11_conf 
b/sysutils/conky/patches/patch-data_conky_no_x11_conf
deleted file mode 100644
index 98345b05f75..00000000000
--- a/sysutils/conky/patches/patch-data_conky_no_x11_conf
+++ /dev/null
@@ -1,12 +0,0 @@
---- data/conky_no_x11.conf.orig        Thu May  3 23:08:27 2012
-+++ data/conky_no_x11.conf     Fri Aug 10 13:47:45 2012
-@@ -27,7 +27,8 @@ background no
- cpu_avg_samples 2
- net_avg_samples 2
- no_buffers yes
--out_to_stderr no
-+out_to_x no
-+out_to_ncurses yes
- update_interval 1.0
- uppercase no
- use_spacer none
diff --git a/sysutils/conky/patches/patch-doc_CMakeLists_txt 
b/sysutils/conky/patches/patch-doc_CMakeLists_txt
new file mode 100644
index 00000000000..fd9e28309ac
--- /dev/null
+++ b/sysutils/conky/patches/patch-doc_CMakeLists_txt
@@ -0,0 +1,44 @@
+Index: doc/CMakeLists.txt
+--- doc/CMakeLists.txt.orig
++++ doc/CMakeLists.txt
+@@ -25,15 +25,33 @@ if(BUILD_DOCS)
+         WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+         SOURCES config_settings.yaml variables.yaml lua.yaml man.md.j2
+     )
+-    set(pandoc_mode markdown-markdown_in_html_blocks+raw_html)
+-    add_custom_target(conky.1
+-        ALL
+-        COMMAND ${APP_PANDOC} --standalone -f ${pandoc_mode} -t man 
${CMAKE_CURRENT_BINARY_DIR}/man.md > ${CMAKE_CURRENT_BINARY_DIR}/conky.1
+-        SOURCES config_settings.yaml variables.yaml lua.yaml man.md.j2
+-    )
++
++    option(USE_PANDOC "Use Pandoc to generate manpage" ON)
++    option(USE_LOWDOWN "Use Lowdown to generate manpage" OFF)
++
++    if(USE_PANDOC)
++        message(STATUS "Using Pandoc to generate manpage.")
++        set(pandoc_mode markdown-markdown_in_html_blocks+raw_html)
++        add_custom_target(conky.1
++            ALL
++            COMMAND ${APP_PANDOC} --standalone -f ${pandoc_mode} -t man 
${CMAKE_CURRENT_BINARY_DIR}/man.md > ${CMAKE_CURRENT_BINARY_DIR}/conky.1
++            SOURCES config_settings.yaml variables.yaml lua.yaml man.md.j2
++        )
++    elseif(USE_LOWDOWN)
++        message(STATUS "Using Lowdown to generate manpage.")
++        find_program(LOWDOWN_EXECUTABLE NAMES lowdown REQUIRED)
++        add_custom_target(conky.1
++            ALL
++            COMMAND ${LOWDOWN_EXECUTABLE} -s -Tman 
${CMAKE_CURRENT_BINARY_DIR}/man.md > ${CMAKE_CURRENT_BINARY_DIR}/conky.1
++            SOURCES config_settings.yaml variables.yaml lua.yaml man.md.j2
++        )
++    else()
++        message(FATAL_ERROR "You must enable either USE_PANDOC or USE_LOWDOWN 
to build the manpage.")
++    endif()
++
+     add_dependencies(conky.1 man.md)
+ 
+-    set(MAN_PATH "share/man/man1")
++    set(MAN_PATH "man/man1")
+     set(MAN_FILES ${CMAKE_CURRENT_BINARY_DIR}/conky.1)
+ 
+     install(FILES ${DOC_FILES} DESTINATION ${DOC_PATH})
diff --git a/sysutils/conky/patches/patch-doc_Makefile_am 
b/sysutils/conky/patches/patch-doc_Makefile_am
deleted file mode 100644
index 0d1a2172c2a..00000000000
--- a/sysutils/conky/patches/patch-doc_Makefile_am
+++ /dev/null
@@ -1,18 +0,0 @@
-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
diff --git a/sysutils/conky/patches/patch-lua_CMakeLists_txt 
b/sysutils/conky/patches/patch-lua_CMakeLists_txt
new file mode 100644
index 00000000000..e95430d797b
--- /dev/null
+++ b/sysutils/conky/patches/patch-lua_CMakeLists_txt
@@ -0,0 +1,12 @@
+Index: lua/CMakeLists.txt
+--- lua/CMakeLists.txt.orig
++++ lua/CMakeLists.txt
+@@ -27,6 +27,8 @@ add_definitions(-DTOLUA_RELEASE)
+ if(BUILD_LUA_CAIRO)
+   include_directories(${luacairo_includes} ${CMAKE_CURRENT_SOURCE_DIR})
+ 
++  link_directories(${LIBS})
++
+   # cairo_set_dash() needs this special hack to work properly if you have a
+   # better solution, please let me know
+   wrap_tolua(luacairo_src cairo.pkg libcairo.patch)
diff --git a/sysutils/conky/patches/patch-src_common_c 
b/sysutils/conky/patches/patch-src_common_c
deleted file mode 100644
index bfc729d6f8a..00000000000
--- a/sysutils/conky/patches/patch-src_common_c
+++ /dev/null
@@ -1,12 +0,0 @@
-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;
diff --git a/sysutils/conky/patches/patch-src_conky_c 
b/sysutils/conky/patches/patch-src_conky_c
deleted file mode 100644
index 48e5a1adaae..00000000000
--- a/sysutils/conky/patches/patch-src_conky_c
+++ /dev/null
@@ -1,86 +0,0 @@
-Correctly change update_interval based on whether AC is plugged in
-or on battery for OpenBSD.
-
-Index: src/conky.c
---- src/conky.c.orig
-+++ src/conky.c
-@@ -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;
- 
-@@ -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__ */
--#if (defined(__FreeBSD__) || defined(__linux__))
-+#if (defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__linux__))
-                       OBJ(if_up) {
-                               if (!interface_up(obj)) {
-                                       DO_JUMP;
-@@ -1899,7 +1897,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;
- 
-@@ -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) {
-+#ifndef __OpenBSD__
-                       char buf[max_user_text];
- 
-                       get_battery_short_status(buf, max_user_text, "BAT0");
-@@ -3502,6 +3501,18 @@ static void main_loop(void)
-                       } else {
-                               update_interval = update_interval_old;
-                       }
-+#else
-+                      char *apm_status;
-+                      apm_status = get_apm_adapter();
-+                      if (apm_status != NULL) {
-+                if (strcmp(apm_status,"off-line") == 0) {
-+                                update_interval = update_interval_bat;
-+                      } else {
-+                                update_interval = update_interval_old;
-+                      }
-+                              free(apm_status);
-+            }
-+#endif
-               }
-               info.looped++;
- 
diff --git a/sysutils/conky/patches/patch-src_conky_h 
b/sysutils/conky/patches/patch-src_conky_h
deleted file mode 100644
index 61c040f3275..00000000000
--- a/sysutils/conky/patches/patch-src_conky_h
+++ /dev/null
@@ -1,19 +0,0 @@
-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;
diff --git a/sysutils/conky/patches/patch-src_core_c 
b/sysutils/conky/patches/patch-src_core_c
deleted file mode 100644
index 01138ecca4d..00000000000
--- a/sysutils/conky/patches/patch-src_core_c
+++ /dev/null
@@ -1,41 +0,0 @@
---- src/core.c.orig    Thu May  3 23:08:27 2012
-+++ src/core.c Tue Jul 24 18:10:39 2012
-@@ -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) {
-@@ -326,7 +326,7 @@ struct text_object *construct_text_object(const char *
-                       obj->data.i = PB_BATT_STATUS;
-               }
- #endif /* __linux__ */
--#if (defined(__FreeBSD__) || defined(__linux__))
-+#if (defined(__FreeBSD__) || defined (__OpenBSD__) || defined(__linux__))
-       END OBJ_IF_ARG(if_up, 0, "if_up needs an argument")
-               parse_if_up_arg(obj, arg);
- #endif
-@@ -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)
-@@ -1523,7 +1523,7 @@ void free_text_objects(struct text_object *root, int i
-                                       free(data.s);
-                               break;
- #endif
--#if (defined(__FreeBSD__) || defined(__linux__))
-+#if (defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__linux__))
-                       case OBJ_if_up:
-                               free_if_up(obj);
-                               break;
diff --git a/sysutils/conky/patches/patch-src_fs_c 
b/sysutils/conky/patches/patch-src_fs_c
deleted file mode 100644
index b6b26fc362c..00000000000
--- a/sysutils/conky/patches/patch-src_fs_c
+++ /dev/null
@@ -1,22 +0,0 @@
---- src/fs.c.orig      Tue Jul 24 18:26:13 2012
-+++ src/fs.c   Tue Jul 24 18:32:23 2012
-@@ -118,16 +118,16 @@ struct fs_stat *prepare_fs_stat(const char *s)
- 
- static void update_fs_stat(struct fs_stat *fs)
- {
--      struct statfs64 s;
-+      struct statfs s;
- 
--      if (statfs64(fs->path, &s) == 0) {
-+      if (statfs(fs->path, &s) == 0) {
-               fs->size = (long long)s.f_blocks * s.f_bsize;
-               /* bfree (root) or bavail (non-roots) ? */
-               fs->avail = (long long)s.f_bavail * s.f_bsize;
-               fs->free = (long long)s.f_bfree * s.f_bsize;
-               get_fs_type(fs->path, fs->type);
-       } else {
--              NORM_ERR("statfs64 '%s': %s", fs->path, strerror(errno));
-+              NORM_ERR("statfs '%s': %s", fs->path, strerror(errno));
-               fs->size = 0;
-               fs->avail = 0;
-               fs->free = 0;
diff --git a/sysutils/conky/patches/patch-src_llua_c 
b/sysutils/conky/patches/patch-src_llua_c
deleted file mode 100644
index 3d1289d25fd..00000000000
--- a/sysutils/conky/patches/patch-src_llua_c
+++ /dev/null
@@ -1,20 +0,0 @@
---- src/llua.c.orig    Wed Apr 27 14:37:28 2011
-+++ src/llua.c Wed Apr 27 14:39:18 2011
-@@ -28,6 +28,8 @@
- 
- #include <ctype.h>
- 
-+#include <sys/param.h>
-+
- #ifdef LUA_EXTRAS
- #include <tolua++.h>
- #endif /* LUA_EXTRAS */
-@@ -39,8 +41,6 @@ void llua_append_notify(const char *name);
- void llua_rm_notifies(void);
- static int llua_block_notify = 0;
- #endif /* HAVE_SYS_INOTIFY_H */
--
--#define MIN(a, b) ( (a) < (b) ? (a) : (b) )
- 
- static char *draw_pre_hook = 0;
- static char *draw_post_hook = 0;
diff --git a/sysutils/conky/patches/patch-src_mixer_c 
b/sysutils/conky/patches/patch-src_mixer_c
deleted file mode 100644
index a241e0fde7d..00000000000
--- a/sysutils/conky/patches/patch-src_mixer_c
+++ /dev/null
@@ -1,12 +0,0 @@
-Index: src/mixer.c
---- src/mixer.c.orig
-+++ src/mixer.c
-@@ -48,7 +48,7 @@
- #endif /* __OpenBSD__ */
- #endif /* HAVE_LINUX_SOUNDCARD_H */
- 
--#define MIXER_DEV "/dev/mixer"
-+#define MIXER_DEV "/dev/null"
- 
- static int mixer_fd;
- static const char *devs[] = SOUND_DEVICE_NAMES;
diff --git a/sysutils/conky/patches/patch-src_openbsd_c 
b/sysutils/conky/patches/patch-src_openbsd_c
deleted file mode 100644
index d72b7572d66..00000000000
--- a/sysutils/conky/patches/patch-src_openbsd_c
+++ /dev/null
@@ -1,400 +0,0 @@
-declarations in common.h got changed, but upstream forgot to do the
-corresponding changes into openbsd.c
-
-Adapt to new OpenBSD kinfo_proc API.
-
-Protect kvm_getprocs and global vars with mutexes.
-
-dkstat.h is going away on OpenBSD, so use sys/sched.h instead for CP_*
-
-Make "inline void proc_find_top" static to fix building with clang.
-
---- src/openbsd.c.orig Thu May  3 23:08:27 2012
-+++ src/openbsd.c      Wed Apr 19 22:14:41 2017
-@@ -28,10 +28,11 @@
-  *
-  */
- 
--#include <sys/dkstat.h>
- #include <sys/param.h>
-+#include <sys/sched.h>
- #include <sys/resource.h>
- #include <sys/socket.h>
-+#include <sys/proc.h>
- #include <sys/sysctl.h>
- #include <sys/time.h>
- #include <sys/types.h>
-@@ -53,6 +54,7 @@
- #include <ifaddrs.h>
- #include <limits.h>
- #include <unistd.h>
-+#include <pthread.h>
- #include <machine/apmvar.h>
- 
- #include <net80211/ieee80211.h>
-@@ -70,7 +72,7 @@
- #define LOG1024                       10
- #define pagetok(size) ((size) << pageshift)
- 
--inline void proc_find_top(struct process **cpu, struct process **mem);
-+static inline void proc_find_top(struct process **cpu, struct process **mem);
- 
- static short cpu_setup = 0;
- static kvm_t *kd = 0;
-@@ -81,6 +83,8 @@ size_t len = 0;
- int init_kvm = 0;
- int init_sensors = 0;
- 
-+pthread_mutex_t kvm_mutex = PTHREAD_MUTEX_INITIALIZER;
-+
- static int kvm_init()
- {
-       if (init_kvm) {
-@@ -140,7 +144,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 +159,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 +199,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 +213,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,28 +272,36 @@ void update_net_stats()
-       }
- 
-       freeifaddrs(ifap);
-+      return 0;
- }
- 
--void update_total_processes()
-+int update_total_processes()
- {
--      int n_processes;
-+      int n_processes = 0;
- 
-+      int max_size = sizeof(struct kinfo_proc);
-+
-       kvm_init();
--      kvm_getprocs(kd, KERN_PROC_ALL, 0, &n_processes);
-+      pthread_mutex_lock(&kvm_mutex);
-+      kvm_getprocs(kd, KERN_PROC_ALL, 0, max_size, &n_processes);
-+      pthread_mutex_unlock(&kvm_mutex);
- 
-       info.procs = n_processes;
-+      return 0;
- }
- 
--void update_running_processes()
-+int update_running_processes()
- {
--      struct kinfo_proc2 *p;
--      int n_processes;
-+      struct kinfo_proc *p;
-+      int n_processes = 0;
-       int i, cnt = 0;
- 
-       kvm_init();
--      int max_size = sizeof(struct kinfo_proc2);
-+      int max_size = sizeof(struct kinfo_proc);
- 
--      p = kvm_getproc2(kd, KERN_PROC_ALL, 0, max_size, &n_processes);
-+      pthread_mutex_lock(&kvm_mutex);
-+      p = kvm_getprocs(kd, KERN_PROC_ALL, 0, max_size, &n_processes);
-+      pthread_mutex_unlock(&kvm_mutex);
-       for (i = 0; i < n_processes; i++) {
-               if (p[i].p_stat == SRUN) {
-                       cnt++;
-@@ -295,96 +309,64 @@ void update_running_processes()
-       }
- 
-       info.run_procs = cnt;
-+      return 0;
- }
- 
--/* new SMP code can be enabled by commenting the following line */
--#define OLDCPU
--
--#ifdef OLDCPU
--struct cpu_load_struct {
--      unsigned long load[5];
--};
--
--struct cpu_load_struct fresh = { {0, 0, 0, 0, 0} };
--long cpu_used, oldtotal, oldused;
--#else
- #include <assert.h>
- int64_t *fresh = NULL;
- 
- /* XXX is 8 enough? - What's the constant for MAXCPU? */
- /* allocate this with malloc would be better */
- int64_t oldtotal[8], oldused[8];
--#endif
- 
- void get_cpu_count()
- {
-       int cpu_count = 1;      /* default to 1 cpu */
--#ifndef OLDCPU
-+      static pthread_mutex_t count_mutex = PTHREAD_MUTEX_INITIALIZER;
-+
-       int mib[2] = { CTL_HW, HW_NCPU };
-       size_t len = sizeof(cpu_count);
- 
-       if (sysctl(mib, 2, &cpu_count, &len, NULL, 0) != 0) {
-               NORM_ERR("error getting cpu count, defaulting to 1");
-       }
--#endif
-+
-+      pthread_mutex_lock(&count_mutex);
-+
-+      if (info.cpu_count == cpu_count) {
-+              pthread_mutex_unlock(&count_mutex);
-+              return;
-+      }
-+
-       info.cpu_count = cpu_count;
- 
-+      free(info.cpu_usage);
-+
-       info.cpu_usage = malloc(info.cpu_count * sizeof(float));
-       if (info.cpu_usage == NULL) {
-               CRIT_ERR(NULL, NULL, "malloc");
-       }
- 
--#ifndef OLDCPU
--      assert(fresh == NULL);  /* XXX Is this leaking memory? */
-+      free(fresh);
-       /* XXX Where shall I free this? */
-       if (NULL == (fresh = calloc(cpu_count, sizeof(int64_t) * CPUSTATES))) {
-               CRIT_ERR(NULL, NULL, "calloc");
-       }
--#endif
-+
-+      pthread_mutex_unlock(&count_mutex);
- }
- 
--void update_cpu_usage()
-+int update_cpu_usage()
- {
--#ifdef OLDCPU
--      int mib[2] = { CTL_KERN, KERN_CPTIME };
--      long used, total;
--      long cp_time[CPUSTATES];
--      size_t len = sizeof(cp_time);
--#else
-       size_t size;
-       unsigned int i;
--#endif
- 
-       /* add check for !info.cpu_usage since that mem is freed on a SIGUSR1 */
-       if ((cpu_setup == 0) || (!info.cpu_usage)) {
-               get_cpu_count();
-               cpu_setup = 1;
-       }
--
--#ifdef OLDCPU
--      if (sysctl(mib, 2, &cp_time, &len, NULL, 0) < 0) {
--              NORM_ERR("Cannot get kern.cp_time");
--      }
--
--      fresh.load[0] = cp_time[CP_USER];
--      fresh.load[1] = cp_time[CP_NICE];
--      fresh.load[2] = cp_time[CP_SYS];
--      fresh.load[3] = cp_time[CP_IDLE];
--      fresh.load[4] = cp_time[CP_IDLE];
--
--      used = fresh.load[0] + fresh.load[1] + fresh.load[2];
--      total = fresh.load[0] + fresh.load[1] + fresh.load[2] + fresh.load[3];
--
--      if ((total - oldtotal) != 0) {
--              info.cpu_usage[0] = ((double) (used - oldused)) /
--                      (double) (total - oldtotal);
--      } else {
--              info.cpu_usage[0] = 0;
--      }
--
--      oldused = used;
--      oldtotal = total;
--#else
-+      
-       if (info.cpu_count > 1) {
-               size = CPUSTATES * sizeof(int64_t);
-               for (i = 0; i < info.cpu_count; i++) {
-@@ -426,10 +408,11 @@ void update_cpu_usage()
-               oldused[i] = used;
-               oldtotal[i] = total;
-       }
--#endif
-+
-+      return 0;
- }
- 
--void update_load_average()
-+int update_load_average()
- {
-       double v[3];
- 
-@@ -438,6 +421,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 +590,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;
- }
- 
- #if 0
-@@ -665,19 +650,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)
-@@ -706,10 +683,10 @@ int comparemem(const void *a, const void *b)
-       return 0;
- }
- 
--inline void proc_find_top(struct process **cpu, struct process **mem)
-+static inline void proc_find_top(struct process **cpu, struct process **mem)
- {
--      struct kinfo_proc2 *p;
--      int n_processes;
-+      struct kinfo_proc *p;
-+      int n_processes = 0;
-       int i, j = 0;
-       struct process *processes;
-       int mib[2];
-@@ -730,9 +707,11 @@ inline void proc_find_top(struct process **cpu, struct
-       /* translate bytes into page count */
-       total_pages = usermem / pagesize;
- 
--      int max_size = sizeof(struct kinfo_proc2);
-+      int max_size = sizeof(struct kinfo_proc);
- 
--      p = kvm_getproc2(kd, KERN_PROC_ALL, 0, max_size, &n_processes);
-+
-+      pthread_mutex_lock(&kvm_mutex);
-+      p = kvm_getprocs(kd, KERN_PROC_ALL, 0, max_size, &n_processes);
-       processes = malloc(n_processes * sizeof(struct process));
- 
-       for (i = 0; i < n_processes; i++) {
-@@ -740,9 +719,12 @@ 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].vsize = p[i].p_vm_map_size;
-+                      processes[j].rss = p[i].p_vm_rssize * PAGE_SIZE;
-                       j++;
-               }
-       }
-+      pthread_mutex_unlock(&kvm_mutex);
- 
-       qsort(processes, j - 1, sizeof(struct process), comparemem);
-       for (i = 0; i < 10; i++) {
-@@ -752,6 +734,8 @@ inline void proc_find_top(struct process **cpu, struct
-               tmp->pid = processes[i].pid;
-               tmp->amount = processes[i].amount;
-               tmp->name = strndup(processes[i].name, text_buffer_size);
-+              tmp->vsize = processes[i].vsize;
-+              tmp->rss = processes[i].rss;
- 
-               ttmp = mem[i];
-               mem[i] = tmp;
-@@ -769,6 +753,8 @@ inline void proc_find_top(struct process **cpu, struct
-               tmp->pid = processes[i].pid;
-               tmp->amount = processes[i].amount;
-               tmp->name = strndup(processes[i].name, text_buffer_size);
-+              tmp->vsize = processes[i].vsize;
-+              tmp->rss = processes[i].rss;
- 
-               ttmp = cpu[i];
-               cpu[i] = tmp;
-@@ -784,7 +770,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 +893,6 @@ char *get_apm_battery_time()
-       return out;
- }
- 
--#endif
- 
- /* empty stubs so conky links */
- void prepare_update()
-@@ -923,8 +907,4 @@ int get_entropy_avail(unsigned int *val)
- int get_entropy_poolsize(unsigned int *val)
- {
-       return 1;
--}
--
--void free_all_processes(void)
--{
- }
diff --git a/sysutils/conky/patches/patch-src_openbsd_h 
b/sysutils/conky/patches/patch-src_openbsd_h
deleted file mode 100644
index 92449d75a71..00000000000
--- a/sysutils/conky/patches/patch-src_openbsd_h
+++ /dev/null
@@ -1,29 +0,0 @@
---- 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
-+
- #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;
--#endif
- 
- int get_entropy_avail(unsigned int *);
- int get_entropy_poolsize(unsigned int *);
-+
-+static int sensor_device;
- 
- #endif /*OPENBSD_H_*/
diff --git a/sysutils/conky/patches/patch-src_read_tcp_c 
b/sysutils/conky/patches/patch-src_read_tcp_c
deleted file mode 100644
index c4008f19f26..00000000000
--- a/sysutils/conky/patches/patch-src_read_tcp_c
+++ /dev/null
@@ -1,10 +0,0 @@
---- src/read_tcp.c.orig        Sat Sep 10 12:27:11 2016
-+++ src/read_tcp.c     Sat Sep 10 12:27:20 2016
-@@ -34,6 +34,7 @@
- #include <netdb.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <sys/select.h> /* fd_set */
- #include <unistd.h>
- #include <netinet/in.h>
- 
diff --git a/sysutils/conky/patches/patch-src_text_object_h 
b/sysutils/conky/patches/patch-src_text_object_h
deleted file mode 100644
index 044b8434973..00000000000
--- a/sysutils/conky/patches/patch-src_text_object_h
+++ /dev/null
@@ -1,20 +0,0 @@
---- src/text_object.h.orig     Tue Oct  5 23:29:36 2010
-+++ src/text_object.h  Mon Jul 18 14:05:17 2011
-@@ -166,7 +166,7 @@ enum text_object_type {
-       OBJ_wireless_link_qual_perc,
-       OBJ_wireless_link_bar,
- #endif /* __linux__ */
--#if defined(__FreeBSD__) || defined(__linux__)
-+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__linux__)
-       OBJ_if_up,
- #endif
-       OBJ_if_empty,
-@@ -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,
diff --git a/sysutils/conky/pkg/PLIST b/sysutils/conky/pkg/PLIST
index 186bca4018d..ad40a29e93b 100644
--- a/sysutils/conky/pkg/PLIST
+++ b/sysutils/conky/pkg/PLIST
@@ -1,15 +1,11 @@
+@pkgpath ${BASE_PKGPATH},xmms2
 @pkgpath ${BASE_PKGPATH},imlib2
 @pkgpath ${BASE_PKGPATH},audacious
 @bin bin/conky
 @man man/man1/conky.1
-share/doc/conky/
-share/doc/conky/README
-share/doc/conky/config_settings.html
-share/doc/conky/docs.html
-share/doc/conky/lua.html
-share/doc/conky/variables.html
 share/examples/conky/
 @sample ${SYSCONFDIR}/conky/
 share/examples/conky/conky.conf
 @sample ${SYSCONFDIR}/conky/conky.conf
 share/examples/conky/conky_no_x11.conf
+share/examples/conky/convert.lua

Reply via email to