pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/xfce4-battery-plugin Make NetBSD support arch...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/eb91bf8c0501
branches:  trunk
changeset: 315527:eb91bf8c0501
user:      martin <martin%pkgsrc.org@localhost>
date:      Sun Nov 25 20:55:41 2018 +0000

description:
Make NetBSD support architecture independent.

diffstat:

 sysutils/xfce4-battery-plugin/Makefile                             |  13 +---
 sysutils/xfce4-battery-plugin/distinfo                             |   4 +-
 sysutils/xfce4-battery-plugin/patches/patch-panel-plugin_battery.c |  32 +++++++--
 3 files changed, 27 insertions(+), 22 deletions(-)

diffs (111 lines):

diff -r a243c544aff8 -r eb91bf8c0501 sysutils/xfce4-battery-plugin/Makefile
--- a/sysutils/xfce4-battery-plugin/Makefile    Sun Nov 25 20:39:29 2018 +0000
+++ b/sysutils/xfce4-battery-plugin/Makefile    Sun Nov 25 20:55:41 2018 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.48 2018/11/14 22:22:28 kleink Exp $
+# $NetBSD: Makefile,v 1.49 2018/11/25 20:55:41 martin Exp $
 
-PKGREVISION= 6
+PKGREVISION= 7
 .include "../../meta-pkgs/xfce4/Makefile.common"
 
 VERSION=       1.1.0
@@ -11,15 +11,6 @@
 HOMEPAGE=      http://goodies.xfce.org/projects/panel-plugins/xfce4-battery-plugin
 COMMENT=       Xfce battery monitor plugin
 
-# On NetBSD/sparc64, apmvar.h is not exist in /usr/include/machine.
-# Reported in PR port-sparc64/36735.
-.if ${OPSYS} == "NetBSD" &&                    \
-    (!exists(/usr/include/machine/apmvar.h) && \
-     !exists(/usr/include/dev/apm/apmio.h) && \
-     !exists(/usr/include/sparc/apmio.h))
-PKG_FAIL_REASON+=      "APM is not available on ${MACHINE_PLATFORM}."
-.endif
-
 .include "../../graphics/hicolor-icon-theme/buildlink3.mk"
 .include "../../x11/xfce4-panel/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff -r a243c544aff8 -r eb91bf8c0501 sysutils/xfce4-battery-plugin/distinfo
--- a/sysutils/xfce4-battery-plugin/distinfo    Sun Nov 25 20:39:29 2018 +0000
+++ b/sysutils/xfce4-battery-plugin/distinfo    Sun Nov 25 20:55:41 2018 +0000
@@ -1,7 +1,7 @@
-$NetBSD: distinfo,v 1.12 2017/06/20 21:26:54 youri Exp $
+$NetBSD: distinfo,v 1.13 2018/11/25 20:55:41 martin Exp $
 
 SHA1 (xfce4-battery-plugin-1.1.0.tar.bz2) = 60e341cbac086b774024372f18ccee09473f52df
 RMD160 (xfce4-battery-plugin-1.1.0.tar.bz2) = 024ed07993b8bdf8c6d8831170e43205794de7c4
 SHA512 (xfce4-battery-plugin-1.1.0.tar.bz2) = d3f5b6d3657abfba2c4c5cb3ab8ddc87f4862f24eb614cb91af48332b3082c3dce7f32eb2e3cb8a9d501ddb01c6259c4fbfbab8ed9c221633e47eb17c623cf09
 Size (xfce4-battery-plugin-1.1.0.tar.bz2) = 398621 bytes
-SHA1 (patch-panel-plugin_battery.c) = d2a227639d1f7ca1533823cbcbe6933a3b092fb0
+SHA1 (patch-panel-plugin_battery.c) = 65a4b74fd3a59aea6e2adc00a8a9010410dd76b0
diff -r a243c544aff8 -r eb91bf8c0501 sysutils/xfce4-battery-plugin/patches/patch-panel-plugin_battery.c
--- a/sysutils/xfce4-battery-plugin/patches/patch-panel-plugin_battery.c        Sun Nov 25 20:39:29 2018 +0000
+++ b/sysutils/xfce4-battery-plugin/patches/patch-panel-plugin_battery.c        Sun Nov 25 20:55:41 2018 +0000
@@ -1,11 +1,25 @@
-$NetBSD: patch-panel-plugin_battery.c,v 1.2 2017/06/20 21:26:54 youri Exp $
+$NetBSD: patch-panel-plugin_battery.c,v 1.3 2018/11/25 20:55:42 martin Exp $
 
 Fix for NetBSD.
 
---- panel-plugin/battery.c.orig        2012-06-17 20:05:17.000000000 +0000
-+++ panel-plugin/battery.c
-@@ -30,8 +30,16 @@
- #elif (defined(__OpenBSD__) || defined(__NetBSD__))
+--- panel-plugin/battery.c.orig        2016-10-29 08:37:38.000000000 +0200
++++ panel-plugin/battery.c     2018-11-25 21:49:59.741230700 +0100
+@@ -26,13 +26,28 @@
+ #include <config.h>
+ #endif
+ 
+-#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && (defined(i386) || defined(__i386__))
++#ifdef __NetBSD__
++#include <sys/param.h>
++#include <sys/ioctl.h>
++#include <dev/apm/apmbios.h>
++#include <dev/apm/apmio.h>
++#define APMDEVICE "/dev/apm"
++#define _ACPI_APM_BATT_UNKNOWN        0xffff /* from sys/dev/acpi/acpi_apm.c */
++#elif (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && (defined(i386) || defined(__i386__))
+ #include <machine/apm_bios.h>
+-#elif (defined(__OpenBSD__) || defined(__NetBSD__))
++#elif (defined(__OpenBSD__)
  #include <sys/param.h>
  #include <sys/ioctl.h>
 +#if defined(__sparc64__)
@@ -21,7 +35,7 @@
  #elif __linux__
  #include <libapm.h>
  #endif
-@@ -172,7 +180,7 @@ init_options(t_battmon_options *options)
+@@ -162,7 +177,7 @@ init_options(t_battmon_options *options)
  gboolean
  detect_battery_info(t_battmon *battmon)
  {
@@ -30,7 +44,7 @@
    /* This is how I read the information from the APM subsystem under
       FreeBSD.  Each time this functions is called (once every second)
       the APM device is opened, read from and then closed.
-@@ -411,7 +419,7 @@ update_apm_status(t_battmon *battmon)
+@@ -401,7 +416,7 @@ update_apm_status(t_battmon *battmon)
          acline = apm.ac_line_status ? TRUE : FALSE;
  
      }
@@ -39,7 +53,7 @@
      else {
   /* This is how I read the information from the APM subsystem under
       FreeBSD.  Each time this functions is called (once every second)
-@@ -510,6 +518,11 @@ battmon.c:241: for each function it appe
+@@ -500,6 +515,11 @@ battmon.c:241: for each function it appe
      if(battmon->options.display_percentage && charge > 0 && !(battmon->options.hide_when_full && acline && charge >= 99)){
          gtk_widget_show(GTK_WIDGET(battmon->charge));
          gtk_widget_show(GTK_WIDGET(battmon->timechargealignment));
@@ -51,7 +65,7 @@
          g_snprintf(buffer, sizeof(buffer),"%d%% ", charge);
          gtk_label_set_text(battmon->charge,buffer);
      } else {
-@@ -519,6 +532,10 @@ battmon.c:241: for each function it appe
+@@ -509,6 +529,10 @@ battmon.c:241: for each function it appe
      if (battmon->options.display_time && time_remaining > 0 && !(battmon->options.hide_when_full && acline && charge >= 99 )){
          gtk_widget_show(GTK_WIDGET(battmon->rtime));
          gtk_widget_show(GTK_WIDGET(battmon->timechargealignment));



Home | Main Index | Thread Index | Old Index