On Fri, Feb 09, 2018 at 05:57:17PM +0100, Klemens Nanni wrote: > On Sat, Jan 27, 2018 at 08:51:58AM +0200, Timo Myyrä wrote: > > Klemens Nanni <k...@posteo.org> writes: > > > > > On Fri, Jan 26, 2018 at 09:13:17AM +0200, Timo Myyrä wrote: > > >> > Klemens Nanni <k...@posteo.org> writes: > > >> >> Paths in the example dunst.rc need to be adjusted so copying it over > > >> >> will work without manually fixing them. > > > Yuck, I forgot to include those in my earlier diff, sorry. > > > > > >> Here is an updated diff to include patching the dunstrc file and pod doc. > > > Except for a few nits below this diff looks good to me. > > > > > >> Index: Makefile > > >> =================================================================== > > >> RCS file: /cvs/ports/x11/dunst/Makefile,v > > >> retrieving revision 1.3 > > >> diff -u -p -r1.3 Makefile > > >> --- Makefile 31 Aug 2017 20:57:00 -0000 1.3 > > >> +++ Makefile 26 Jan 2018 07:11:14 -0000 > > >> @@ -29,11 +27,13 @@ LIB_DEPENDS += devel/gettext \ > > > There are two spaces after += instead of a tab. > > > > > >> devel/pango \ > > >> graphics/cairo \ > > >> graphics/gdk-pixbuf2 \ > > >> - x11/gtk+2 \ > > >> x11/libxdg-basedir \ > > >> x11/dbus > > > I'd still move dbus up to sort them alphabetically as done in my earlier > > > diff. > > > > > >> MAKE_FLAGS = V=1 PREFIX="${PREFIX}" MANPREFIX="${PREFIX}/man" > > > Not a big fan of those squashed ones, they're better readable across > > > multiple lines as done for *_DEPENDS (also makes future diffs easier). > > > > Ok, here's revised diff: > Updated below for 1.3.1 from 30.01.2018: > > Version 1.3.1 addresses a race condition that can cause the > service file to be empty upon installation. > It contains no other changes, [...] > > Feedback? Any takers? > > Index: Makefile > =================================================================== > RCS file: /cvs/ports/x11/dunst/Makefile,v > retrieving revision 1.3 > diff -u -p -r1.3 Makefile > --- Makefile 31 Aug 2017 20:57:00 -0000 1.3 > +++ Makefile 9 Feb 2018 16:54:29 -0000 > @@ -4,36 +4,38 @@ COMMENT= customizable and lightweight no > > GH_ACCOUNT = dunst-project > GH_PROJECT = dunst > -GH_TAGNAME = v1.2.0 > +GH_TAGNAME = v1.3.1 > > CATEGORIES = x11 > > HOMEPAGE= https://dunst-project.org/ > > -MAINTAINER = Timo Myyra <timo.my...@wickedbsd.net> > +MAINTAINER = Timo Myyra <timo.my...@bittivirhe.fi> > > # BSD > PERMIT_PACKAGE_CDROM= Yes > > # uses pledge() > -WANTLIB += X11 Xcomposite Xcursor Xdamage Xext Xfixes Xi Xinerama > -WANTLIB += Xrandr Xrender Xss c cairo dbus-1 fontconfig freetype > -WANTLIB += gdk-x11-2.0 gdk_pixbuf-2.0 gio-2.0 glib-2.0 gobject-2.0 > -WANTLIB += intl m pango-1.0 pangocairo-1.0 pthread xdg-basedir > -WANTLIB += z > +WANTLIB += X11 Xinerama Xrandr Xss c cairo dbus-1 gdk_pixbuf-2.0 > +WANTLIB += gio-2.0 glib-2.0 gobject-2.0 intl m pango-1.0 pangocairo-1.0 > +WANTLIB += pthread xdg-basedir > > USE_GMAKE = Yes > > -LIB_DEPENDS += devel/gettext \ > +LIB_DEPENDS += devel/gettext \ > devel/glib2 \ > devel/pango \ > graphics/cairo \ > graphics/gdk-pixbuf2 \ > - x11/gtk+2 \ > - x11/libxdg-basedir \ > - x11/dbus > + x11/dbus \ > + x11/libxdg-basedir > > -MAKE_FLAGS = V=1 PREFIX="${PREFIX}" MANPREFIX="${PREFIX}/man" > +MAKE_FLAGS = V=1 \ > + PREFIX="${PREFIX}" \ > + MANPREFIX="${PREFIX}/man" > + > +pre-configure: > + ${SUBST_CMD} ${WRKSRC}/docs/dunst.pod ${WRKSRC}/dunstrc > > post-install: > mv ${PREFIX}/share/dunst ${PREFIX}/share/examples/dunst > Index: distinfo > =================================================================== > RCS file: /cvs/ports/x11/dunst/distinfo,v > retrieving revision 1.2 > diff -u -p -r1.2 distinfo > --- distinfo 31 Aug 2017 20:57:00 -0000 1.2 > +++ distinfo 9 Feb 2018 16:54:29 -0000 > @@ -1,2 +1,2 @@ > -SHA256 (dunst-1.2.0.tar.gz) = o8BbXvh+iHBKYgcjbkJ3PfvPUMsjx89R5JSnI2t1xa0= > -SIZE (dunst-1.2.0.tar.gz) = 110628 > +SHA256 (dunst-1.3.1.tar.gz) = 6iluHTJEZBmGyFlsiKRIL2AJDki6VE4Z+uYMhne4bdY= > +SIZE (dunst-1.3.1.tar.gz) = 121539 > Index: patches/patch-config_mk > =================================================================== > RCS file: /cvs/ports/x11/dunst/patches/patch-config_mk,v > retrieving revision 1.2 > diff -u -p -r1.2 patch-config_mk > --- patches/patch-config_mk 31 Aug 2017 20:57:00 -0000 1.2 > +++ patches/patch-config_mk 9 Feb 2018 16:54:29 -0000 > @@ -2,12 +2,12 @@ $OpenBSD: patch-config_mk,v 1.2 2017/08/ > Index: config.mk > --- config.mk.orig > +++ config.mk > -@@ -28,7 +28,7 @@ endif > +@@ -12,7 +12,7 @@ MANPREFIX = ${PREFIX}/share/man > > # flags > CPPFLAGS += -D_DEFAULT_SOURCE -DVERSION=\"${VERSION}\" > -CFLAGS += -g --std=gnu99 -pedantic -Wall -Wno-overlength-strings -Os > ${STATIC} ${CPPFLAGS} > +CFLAGS += -g --std=gnu99 -pedantic -Wall -Wno-overlength-strings > ${STATIC} ${CPPFLAGS} > + LDFLAGS += -lm -L${X11LIB} > > - pkg_config_packs := dbus-1 x11 xscrnsaver \ > - "glib-2.0 >= 2.36" gio-2.0 \ > + CPPFLAGS_DEBUG := -DDEBUG_BUILD > Index: patches/patch-docs_dunst_pod > =================================================================== > RCS file: patches/patch-docs_dunst_pod > diff -N patches/patch-docs_dunst_pod > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ patches/patch-docs_dunst_pod 9 Feb 2018 16:54:29 -0000 > @@ -0,0 +1,38 @@ > +$OpenBSD$ > + > +Index: docs/dunst.pod > +--- docs/dunst.pod.orig > ++++ docs/dunst.pod > +@@ -35,7 +35,7 @@ rules or using the output in other scripts. > + > + =head1 CONFIGURATION > + > +-An example configuration file is included (usually > /usr/share/dunst/dunstrc). > ++An example configuration file is included (usually > ${PREFIX}/share/dunst/dunstrc). > + To change the configuration, copy this file to ~/.config/dunst/dunstrc and > edit > + it accordingly. > + > +@@ -395,7 +395,7 @@ Set to 0 to disable icon scaling. (default) > + > + If B<icon_position> is set to off, this setting is ignored. > + > +-=item B<icon_path> (default: > "/usr/share/icons/gnome/16x16/status/:/usr/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. > +@@ -414,12 +414,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. > + > +-=item B<dmenu> (default: "/usr/bin/dmenu") > ++=item B<dmenu> (default: "${PREFIX}/bin/dmenu") > + > + The command that will be run when opening the context menu. Should be either > + a dmenu command or a dmenu-compatible menu. > + > +-=item B<browser> (default: "/usr/bin/firefox") > ++=item B<browser> (default: "${PREFIX}/bin/firefox") > + > + The command that will be run when opening a URL. The URL to be opened will > be > + appended to the end of the value of this setting. > Index: patches/patch-dunstrc > =================================================================== > RCS file: patches/patch-dunstrc > diff -N patches/patch-dunstrc > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ patches/patch-dunstrc 9 Feb 2018 16:54:29 -0000 > @@ -0,0 +1,27 @@ > +$OpenBSD$ > + > +Index: dunstrc > +--- dunstrc.orig > ++++ dunstrc > +@@ -165,7 +165,7 @@ > + max_icon_size = 32 > + > + # Paths to default icons. > +- 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 ### > + > +@@ -179,10 +179,10 @@ > + ### Misc/Advanced ### > + > + # dmenu path. > +- dmenu = /usr/bin/dmenu -p dunst: > ++ dmenu = ${PREFIX}/bin/dmenu -p dunst: > + > + # Browser for opening urls in context menu. > +- browser = /usr/bin/firefox -new-tab > ++ browser = ${PREFIX}/bin/firefox -new-tab > + > + # Always run rule-defined scripts, even if the notification is > suppressed > + always_run_script = true > Index: patches/patch-src_dunst_c > =================================================================== > RCS file: /cvs/ports/x11/dunst/patches/patch-src_dunst_c,v > retrieving revision 1.1 > diff -u -p -r1.1 patch-src_dunst_c > --- patches/patch-src_dunst_c 31 Aug 2017 20:57:00 -0000 1.1 > +++ patches/patch-src_dunst_c 9 Feb 2018 16:54:29 -0000 > @@ -3,9 +3,9 @@ $OpenBSD: patch-src_dunst_c,v 1.1 2017/0 > Index: src/dunst.c > --- src/dunst.c.orig > +++ src/dunst.c > -@@ -14,6 +14,9 @@ > +@@ -12,6 +12,9 @@ > + #include <stdio.h> > #include <stdlib.h> > - #include <time.h> > > +#include <err.h> > +#include <unistd.h> > @@ -13,13 +13,19 @@ Index: src/dunst.c > #include "dbus.h" > #include "menu.h" > #include "notification.h" > -@@ -325,6 +328,9 @@ int dunst_main(int argc, char *argv[]) > +@@ -147,6 +150,15 @@ int dunst_main(int argc, char *argv[]) > int owner_id = initdbus(); > > x_setup(); > -+ > -+ if (pledge("stdio rpath proc exec", NULL) == -1) > -+ err(1, "pledge"); > ++ > ++ /* allow prot_exec if icons are used */ > ++ if (settings.icon_position != icons_off) { > ++ if (pledge("stdio rpath proc exec prot_exec", NULL) == -1) > ++ err(1, "pledge"); > ++ } else { > ++ if (pledge("stdio rpath proc exec", NULL) == -1) > ++ err(1, "pledge"); > ++ } > > if (settings.startup_notification) { > notification *n = notification_create(); > Index: patches/patch-src_menu_c > =================================================================== > RCS file: /cvs/ports/x11/dunst/patches/patch-src_menu_c,v > retrieving revision 1.1 > diff -u -p -r1.1 patch-src_menu_c > --- patches/patch-src_menu_c 31 Aug 2017 20:57:00 -0000 1.1 > +++ patches/patch-src_menu_c 9 Feb 2018 16:54:29 -0000 > @@ -11,7 +11,7 @@ Index: src/menu.c > - "\\b(https?://|ftps?://|news://|mailto:|file://|www\\.)" > - "[-[:alnum:]_\\@;/?:&=%$.+!*\x27,~#]*" > - > "(\\([-[:alnum:]_\\@;/?:&=%$.+!*\x27,~#]*\\)|[-[:alnum:]_\\@;/?:&=%$+*~])+"; > -+ char *regex = > "[[:<:]](https?://|ftps?://|news://|mailto:|file://|www\\.)[0-9a-zA-Z_/.@]+[a-zA-Z/]"; > ++ char *regex = > "[[:<:]](https?://|ftps?://|news://|mailto:|file://|www\\.)[0-9a-zA-Z_/.@]+[a-zA-Z/]"; > int ret = regcomp(&cregex, regex, REG_EXTENDED | REG_ICASE); > if (ret != 0) { > fputs("failed to compile regex", stderr); > Index: patches/patch-src_notification_c > =================================================================== > RCS file: patches/patch-src_notification_c > diff -N patches/patch-src_notification_c > --- patches/patch-src_notification_c 31 Aug 2017 20:57:00 -0000 1.1 > +++ /dev/null 1 Jan 1970 00:00:00 -0000 > @@ -1,13 +0,0 @@ > -$OpenBSD: patch-src_notification_c,v 1.1 2017/08/31 20:57:00 sthen Exp $ > - > -Index: src/notification.c > ---- src/notification.c.orig > -+++ src/notification.c > -@@ -5,6 +5,7 @@ > - > - #include <assert.h> > - #include <errno.h> > -+#include <libgen.h> > - #include <glib.h> > - #include <stdbool.h> > - #include <stdio.h> > Index: pkg/PLIST > =================================================================== > RCS file: /cvs/ports/x11/dunst/pkg/PLIST,v > retrieving revision 1.2 > diff -u -p -r1.2 PLIST > --- pkg/PLIST 31 Aug 2017 20:57:01 -0000 1.2 > +++ pkg/PLIST 9 Feb 2018 16:54:29 -0000 > @@ -1,8 +1,5 @@ > @comment $OpenBSD: PLIST,v 1.2 2017/08/31 20:57:01 sthen Exp $ > @bin bin/dunst > -@comment lib/systemd/ > -@comment lib/systemd/user/ > -@comment lib/systemd/user/dunst.service > @man man/man1/dunst.1 > share/dbus-1/services/org.knopwob.dunst.service > share/examples/dunst/ > Anyone? I'd like to commit this update.
Someone raised concerns about the new `prot_exec' promise: This can probably be improved with further work but right now I think it's more important to have a working port; afterall having it pledged is still better than no pledge at all.