Hi,

The fix is taken from Gentoo [0]. While here i've updated HOMEPAGE and
MASTER_SITES, refreshed WANTLIB and an existing patch.

It works fine on amd64. 

OK? 

Charlène.


[0]
https://gitweb.gentoo.org/repo/gentoo.git/tree/x11-plugins/wmapm/files/wmapm-3.1-fno-common.patch


Index: Makefile
===================================================================
RCS file: /cvs/ports/sysutils/wmapm/Makefile,v
retrieving revision 1.30
diff -u -p -u -p -r1.30 Makefile
--- Makefile    12 Jul 2019 20:49:54 -0000      1.30
+++ Makefile    30 Jan 2021 15:14:37 -0000
@@ -5,16 +5,16 @@ ONLY_FOR_ARCHS=               ${APM_ARCHS}
 COMMENT=               wm-dockapp; APM/battery monitor
 
 DISTNAME=              wmapm-3.1
-REVISION =             3
+REVISION =             4
 CATEGORIES=            sysutils x11 x11/windowmaker
 
-HOMEPAGE=              http://nis-www.lanl.gov/~mgh/WindowMaker/DockApps.shtml
+HOMEPAGE=              https://www.dockapps.net/wmapm
 
 # GPL
 PERMIT_PACKAGE=        Yes
-WANTLIB=               X11 Xext Xpm c xcb
+WANTLIB=               X11 Xext Xpm c
 
-MASTER_SITES=          http://nis-www.lanl.gov/~mgh/WindowMaker/
+MASTER_SITES=          https://www.dockapps.net/download/
 
 NO_TEST=               Yes
 
Index: patches/patch-wmapm_c
===================================================================
RCS file: /cvs/ports/sysutils/wmapm/patches/patch-wmapm_c,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 patch-wmapm_c
--- patches/patch-wmapm_c       7 Mar 2005 05:37:20 -0000       1.2
+++ patches/patch-wmapm_c       30 Jan 2021 15:14:37 -0000
@@ -1,6 +1,7 @@
 $OpenBSD: patch-wmapm_c,v 1.2 2005/03/07 05:37:20 mcbride Exp $
---- wmapm/wmapm.c.orig Tue Jan 11 17:37:25 2000
-+++ wmapm/wmapm.c      Wed Jan 10 17:35:20 2001
+Index: wmapm/wmapm.c
+--- wmapm/wmapm.c.orig
++++ wmapm/wmapm.c
 @@ -151,12 +151,17 @@
  #endif
  
@@ -84,20 +85,21 @@ $OpenBSD: patch-wmapm_c,v 1.2 2005/03/07
  #endif
  
                /*
-@@ -417,9 +427,10 @@ int main(int argc, char *argv[]) {
+@@ -417,10 +427,11 @@ int main(int argc, char *argv[]) {
  
  #ifdef Linux
                time_left = (my_cur_info.using_minutes) ? 
my_cur_info.battery_time : my_cur_info.battery_time / 60;
--#endif
--#ifdef FreeBSD
--              time_left = (my_cur_info.using_minutes) ? 
my_cur_info.battery_time / 60 : my_cur_info.battery_time / 3600;
 +#elif defined(FreeBSD)
 +              time_left = my_cur_info.battery_time / 3600;
 +#elif defined(__OpenBSD__)
 +              time_left = my_cur_info.battery_time;
  #endif
+-#ifdef FreeBSD
+-              time_left = (my_cur_info.using_minutes) ? 
my_cur_info.battery_time / 60 : my_cur_info.battery_time / 3600;
+-#endif
  
                hour_left = time_left / 60;
+               min_left  = time_left % 60;
 @@ -689,7 +700,7 @@ void pressEvent(XButtonEvent *xev){
        copyXPMArea(21, 106, 13, 11, 46, 48);
        RedrawWindow();
@@ -131,13 +133,13 @@ $OpenBSD: patch-wmapm_c,v 1.2 2005/03/07
 -#endif 
 +#elif defined(__OpenBSD__)
 +int apm_read(struct apm_power_info *temp_info) {
-+
+ 
+-#ifdef SunOS
 +    int fd;
 +   
 +    if ( (fd = open(APMDEV, O_RDONLY)) < 0){
 +      return(1);
- 
--#ifdef SunOS
++
 +    } else if ( ioctl(fd, APM_IOC_GETPOWER, temp_info) == -1 ) {
 +
 +        close(fd);
Index: patches/patch-wmgeneral_wmgeneral_c
===================================================================
RCS file: patches/patch-wmgeneral_wmgeneral_c
diff -N patches/patch-wmgeneral_wmgeneral_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-wmgeneral_wmgeneral_c 30 Jan 2021 15:14:37 -0000
@@ -0,0 +1,15 @@
+$OpenBSD$
+
+Fix -fno-common build failure.
+
+Index: wmgeneral/wmgeneral.c
+--- wmgeneral/wmgeneral.c.orig
++++ wmgeneral/wmgeneral.c
+@@ -50,6 +50,7 @@ Window               iconwin, win;
+ GC                    NormalGC;
+ XpmIcon               wmgen;
+ Pixmap                pixmask;
++Display               *display;
+ 
+   /*****************/
+  /* Mouse Regions */
Index: patches/patch-wmgeneral_wmgeneral_h
===================================================================
RCS file: patches/patch-wmgeneral_wmgeneral_h
diff -N patches/patch-wmgeneral_wmgeneral_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-wmgeneral_wmgeneral_h 30 Jan 2021 15:14:37 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Fix -fno-common build failure.
+
+Index: wmgeneral/wmgeneral.h
+--- wmgeneral/wmgeneral.h.orig
++++ wmgeneral/wmgeneral.h
+@@ -28,7 +28,7 @@ typedef struct {
+  /* Global variable */
+ /*******************/
+ 
+-Display               *display;
++extern Display                *display;
+ 
+   /***********************/
+  /* Function Prototypes */

Reply via email to