The below diff updates wmmoonclock to 1.30. This fixes the `-fno-common'
issue out of the box. Note that it uses a configure script instead of a
Makefile.
Port-wise:
- drop the whole Makefile patch, flags are good out of the box, and
the new build system uses pkg-config, so everything is in place
- provide a .desktop file
- keep the legacy binary name, upstream provides an all lower cased
binary, but a camel cased manpage
- move HOMEPAGE and MASTER_SITES to dockapps.net
Testing:
It has been build and run tested on amd64 and macppc successfully.
Comments/feedback are welcome,
Charlène.
Index: Makefile
===================================================================
RCS file: /cvs/ports/astro/wmmoonclock/Makefile,v
retrieving revision 1.34
diff -u -p -u -p -r1.34 Makefile
--- Makefile 26 Jan 2020 11:14:29 -0000 1.34
+++ Makefile 1 Feb 2021 14:47:55 -0000
@@ -2,22 +2,26 @@
COMMENT= wm-dockapp; shows the moon phase
-DISTNAME= wmMoonClock-1.27
-PKGNAME= ${DISTNAME:L}
-REVISION= 5
+DISTNAME= wmmoonclock-1.30
CATEGORIES= astro x11 x11/windowmaker
+HOMEPAGE= https://www.dockapps.net/wmmoonclock
+
# GPL
PERMIT_PACKAGE= Yes
WANTLIB= X11 Xext Xpm c m
-MASTER_SITES= https://distfiles.sigtrap.nl/
+MASTER_SITES= https://www.dockapps.net/download/
+
+RUN_DEPENDS= devel/desktop-file-utils
-MAKE_ENV= CC="${CC}"
+CONFIGURE_STYLE= gnu
NO_TEST= Yes
-WRKSRC= ${WRKDIST}/Src
+# Keep the legacy binary name (and match with the manpage name)
+post-install:
+ cd ${PREFIX}/bin && mv wmmoonclock wmMoonClock
.include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/astro/wmmoonclock/distinfo,v
retrieving revision 1.4
diff -u -p -u -p -r1.4 distinfo
--- distinfo 4 Apr 2013 16:06:27 -0000 1.4
+++ distinfo 1 Feb 2021 14:47:55 -0000
@@ -1,2 +1,2 @@
-SHA256 (wmMoonClock-1.27.tar.gz) = Q50zCjDuHLCE4FEuiU9eGi6YaXRaInT72aVoMsFSfHc=
-SIZE (wmMoonClock-1.27.tar.gz) = 155197
+SHA256 (wmmoonclock-1.30.tar.gz) = i6fc6xDOP3eEgDUwOd5HQEU3rzUJLJQa5O4Ifp49Q6A=
+SIZE (wmmoonclock-1.30.tar.gz) = 238171
Index: patches/patch-Makefile
===================================================================
RCS file: patches/patch-Makefile
diff -N patches/patch-Makefile
--- patches/patch-Makefile 18 Dec 2007 10:39:47 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,41 +0,0 @@
-$OpenBSD: patch-Makefile,v 1.2 2007/12/18 10:39:47 ajacoutot Exp $
---- Src/Makefile.orig Tue Mar 23 03:20:32 1999
-+++ Src/Makefile Tue Dec 18 10:16:26 2007
-@@ -1,8 +1,5 @@
--CC = gcc
--CFLAGS = -O2
--INCDIR = -I/usr/X11R6/include/X11
--DESTDIR= /usr/X11R6
--LIBDIR = -L/usr/X11R6/lib
-+CFLAGS += -I${X11BASE}/include
-+LIBDIR = -L${X11BASE}/lib
-
- # for Linux
- LIBS = -lXpm -lX11 -lXext
-@@ -13,16 +10,11 @@ LIBS = -lXpm -lX11 -lXext
- OBJS = wmMoonClock.o CalcEphem.o Moon.o MoonRise.o \
- xutils.o
-
--
--.c.o:
-- $(CC) $(CFLAGS) -D$(shell echo `uname -s`) -c $< -o $*.o $(INCDIR)
--
--
- all: wmMoonClock.o wmMoonClock
-
- wmMoonClock.o: wmMoonClock_master.xpm wmMoonClock_mask.xbm CalcEphem.h
- wmMoonClock: $(OBJS)
-- $(CC) $(COPTS) $(SYSTEM) -lm -o wmMoonClock $^ $(INCDIR) $(LIBDIR)
$(LIBS)
-+ $(CC) $(COPTS) $(SYSTEM) -o wmMoonClock $(OBJS) $(INCDIR) $(LIBDIR)
$(LIBS) -lm
-
- clean:
- for i in $(OBJS) ; do \
-@@ -31,6 +23,6 @@ clean:
- rm -f wmMoonClock
-
- install:: wmMoonClock
-- install -s -m 0755 wmMoonClock $(DESTDIR)/bin
-- install -m 0644 wmMoonClock.1 $(DESTDIR)/man/man1
-+ $(BSD_INSTALL_PROGRAM) wmMoonClock $(PREFIX)/bin
-+ $(BSD_INSTALL_MAN) wmMoonClock.1 $(PREFIX)/man/man1
-
Index: patches/patch-wmMoonClock_c
===================================================================
RCS file: /cvs/ports/astro/wmmoonclock/patches/patch-wmMoonClock_c,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 patch-wmMoonClock_c
--- patches/patch-wmMoonClock_c 18 Dec 2007 10:39:47 -0000 1.2
+++ patches/patch-wmMoonClock_c 1 Feb 2021 14:47:55 -0000
@@ -1,16 +1,17 @@
$OpenBSD: patch-wmMoonClock_c,v 1.2 2007/12/18 10:39:47 ajacoutot Exp $
---- Src/wmMoonClock.c.orig Mon Jun 7 16:27:18 1999
-+++ Src/wmMoonClock.c Tue Dec 18 10:16:26 2007
-@@ -162,7 +162,7 @@ int main(int argc, char *argv[]) {
- int i, n, k, j, ImageNumber;
- int Year, Month, DayOfWeek, DayOfMonth;
- int Hours, Mins, Secs, OldSecs, digit, xoff, xsize;
+Index: src/wmMoonClock.c
+--- src/wmMoonClock.c.orig
++++ src/wmMoonClock.c
+@@ -157,7 +157,7 @@ int main(int argc, char *argv[]) {
+ struct tm *GMTTime, *LocalTime;
+ XEvent event;
+ int i, n, j, ImageNumber, Year, Month, DayOfMonth,
digit;
- long CurrentLocalTime, CurrentGMTTime, date;
+ time_t CurrentLocalTime, CurrentGMTTime, date;
double UT, val, RA, DEC, UTRise, UTSet, LocalHour, hour24();
int D, H, M, S, sgn, A, B, q;
- char str[10];
-@@ -771,7 +771,7 @@ void ParseCMDLine(int argc, char *argv[]) {
+ CTrans c;
+@@ -775,7 +775,7 @@ void ParseCMDLine(int argc, char *argv[]) {
print_usage();
exit(-1);
}
@@ -19,7 +20,7 @@ $OpenBSD: patch-wmMoonClock_c,v 1.2 2007
} else if (!strcmp(argv[i], "-lc")){
-@@ -780,7 +780,7 @@ void ParseCMDLine(int argc, char *argv[]) {
+@@ -784,7 +784,7 @@ void ParseCMDLine(int argc, char *argv[]) {
print_usage();
exit(-1);
}
@@ -28,7 +29,7 @@ $OpenBSD: patch-wmMoonClock_c,v 1.2 2007
} else if (!strcmp(argv[i], "-dc")){
-@@ -789,7 +789,7 @@ void ParseCMDLine(int argc, char *argv[]) {
+@@ -793,7 +793,7 @@ void ParseCMDLine(int argc, char *argv[]) {
print_usage();
exit(-1);
}
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/astro/wmmoonclock/pkg/PLIST,v
retrieving revision 1.3
diff -u -p -u -p -r1.3 PLIST
--- pkg/PLIST 12 May 2018 09:41:31 -0000 1.3
+++ pkg/PLIST 1 Feb 2021 14:47:55 -0000
@@ -1,3 +1,6 @@
@comment $OpenBSD: PLIST,v 1.3 2018/05/12 09:41:31 espie Exp $
@bin bin/wmMoonClock
@man man/man1/wmMoonClock.1
+share/applications/
+share/applications/wmmoonclock.desktop
+@tag update-desktop-database