aboutsummaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorLars Engels <lme@FreeBSD.org>2016-04-26 11:32:20 +0000
committerLars Engels <lme@FreeBSD.org>2016-04-26 11:32:20 +0000
commitdd9a35fb2db1416822505f18825365385ae06a68 (patch)
tree63871875f4f0d88c5cfb8601b6f6a89f5a86667f /sysutils
parentbb436c049cd3406d2438c6a693a9e4eea0581e07 (diff)
Notes
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/conky/Makefile2
-rw-r--r--sysutils/conky/files/patch-configure226
-rw-r--r--sysutils/conky/files/patch-lua-cairo.pkg4
-rw-r--r--sysutils/conky/files/patch-src-conky.c10
-rw-r--r--sysutils/conky/files/patch-src-freebsd.c111
-rw-r--r--sysutils/conky/files/patch-src-freebsd.h4
-rw-r--r--sysutils/conky/files/patch-src-fs.c6
7 files changed, 285 insertions, 78 deletions
diff --git a/sysutils/conky/Makefile b/sysutils/conky/Makefile
index 1ac72576a95c..ff4537b4f755 100644
--- a/sysutils/conky/Makefile
+++ b/sysutils/conky/Makefile
@@ -3,7 +3,7 @@
PORTNAME= conky
PORTVERSION= 1.9.0
-PORTREVISION= 5
+PORTREVISION= 6
CATEGORIES= sysutils
MASTER_SITES= SF
diff --git a/sysutils/conky/files/patch-configure b/sysutils/conky/files/patch-configure
index b1d0b0e45d71..4a632c13256e 100644
--- a/sysutils/conky/files/patch-configure
+++ b/sysutils/conky/files/patch-configure
@@ -1,6 +1,6 @@
---- configure.orig 2012-05-04 00:47:40.000000000 +0300
-+++ configure 2012-12-06 04:26:37.000000000 +0200
-@@ -895,6 +895,7 @@
+--- configure.orig 2012-05-03 21:47:40 UTC
++++ configure
+@@ -895,6 +895,7 @@ enable_xdamage
enable_xft
enable_nvidia
enable_alsa
@@ -8,7 +8,7 @@
enable_debug
enable_testing
enable_profiling
-@@ -1620,6 +1621,7 @@
+@@ -1620,6 +1621,7 @@ Optional Features:
--enable-nvidia enable if you want nvidia support [default=no]
--disable-alsa disable if you do not want ALSA support
[default=yes]
@@ -16,7 +16,7 @@
--enable-debug compile with debug symbols [default=no]
--enable-testing use strict compiler flags for testing [default=no]
--enable-profiling specify compiler flags for use with gprof and gcov
-@@ -11930,7 +11932,11 @@
+@@ -11930,7 +11932,11 @@ case $uname in
Linux*)
WANT_SYSINFO=yes
;;
@@ -29,7 +29,207 @@
WANT_KVM=yes
WANT_DEVSTAT=yes
WANT_OPTRESET=yes
-@@ -16998,18 +17004,63 @@
+@@ -14046,12 +14052,12 @@ if test -n "$PKG_CONFIG"; then
+ pkg_cv_LUA51_CFLAGS="$LUA51_CFLAGS"
+ else
+ if test -n "$PKG_CONFIG" && \
+- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua5.1 >= 5.1\""; } >&5
+- ($PKG_CONFIG --exists --print-errors "lua5.1 >= 5.1") 2>&5
++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua-5.1 >= 5.1\""; } >&5
++ ($PKG_CONFIG --exists --print-errors "lua-5.1 >= 5.1") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+- pkg_cv_LUA51_CFLAGS=`$PKG_CONFIG --cflags "lua5.1 >= 5.1" 2>/dev/null`
++ pkg_cv_LUA51_CFLAGS=`$PKG_CONFIG --cflags "lua-5.1 >= 5.1" 2>/dev/null`
+ else
+ pkg_failed=yes
+ fi
+@@ -14064,12 +14070,12 @@ if test -n "$PKG_CONFIG"; then
+ pkg_cv_LUA51_LIBS="$LUA51_LIBS"
+ else
+ if test -n "$PKG_CONFIG" && \
+- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua5.1 >= 5.1\""; } >&5
+- ($PKG_CONFIG --exists --print-errors "lua5.1 >= 5.1") 2>&5
++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua-5.1 >= 5.1\""; } >&5
++ ($PKG_CONFIG --exists --print-errors "lua-5.1 >= 5.1") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+- pkg_cv_LUA51_LIBS=`$PKG_CONFIG --libs "lua5.1 >= 5.1" 2>/dev/null`
++ pkg_cv_LUA51_LIBS=`$PKG_CONFIG --libs "lua-5.1 >= 5.1" 2>/dev/null`
+ else
+ pkg_failed=yes
+ fi
+@@ -14088,14 +14094,14 @@ else
+ _pkg_short_errors_supported=no
+ fi
+ if test $_pkg_short_errors_supported = yes; then
+- LUA51_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "lua5.1 >= 5.1"`
++ LUA51_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "lua-5.1 >= 5.1"`
+ else
+- LUA51_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "lua5.1 >= 5.1"`
++ LUA51_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "lua-5.1 >= 5.1"`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LUA51_PKG_ERRORS" >&5
+
+- as_fn_error $? "Package requirements (lua5.1 >= 5.1) were not met:
++ as_fn_error $? "Package requirements (lua-5.1 >= 5.1) were not met:
+
+ $LUA51_PKG_ERRORS
+
+@@ -14139,12 +14145,12 @@ if test -n "$PKG_CONFIG"; then
+ pkg_cv_LUA51_CFLAGS="$LUA51_CFLAGS"
+ else
+ if test -n "$PKG_CONFIG" && \
+- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua5.1 >= 5.1\""; } >&5
+- ($PKG_CONFIG --exists --print-errors "lua5.1 >= 5.1") 2>&5
++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua-5.1 >= 5.1\""; } >&5
++ ($PKG_CONFIG --exists --print-errors "lua-5.1 >= 5.1") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+- pkg_cv_LUA51_CFLAGS=`$PKG_CONFIG --cflags "lua5.1 >= 5.1" 2>/dev/null`
++ pkg_cv_LUA51_CFLAGS=`$PKG_CONFIG --cflags "lua-5.1 >= 5.1" 2>/dev/null`
+ else
+ pkg_failed=yes
+ fi
+@@ -14157,12 +14163,12 @@ if test -n "$PKG_CONFIG"; then
+ pkg_cv_LUA51_LIBS="$LUA51_LIBS"
+ else
+ if test -n "$PKG_CONFIG" && \
+- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua5.1 >= 5.1\""; } >&5
+- ($PKG_CONFIG --exists --print-errors "lua5.1 >= 5.1") 2>&5
++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua-5.1 >= 5.1\""; } >&5
++ ($PKG_CONFIG --exists --print-errors "lua-5.1 >= 5.1") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+- pkg_cv_LUA51_LIBS=`$PKG_CONFIG --libs "lua5.1 >= 5.1" 2>/dev/null`
++ pkg_cv_LUA51_LIBS=`$PKG_CONFIG --libs "lua-5.1 >= 5.1" 2>/dev/null`
+ else
+ pkg_failed=yes
+ fi
+@@ -14181,14 +14187,14 @@ else
+ _pkg_short_errors_supported=no
+ fi
+ if test $_pkg_short_errors_supported = yes; then
+- LUA51_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "lua5.1 >= 5.1"`
++ LUA51_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "lua-5.1 >= 5.1"`
+ else
+- LUA51_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "lua5.1 >= 5.1"`
++ LUA51_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "lua-5.1 >= 5.1"`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LUA51_PKG_ERRORS" >&5
+
+- as_fn_error $? "Package requirements (lua5.1 >= 5.1) were not met:
++ as_fn_error $? "Package requirements (lua-5.1 >= 5.1) were not met:
+
+ $LUA51_PKG_ERRORS
+
+@@ -14302,12 +14308,12 @@ if test -n "$PKG_CONFIG"; then
+ pkg_cv_LUA51_CFLAGS="$LUA51_CFLAGS"
+ else
+ if test -n "$PKG_CONFIG" && \
+- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua5.1 >= 5.1\""; } >&5
+- ($PKG_CONFIG --exists --print-errors "lua5.1 >= 5.1") 2>&5
++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua-5.1 >= 5.1\""; } >&5
++ ($PKG_CONFIG --exists --print-errors "lua-5.1 >= 5.1") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+- pkg_cv_LUA51_CFLAGS=`$PKG_CONFIG --cflags "lua5.1 >= 5.1" 2>/dev/null`
++ pkg_cv_LUA51_CFLAGS=`$PKG_CONFIG --cflags "lua-5.1 >= 5.1" 2>/dev/null`
+ else
+ pkg_failed=yes
+ fi
+@@ -14320,12 +14326,12 @@ if test -n "$PKG_CONFIG"; then
+ pkg_cv_LUA51_LIBS="$LUA51_LIBS"
+ else
+ if test -n "$PKG_CONFIG" && \
+- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua5.1 >= 5.1\""; } >&5
+- ($PKG_CONFIG --exists --print-errors "lua5.1 >= 5.1") 2>&5
++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua-5.1 >= 5.1\""; } >&5
++ ($PKG_CONFIG --exists --print-errors "lua-5.1 >= 5.1") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+- pkg_cv_LUA51_LIBS=`$PKG_CONFIG --libs "lua5.1 >= 5.1" 2>/dev/null`
++ pkg_cv_LUA51_LIBS=`$PKG_CONFIG --libs "lua-5.1 >= 5.1" 2>/dev/null`
+ else
+ pkg_failed=yes
+ fi
+@@ -14344,14 +14350,14 @@ else
+ _pkg_short_errors_supported=no
+ fi
+ if test $_pkg_short_errors_supported = yes; then
+- LUA51_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "lua5.1 >= 5.1"`
++ LUA51_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "lua-5.1 >= 5.1"`
+ else
+- LUA51_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "lua5.1 >= 5.1"`
++ LUA51_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "lua-5.1 >= 5.1"`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LUA51_PKG_ERRORS" >&5
+
+- as_fn_error $? "Package requirements (lua5.1 >= 5.1) were not met:
++ as_fn_error $? "Package requirements (lua-5.1 >= 5.1) were not met:
+
+ $LUA51_PKG_ERRORS
+
+@@ -14395,12 +14401,12 @@ if test -n "$PKG_CONFIG"; then
+ pkg_cv_LUA51_CFLAGS="$LUA51_CFLAGS"
+ else
+ if test -n "$PKG_CONFIG" && \
+- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua5.1 >= 5.1\""; } >&5
+- ($PKG_CONFIG --exists --print-errors "lua5.1 >= 5.1") 2>&5
++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua-5.1 >= 5.1\""; } >&5
++ ($PKG_CONFIG --exists --print-errors "lua-5.1 >= 5.1") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+- pkg_cv_LUA51_CFLAGS=`$PKG_CONFIG --cflags "lua5.1 >= 5.1" 2>/dev/null`
++ pkg_cv_LUA51_CFLAGS=`$PKG_CONFIG --cflags "lua-5.1 >= 5.1" 2>/dev/null`
+ else
+ pkg_failed=yes
+ fi
+@@ -14413,12 +14419,12 @@ if test -n "$PKG_CONFIG"; then
+ pkg_cv_LUA51_LIBS="$LUA51_LIBS"
+ else
+ if test -n "$PKG_CONFIG" && \
+- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua5.1 >= 5.1\""; } >&5
+- ($PKG_CONFIG --exists --print-errors "lua5.1 >= 5.1") 2>&5
++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua-5.1 >= 5.1\""; } >&5
++ ($PKG_CONFIG --exists --print-errors "lua-5.1 >= 5.1") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+- pkg_cv_LUA51_LIBS=`$PKG_CONFIG --libs "lua5.1 >= 5.1" 2>/dev/null`
++ pkg_cv_LUA51_LIBS=`$PKG_CONFIG --libs "lua-5.1 >= 5.1" 2>/dev/null`
+ else
+ pkg_failed=yes
+ fi
+@@ -14437,14 +14443,14 @@ else
+ _pkg_short_errors_supported=no
+ fi
+ if test $_pkg_short_errors_supported = yes; then
+- LUA51_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "lua5.1 >= 5.1"`
++ LUA51_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "lua-5.1 >= 5.1"`
+ else
+- LUA51_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "lua5.1 >= 5.1"`
++ LUA51_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "lua-5.1 >= 5.1"`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LUA51_PKG_ERRORS" >&5
+
+- as_fn_error $? "Package requirements (lua5.1 >= 5.1) were not met:
++ as_fn_error $? "Package requirements (lua-5.1 >= 5.1) were not met:
+
+ $LUA51_PKG_ERRORS
+
+@@ -16998,18 +17004,63 @@ fi
done
@@ -55,8 +255,8 @@
+else
+ want_inotify=no
+fi
-
- fi
++
++fi
+if test x$want_inotify = xyes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inotify_init in -linotify" >&5
+$as_echo_n "checking for inotify_init in -linotify... " >&6; }
@@ -67,10 +267,9 @@
+LIBS="-linotify $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
-
--done
-+#include <sys/inotify.h>
+
++#include <sys/inotify.h>
+
+char inotify_init ();
+int
+main ()
@@ -95,8 +294,9 @@
+ conky_LIBS="$conky_LIBS -linotify"
+else
+ want_inotify=yes
-+fi
-+
+ fi
+
+-done
+fi
diff --git a/sysutils/conky/files/patch-lua-cairo.pkg b/sysutils/conky/files/patch-lua-cairo.pkg
index b097095dfa7e..1997a39f186c 100644
--- a/sysutils/conky/files/patch-lua-cairo.pkg
+++ b/sysutils/conky/files/patch-lua-cairo.pkg
@@ -1,6 +1,6 @@
---- lua/cairo.pkg.orig
+--- lua/cairo.pkg.orig 2012-05-03 21:08:27 UTC
+++ lua/cairo.pkg
-@@ -4,6 +4,7 @@
+@@ -4,6 +4,7 @@ $#include <cairo.h>
$#include <cairo-xlib.h>
$#include <X11/Xlib.h>
$#include "libcairo-helper.h"
diff --git a/sysutils/conky/files/patch-src-conky.c b/sysutils/conky/files/patch-src-conky.c
index e113733f60c3..3af04ec76a8c 100644
--- a/sysutils/conky/files/patch-src-conky.c
+++ b/sysutils/conky/files/patch-src-conky.c
@@ -1,5 +1,5 @@
---- src/conky.c.orig 2012-05-04 00:22:21.000000000 +0300
-+++ src/conky.c 2012-12-04 11:09:20.000000000 +0200
+--- src/conky.c.orig 2012-05-03 21:22:21 UTC
++++ src/conky.c
@@ -119,7 +119,7 @@
#include "openbsd.h"
#endif
@@ -9,7 +9,7 @@
#include <bsd/bsd.h>
#endif
-@@ -4292,7 +4292,8 @@
+@@ -4292,7 +4292,8 @@ static void set_default_configurations(v
free_templates();
@@ -19,7 +19,7 @@
{
char buf[256];
-@@ -5662,6 +5663,7 @@
+@@ -5662,6 +5663,7 @@ void initialisation(int argc, char **arg
current_mail_spool = strndup(buf, text_buffer_size);
}
}
@@ -27,7 +27,7 @@
#endif
/* handle other command line arguments */
-@@ -5971,7 +5973,7 @@
+@@ -5971,7 +5973,7 @@ int main(int argc, char **argv)
void alarm_handler(void) {
if(childpid > 0) {
diff --git a/sysutils/conky/files/patch-src-freebsd.c b/sysutils/conky/files/patch-src-freebsd.c
index 2fe950a07466..d80d3a2d887a 100644
--- a/sysutils/conky/files/patch-src-freebsd.c
+++ b/sysutils/conky/files/patch-src-freebsd.c
@@ -1,64 +1,71 @@
---- src/freebsd.c.orig 2012-05-04 06:08:27.000000000 +0900
-+++ src/freebsd.c 2013-08-05 09:02:37.000000000 +0900
-@@ -38,6 +38,11 @@
- #include <sys/types.h>
- #include <sys/user.h>
-
-+#if defined(__FreeBSD__) && (!defined(__FreeBSD_kernel__) || !(__FreeBSD_kernel__ + 0))
-+# undef __FreeBSD_kernel__
-+# define __FreeBSD_kernel__ __FreeBSD__
-+#endif
-+
- #include <net/if.h>
- #include <net/if_mib.h>
- #include <net/if_media.h>
-@@ -283,7 +288,7 @@
+--- src/freebsd.c.orig 2012-05-03 21:08:27 UTC
++++ src/freebsd.c
+@@ -283,11 +283,7 @@ int update_running_processes(void)
pthread_mutex_lock(&kvm_proc_mutex);
p = kvm_getprocs(kd, KERN_PROC_ALL, 0, &n_processes);
for (i = 0; i < n_processes; i++) {
-#if (__FreeBSD__ < 5) && (__FreeBSD_kernel__ < 5)
-+#if (defined(__FreeBSD__) && (__FreeBSD__ < 5)) || (defined(__FreeBSD_kernel__) && (__FreeBSD_kernel__ < 5))
- if (p[i].kp_proc.p_stat == SRUN) {
- #else
+- if (p[i].kp_proc.p_stat == SRUN) {
+-#else
if (p[i].ki_stat == SRUN) {
-@@ -300,7 +305,9 @@
- void get_cpu_count(void)
- {
- int cpu_count = 0;
-- size_t cpu_count_len = sizeof(cpu_count);
-+ /* add check for !info.cpu_usage since that mem is freed on a SIGUSR1 */
-+ if ((cpu_setup == 1) && (info.cpu_usage))
-+ return;
-
- if (GETSYSCTL("hw.ncpu", cpu_count) == 0) {
- info.cpu_count = cpu_count;
-@@ -313,6 +320,7 @@
- if (info.cpu_usage == NULL) {
- CRIT_ERR(NULL, NULL, "malloc");
+-#endif
+ cnt++;
+ }
}
-+ cpu_setup = 1;
- }
+@@ -464,7 +460,7 @@ void get_battery_stuff(char *buf, unsign
+ break;
+ case BATTERY_STATUS:
+ if (batstate == 1) // Discharging
+- snprintf(buf, n, "remaining %d%%", batcapacity);
++ snprintf(buf, n, "remaining (%d%%)", batcapacity);
+ else
+ snprintf(buf, n, batstate == 2 ? "charging (%d%%)" :
+ (batstate == 7 ? "absent/on AC" : "charged (%d%%)"),
+@@ -497,26 +493,10 @@ static int check_bat(const char *bat)
- struct cpu_info {
-@@ -330,11 +338,7 @@
- unsigned int malloc_cpu_size = 0;
- extern void* global_cpu;
+ int get_battery_perct(const char *bat)
+ {
+- union acpi_battery_ioctl_arg battio;
+- int batnum, acpifd;
+- int designcap, lastfulcap, batperct;
++ int batcapacity;
-- /* 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;
+- if ((battio.unit = batnum = check_bat(bat)) < 0)
+- return 0;
+- if ((acpifd = open("/dev/acpi", O_RDONLY)) < 0) {
+- fprintf(stderr, "Can't open ACPI device\n");
+- return 0;
+- }
+- if (ioctl(acpifd, ACPIIO_BATT_GET_BIF, &battio) == -1) {
+- fprintf(stderr, "Unable to get info for battery unit %d\n", batnum);
+- return 0;
- }
-+ get_cpu_count();
+- close(acpifd);
+- designcap = battio.bif.dcap;
+- lastfulcap = battio.bif.lfcap;
+- batperct = (designcap > 0 && lastfulcap > 0) ?
+- (int) (((float) lastfulcap / designcap) * 100) : 0;
+- return batperct > 100 ? 100 : batperct;
++ get_battery_stats(NULL, &batcapacity, NULL, NULL);
++ return batcapacity;
+ }
- if (!global_cpu) {
- malloc_cpu_size = (info.cpu_count + 1) * sizeof(struct cpu_info);
-@@ -702,7 +706,7 @@
- free(dev_select);
+ int get_battery_perct_bar(const char *bar)
+@@ -970,11 +950,14 @@ void get_battery_short_status(char *buff
+ if (0 == strncmp("charging", buffer, 8)) {
+ buffer[0] = 'C';
+ memmove(buffer + 1, buffer + 8, n - 8);
+- } else if (0 == strncmp("discharging", buffer, 11)) {
++ } else if (0 == strncmp("remaining", buffer, 9)) {
+ buffer[0] = 'D';
+- memmove(buffer + 1, buffer + 11, n - 11);
++ memmove(buffer + 1, buffer + 9, n - 9);
++ } else if (0 == strncmp("charged", buffer, 7)) {
++ buffer[0] = 'F';
++ memmove(buffer + 1, buffer + 7, n - 7);
+ } else if (0 == strncmp("absent/on AC", buffer, 12)) {
+- buffer[0] = 'A';
++ buffer[0] = 'N';
+ memmove(buffer + 1, buffer + 12, n - 12);
}
-
-- free(statinfo_cur.dinfo);
-+ free(statinfo_cur.dinfo->mem_ptr);
- return 0;
}
-
diff --git a/sysutils/conky/files/patch-src-freebsd.h b/sysutils/conky/files/patch-src-freebsd.h
index 7b9050048bd0..7ec921d791b3 100644
--- a/sysutils/conky/files/patch-src-freebsd.h
+++ b/sysutils/conky/files/patch-src-freebsd.h
@@ -1,5 +1,5 @@
---- src/freebsd.h.orig 2012-12-04 04:24:41.000000000 +0200
-+++ src/freebsd.h 2012-12-04 04:24:52.000000000 +0200
+--- src/freebsd.h.orig 2012-05-03 21:08:27 UTC
++++ src/freebsd.h
@@ -10,6 +10,7 @@
#include <fcntl.h>
#include <kvm.h>
diff --git a/sysutils/conky/files/patch-src-fs.c b/sysutils/conky/files/patch-src-fs.c
index 538580ee5be8..fd6744c62c06 100644
--- a/sysutils/conky/files/patch-src-fs.c
+++ b/sysutils/conky/files/patch-src-fs.c
@@ -1,6 +1,6 @@
---- src/fs.c.orig 2012-05-04 00:08:27.000000000 +0300
-+++ src/fs.c 2012-07-18 20:24:10.000000000 +0300
-@@ -118,9 +118,15 @@
+--- src/fs.c.orig 2012-05-03 21:08:27 UTC
++++ src/fs.c
+@@ -118,9 +118,15 @@ struct fs_stat *prepare_fs_stat(const ch
static void update_fs_stat(struct fs_stat *fs)
{