git: 9d74a305e773 - main - x11-clocks/wmclockmon: resurrect

From: Jesper Schmitz Mouridsen <jsm_at_FreeBSD.org>
Date: Mon, 05 Dec 2022 15:13:04 UTC
The branch main has been updated by jsm:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9d74a305e773815efa751ef3e4182bb660450ad2

commit 9d74a305e773815efa751ef3e4182bb660450ad2
Author:     Jesper Schmitz Mouridsen <jsm@FreeBSD.org>
AuthorDate: 2022-12-05 15:09:04 +0000
Commit:     Jesper Schmitz Mouridsen <jsm@FreeBSD.org>
CommitDate: 2022-12-05 15:12:42 +0000

    x11-clocks/wmclockmon: resurrect
    
     Update to gtk20 with patch from debian.
     Fix build with -fno-common from openbsd patches.
    
    PR:             268143
---
 MOVED                                              |   1 -
 x11-clocks/Makefile                                |   1 +
 x11-clocks/wmclockmon/Makefile                     |  34 +++++
 x11-clocks/wmclockmon/distinfo                     |   3 +
 x11-clocks/wmclockmon/files/patch-src_main.c       |  33 +++++
 .../wmclockmon/files/patch-wmclockmon-cal_main.c   |  25 ++++
 .../wmclockmon/files/patch-wmclockmon-cal_main.h   |  11 ++
 .../files/patch-wmclockmon-cal_mainwindow.c        | 147 +++++++++++++++++++++
 .../files/patch-wmclockmon-cal_mainwindow.h        |  36 +++++
 .../files/patch-wmclockmon-config_actions.c        |  27 ++++
 .../files/patch-wmclockmon-config_dialogs.c        |  18 +++
 .../files/patch-wmclockmon-config_edit.c           |  18 +++
 .../files/patch-wmclockmon-config_edit.h           |  11 ++
 .../files/patch-wmclockmon-config_mainwindow.c     |  76 +++++++++++
 .../files/patch-wmclockmon-config_mainwindow.h     |  44 ++++++
 .../files/patch-wmclockmon-config_tools.c          |  24 ++++
 .../files/patch-wmclockmon-config_variables.h      |  41 ++++++
 x11-clocks/wmclockmon/pkg-descr                    |   2 +
 x11-clocks/wmclockmon/pkg-plist                    |  80 +++++++++++
 19 files changed, 631 insertions(+), 1 deletion(-)

diff --git a/MOVED b/MOVED
index a981e69146ac..2d6045d8ef8d 100644
--- a/MOVED
+++ b/MOVED
@@ -10711,7 +10711,6 @@ games/kajongg||2018-12-21|Has expired: Broken for more than 6 months
 games/netspades||2018-12-21|Has expired: Uses obsolete glib12
 games/gtklife||2018-12-21|Has expired: Uses obsolete glib12
 biology/xmolwt||2018-12-21|Has expired: Uses obsolete glib12
-x11-clocks/wmclockmon||2018-12-21|Has expired: Uses obsolete glib12
 x11-clocks/asclock-gtk||2018-12-21|Has expired: Uses obsolete glib12
 net-im/gale||2018-12-21|Has expired: Uses obsolete glib12
 audio/xmms-ahx||2018-12-21|Has expired: Uses obsolete glib12, use audio/hvl2wav instead
diff --git a/x11-clocks/Makefile b/x11-clocks/Makefile
index a775f9bf442c..95991bc42623 100644
--- a/x11-clocks/Makefile
+++ b/x11-clocks/Makefile
@@ -34,6 +34,7 @@
     SUBDIR += wmblueclock
     SUBDIR += wmcalclock
     SUBDIR += wmclock
+    SUBDIR += wmclockmon
     SUBDIR += wmfishtime
     SUBDIR += wmtime
     SUBDIR += wmtimer
diff --git a/x11-clocks/wmclockmon/Makefile b/x11-clocks/wmclockmon/Makefile
new file mode 100644
index 000000000000..0e29cd43d471
--- /dev/null
+++ b/x11-clocks/wmclockmon/Makefile
@@ -0,0 +1,34 @@
+PORTNAME=	wmclockmon
+PORTVERSION=	0.8.1
+PORTREVISION=	8
+CATEGORIES=	x11-clocks windowmaker
+MASTER_SITES=	http://tnemeth.free.fr/projets/programmes/
+
+MAINTAINER=	list@understudy.net
+COMMENT=	Digital clock dockapp with a similar look to wmcpuload
+WWW=		http://tnemeth.free.fr/projets/dockapps.html
+
+LICENSE=	GPLv2
+
+LIB_DEPENDS=	libharfbuzz.so:print/harfbuzz \
+		libfontconfig.so:x11-fonts/fontconfig \
+		libfreetype.so:print/freetype2
+
+USES=		xorg gnome pkgconfig
+USE_XORG=	xpm x11 xext
+USE_GNOME=	gtk20 cairo gdkpixbuf2
+
+GNU_CONFIGURE=	yes
+
+post-patch:
+	@${REINPLACE_CMD} -e 's|gtk-config|pkgconf gtk+-2.0|g'\
+		${WRKSRC}/wmclockmon-config/Makefile.in
+	 @${REINPLACE_CMD} -e 's|gtk-config|pkgconf gtk+-2.0|g'\
+		${WRKSRC}/wmclockmon-cal/Makefile.in
+post-install:
+	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
+.for i in 1 2
+	@${INSTALL_DATA} ${WRKSRC}/doc/sample${i}.wmclockmonrc ${STAGEDIR}${EXAMPLESDIR}
+.endfor
+
+.include <bsd.port.mk>
diff --git a/x11-clocks/wmclockmon/distinfo b/x11-clocks/wmclockmon/distinfo
new file mode 100644
index 000000000000..73743930067c
--- /dev/null
+++ b/x11-clocks/wmclockmon/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1670253089
+SHA256 (wmclockmon-0.8.1.tar.gz) = f6a77ea89512813acb00144ddc355c11dee7c89c39380563e68ea7098cfb418d
+SIZE (wmclockmon-0.8.1.tar.gz) = 138662
diff --git a/x11-clocks/wmclockmon/files/patch-src_main.c b/x11-clocks/wmclockmon/files/patch-src_main.c
new file mode 100644
index 000000000000..729b0b4eda52
--- /dev/null
+++ b/x11-clocks/wmclockmon/files/patch-src_main.c
@@ -0,0 +1,33 @@
+--- src/main.c.orig	2005-04-07 09:37:43 UTC
++++ src/main.c
+@@ -51,7 +51,7 @@
+ #define FREE(data) {if (data) free(data); data = NULL;}
+ #define SET_STRING(str, val) {if (str) free(str); str = xstrdup(val);}
+ 
+-#if defined(netbsd) || defined(openbsd) || defined(freebsd) || defined(darwin)
++#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__APPLE__)
+ #  define BSDTIMEZONE
+ #endif
+ 
+@@ -1270,10 +1270,10 @@ static void time_update() {
+     time_t     tnow;
+ 
+     time(&tnow);
+-    timeinfos = localtime(&tnow);
+ 
+     if (time_mode == INTERNET) {
+         long localtmzone;
++    	timeinfos = gmtime(&tnow);
+         swtime = timeinfos->tm_hour * 3600
+                + timeinfos->tm_min * 60
+                + timeinfos->tm_sec;
+@@ -1290,6 +1290,9 @@ static void time_update() {
+             swtime -= 1000;
+         else
+             if (swtime < 0) swtime += 1000;
++    }
++    else {
++    	timeinfos = localtime(&tnow);
+     }
+ }
+ 
diff --git a/x11-clocks/wmclockmon/files/patch-wmclockmon-cal_main.c b/x11-clocks/wmclockmon/files/patch-wmclockmon-cal_main.c
new file mode 100644
index 000000000000..197b39b6a14d
--- /dev/null
+++ b/x11-clocks/wmclockmon/files/patch-wmclockmon-cal_main.c
@@ -0,0 +1,25 @@
+--- wmclockmon-cal/main.c.orig	2022-12-03 21:39:45 UTC
++++ wmclockmon-cal/main.c
+@@ -15,6 +15,22 @@
+ #include "mainwindow.h"
+ #include "main.h"
+ 
++GtkWidget *application;
++GtkWidget *alarmlist;
++GtkWidget *wid_backlight;
++GtkWidget *wid_blink;
++GtkWidget *wid_styledir;
++GtkWidget *wid_stylename;
++GtkWidget *wid_color;
++GtkWidget *wid_command;
++GtkWidget *wid_msgcmd;
++GtkWidget *wid_h12;
++GtkWidget *wid_itm;
++GtkWidget *wid_locale;
++
++int selected_row;
++
++struct tm *timeinfos;
+ 
+ void Usage () {
+     printf("Usage: "PACKAGE"-cal [-h] [-v]\n"
diff --git a/x11-clocks/wmclockmon/files/patch-wmclockmon-cal_main.h b/x11-clocks/wmclockmon/files/patch-wmclockmon-cal_main.h
new file mode 100644
index 000000000000..ac8b01771a5b
--- /dev/null
+++ b/x11-clocks/wmclockmon/files/patch-wmclockmon-cal_main.h
@@ -0,0 +1,11 @@
+--- wmclockmon-cal/main.h.orig	2022-12-03 21:02:51 UTC
++++ wmclockmon-cal/main.h
+@@ -9,7 +9,7 @@
+ #include <sys/time.h>
+ 
+ 
+-struct tm *timeinfos;
++extern struct tm *timeinfos;
+ 
+ void quit_app();
+ 
diff --git a/x11-clocks/wmclockmon/files/patch-wmclockmon-cal_mainwindow.c b/x11-clocks/wmclockmon/files/patch-wmclockmon-cal_mainwindow.c
new file mode 100644
index 000000000000..c126d4ce7aa7
--- /dev/null
+++ b/x11-clocks/wmclockmon/files/patch-wmclockmon-cal_mainwindow.c
@@ -0,0 +1,147 @@
+--- wmclockmon-cal/mainwindow.c.orig	2005-04-07 09:37:43 UTC
++++ wmclockmon-cal/mainwindow.c
+@@ -51,7 +51,6 @@ static void show_editor() {
+     gtk_widget_hide(calendar);
+     gtk_widget_hide(closewindow);
+     gtk_widget_grab_default(GTK_WIDGET(cancel));
+-    gtk_widget_draw_default(GTK_WIDGET(cancel));
+     gtk_widget_grab_focus(GTK_WIDGET(edit));
+     gtk_widget_show(text_buttons);
+     gtk_widget_show(edit);
+@@ -69,7 +68,6 @@ static void hide_editor() {
+     gtk_widget_hide(cancel);
+     gtk_widget_show(calendar);
+     gtk_widget_grab_default(GTK_WIDGET(closewindow));
+-    gtk_widget_draw_default(GTK_WIDGET(closewindow));
+     gtk_widget_grab_focus(GTK_WIDGET(closewindow));
+     gtk_widget_show(closewindow);
+ }
+@@ -93,13 +91,20 @@ static void load_file(const char *datestr) {
+     FILE *file;
+     char *filename = get_file(datestr);
+ 
++    GtkTextIter iter;
++    GtkTextBuffer *buf;
++
++    buf = GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(edit)));
++    gtk_text_buffer_get_end_iter(GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(edit))), &iter);
++    gtk_text_buffer_place_cursor(GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(edit))), &iter);
++
+     if ((file = fopen(filename, "r")) != NULL) {
+         while (! feof(file)) {
+             char line[MAXSTRLEN + 1];
+             bzero(line, MAXSTRLEN + 1);
+             fgets(line, MAXSTRLEN, file);
+             if (line[0] != 0)
+-                gtk_text_insert(GTK_TEXT(edit), NULL, NULL, NULL, line, -1);
++	      gtk_text_buffer_insert(buf, &iter, line, -1);
+         }
+         fclose(file);
+     }
+@@ -154,21 +159,14 @@ static void set_buttons_text() {
+ 
+ 
+ static void editor_flush() {
+-    int cont = TRUE;
+-
+-    while (cont) {
+-       cont = gtk_text_backward_delete(GTK_TEXT(edit), 1);
+-    }
+-    cont = TRUE;
+-    while (cont) {
+-       cont = gtk_text_forward_delete(GTK_TEXT(edit), 1);
+-    }
++    gtk_text_buffer_set_text(GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(edit))), "", 0);
+ }
+ 
+ 
+ static void editor_fill(int which) {
+     char *filename, *dstr;
+     GtkWidget *label;
++    GtkTextIter iter;
+ 
+     switch (which) {
+         case UNIQUE: label = label_u; break;
+@@ -179,11 +177,10 @@ static void editor_fill(int which) {
+     gtk_label_get(GTK_LABEL(label), &dstr);
+     strcpy(daystr, dstr);
+     to_button(which);
+-    gtk_text_freeze(GTK_TEXT(edit));
+     editor_flush();
+     load_file(daystr);
+-    gtk_text_set_point(GTK_TEXT(edit), gtk_text_get_length(GTK_TEXT(edit)));
+-    gtk_text_thaw(GTK_TEXT(edit));
++    gtk_text_buffer_get_end_iter(GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(edit))), &iter);
++    gtk_text_buffer_place_cursor(GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(edit))), &iter);
+ }
+ 
+ 
+@@ -225,8 +222,15 @@ static void save_datas() {
+     char *dirname  = xmalloc(len + 2);
+     struct stat stat_buf;
+ 
++    GtkTextIter ts, te;
++    gchar *tbuf;
++    int tlen;
++
++    tlen = gtk_text_buffer_get_char_count(GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(edit))));
++    gtk_text_buffer_get_bounds(GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(edit))), &ts, &te);
++
+     sprintf(dirname, "%s/%s", robust_home(), DEFAULT_CONFIGDIR);
+-    if (gtk_text_get_length(GTK_TEXT(edit)) > 0) {
++    if (tlen > 0) {
+         if (! ((stat(dirname, &stat_buf) == 0) && S_ISDIR(stat_buf.st_mode)))
+             mkdir(dirname, 0755);
+ 
+@@ -235,13 +239,11 @@ static void save_datas() {
+             int   year, month, day;
+ 
+             if (file) {
+-                int i;
+-                for (i = 0 ; i < gtk_text_get_length(GTK_TEXT(edit)) ; i++) {
+-                    char t = GTK_TEXT_INDEX(GTK_TEXT(edit), i);
+-                    fprintf(file, "%c", t);
+-                }
+-                fflush(file);
+-                fclose(file);
++	      tbuf = gtk_text_buffer_get_text(GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(edit))), &ts, &te, TRUE);
++	      fprintf(file, "%s", tbuf);
++	      g_free(tbuf);
++	      fflush(file);
++	      fclose(file);
+             }
+             gtk_calendar_get_date(GTK_CALENDAR(calendar), &year, &month, &day);
+             gtk_calendar_mark_day(GTK_CALENDAR(calendar), day);
+@@ -259,9 +261,7 @@ static void delete_file() {
+     gtk_calendar_get_date(GTK_CALENDAR(calendar), &year, &month, &day);
+     gtk_calendar_unmark_day(GTK_CALENDAR(calendar), day);
+     FREE(filename);
+-    gtk_text_freeze(GTK_TEXT(edit));
+     editor_flush();
+-    gtk_text_thaw(GTK_TEXT(edit));
+ }
+ 
+ 
+@@ -357,10 +357,10 @@ void create_mainwindow() {
+             GTK_SIGNAL_FUNC(mark_days), NULL);
+     gtk_widget_show(calendar);
+ 
+-    edit = gtk_text_new(NULL, NULL);
+-    gtk_text_set_editable(GTK_TEXT(edit), TRUE);
+-    gtk_text_set_word_wrap(GTK_TEXT(edit), TRUE);
+-    gtk_text_set_line_wrap(GTK_TEXT(edit), TRUE);
++    edit = gtk_text_view_new();
++    gtk_text_view_set_editable(GTK_TEXT_VIEW(edit), TRUE);
++    gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(edit), GTK_WRAP_WORD_CHAR);
++
+     gtk_box_pack_start(GTK_BOX(main_vbox), edit, TRUE, TRUE, 1);
+ 
+ 
+@@ -413,7 +413,6 @@ void create_mainwindow() {
+     gtk_box_pack_start(GTK_BOX(buttons_hbox), closewindow, TRUE, TRUE, 0);
+     GTK_WIDGET_SET_FLAGS(GTK_WIDGET(closewindow), GTK_CAN_DEFAULT);
+     gtk_widget_grab_default(GTK_WIDGET(closewindow));
+-    gtk_widget_draw_default(GTK_WIDGET(closewindow));
+     gtk_widget_show(closewindow);
+ 
+ 
diff --git a/x11-clocks/wmclockmon/files/patch-wmclockmon-cal_mainwindow.h b/x11-clocks/wmclockmon/files/patch-wmclockmon-cal_mainwindow.h
new file mode 100644
index 000000000000..ff2ce924d2c3
--- /dev/null
+++ b/x11-clocks/wmclockmon/files/patch-wmclockmon-cal_mainwindow.h
@@ -0,0 +1,36 @@
+--- wmclockmon-cal/mainwindow.h.orig	2005-04-07 09:37:43 UTC
++++ wmclockmon-cal/mainwindow.h
+@@ -7,20 +7,20 @@
+ 
+ #include <gtk/gtk.h>
+ 
+-GtkWidget *application;
+-GtkWidget *alarmlist;
+-GtkWidget *wid_backlight;
+-GtkWidget *wid_blink;
+-GtkWidget *wid_styledir;
+-GtkWidget *wid_stylename;
+-GtkWidget *wid_color;
+-GtkWidget *wid_command;
+-GtkWidget *wid_msgcmd;
+-GtkWidget *wid_h12;
+-GtkWidget *wid_itm;
+-GtkWidget *wid_locale;
++extern GtkWidget *application;
++extern GtkWidget *alarmlist;
++extern GtkWidget *wid_backlight;
++extern GtkWidget *wid_blink;
++extern GtkWidget *wid_styledir;
++extern GtkWidget *wid_stylename;
++extern GtkWidget *wid_color;
++extern GtkWidget *wid_command;
++extern GtkWidget *wid_msgcmd;
++extern GtkWidget *wid_h12;
++extern GtkWidget *wid_itm;
++extern GtkWidget *wid_locale;
+ 
+-int selected_row;
++extern int selected_row;
+ 
+ gint list_unsel_cb (GtkCList *clist,
+         gint row,
diff --git a/x11-clocks/wmclockmon/files/patch-wmclockmon-config_actions.c b/x11-clocks/wmclockmon/files/patch-wmclockmon-config_actions.c
new file mode 100644
index 000000000000..b30731bf9125
--- /dev/null
+++ b/x11-clocks/wmclockmon/files/patch-wmclockmon-config_actions.c
@@ -0,0 +1,27 @@
+--- wmclockmon-config/actions.c.orig	2005-04-07 09:37:43 UTC
++++ wmclockmon-config/actions.c
+@@ -19,6 +19,24 @@
+ #include "edit.h"
+ #include "actions.h"
+ 
++GtkWidget *application;
++GtkWidget *alarmlist;
++GtkWidget *wid_backlight;
++GtkWidget *wid_blink;
++GtkWidget *wid_styledir;
++GtkWidget *wid_stylename;
++GtkWidget *wid_color;
++GtkWidget *wid_command;
++GtkWidget *wid_msgcmd;
++GtkWidget *wid_h12;
++GtkWidget *wid_clk;
++GtkWidget *wid_itm;
++GtkWidget *wid_bin;
++GtkWidget *wid_locale;
++GtkWidget *wid_showcal;
++GtkWidget *wid_calalrms;
++
++int selected_row;
+ 
+ void quit_app() {
+     FREE(command);
diff --git a/x11-clocks/wmclockmon/files/patch-wmclockmon-config_dialogs.c b/x11-clocks/wmclockmon/files/patch-wmclockmon-config_dialogs.c
new file mode 100644
index 000000000000..263f059cde66
--- /dev/null
+++ b/x11-clocks/wmclockmon/files/patch-wmclockmon-config_dialogs.c
@@ -0,0 +1,18 @@
+--- wmclockmon-config/dialogs.c.orig	2005-04-07 09:37:43 UTC
++++ wmclockmon-config/dialogs.c
+@@ -38,7 +38,6 @@ void ync_dialog(const char *title, const char *text, v
+                        bouton, TRUE, TRUE, 0);
+     GTK_WIDGET_SET_FLAGS(GTK_WIDGET(bouton), GTK_CAN_DEFAULT);
+     gtk_widget_grab_default(GTK_WIDGET(bouton));
+-    gtk_widget_draw_default(GTK_WIDGET(bouton));
+     gtk_widget_show(bouton);
+ 
+     bouton = gtk_button_new_with_label("No");
+@@ -96,7 +95,6 @@ void ok_dialog(const char *title, const char *text) {
+                        bouton, TRUE, TRUE, 0);
+     GTK_WIDGET_SET_FLAGS(GTK_WIDGET(bouton), GTK_CAN_DEFAULT);
+     gtk_widget_grab_default(GTK_WIDGET(bouton));
+-    gtk_widget_draw_default(GTK_WIDGET(bouton));
+     gtk_widget_show(bouton);
+ 
+     gtk_container_set_border_width(GTK_CONTAINER
diff --git a/x11-clocks/wmclockmon/files/patch-wmclockmon-config_edit.c b/x11-clocks/wmclockmon/files/patch-wmclockmon-config_edit.c
new file mode 100644
index 000000000000..b2c4061c0b12
--- /dev/null
+++ b/x11-clocks/wmclockmon/files/patch-wmclockmon-config_edit.c
@@ -0,0 +1,18 @@
+--- wmclockmon-config/edit.c.orig	2005-04-07 09:37:43 UTC
++++ wmclockmon-config/edit.c
+@@ -10,6 +10,7 @@
+ #include "defines.h"
+ #include "tools.h"
+ #include "edit.h"
++char *newalarm;
+ 
+ static GtkWidget *wid_status;
+ static GtkWidget *wid_time;
+@@ -76,7 +77,6 @@ void edit_dialog(const char *title,
+                        bouton, TRUE, TRUE, 0);
+     GTK_WIDGET_SET_FLAGS(GTK_WIDGET(bouton), GTK_CAN_DEFAULT);
+     gtk_widget_grab_default(GTK_WIDGET(bouton));
+-    gtk_widget_draw_default(GTK_WIDGET(bouton));
+     gtk_widget_show(bouton);
+ 
+     bouton = gtk_button_new_with_label("Cancel");
diff --git a/x11-clocks/wmclockmon/files/patch-wmclockmon-config_edit.h b/x11-clocks/wmclockmon/files/patch-wmclockmon-config_edit.h
new file mode 100644
index 000000000000..efc67506ed79
--- /dev/null
+++ b/x11-clocks/wmclockmon/files/patch-wmclockmon-config_edit.h
@@ -0,0 +1,11 @@
+--- wmclockmon-config/edit.h.orig	2022-12-03 20:48:12 UTC
++++ wmclockmon-config/edit.h
+@@ -5,7 +5,7 @@
+ #ifndef EDIT_H
+ #define EDIT_H
+ 
+-char *newalarm;
++extern char *newalarm;
+ 
+ void edit_dialog(const char *title,
+         int on,
diff --git a/x11-clocks/wmclockmon/files/patch-wmclockmon-config_mainwindow.c b/x11-clocks/wmclockmon/files/patch-wmclockmon-config_mainwindow.c
new file mode 100644
index 000000000000..ddbdabf4f78f
--- /dev/null
+++ b/x11-clocks/wmclockmon/files/patch-wmclockmon-config_mainwindow.c
@@ -0,0 +1,76 @@
+--- wmclockmon-config/mainwindow.c.orig	2005-04-07 09:37:43 UTC
++++ wmclockmon-config/mainwindow.c
+@@ -10,9 +10,9 @@
+ #include "actions.h"
+ 
+ 
+-static GtkWidget *edit;
+-static GtkWidget *set;
+-static GtkWidget *remove;
++static GtkWidget *b_edit;
++static GtkWidget *b_set;
++static GtkWidget *b_remove;
+ 
+ static gint list_sel_cb (GtkCList *clist,
+                          gint row,
+@@ -20,9 +20,9 @@ static gint list_sel_cb (GtkCList *clist,
+                          GdkEventButton *event,
+                          void *data) {
+     selected_row = row;
+-    gtk_widget_set_sensitive(edit,   TRUE);
+-    gtk_widget_set_sensitive(set,    TRUE);
+-    gtk_widget_set_sensitive(remove, TRUE);
++    gtk_widget_set_sensitive(b_edit,   TRUE);
++    gtk_widget_set_sensitive(b_set,    TRUE);
++    gtk_widget_set_sensitive(b_remove, TRUE);
+     return TRUE;
+ }
+ 
+@@ -33,9 +33,9 @@ gint list_unsel_cb (GtkCList *clist,
+                            GdkEventButton *event,
+                            void *data) {
+     selected_row = -1;
+-    gtk_widget_set_sensitive(edit,   FALSE);
+-    gtk_widget_set_sensitive(set,    FALSE);
+-    gtk_widget_set_sensitive(remove, FALSE);
++    gtk_widget_set_sensitive(b_edit,   FALSE);
++    gtk_widget_set_sensitive(b_set,    FALSE);
++    gtk_widget_set_sensitive(b_remove, FALSE);
+     return TRUE;
+ }
+ 
+@@ -267,7 +267,7 @@ void create_mainwindow() {
+     gtk_table_attach_defaults(GTK_TABLE(table), bouton, 0, 1, 1, 2);
+     gtk_widget_set_sensitive(bouton, FALSE);
+     gtk_widget_show(bouton);
+-    edit = bouton;
++    b_edit = bouton;
+ 
+     bouton = gtk_button_new_with_label(" Switch On/Off ");
+     gtk_signal_connect(GTK_OBJECT(bouton), "clicked",
+@@ -275,7 +275,7 @@ void create_mainwindow() {
+     gtk_table_attach_defaults(GTK_TABLE(table), bouton, 1, 2, 1, 2);
+     gtk_widget_set_sensitive(bouton, FALSE);
+     gtk_widget_show(bouton);
+-    set = bouton;
++    b_set = bouton;
+ 
+     bouton = gtk_button_new_with_label(" Remove alarm ");
+     gtk_signal_connect(GTK_OBJECT(bouton), "clicked",
+@@ -283,7 +283,7 @@ void create_mainwindow() {
+     gtk_table_attach_defaults(GTK_TABLE(table), bouton, 1, 2, 0, 1);
+     gtk_widget_set_sensitive(bouton, FALSE);
+     gtk_widget_show(bouton);
+-    remove = bouton;
++    b_remove = bouton;
+ 
+ 
+     label = gtk_label_new(" Alarms ");
+@@ -312,7 +312,6 @@ void create_mainwindow() {
+     gtk_box_pack_start(GTK_BOX(buttons_hbox), bouton, TRUE, TRUE, 0);
+     GTK_WIDGET_SET_FLAGS(GTK_WIDGET(bouton), GTK_CAN_DEFAULT);
+     gtk_widget_grab_default(GTK_WIDGET(bouton));
+-    gtk_widget_draw_default(GTK_WIDGET(bouton));
+     gtk_widget_show(bouton);
+ 
+     bouton = gtk_button_new_with_label(" Cancel ");
diff --git a/x11-clocks/wmclockmon/files/patch-wmclockmon-config_mainwindow.h b/x11-clocks/wmclockmon/files/patch-wmclockmon-config_mainwindow.h
new file mode 100644
index 000000000000..27a48c6056f0
--- /dev/null
+++ b/x11-clocks/wmclockmon/files/patch-wmclockmon-config_mainwindow.h
@@ -0,0 +1,44 @@
+--- wmclockmon-config/mainwindow.h.orig	2005-04-07 09:37:43 UTC
++++ wmclockmon-config/mainwindow.h
+@@ -7,24 +7,24 @@
+ 
+ #include <gtk/gtk.h>
+ 
+-GtkWidget *application;
+-GtkWidget *alarmlist;
+-GtkWidget *wid_backlight;
+-GtkWidget *wid_blink;
+-GtkWidget *wid_styledir;
+-GtkWidget *wid_stylename;
+-GtkWidget *wid_color;
+-GtkWidget *wid_command;
+-GtkWidget *wid_msgcmd;
+-GtkWidget *wid_h12;
+-GtkWidget *wid_clk;
+-GtkWidget *wid_itm;
+-GtkWidget *wid_bin;
+-GtkWidget *wid_locale;
+-GtkWidget *wid_showcal;
+-GtkWidget *wid_calalrms;
++extern GtkWidget *application;
++extern GtkWidget *alarmlist;
++extern GtkWidget *wid_backlight;
++extern GtkWidget *wid_blink;
++extern GtkWidget *wid_styledir;
++extern GtkWidget *wid_stylename;
++extern GtkWidget *wid_color;
++extern GtkWidget *wid_command;
++extern GtkWidget *wid_msgcmd;
++extern GtkWidget *wid_h12;
++extern GtkWidget *wid_clk;
++extern GtkWidget *wid_itm;
++extern GtkWidget *wid_bin;
++extern GtkWidget *wid_locale;
++extern GtkWidget *wid_showcal;
++extern GtkWidget *wid_calalrms;
+ 
+-int selected_row;
++extern int selected_row;
+ 
+ gint list_unsel_cb (GtkCList *clist,
+         gint row,
diff --git a/x11-clocks/wmclockmon/files/patch-wmclockmon-config_tools.c b/x11-clocks/wmclockmon/files/patch-wmclockmon-config_tools.c
new file mode 100644
index 000000000000..5245d934ddaa
--- /dev/null
+++ b/x11-clocks/wmclockmon/files/patch-wmclockmon-config_tools.c
@@ -0,0 +1,24 @@
+--- wmclockmon-config/tools.c.orig	2022-12-03 20:34:55 UTC
++++ wmclockmon-config/tools.c
+@@ -17,6 +17,21 @@
+ #include <sys/types.h>
+ #include "configfile.h"
+ 
++int    backlight;
++int    switch_authorized;
++int    h12;
++int    time_mode;
++int    use_leds;
++int    use_locale;
++int    showcal;
++int    calalrms;
++char  *style_name;
++char  *style_dir;
++char  *config_file;
++char  *light_color;
++char  *command;
++char  *msgcmd;
++Alarm *alarms;
+ 
+ int fexist(const char *filename) {
+     FILE *file;
diff --git a/x11-clocks/wmclockmon/files/patch-wmclockmon-config_variables.h b/x11-clocks/wmclockmon/files/patch-wmclockmon-config_variables.h
new file mode 100644
index 000000000000..bfa98ed55a00
--- /dev/null
+++ b/x11-clocks/wmclockmon/files/patch-wmclockmon-config_variables.h
@@ -0,0 +1,41 @@
+Fix -fno-common build failure.
+
+Index: wmclockmon-config/variables.h
+--- wmclockmon-config/variables.h.orig	2005-04-07 09:37:43 UTC
++++ wmclockmon-config/variables.h
+@@ -7,20 +7,20 @@
+ 
+ #include "defines.h"
+ 
+-int    backlight;
+-int    switch_authorized;
+-int    h12;
+-int    time_mode;
+-int    use_leds;
+-int    use_locale;
+-int    showcal;
+-int    calalrms;
+-char  *style_name;
+-char  *style_dir;
+-char  *config_file;
+-char  *light_color;
+-char  *command;
+-char  *msgcmd;
+-Alarm *alarms;
++extern int    backlight;
++extern int    switch_authorized;
++extern int    h12;
++extern int    time_mode;
++extern int    use_leds;
++extern int    use_locale;
++extern int    showcal;
++extern int    calalrms;
++extern char  *style_name;
++extern char  *style_dir;
++extern char  *config_file;
++extern char  *light_color;
++extern char  *command;
++extern char  *msgcmd;
++extern Alarm *alarms;
+ 
+ #endif
diff --git a/x11-clocks/wmclockmon/pkg-descr b/x11-clocks/wmclockmon/pkg-descr
new file mode 100644
index 000000000000..5c6ce2d2f04c
--- /dev/null
+++ b/x11-clocks/wmclockmon/pkg-descr
@@ -0,0 +1,2 @@
+A digital clock dockapp with 3 different styles, and that uses
+locales to display weekday and month names.
diff --git a/x11-clocks/wmclockmon/pkg-plist b/x11-clocks/wmclockmon/pkg-plist
new file mode 100644
index 000000000000..0d4d815e6b61
--- /dev/null
+++ b/x11-clocks/wmclockmon/pkg-plist
@@ -0,0 +1,80 @@
+bin/wmclockmon
+bin/wmclockmon-cal
+bin/wmclockmon-config
+man/man1/wmclockmon-cal.1.gz
+man/man1/wmclockmon-config.1.gz
+man/man1/wmclockmon.1.gz
+%%EXAMPLESDIR%%/sample1.wmclockmonrc
+%%EXAMPLESDIR%%/sample2.wmclockmonrc
+%%DATADIR%%/backlight0_off.xpm
+%%DATADIR%%/backlight0_on.xpm
+%%DATADIR%%/backlight1_off.xpm
+%%DATADIR%%/backlight1_on.xpm
+%%DATADIR%%/backlight2_off.xpm
+%%DATADIR%%/backlight2_on.xpm
+%%DATADIR%%/backlight3_off.xpm
+%%DATADIR%%/backlight3_on.xpm
+%%DATADIR%%/backlight4_off.xpm
+%%DATADIR%%/backlight4_on.xpm
+%%DATADIR%%/backlight5_off.xpm
+%%DATADIR%%/backlight5_on.xpm
+%%DATADIR%%/backlight6_off.xpm
+%%DATADIR%%/backlight6_on.xpm
+%%DATADIR%%/backlightB_color_off.xpm
+%%DATADIR%%/backlightB_color_on.xpm
+%%DATADIR%%/backlightB_new_off.xpm
+%%DATADIR%%/backlightB_new_on.xpm
+%%DATADIR%%/backlightB_off.xpm
+%%DATADIR%%/backlightB_old_off.xpm
+%%DATADIR%%/backlightB_old_on.xpm
+%%DATADIR%%/backlightB_on.xpm
+%%DATADIR%%/backlightI_color_off.xpm
+%%DATADIR%%/backlightI_color_on.xpm
+%%DATADIR%%/backlightI_off.xpm
+%%DATADIR%%/backlightI_on.xpm
+%%DATADIR%%/backlight_0_color_off.xpm
+%%DATADIR%%/backlight_0_color_on.xpm
+%%DATADIR%%/backlight_1_color_off.xpm
+%%DATADIR%%/backlight_1_color_on.xpm
+%%DATADIR%%/backlight_2_color_off.xpm
+%%DATADIR%%/backlight_2_color_on.xpm
+%%DATADIR%%/backlight_3_color_off.xpm
+%%DATADIR%%/backlight_3_color_on.xpm
+%%DATADIR%%/backlight_4_color_off.xpm
+%%DATADIR%%/backlight_4_color_on.xpm
+%%DATADIR%%/backlight_5_color_off.xpm
+%%DATADIR%%/backlight_5_color_on.xpm
+%%DATADIR%%/backlight_6_color_off.xpm
+%%DATADIR%%/backlight_6_color_on.xpm
+%%DATADIR%%/default.bwcs
+%%DATADIR%%/default.iwcs
+%%DATADIR%%/default.lwcs
+%%DATADIR%%/default.mwcs
+%%DATADIR%%/default.pwcs
+%%DATADIR%%/lcd1.mwcs
+%%DATADIR%%/lcd2.mwcs
+%%DATADIR%%/lcd3.mwcs
+%%DATADIR%%/lcd4.mwcs
+%%DATADIR%%/lcd5.mwcs
+%%DATADIR%%/lcd6.mwcs
+%%DATADIR%%/led.bwcs
+%%DATADIR%%/led.iwcs
+%%DATADIR%%/led.lwcs
+%%DATADIR%%/led.pwcs
+%%DATADIR%%/led0.mwcs
+%%DATADIR%%/led1.mwcs
+%%DATADIR%%/led2.mwcs
+%%DATADIR%%/led3.mwcs
+%%DATADIR%%/led4.mwcs
+%%DATADIR%%/led5.mwcs
+%%DATADIR%%/led6.mwcs
+%%DATADIR%%/letters.xpm
+%%DATADIR%%/letters_color.xpm
+%%DATADIR%%/letters_new.xpm
+%%DATADIR%%/new.bwcs
+%%DATADIR%%/new.lwcs
+%%DATADIR%%/new.mwcs
+%%DATADIR%%/new.pwcs
+%%DATADIR%%/parts.xpm
+%%DATADIR%%/parts_color.xpm
+%%DATADIR%%/parts_new.xpm