git: 3377cfa4c2e7 - main - multimedia/droidcam: Fix previous patch and minor changes

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Mon, 30 Sep 2024 14:08:50 UTC
The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3377cfa4c2e7ab8a4b29fb977588de6e9b72b22c

commit 3377cfa4c2e7ab8a4b29fb977588de6e9b72b22c
Author:     Yusuf Yaman <nxjoseph@protonmail.com>
AuthorDate: 2024-09-29 21:09:12 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2024-09-30 14:07:48 +0000

    multimedia/droidcam: Fix previous patch and minor changes
    
    This patch fixes 281586 by adding forgotten directory pointing to the program's icon path.
    Also, now it uses ${PORTNAME} wherever it's possible and replaces program's
    installation path with ${PREFIX} in program's .desktop file.
    
    PR:             281720
    Fixes:          adc8361b87972451ffbfe619aa714bc2fd2fa024
---
 multimedia/droidcam/Makefile | 30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)

diff --git a/multimedia/droidcam/Makefile b/multimedia/droidcam/Makefile
index 5bcd3594181f..eadf870b2da6 100644
--- a/multimedia/droidcam/Makefile
+++ b/multimedia/droidcam/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	droidcam
 DISTVERSIONPREFIX=	v
 DISTVERSION=	2.1.3
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	multimedia
 
 MAINTAINER=	nxjoseph@protonmail.com
@@ -28,11 +28,11 @@ LIB_DEPENDS=	libappindicator3.so:devel/libappindicator \
 		libpango-1.0.so:x11-toolkits/pango \
 		libpangocairo-1.0.so:x11-toolkits/pango \
 		libspeex.so:audio/speex \
+		libswscale.so:multimedia/ffmpeg \
 		libturbojpeg.so:graphics/libjpeg-turbo \
 		libusbmuxd-2.0.so:comms/libusbmuxd \
 		libwayland-client.so:graphics/wayland \
-		libX11.so:x11/libX11 \
-		libswscale.so:multimedia/ffmpeg
+		libX11.so:x11/libX11
 RUN_DEPENDS=	adb:devel/android-tools \
 		ffmpeg:multimedia/ffmpeg \
 		usbmuxd:comms/usbmuxd \
@@ -45,10 +45,10 @@ GH_PROJECT=	droidcam-linux-client
 USE_GNOME=	cairo gdkpixbuf2 glib20 gtk30 pango
 USE_XORG=	x11
 
-PLIST_FILES=	bin/droidcam \
-		bin/droidcam-cli \
-		share/applications/droidcam.desktop \
-		share/pixmaps/droidcam-icon.png
+PLIST_FILES=	bin/${PORTNAME} \
+		bin/${PORTNAME}-cli \
+		share/applications/${PORTNAME}.desktop \
+		share/pixmaps/${PORTNAME}-icon.png
 
 OPTIONS_DEFINE=	NLS
 OPTIONS_SUB=	yes
@@ -57,17 +57,21 @@ NLS_USES=		gettext
 NLS_CONFIGURE_ENABLE=	nls
 
 pre-configure:
-	${REINPLACE_CMD} -e 's,/opt/droidcam-icon.png,${PREFIX}/pixmaps/droidcam-icon.png,' \
-		${WRKSRC}/src/droidcam.c ${WRKSRC}/droidcam.desktop
+	${REINPLACE_CMD} -e 's,/opt/${PORTNAME}-icon.png,${PREFIX}/share/pixmaps/${PORTNAME}-icon.png,' \
+		${WRKSRC}/src/${PORTNAME}.c \
+		${WRKSRC}/${PORTNAME}.desktop
+	${REINPLACE_CMD} -e 's,Exec=/usr/local/bin/${PORTNAME},${PREFIX}/bin/${PORTNAME},' \
+		-e 's,TryExec=/usr/local/bin/${PORTNAME},${PREFIX}/bin/${PORTNAME},' \
+		${WRKSRC}/${PORTNAME}.desktop
 
 do-install:
-	${INSTALL_PROGRAM} ${WRKSRC}/droidcam \
+	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} \
 		${STAGEDIR}${PREFIX}/bin
-	${INSTALL_PROGRAM} ${WRKSRC}/droidcam-cli \
+	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME}-cli \
 		${STAGEDIR}${PREFIX}/bin
 	${INSTALL_DATA} ${WRKSRC}/icon2.png \
-		${STAGEDIR}${PREFIX}/share/pixmaps/droidcam-icon.png
-	${INSTALL_DATA} ${WRKSRC}/droidcam.desktop \
+		${STAGEDIR}${PREFIX}/share/pixmaps/${PORTNAME}-icon.png
+	${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.desktop \
 		${STAGEDIR}${PREFIX}/share/applications
 
 .include <bsd.port.mk>