git: 0af14d659e48 - main - graphics/xournalpp: Install desktop files

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Fri, 23 Feb 2024 21:09:19 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0af14d659e48b71780fd2c9b14104fa7ce5d7bdf

commit 0af14d659e48b71780fd2c9b14104fa7ce5d7bdf
Author:     Michael Straube <michael.straube@posteo.de>
AuthorDate: 2024-02-23 21:00:56 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2024-02-23 21:09:17 +0000

    graphics/xournalpp: Install desktop files
---
 graphics/xournalpp/Makefile                   |  4 ++--
 graphics/xournalpp/distinfo                   |  4 +++-
 graphics/xournalpp/files/patch-CMakeLists.txt | 22 ++++++++++++++++++++++
 graphics/xournalpp/pkg-plist                  | 10 ++++++++++
 4 files changed, 37 insertions(+), 3 deletions(-)

diff --git a/graphics/xournalpp/Makefile b/graphics/xournalpp/Makefile
index cf60e1ddc8a0..31c0fbc880d0 100644
--- a/graphics/xournalpp/Makefile
+++ b/graphics/xournalpp/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	xournalpp
 DISTVERSIONPREFIX=	v
 DISTVERSION=	1.2.2
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	graphics
 
 MAINTAINER=	yuri@FreeBSD.org
@@ -19,7 +19,7 @@ LIB_DEPENDS=	libgtksourceview-4.so:x11-toolkits/gtksourceview4 \
 		libsndfile.so:audio/libsndfile \
 		libzip.so:archivers/libzip
 
-USES=		cmake compiler:c++11-lang gettext-tools gnome lua pkgconfig tex xorg
+USES=		cmake compiler:c++11-lang gettext-tools gnome lua pkgconfig tex xorg desktop-file-utils shared-mime-info
 USE_GITHUB=	yes
 USE_GNOME=	atk cairo gdkpixbuf2 glib20 gtk30 librsvg2 libxml2 pango
 USE_XORG=	x11 xext xi
diff --git a/graphics/xournalpp/distinfo b/graphics/xournalpp/distinfo
index 8e40485aad8c..293c9b90a983 100644
--- a/graphics/xournalpp/distinfo
+++ b/graphics/xournalpp/distinfo
@@ -1,3 +1,5 @@
-TIMESTAMP = 1697346808
+TIMESTAMP = 1708720261
 SHA256 (xournalpp-xournalpp-v1.2.2_GH0.tar.gz) = b873ea4e2beadc3061fab87faef31c374ae7876c88dbda5565c491945cf7290f
 SIZE (xournalpp-xournalpp-v1.2.2_GH0.tar.gz) = 16705580
+SHA256 (26889c0e901ba4271b355e1893a6af7c4a2c2afa.patch) = 0b03b64ffdee49b9dcc2923c25a6080c0304527c5d4002bab1b06a293e36ccaa
+SIZE (26889c0e901ba4271b355e1893a6af7c4a2c2afa.patch) = 2432
diff --git a/graphics/xournalpp/files/patch-CMakeLists.txt b/graphics/xournalpp/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..1adee6476114
--- /dev/null
+++ b/graphics/xournalpp/files/patch-CMakeLists.txt
@@ -0,0 +1,22 @@
+--- CMakeLists.txt.orig	2023-10-14 09:09:56 UTC
++++ CMakeLists.txt
+@@ -138,6 +138,10 @@ endif ()
+     endif ()
+ endif ()
+ 
++if (UNIX AND NOT APPLE AND NOT CYGWIN)
++    set(INSTALL_DESKTOP_FILES true)
++endif()
++
+ find_package(ZLIB REQUIRED)
+ find_package(Threads REQUIRED)
+ 
+@@ -329,7 +333,7 @@ install(DIRECTORY resources
+         )
+ 
+ # Install desktop shortcuts for Linux
+-if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
++if (${INSTALL_DESKTOP_FILES})
+     message("Installing desktop files")
+ 
+     # Install icons
diff --git a/graphics/xournalpp/pkg-plist b/graphics/xournalpp/pkg-plist
index cfa73f3bd15e..29b96a6bca24 100644
--- a/graphics/xournalpp/pkg-plist
+++ b/graphics/xournalpp/pkg-plist
@@ -1,5 +1,12 @@
 bin/xournalpp
 bin/xournalpp-thumbnailer
+share/applications/com.github.xournalpp.xournalpp.desktop
+share/icons/hicolor/scalable/apps/com.github.xournalpp.xournalpp.svg
+share/icons/hicolor/scalable/mimetypes/application-x-xojpp.svg
+share/icons/hicolor/scalable/mimetypes/application-x-xopp.svg
+share/icons/hicolor/scalable/mimetypes/application-x-xopt.svg
+share/icons/hicolor/scalable/mimetypes/gnome-mime-application-x-xopp.svg
+share/icons/hicolor/scalable/mimetypes/gnome-mime-application-x-xopt.svg
 share/locale/af_ZA/LC_MESSAGES/xournalpp.mo
 share/locale/ar/LC_MESSAGES/xournalpp.mo
 share/locale/bn_BD/LC_MESSAGES/xournalpp.mo
@@ -40,6 +47,9 @@ share/locale/zh_HK/LC_MESSAGES/xournalpp.mo
 share/locale/zh_TW/LC_MESSAGES/xournalpp.mo
 share/man/man1/xournalpp-thumbnailer.1.gz
 share/man/man1/xournalpp.1.gz
+share/metainfo/com.github.xournalpp.xournalpp.appdata.xml
+share/mime/packages/com.github.xournalpp.xournalpp.xml
+share/thumbnailers/com.github.xournalpp.xournalpp.thumbnailer
 %%DATADIR%%/plugins/ColorCycle/main.lua
 %%DATADIR%%/plugins/ColorCycle/plugin.ini
 %%DATADIR%%/plugins/Example/main.lua