git: f3d18ded6804 - main - net-im/linux-whatsdesk: Add new port

From: Nicola Vitale <nivit_at_FreeBSD.org>
Date: Mon, 26 Aug 2024 14:15:10 UTC
The branch main has been updated by nivit:

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

commit f3d18ded6804e7145e90c84573d9e725b35a8343
Author:     Nicola Vitale <nivit@FreeBSD.org>
AuthorDate: 2024-08-26 14:12:21 +0000
Commit:     Nicola Vitale <nivit@FreeBSD.org>
CommitDate: 2024-08-26 14:14:37 +0000

    net-im/linux-whatsdesk: Add new port
    
    WhatsDesk is an unofficial client of Whatsapp.
    
    This project is only inserting an instance of Whatsapp Web in an electron app
    and adds/enables desktop notifications.
    
    https://gitlab.com/zerkc/whatsdesk
---
 net-im/Makefile                                 |  1 +
 net-im/linux-whatsdesk/Makefile                 | 57 ++++++++++++++++++
 net-im/linux-whatsdesk/distinfo                 |  3 +
 net-im/linux-whatsdesk/files/linux-whatsdesk.in | 11 ++++
 net-im/linux-whatsdesk/pkg-descr                |  4 ++
 net-im/linux-whatsdesk/pkg-message              | 13 ++++
 net-im/linux-whatsdesk/pkg-plist                | 80 +++++++++++++++++++++++++
 7 files changed, 169 insertions(+)

diff --git a/net-im/Makefile b/net-im/Makefile
index e56e237d586a..00c38a44f58d 100644
--- a/net-im/Makefile
+++ b/net-im/Makefile
@@ -52,6 +52,7 @@
     SUBDIR += libsignon-glib
     SUBDIR += libstrophe
     SUBDIR += linux-discord
+    SUBDIR += linux-whatsdesk
     SUBDIR += loudmouth
     SUBDIR += lurch
     SUBDIR += mastodon
diff --git a/net-im/linux-whatsdesk/Makefile b/net-im/linux-whatsdesk/Makefile
new file mode 100644
index 000000000000..3e5570c299c9
--- /dev/null
+++ b/net-im/linux-whatsdesk/Makefile
@@ -0,0 +1,57 @@
+PORTNAME=	linux-whatsdesk
+DISTVERSIONPREFIX=	v
+DISTVERSION=	0.3.9
+CATEGORIES=	net-im
+MASTER_SITES=	https://zerkc.gitlab.io/whatsdesk/
+DISTFILES=	whatsdesk_${DISTVERSION}_amd64.deb
+EXTRACT_ONLY=	${DISTFILES:R}.tar.xz
+
+MAINTAINER=	nivit@FreeBSD.org
+COMMENT=	Unofficial client of Whatsapp
+WWW=		https://gitlab.com/zerkc/whatsdesk
+
+LICENSE=	AGPLv3 BSD3CLAUSE CC-BY-2.5 CC-BY-3.0 LGPL21 MIT MPL11
+LICENSE_COMB=	multi
+
+ONLY_FOR_ARCHS=	amd64
+
+EXTRACT_DEPENDS=	deb2targz:archivers/deb2targz
+
+USES=		desktop-file-utils linux:rl9 tar:xz
+USE_LINUX=	alsa-plugins-oss alsa-plugins-pulseaudio alsalib at-spi2-atk \
+		atk ca-certificates cups-libs dbuslibs devtools gtk3 libdrm \
+		libsigsegv nss opus
+
+NO_BUILD=	yes
+SUB_FILES=	${PORTNAME}
+SUB_LIST=	LINUXBASE=${LINUXBASE}
+
+NO_WRKSUBDIR=	yes
+
+STRIP_CMD=	${LINUXBASE}/usr/bin/strip
+
+pre-extract:
+	${LOCALBASE}/bin/deb2targz ${DISTDIR}/${DISTFILES}
+
+# remove artifact of deb2targz
+post-extract:
+	@${RM} ${DISTDIR}/${DISTFILES:R}.tar.xz
+
+post-patch:
+	${REINPLACE_CMD} -i "" \
+		-e "s,/opt/whatsdesk/\(whatsdesk\),${PREFIX}/bin/linux-\1,1" \
+		${WRKSRC}/usr/share/applications/whatsdesk.desktop
+
+do-install:
+	@${MKDIR} ${STAGEDIR}${DATADIR}
+	(cd ${WRKSRC}/opt/whatsdesk && \
+		${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR} \
+			"-not -regex \./LICENSE.*")
+	(cd ${WRKSRC}/usr/share && \
+		${COPYTREE_SHARE} . ${STAGEDIR}${LOCALBASE}/share \
+			"-not -regex \./doc.*")
+	${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME} ${STAGEDIR}${LOCALBASE}/bin/${PORTNAME}
+	(cd ${STAGEDIR}${DATADIR} && \
+		${STRIP_CMD} chrome-sandbox libvulkan.so.1)
+
+.include <bsd.port.mk>
diff --git a/net-im/linux-whatsdesk/distinfo b/net-im/linux-whatsdesk/distinfo
new file mode 100644
index 000000000000..64f79d45a5d9
--- /dev/null
+++ b/net-im/linux-whatsdesk/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1724279277
+SHA256 (whatsdesk_0.3.9_amd64.deb) = 4756f5c9f22e889fcec3aa34c587cb10bc6e7ccb476d6481e58267c4f6df181e
+SIZE (whatsdesk_0.3.9_amd64.deb) = 64354830
diff --git a/net-im/linux-whatsdesk/files/linux-whatsdesk.in b/net-im/linux-whatsdesk/files/linux-whatsdesk.in
new file mode 100755
index 000000000000..39df1e544af2
--- /dev/null
+++ b/net-im/linux-whatsdesk/files/linux-whatsdesk.in
@@ -0,0 +1,11 @@
+#!%%LINUXBASE%%/bin/bash
+
+export ELECTRON_IS_DEV=0
+export LIBGL_DRI3_DISABLE=1
+export NODE_ENV=production
+# workaround Chromium bug https://bugs.chromium.org/p/chromium/issues/detail?id=918234
+if [ "$DBUS_SESSION_BUS_ADDRESS" = "" ]; then
+    export DBUS_SESSION_BUS_ADDRESS="autolaunch:"
+fi
+
+exec -a "$0" "%%DATADIR%%/whatsdesk" --no-sandbox "$@"
diff --git a/net-im/linux-whatsdesk/pkg-descr b/net-im/linux-whatsdesk/pkg-descr
new file mode 100644
index 000000000000..fd5ea916550f
--- /dev/null
+++ b/net-im/linux-whatsdesk/pkg-descr
@@ -0,0 +1,4 @@
+WhatsDesk is an unofficial client of whatsapp.
+
+This project is only inserting an instance of Whatsapp Web in an electron app
+and adds/enables desktop notifications.
diff --git a/net-im/linux-whatsdesk/pkg-message b/net-im/linux-whatsdesk/pkg-message
new file mode 100644
index 000000000000..0658f441fc7f
--- /dev/null
+++ b/net-im/linux-whatsdesk/pkg-message
@@ -0,0 +1,13 @@
+[
+{ type: install
+  message: <<EOM
+
+If the user's directory is located in /usr/home and doesn't exists the link
+/home, then create one with the command:
+
+  ln -s /usr/home /home
+
+Whatsdesk uses pulseaudio(1), so you have to start the relative server.
+EOM
+}
+]
diff --git a/net-im/linux-whatsdesk/pkg-plist b/net-im/linux-whatsdesk/pkg-plist
new file mode 100644
index 000000000000..1ae746ae8d11
--- /dev/null
+++ b/net-im/linux-whatsdesk/pkg-plist
@@ -0,0 +1,80 @@
+bin/linux-whatsdesk
+share/applications/whatsdesk.desktop
+share/icons/hicolor/128x128/apps/whatsdesk.png
+share/icons/hicolor/512x512/apps/whatsdesk.png
+share/icons/hicolor/64x64/apps/whatsdesk.png
+%%DATADIR%%/chrome_100_percent.pak
+%%DATADIR%%/chrome_200_percent.pak
+%%DATADIR%%/icudtl.dat
+%%DATADIR%%/libEGL.so
+%%DATADIR%%/libGLESv2.so
+%%DATADIR%%/libffmpeg.so
+%%DATADIR%%/libvk_swiftshader.so
+%%DATADIR%%/libvulkan.so.1
+%%DATADIR%%/locales/af.pak
+%%DATADIR%%/locales/am.pak
+%%DATADIR%%/locales/ar.pak
+%%DATADIR%%/locales/bg.pak
+%%DATADIR%%/locales/bn.pak
+%%DATADIR%%/locales/ca.pak
+%%DATADIR%%/locales/cs.pak
+%%DATADIR%%/locales/da.pak
+%%DATADIR%%/locales/de.pak
+%%DATADIR%%/locales/el.pak
+%%DATADIR%%/locales/en-GB.pak
+%%DATADIR%%/locales/en-US.pak
+%%DATADIR%%/locales/es-419.pak
+%%DATADIR%%/locales/es.pak
+%%DATADIR%%/locales/et.pak
+%%DATADIR%%/locales/fa.pak
+%%DATADIR%%/locales/fi.pak
+%%DATADIR%%/locales/fil.pak
+%%DATADIR%%/locales/fr.pak
+%%DATADIR%%/locales/gu.pak
+%%DATADIR%%/locales/he.pak
+%%DATADIR%%/locales/hi.pak
+%%DATADIR%%/locales/hr.pak
+%%DATADIR%%/locales/hu.pak
+%%DATADIR%%/locales/id.pak
+%%DATADIR%%/locales/it.pak
+%%DATADIR%%/locales/ja.pak
+%%DATADIR%%/locales/kn.pak
+%%DATADIR%%/locales/ko.pak
+%%DATADIR%%/locales/lt.pak
+%%DATADIR%%/locales/lv.pak
+%%DATADIR%%/locales/ml.pak
+%%DATADIR%%/locales/mr.pak
+%%DATADIR%%/locales/ms.pak
+%%DATADIR%%/locales/nb.pak
+%%DATADIR%%/locales/nl.pak
+%%DATADIR%%/locales/pl.pak
+%%DATADIR%%/locales/pt-BR.pak
+%%DATADIR%%/locales/pt-PT.pak
+%%DATADIR%%/locales/ro.pak
+%%DATADIR%%/locales/ru.pak
+%%DATADIR%%/locales/sk.pak
+%%DATADIR%%/locales/sl.pak
+%%DATADIR%%/locales/sr.pak
+%%DATADIR%%/locales/sv.pak
+%%DATADIR%%/locales/sw.pak
+%%DATADIR%%/locales/ta.pak
+%%DATADIR%%/locales/te.pak
+%%DATADIR%%/locales/th.pak
+%%DATADIR%%/locales/tr.pak
+%%DATADIR%%/locales/uk.pak
+%%DATADIR%%/locales/ur.pak
+%%DATADIR%%/locales/vi.pak
+%%DATADIR%%/locales/zh-CN.pak
+%%DATADIR%%/locales/zh-TW.pak
+%%DATADIR%%/resources.pak
+%%DATADIR%%/resources/app.asar
+%%DATADIR%%/snapshot_blob.bin
+%%DATADIR%%/v8_context_snapshot.bin
+%%DATADIR%%/vk_swiftshader_icd.json
+@mode 4555
+%%DATADIR%%/chrome-sandbox
+@mode
+@mode 555
+%%DATADIR%%/chrome_crashpad_handler
+%%DATADIR%%/whatsdesk
+@mode