git: 77f485048c3c - main - science/linux-zotero: Commit zotero.desktop patches & fix Exec

From: Mateusz Piotrowski <0mp_at_FreeBSD.org>
Date: Fri, 29 Jul 2022 13:21:12 UTC
The branch main has been updated by 0mp:

URL: https://cgit.FreeBSD.org/ports/commit/?id=77f485048c3c7c6a0807ae71619932b23fae51d7

commit 77f485048c3c7c6a0807ae71619932b23fae51d7
Author:     Mateusz Piotrowski <0mp@FreeBSD.org>
AuthorDate: 2022-07-29 13:19:11 +0000
Commit:     Mateusz Piotrowski <0mp@FreeBSD.org>
CommitDate: 2022-07-29 13:21:06 +0000

    science/linux-zotero: Commit zotero.desktop patches & fix Exec
    
    I forgot to commit the patch for the icon support. While here, fix the
    Exec line.
---
 science/linux-zotero/Makefile                   |  5 +++--
 science/linux-zotero/files/patch-zotero.desktop | 12 ++++++++++++
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/science/linux-zotero/Makefile b/science/linux-zotero/Makefile
index 98a01ea33525..8cf918746899 100644
--- a/science/linux-zotero/Makefile
+++ b/science/linux-zotero/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	zotero
 DISTVERSION=	6.0.10
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	science deskutils linux
 MASTER_SITES=	https://download.zotero.org/client/release/${DISTVERSION}/ \
 		https://raw.githubusercontent.com/zotero/zotero-standalone-build/${DISTVERSION}/:LICENSE
@@ -38,11 +38,12 @@ post-extract:
 	${CP} ${DISTDIR}/${DIST_SUBDIR}/COPYING ${WRKDIR}
 
 do-configure:
+	${REINPLACE_CMD} 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/${PORTNAME}.desktop
 	(cd ${WRKSRC} && ${BRANDELF} -t Linux ${_BINARIES})
 
 do-install:
 	@${MKDIR} ${STAGEDIR}${DATADIR}
-	(cd ${WRKSRC} && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR} "! -name '*.orig'")
+	(cd ${WRKSRC} && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR} "! -name '*.orig' ! -name '*.bak'")
 	(cd ${WRKSRC} && ${CHMOD} +x ${_BINARIES})
 # Only strip zotero-bin. Other ${_BINARIES} break strip(1).
 	(cd ${STAGEDIR}${DATADIR} && ${STRIP_CMD} zotero-bin)
diff --git a/science/linux-zotero/files/patch-zotero.desktop b/science/linux-zotero/files/patch-zotero.desktop
new file mode 100644
index 000000000000..6dee7e42009a
--- /dev/null
+++ b/science/linux-zotero/files/patch-zotero.desktop
@@ -0,0 +1,12 @@
+--- zotero.desktop.orig	2022-07-19 02:55:23 UTC
++++ zotero.desktop
+@@ -1,7 +1,7 @@ Name=Zotero
+ [Desktop Entry]
+ Name=Zotero
+-Exec=bash -c "$(dirname $(realpath $(echo %k | sed -e 's/^file:\/\///')))/zotero -url %U"
+-Icon=zotero.ico
++Exec=%%PREFIX%%/bin/zotero -url %U
++Icon=zotero.png
+ Type=Application
+ Terminal=false
+ Categories=Office;