On Tue 06/06/2023 23:38, Joel Carnat wrote:
> Hello,
> 
> I have seen that Unison does not have a launch icon in my XFCE whisker menu.
> Looking at https://github.com/bcpierce00/unison/issues/162, a PR has been
> submitted in 2018 but it is still opened and unresolved.
> 
> Using the unison.desktop file from ArchLinux, this patch adds the file to
> the OpenBSD port. Not sure if it's the proper way to do it but I use the
> patch feature to create the unison.desktop from NULL.
> 
> Attached is the patch to create the unison.desktop and the cvs diff to the
> port.

Some comments:
- REVISION starts at 0
- !no_x11 flavor has a run dependency on devel/desktop-file-utils
- Instead of creating unison.desktop from NULL just have it in
  ${FILESDIR}
- !no_x11 flavor specific bits should be placed in PFRAG.no-no_x11

Could you check if the diff below works for you?


diff --git Makefile Makefile
index 0fa4c136fc1..9cd720972b8 100644
--- Makefile
+++ Makefile
@@ -8,6 +8,7 @@ COMMENT =       multi-platform file synchronization tool
 GH_ACCOUNT =   bcpierce00
 GH_PROJECT =   unison
 GH_TAGNAME =   v2.53.3
+REVISION =     0
 
 CATEGORIES =   net
 
@@ -39,6 +40,7 @@ WANTLIB +=    gdk_pixbuf-2.0 gio-2.0 glib-2.0 gobject-2.0 
gtk-3 harfbuzz
 WANTLIB +=     intl pango-1.0 pangocairo-1.0
 BUILD_DEPENDS +=       x11/lablgtk3
 LIB_DEPENDS +=         x11/gtk+3
+RUN_DEPENDS +=         devel/desktop-file-utils
 MAKE_FLAGS +=          UISTYLE=gtk3
 .endif
 
@@ -55,5 +57,13 @@ do-install:
        ${INSTALL_MAN} ${WRKSRC}/man/unison.1 ${PREFIX}/man/man1
        ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/unison
        @cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${PREFIX}/share/doc/unison
+.if !${FLAVOR:Mno_x11}
+       ${INSTALL_DATA_DIR} ${PREFIX}/share/pixmaps
+       ${INSTALL_DATA} ${WRKSRC}/icons/U.svg \
+               ${PREFIX}/share/pixmaps/unison.svg
+       ${INSTALL_DATA_DIR} ${PREFIX}/share/applications
+       ${INSTALL_DATA} ${FILESDIR}/unison.desktop \
+               ${PREFIX}/share/applications/
+.endif
 
 .include <bsd.port.mk>
diff --git files/unison.desktop files/unison.desktop
new file mode 100644
index 00000000000..af64ef6617c
--- /dev/null
+++ files/unison.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=unison
+Comment=File synchronisation tool for X11
+TryExec=unison
+Exec=unison
+Terminal=false
+Type=Application
+Categories=GTK;Application;Network;
+Icon=unison
+StartupNotify=true
diff --git pkg/PFRAG.no-no_x11 pkg/PFRAG.no-no_x11
new file mode 100644
index 00000000000..a8d2b57156d
--- /dev/null
+++ pkg/PFRAG.no-no_x11
@@ -0,0 +1,4 @@
+share/applications/unison.desktop
+share/pixmaps/
+share/pixmaps/unison.svg
+@tag update-desktop-database
diff --git pkg/PLIST pkg/PLIST
index c8a7e9ab292..4b3d8d144fa 100644
--- pkg/PLIST
+++ pkg/PLIST
@@ -10,3 +10,4 @@ share/doc/pkg-readmes/${PKGSTEM}
 share/doc/unison/
 share/doc/unison/NEWS.md
 share/doc/unison/README.md
+!%%no_x11%%

Reply via email to