git: 8dea5aa1e02c - 2021Q4 - net-im/telegram-desktop: convert webkit-gtk dependency to OPTIONS (+)

From: Olivier Cochard <olivier_at_FreeBSD.org>
Date: Fri, 10 Dec 2021 22:00:00 UTC
The branch 2021Q4 has been updated by olivier:

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

commit 8dea5aa1e02c53302a1d9b183f49dd62fa7056c4
Author:     Dima Panov <fluffy@FreeBSD.org>
AuthorDate: 2021-10-14 17:57:17 +0000
Commit:     Olivier Cochard <olivier@FreeBSD.org>
CommitDate: 2021-12-10 21:19:12 +0000

    net-im/telegram-desktop: convert webkit-gtk dependency to OPTIONS (+)
    
    - Add WEBKIT option, disabled by default
    - Bump PORTREVISION, default dependencies was changed
    
    Previously dropped GTK option was used to enable gtk native dialogs
    and render rich window content.
    With last releases WebKit-gtk used only for in-app payments system.
    While internal payments still experimental and not wide used,
    there is no reason to hook this burden to the build as default yet.
    
    Discussed with: osa, danfe, maintainer via ML
    Approved by:    maintainer
    
    (cherry picked from commit ece7e7d92c75401608ccb6d64bcdb0b51898fe2c)
---
 net-im/telegram-desktop/Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/net-im/telegram-desktop/Makefile b/net-im/telegram-desktop/Makefile
index 12264d47a854..ee236dcca34b 100644
--- a/net-im/telegram-desktop/Makefile
+++ b/net-im/telegram-desktop/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	telegram-desktop
 DISTVERSION=	3.1.9
+PORTREVISION=	1
 CATEGORIES=	net-im
 MASTER_SITES=	https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/releases/download/v${DISTVERSION}/
 DISTNAME=	tdesktop-${DISTVERSION}-full
@@ -39,7 +40,6 @@ LIB_DEPENDS=	libavformat.so:multimedia/ffmpeg \
 		libpipewire-0.3.so:multimedia/pipewire \
 		libqrcodegencpp.so:graphics/qr-code-generator \
 		libusrsctp.so:net/libusrsctp \
-		libwebkit2gtk-4.0.so:www/webkit2-gtk3 \
 		libxcb-keysyms.so:x11/xcb-util-keysyms \
 		libxkbcommon.so:x11/libxkbcommon \
 		libxxhash.so:devel/xxhash \
@@ -77,14 +77,19 @@ NO_CCACHE=	yes
 # Telegram uses OpenAL for its audio, but libtgvoip (for voice calls) can use PulseAudio or ALSA.
 # It dynamically loads PulseAudio, and if this fails, it loads ALSA.
 # If both of them are not installed, then voice calls do not work, but other functionalities still work.
+OPTIONS_DEFINE=		WEBKIT
 OPTIONS_DEFAULT=	ALSA
 OPTIONS_MULTI=		AUDIO
 OPTIONS_MULTI_AUDIO=	ALSA PULSEAUDIO
 
 AUDIO_DESC=	Audio backend for voice calls
+WEBKIT_DESC=	WebKit-gtk integration for payments
 
 ALSA_LIB_DEPENDS=	libasound.so:audio/alsa-lib
 PULSEAUDIO_LIB_DEPENDS=	libpulse.so:audio/pulseaudio
+WEBKIT_CMAKE_BOOL_OFF=	DESKTOP_APP_DISABLE_WEBKITGTK
+WEBKIT_LIB_DEPENDS=	libwebkit2gtk-4.0.so:www/webkit2-gtk3
+WEBKIT_USE=	GNOME=cairo,gtk30
 
 # Telegram asks each custom build to have its own API ID and hash.
 TELEGRAM_API_HASH=	20a3432aab43f24bb4460fceac5ba38d