On Mon, Dec 30 2024, Stuart Henderson wrote:

> On 2024/12/30 10:12, Timo Myyrä wrote:
>>       # dmenu path.
>>  -    dmenu = /usr/bin/dmenu -p dunst:
>> -+    dmenu = ${LOCALBASE}/bin/dmenu -p dunst:
>> ++    dmenu = ${PREFIX}/bin/dmenu -p dunst:
>>   
>>       # Browser for opening urls in context menu.
>>  -    browser = /usr/bin/xdg-open
>> -+    browser = ${LOCALBASE}/bin/xdg-open
>> ++    browser = ${PREFIX}/bin/xdg-open
>
> PREFIX is "comes from this port", those come from other ports
> so LOCALBASE was already correct.
>
>>  share/dunst/
>> -@sample ${SYSCONFDIR}/dunst/
>>  share/dunst/dunstrc
>> -@sample ${SYSCONFDIR}/dunst/dunstrc
>
> why remove those @samples?
>
>> +share/examples/bash-completion/
>> +share/examples/bash-completion/completions/
>> +share/examples/bash-completion/completions/dunst
>> +share/examples/bash-completion/completions/dunstctl
>>  share/examples/dbus-1/
>>  share/examples/dbus-1/services/
>>  share/examples/dbus-1/services/org.knopwob.dunst.service
>> +share/examples/fish/
>> +share/examples/fish/vendor_completions.d/
>> +share/examples/fish/vendor_completions.d/dunst.fish
>> +share/examples/fish/vendor_completions.d/dunstctl.fish
>> +share/examples/fish/vendor_completions.d/dunstify.fish
>> +share/examples/zsh/
>> +share/examples/zsh/site-functions/
>> +share/examples/zsh/site-functions/_dunst
>> +share/examples/zsh/site-functions/_dunstctl
>
> the completion scripts should go to share/bash-completion,
> share/fish/vendor_completions.d, share/zsh/site-functions rather
> than under share/examples

Good points, here's an updated diff.

timo

diff /usr/ports
commit - 249cdbc13b64ccbf1b0f4c92f4775e302caa0a15
path + /usr/ports
blob - eac7443cb23f53d564d0d50c9e3a4c894a1fda82
file + x11/dunst/Makefile
--- x11/dunst/Makefile
+++ x11/dunst/Makefile
@@ -2,8 +2,7 @@ COMMENT =       customizable and lightweight notification-da
 
 GH_ACCOUNT =   dunst-project
 GH_PROJECT =   dunst
-GH_TAGNAME =   v1.9.2
-REVISION =     0
+GH_TAGNAME =   v1.12.1
 
 CATEGORIES =   x11
 
@@ -44,7 +43,10 @@ MAKE_FLAGS = WAYLAND=0
 FAKE_FLAGS =   PREFIX="${PREFIX}" \
                MANPREFIX="${PREFIX}/man" \
                DATADIR="${PREFIX}/share/examples" \
-               SYSCONFDIR="/etc"
+               SYSCONFDIR="/etc" \
+               BASHCOMPLETIONDIR="${LOCALBASE}/share/bash-completion" \
+               
FISHCOMPLETIONDIR="${LOCALBASE}/share/fish/vendor_completions.d" \
+               ZSHCOMPLETIONDIR="${LOCALBASE}/share/zsh/site-functions"
 
 pre-configure:
        ${SUBST_CMD} ${WRKSRC}/docs/dunst.1.pod \
blob - 093bbc84211d476e0f7fa34991e242f0a06f73da
file + x11/dunst/distinfo
--- x11/dunst/distinfo
+++ x11/dunst/distinfo
@@ -1,2 +1,2 @@
-SHA256 (dunst-1.9.2.tar.gz) = +mzkXAr0uuGIsNZ5pbqS+Pm35DAbsbtHboLfJrzp5xo=
-SIZE (dunst-1.9.2.tar.gz) = 4614703
+SHA256 (dunst-1.12.1.tar.gz) = NAsQw47lGadbFAQPZVBdcoF4VzWM56b+IxkKtoeC+JI=
+SIZE (dunst-1.12.1.tar.gz) = 4654978
blob - 958ea4261737f9be45def56356d55fbd23c4dccb
file + x11/dunst/patches/patch-config_mk
--- x11/dunst/patches/patch-config_mk
+++ x11/dunst/patches/patch-config_mk
@@ -1,13 +1,13 @@
 Index: config.mk
 --- config.mk.orig
 +++ config.mk
-@@ -42,8 +42,8 @@ endif
+@@ -52,8 +52,8 @@ endif
  
  # flags
- DEFAULT_CPPFLAGS = -Wno-gnu-zero-variadic-macro-arguments -D_DEFAULT_SOURCE 
-DVERSION=\"${VERSION}\" -DSYSCONFDIR=\"${SYSCONFDIR}\"
--DEFAULT_CFLAGS   = -g -std=gnu99 -pedantic -Wall -Wno-overlength-strings -Os 
${ENABLE_WAYLAND} ${EXTRA_CFLAGS}
+ DEFAULT_CPPFLAGS = -Wno-gnu-zero-variadic-macro-arguments -D_DEFAULT_SOURCE 
-DVERSION=\"${VERSION}\" -DSYSCONFDIR=\"${SYSCONFDIR}\" ${ENABLE_WAYLAND} 
${ENABLE_X11}
+-DEFAULT_CFLAGS   = -g -std=gnu11 -pedantic -Wall -Wno-overlength-strings -Os 
${EXTRA_CFLAGS}
 -DEFAULT_LDFLAGS  = -lm -lrt
-+DEFAULT_CFLAGS   = -g -std=gnu99 -pedantic -Wall -Wno-overlength-strings 
${ENABLE_WAYLAND} ${EXTRA_CFLAGS}
++DEFAULT_CFLAGS   = -g -std=gnu11 -pedantic -Wall -Wno-overlength-strings 
${EXTRA_CFLAGS}
 +DEFAULT_LDFLAGS  = -lm
  
  CPPFLAGS_DEBUG := -DDEBUG_BUILD
blob - e6662fa63eda43c029f8bf0b8060abd06724b7e1
file + x11/dunst/patches/patch-docs_dunst_1_pod
--- x11/dunst/patches/patch-docs_dunst_1_pod
+++ x11/dunst/patches/patch-docs_dunst_1_pod
@@ -1,12 +1,12 @@
 Index: docs/dunst.1.pod
 --- docs/dunst.1.pod.orig
 +++ docs/dunst.1.pod
-@@ -61,7 +61,7 @@ Display a notification on startup.
+@@ -94,7 +94,7 @@ Set notification timeout time.
  
  A default configuration file is included (usually 
##SYSCONFDIR##/dunst/dunstrc)
  and serves as the least important configuration file. Note: this was 
previously
 -/usr/share/dunst/dunstrc. You can edit this file to change the system-wide
-+${PREFIX}/share/dunst/dunstrc. You can edit this file to change the 
system-wide
++${LOCALBASE}/share/dunst/dunstrc. You can edit this file to change the 
system-wide
  defaults or copy it to a more important location to override its settings. See
  the FILES section for more details on where dunst searches for its
  configuration files and how settings get applied.
blob - 76eb300d292dd84ed65eb1f6f5a8a1deb9d9a797
file + x11/dunst/patches/patch-docs_dunst_5_pod
--- x11/dunst/patches/patch-docs_dunst_5_pod
+++ x11/dunst/patches/patch-docs_dunst_5_pod
@@ -1,25 +1,25 @@
 Index: docs/dunst.5.pod
 --- docs/dunst.5.pod.orig
 +++ docs/dunst.5.pod
-@@ -409,7 +409,7 @@ Hide the count of stacked duplicate notifications.
+@@ -463,7 +463,7 @@ Hide the count of stacked duplicate notifications.
  Show an indicator if a notification contains actions and/or open-able URLs. 
See
  ACTIONS below for further details.
  
 -=item B<icon_path> (default: 
"/usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/")
-+=item B<icon_path> (default: 
"${PREFIX}/share/icons/gnome/16x16/status/:${PREFIX}/share/icons/gnome/16x16/devices/")
++=item B<icon_path> (default: 
"${LOCALBASE}/share/icons/gnome/16x16/status/:${LOCALBASE}/share/icons/gnome/16x16/devices/")
  
  Can be set to a colon-separated list of paths to search for icons to use with
  notifications.
-@@ -423,7 +423,7 @@ replace this and will need new settings.
- Comma-separated of names of the the themes to use for looking up icons. This 
has
- to be the name of the directory in which the theme is located, not the
+@@ -477,7 +477,7 @@ replace icon_path search.
+ Comma-separated list of names of the themes to use for looking up icons. This
+ has to be the name of the directory in which the theme is located, not the
  human-friendly name of the theme. So for example, the theme B<Breeze Dark> is
 -located in F</usr/share/icons/breeze-dark>. In this case you have to set the
-+located in F<${PREFIX}/share/icons/breeze-dark>. In this case you have to set 
the
++located in F<${LOCALBASE}/share/icons/breeze-dark>. In this case you have to 
set the
  theme to B<breeze-dark>.
  
  The first theme in the list is the most important. Only if the icon cannot be
-@@ -461,12 +461,12 @@ Maximum number of notifications that will be kept in h
+@@ -515,12 +515,12 @@ Maximum number of notifications that will be kept in h
  is reached, older notifications will be deleted once a new one arrives. See
  HISTORY.
  
blob - fed4e50ecba2ae7b194f97a5556806372857a133
file + x11/dunst/patches/patch-dunstrc
--- x11/dunst/patches/patch-dunstrc
+++ x11/dunst/patches/patch-dunstrc
@@ -1,16 +1,16 @@
 Index: dunstrc
 --- dunstrc.orig
 +++ dunstrc
-@@ -217,7 +217,7 @@
+@@ -238,7 +238,7 @@
      max_icon_size = 128
  
-     # Paths to default icons (only neccesary when not using recursive icon 
lookup)
+     # Paths to default icons (only necessary when not using recursive icon 
lookup)
 -    icon_path = 
/usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/
 +    icon_path = 
${LOCALBASE}/share/icons/gnome/16x16/status/:${LOCALBASE}/share/icons/gnome/16x16/devices/
  
      ### History ###
  
-@@ -231,10 +231,10 @@
+@@ -252,10 +252,10 @@
      ### Misc/Advanced ###
  
      # dmenu path.
blob - cba0c845fee96e3f439ac82f300a16f0427e3bb9
file + x11/dunst/patches/patch-src_dunst_c
--- x11/dunst/patches/patch-src_dunst_c
+++ x11/dunst/patches/patch-src_dunst_c
@@ -1,12 +1,12 @@
 Index: src/dunst.c
 --- src/dunst.c.orig
 +++ src/dunst.c
-@@ -100,7 +100,7 @@ static gboolean run(void *data)
+@@ -164,7 +164,7 @@ static gboolean run(void *data)
                  gint64 sleep = timeout_at - now;
                  sleep = MAX(sleep, 1000); // Sleep at least 1ms
  
 -                LOG_D("Sleeping for %li ms", sleep/1000);
 +                LOG_D("Sleeping for %lli ms", (long long)sleep/1000);
  
-                 if (sleep >= 0) {
-                         if (reason == 0 || next_timeout < now || timeout_at < 
next_timeout) {
+                 next_timeout_id = g_timeout_add(sleep/1000, run, NULL);
+         }
blob - f49421b7619b5443f71067d2824793187f223852
file + /dev/null
--- x11/dunst/patches/patch-src_input_c
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: src/input.c
---- src/input.c.orig
-+++ src/input.c
-@@ -4,7 +4,9 @@
- #include "settings.h"
- #include "queues.h"
- #include <stddef.h>
-+#ifdef __linux__
- #include <linux/input-event-codes.h>
-+#endif
- 
- int get_notification_clickable_height(struct notification *n, bool first, 
bool last)
- {
blob - 715b6f4731cd5787df605a5fe2e7e98aa020ece7
file + x11/dunst/patches/patch-src_notification_c
--- x11/dunst/patches/patch-src_notification_c
+++ x11/dunst/patches/patch-src_notification_c
@@ -1,16 +1,20 @@
 Index: src/notification.c
 --- src/notification.c.orig
 +++ src/notification.c
-@@ -60,7 +60,7 @@ void notification_print(const struct notification *n)
-         printf("\ticon_id: '%s'\n", n->icon_id);
+@@ -61,9 +61,9 @@ void notification_print(const struct notification *n)
+         printf("\ticon_id: '%s'\n", STR_NN(n->icon_id));
          printf("\tdesktop_entry: '%s'\n", n->desktop_entry ? n->desktop_entry 
: "");
-         printf("\tcategory: %s\n", n->category);
+         printf("\tcategory: %s\n", STR_NN(n->category));
 -        printf("\ttimeout: %ld\n", n->timeout/1000);
+-        printf("\tstart: %ld\n", n->start);
+-        printf("\ttimestamp: %ld\n", n->timestamp);
 +        printf("\ttimeout: %lld\n", (long long)n->timeout/1000);
++        printf("\tstart: %lld\n", (long long)n->start);
++        printf("\ttimestamp: %lld\n", (long long)n->timestamp);
          printf("\turgency: %s\n", notification_urgency_to_string(n->urgency));
          printf("\ttransient: %d\n", n->transient);
-         printf("\tformatted: '%s'\n", n->msg);
-@@ -140,8 +140,8 @@ void notification_run_script(struct notification *n)
+         printf("\tformatted: '%s'\n", STR_NN(n->msg));
+@@ -148,8 +148,8 @@ void notification_run_script(struct notification *n)
                                  // Set environment variables
                                  gchar *n_id_str = g_strdup_printf("%i", 
n->id);
                                  gchar *n_progress_str = g_strdup_printf("%i", 
n->progress);
@@ -21,21 +25,23 @@ Index: src/notification.c
                                  safe_setenv("DUNST_APP_NAME",  appname);
                                  safe_setenv("DUNST_SUMMARY",   summary);
                                  safe_setenv("DUNST_BODY",      body);
-@@ -684,14 +684,14 @@ void notification_update_text_to_render(struct notific
+@@ -726,14 +726,14 @@ void notification_update_text_to_render(struct notific
                  char *new_buf;
                  if (hours > 0) {
                          new_buf =
 -                            g_strdup_printf("%s (%ldh %ldm %lds old)", buf, 
hours,
-+                            g_strdup_printf("%s (%lldh %lldm %llds old)", 
buf, hours,
-                                             minutes, seconds);
+-                                            minutes, seconds);
++                            g_strdup_printf("%s (%lldh %lldm %llds old)", buf,
++                                            (long long)hours, (long 
long)minutes, (long long)seconds);
                  } else if (minutes > 0) {
                          new_buf =
 -                            g_strdup_printf("%s (%ldm %lds old)", buf, 
minutes,
-+                            g_strdup_printf("%s (%lldm %llds old)", buf, 
minutes,
-                                             seconds);
+-                                            seconds);
++                            g_strdup_printf("%s (%lldm %llds old)", buf, 
(long long)minutes,
++                                            (long long)seconds);
                  } else {
 -                        new_buf = g_strdup_printf("%s (%lds old)", buf, 
seconds);
-+                        new_buf = g_strdup_printf("%s (%llds old)", buf, 
seconds);
++                        new_buf = g_strdup_printf("%s (%llds old)", buf, 
(long long)seconds);
                  }
  
                  g_free(buf);
blob - /dev/null
file + x11/dunst/patches/patch-src_rules_c (mode 644)
--- /dev/null
+++ x11/dunst/patches/patch-src_rules_c
@@ -0,0 +1,19 @@
+Index: src/rules.c
+--- src/rules.c.orig
++++ src/rules.c
+@@ -150,12 +150,12 @@ void rule_print(const struct rule *r)
+         if (r->msg_urgency != URG_NONE) printf("\tmsg_urgency: '%s'\n", 
notification_urgency_to_string(r->msg_urgency));
+         if (r->stack_tag != NULL) printf("\tstack_tag: '%s'\n", r->stack_tag);
+         if (r->desktop_entry != NULL) printf("\tdesktop_entry: '%s'\n", 
r->desktop_entry);
+-        if (r->match_dbus_timeout != -1) printf("\tmatch_dbus_timeout: 
%ld\n", r->match_dbus_timeout);
++        if (r->match_dbus_timeout != -1) printf("\tmatch_dbus_timeout: 
%lld\n", (long long)r->match_dbus_timeout);
+         if (r->match_transient != -1) printf("\tmatch_transient: %d\n", 
r->match_transient);
+ 
+         // modifiers
+-        if (r->timeout != -1) printf("\ttimeout: %ld\n", r->timeout);
+-        if (r->override_dbus_timeout != -1) printf("\toverride_dbus_timeout: 
%ld\n", r->override_dbus_timeout);
++        if (r->timeout != -1) printf("\ttimeout: %lld\n", (long 
long)r->timeout);
++        if (r->override_dbus_timeout != -1) printf("\toverride_dbus_timeout: 
%lld\n", (long long)r->override_dbus_timeout);
+         if (r->markup != -1) printf("\tmarkup: %d\n", r->markup);
+         if (r->action_name != NULL) printf("\taction_name: '%s'\n", 
r->action_name);
+         if (r->urgency != URG_NONE) printf("\turgency: '%s'\n", 
notification_urgency_to_string(r->urgency));
blob - e7f4abb95bfa619ce7cb19344f2dee16446b0e7a
file + /dev/null
--- x11/dunst/patches/patch-src_settings_h
+++ /dev/null
@@ -1,12 +0,0 @@
-Index: src/settings.h
---- src/settings.h.orig
-+++ src/settings.h
-@@ -13,6 +13,8 @@
- 
- #define LIST_END (-1)
- 
-+enum mouse_button { BTN_LEFT=1, BTN_RIGHT, BTN_MIDDLE, BTN_TOUCH };
-+
- enum alignment { ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT };
- enum vertical_alignment { VERTICAL_TOP, VERTICAL_CENTER, VERTICAL_BOTTOM };
- enum separator_color { SEP_FOREGROUND, SEP_AUTO, SEP_FRAME, SEP_CUSTOM };
blob - /dev/null
file + x11/dunst/patches/patch-src_utils_c (mode 644)
--- /dev/null
+++ x11/dunst/patches/patch-src_utils_c
@@ -0,0 +1,39 @@
+Revert back to pre-1.10.0 string_to_path for OpenBSD as we don't have
+wordexp(3).
+
+Index: src/utils.c
+--- src/utils.c.orig
++++ src/utils.c
+@@ -13,7 +13,9 @@
+ #include <sys/stat.h>
+ #include <time.h>
+ #include <unistd.h>
++#ifndef __OpenBSD__
+ #include <wordexp.h>
++#endif
+ 
+ #include "log.h"
+ #include "settings_data.h"
+@@ -180,6 +182,14 @@ int string_array_length(char **s)
+ /* see utils.h */
+ char *string_to_path(char *string)
+ {
++#if defined(__OpenBSD__)
++        if (string && STRN_EQ(string, "~/", 2)) {
++                char *home = g_strconcat(user_get_home(), "/", NULL);
++                string = string_replace_at(string, 0, 2, home);
++                g_free(home);
++        }
++      return string;
++#else
+         ASSERT_OR_RET(string, string);
+ 
+         wordexp_t we;
+@@ -208,6 +218,7 @@ char *string_to_path(char *string)
+         wordfree(&we);
+ 
+         return res;
++#endif
+ }
+ 
+ /* see utils.h */
blob - 7fd20d0e4edf51b71a83f9dc5f95a0ced5d4c98e
file + /dev/null
--- x11/dunst/patches/patch-src_x11_x_c
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: src/x11/x.c
---- src/x11/x.c.orig
-+++ src/x11/x.c
-@@ -19,7 +19,9 @@
- #include <X11/Xlib.h>
- #include <X11/Xresource.h>
- #include <X11/Xutil.h>
-+#ifdef __linux__
- #include <linux/input-event-codes.h>
-+#endif
- 
- #include "../dbus.h"
- #include "../draw.h"
blob - 118752ce99490e2ccca2614ef2e5e184afb0c909
file + x11/dunst/pkg/PLIST
--- x11/dunst/pkg/PLIST
+++ x11/dunst/pkg/PLIST
@@ -3,7 +3,10 @@ bin/dunstctl
 @bin bin/dunstify
 @man man/man1/dunst.1
 @man man/man1/dunstctl.1
+@man man/man1/dunstify.1
 @man man/man5/dunst.5
+share/bash-completion/dunst
+share/bash-completion/dunstctl
 share/dunst/
 @sample ${SYSCONFDIR}/dunst/
 share/dunst/dunstrc
@@ -11,3 +14,12 @@ share/dunst/dunstrc
 share/examples/dbus-1/
 share/examples/dbus-1/services/
 share/examples/dbus-1/services/org.knopwob.dunst.service
+share/fish/
+share/fish/vendor_completions.d/
+share/fish/vendor_completions.d/dunst.fish
+share/fish/vendor_completions.d/dunstctl.fish
+share/fish/vendor_completions.d/dunstify.fish
+share/zsh/
+share/zsh/site-functions/
+share/zsh/site-functions/_dunst
+share/zsh/site-functions/_dunstctl

Reply via email to