Skip to content

Commit

Permalink
sysutils/conky: Update to 1.14.0
Browse files Browse the repository at this point in the history
- Add patch implementing missing function for FreeBSD, already
  proposed upstream: brndnmtthws/conky#1252

- Updated dependencies, upstream changed its documentation build
  method

Old html documentation has been removed, the information is now
encoded in yaml files.

Upstream code does not provide a method to automatically produce
human readable documentation from the yaml files, so I install those
directly in PORTDOCS.
  • Loading branch information
madpilot78 committed Oct 13, 2022
1 parent e46dc1d commit cf75f45
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 57 deletions.
24 changes: 13 additions & 11 deletions sysutils/conky/Makefile
@@ -1,5 +1,5 @@
PORTNAME= conky
PORTVERSION= 1.13.1
PORTVERSION= 1.14.0
DISTVERSIONPREFIX= v
CATEGORIES= sysutils

Expand All @@ -8,13 +8,13 @@ COMMENT?= Advanced, highly configurable system monitor for X11
WWW= https://github.com/brndnmtthws/conky

LIB_DEPENDS= libinotify.so:devel/libinotify
BUILD_DEPENDS= db2x_xsltproc:textproc/docbook2X \
docbook-xsl>=0:textproc/docbook-xsl \
xsltproc:textproc/libxslt \
gsed:textproc/gsed
BUILD_DEPENDS= gsed:textproc/gsed \
pandoc:textproc/hs-pandoc \
${PYTHON_PKGNAMEPREFIX}yaml>0:devel/py-yaml@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}Jinja2>=0:devel/py-Jinja2@${PY_FLAVOR}

USES= cpe cmake:noninja compiler:c++11-lib gettext-runtime iconv \
localbase lua:52-53 pkgconfig tar:bzip2
localbase lua:52-53 pkgconfig python:3.7+,build tar:bzip2

CMAKE_ARGS= -DBUILD_PORT_MONITORS:BOOL=false \
-DBUILD_IBM:BOOL=false \
Expand All @@ -28,7 +28,7 @@ CONFLICTS?= conky-awesome
SLAVEDIRS= sysutils/conky-awesome
PLIST_FILES= bin/conky man/man1/conky.1.gz
PORTEXAMPLES= conky.conf conky_no_x11.conf convert.lua
PORTDOCS= html/config_settings.html html/docs.html html/lua.html html/variables.html
PORTDOCS= config_settings.yaml variables.yaml lua.yaml

USE_GITHUB= yes
GH_ACCOUNT= brndnmtthws
Expand Down Expand Up @@ -57,6 +57,7 @@ DOUBLE_BUFFER_IMPLIES= X11
IMLIB2_CMAKE_BOOL= BUILD_IMLIB2
IMLIB2_LIB_DEPENDS= libImlib2.so:graphics/imlib2
IMLIB2_IMPLIES= X11
IMLIB2_USE= xorg=ice,sm

IPV6_CMAKE_BOOL= BUILD_IPV6

Expand Down Expand Up @@ -137,8 +138,6 @@ post-patch:
@${REINPLACE_CMD} -e 's,^set(INCLUDE_SEARCH_PATH \(.*\)),set(INCLUDE_SEARCH_PATH \1 ${LUA_INCDIR}),' \
-e 's/ -lbsd/ -lintl -linotify/' \
${WRKSRC}/cmake/ConkyPlatformChecks.cmake
@${REINPLACE_CMD} -e 's,LOCALBASE,${LOCALBASE},' \
${WRKSRC}/doc/docgen.sh
.if ${LUA_DEFAULT} == 5.2
# Force using lua 5.2
@${REINPLACE_CMD} -e 's/lua.*5\.*3//' \
Expand All @@ -149,7 +148,10 @@ post-patch:
${WRKSRC}/cmake/ConkyPlatformChecks.cmake
.endif

post-build:
(cd ${WRKSRC}/doc && ${SH} docgen.sh)
post-install-DOCS-on:
${MKDIR} ${STAGEDIR}${DOCSDIR}
.for FILE in ${PORTDOCS}
${INSTALL_MAN} ${WRKSRC}/doc/${FILE} ${STAGEDIR}${DOCSDIR}
.endfor

.include <bsd.port.mk>
6 changes: 3 additions & 3 deletions sysutils/conky/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1663601049
SHA256 (brndnmtthws-conky-v1.13.1_GH0.tar.gz) = f85c96250b501e937b9b5d2ff3f06176e14777c94cec81373bbfc8a619d7a05a
SIZE (brndnmtthws-conky-v1.13.1_GH0.tar.gz) = 2443276
TIMESTAMP = 1665603150
SHA256 (brndnmtthws-conky-v1.14.0_GH0.tar.gz) = 36314449441eeae4d2bb1713cdd0738bfb581a9b23d5374137965684de04d964
SIZE (brndnmtthws-conky-v1.14.0_GH0.tar.gz) = 1797564
18 changes: 4 additions & 14 deletions sysutils/conky/files/patch-CMakeLists.txt
@@ -1,6 +1,6 @@
--- CMakeLists.txt.orig 2019-06-23 14:50:35 UTC
--- CMakeLists.txt.orig 2022-10-12 18:18:08 UTC
+++ CMakeLists.txt
@@ -72,9 +72,12 @@ if(BUILD_TESTS)
@@ -73,11 +73,14 @@ if(NOT DEFINED DOC_PATH)
endif()

if(NOT DEFINED DOC_PATH)
Expand All @@ -13,18 +13,8 @@
+endif(NOT DEFINED SAMPLE_PATH)
+set(SAMPLE_FILES extras/convert.lua data/conky_no_x11.conf data/conky.conf)

set(HTML_PATH "${DOC_PATH}/html")
set(HTML_FILES
@@ -83,10 +86,10 @@ set(HTML_FILES
doc/lua.html
doc/variables.html)

-set(MAN_PATH "share/man/man1")
+set(MAN_PATH "man/man1")
set(MAN_FILES doc/conky.1)

-install(FILES ${DOC_FILES} DESTINATION ${DOC_PATH})
+install(FILES ${SAMPLE_FILES} DESTINATION ${SAMPLE_PATH})

if(BUILD_DOCS)
install(FILES ${HTML_FILES} DESTINATION ${HTML_PATH})
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
install(FILES conky.desktop DESTINATION share/applications)
11 changes: 11 additions & 0 deletions sysutils/conky/files/patch-doc_CMakeLists.txt
@@ -0,0 +1,11 @@
--- doc/CMakeLists.txt.orig 2022-10-12 18:18:08 UTC
+++ doc/CMakeLists.txt
@@ -32,7 +32,7 @@ if(BUILD_DOCS)
)
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})
13 changes: 0 additions & 13 deletions sysutils/conky/files/patch-doc_docgen.sh

This file was deleted.

16 changes: 0 additions & 16 deletions sysutils/conky/files/patch-src_display-console.cc

This file was deleted.

30 changes: 30 additions & 0 deletions sysutils/conky/files/patch-src_freebsd.cc
@@ -0,0 +1,30 @@
--- src/freebsd.cc.orig 2022-10-12 18:18:08 UTC
+++ src/freebsd.cc
@@ -460,6 +460,27 @@ int get_battery_perct(const char *) {
return batcapacity;
}

+void get_battery_power_draw(char *buffer, unsigned int n, const char *bat) {
+ int rate = 0;
+ double ret = 0;
+
+ /*
+ * hw.acpi.battery.rate returns battery discharge rate in mW,
+ * or -1 (according to docs, but also 0 in practice) when not discharging.
+ *
+ * ref. acpi_battery(4)
+ */
+ if (GETSYSCTL("hw.acpi.battery.rate", rate)) {
+ fprintf(stderr, "Cannot read sysctl \"hw.acpi.battery.rate\"\n");
+ }
+
+ if (rate > 0) {
+ ret = (double)rate/(double)1000;
+ }
+
+ snprintf(buffer, n, "%.1f", ret);
+}
+
double get_battery_perct_bar(struct text_object *obj) {
int batperct = get_battery_perct(obj->data.s);
return batperct;

0 comments on commit cf75f45

Please sign in to comment.