git: 50119a0b4317 - main - net-im/telegram-desktop: Cleanup and set new maintainer

From: Olivier Cochard <olivier_at_FreeBSD.org>
Date: Wed, 17 Nov 2021 17:08:01 UTC
The branch main has been updated by olivier:

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

commit 50119a0b431718d00a22f424a550239246021ff9
Author:     Olivier Cochard <olivier@FreeBSD.org>
AuthorDate: 2021-11-17 17:05:06 +0000
Commit:     Olivier Cochard <olivier@FreeBSD.org>
CommitDate: 2021-11-17 17:07:29 +0000

    net-im/telegram-desktop: Cleanup and set new maintainer
    
    Reported by:    glebius
---
 net-im/telegram-desktop/Makefile                   | 17 +++++++-------
 ...ceFiles_chat__helpers_stickers__emoji__pack.cpp | 11 ---------
 ...Party_libtgvoip_os_posix_NetworkSocketPosix.cpp | 10 --------
 ...ebrtc__dsp_rtc__base_platform__thread__types.cc | 27 ----------------------
 ...Telegram_ThirdParty_tgcalls_tgcalls_Manager.cpp | 13 -----------
 ...h-Telegram_ThirdParty_tgcalls_tgcalls_Manager.h | 10 --------
 .../files/patch-Telegram_lib__base_base_bytes.h    | 20 ----------------
 .../patch-Telegram_lib__base_base_zlib__help.h     | 13 -----------
 ...ew_platform_linux_webview__linux__webkit__gtk.h | 10 --------
 .../patch-cmake_external_rlottie_CMakeLists.txt    | 11 ---------
 10 files changed, 9 insertions(+), 133 deletions(-)

diff --git a/net-im/telegram-desktop/Makefile b/net-im/telegram-desktop/Makefile
index 40291a38b098..37f07d61f344 100644
--- a/net-im/telegram-desktop/Makefile
+++ b/net-im/telegram-desktop/Makefile
@@ -6,7 +6,7 @@ MASTER_SITES=	https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/releases/download/v
 DISTNAME=	tdesktop-${DISTVERSION}-full
 DISTFILES=	${DISTNAME}${EXTRACT_SUFX}
 
-MAINTAINER=	henry.hu.sh@gmail.com
+MAINTAINER=	glebius@FreeBSD.org
 COMMENT=	Telegram Desktop messaging app
 
 LICENSE=	GPLv3
@@ -61,11 +61,8 @@ CMAKE_ARGS=	-DDESKTOP_APP_SPECIAL_TARGET="" -DTDESKTOP_LAUNCHER_BASENAME="telegr
 		-DTDESKTOP_API_ID=${TELEGRAM_API_ID} -DTDESKTOP_API_HASH=${TELEGRAM_API_HASH} \
 		-Ddisable_autoupdate=1
 CMAKE_ON=	DESKTOP_APP_USE_PACKAGED DESKTOP_APP_DISABLE_CRASH_REPORTS \
-		TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION \
 		DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION
-CMAKE_OFF=	DESKTOP_APP_USE_PACKAGED_RLOTTIE DESKTOP_APP_USE_PACKAGED_VARIANT \
-		DESKTOP_APP_USE_GLIBC_WRAPS TDESKTOP_USE_PACKAGED_TGVOIP \
-		DESKTOP_APP_USE_PACKAGED_FONTS
+CMAKE_OFF=	DESKTOP_APP_USE_PACKAGED_FONTS
 
 # Disable DCHECKs, otherwise video calls will crash.
 CXXFLAGS+=	-DNDEBUG
@@ -73,6 +70,8 @@ CXXFLAGS+=	-DNDEBUG
 # see Bugzilla #245452 for details
 NO_CCACHE=	yes
 
+INSTALLS_ICONS=	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.
@@ -96,9 +95,11 @@ TELEGRAM_API_ID=	601761
 
 .include <bsd.port.pre.mk>
 
-.if ${CHOSEN_COMPILER_TYPE} == clang && ${COMPILER_VERSION} <= 100
-post-patch:
-	@${REINPLACE_CMD} -e '/-fstack-clash-protection/d' ${WRKSRC}/cmake/options_linux.cmake
+.if ${COMPILER_VERSION} < 120
+LLVM_VER=	12
+BUILD_DEPENDS+=	clang${LLVM_VER}:devel/llvm${LLVM_VER}
+CC=		${LOCALBASE}/bin/clang${LLVM_VER}
+CXX=		${LOCALBASE}/bin/clang++${LLVM_VER}
 .endif
 
 .include <bsd.port.post.mk>
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_chat__helpers_stickers__emoji__pack.cpp b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_chat__helpers_stickers__emoji__pack.cpp
deleted file mode 100644
index 8650be013302..000000000000
--- a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_chat__helpers_stickers__emoji__pack.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
---- Telegram/SourceFiles/chat_helpers/stickers_emoji_pack.cpp.orig	2021-10-08 09:51:22 UTC
-+++ Telegram/SourceFiles/chat_helpers/stickers_emoji_pack.cpp
-@@ -99,7 +99,7 @@ constexpr auto kRefreshTimeout = 7200 * crl::time(1000
- 		},
- 		5,
- 	};
--	static const auto list = std::array{
-+	static const auto list = std::array<const Lottie::ColorReplacements*, 5>{
- 		&color1,
- 		&color2,
- 		&color3,
diff --git a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_posix_NetworkSocketPosix.cpp b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_posix_NetworkSocketPosix.cpp
deleted file mode 100644
index d690ef4e6357..000000000000
--- a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_posix_NetworkSocketPosix.cpp
+++ /dev/null
@@ -1,10 +0,0 @@
---- Telegram/ThirdParty/libtgvoip/os/posix/NetworkSocketPosix.cpp.orig	2019-04-03 18:20:00 UTC
-+++ Telegram/ThirdParty/libtgvoip/os/posix/NetworkSocketPosix.cpp
-@@ -64,6 +64,7 @@ void NetworkSocketPosix::SetMaxPriority(){
- 	if(res<0){
- 		LOGE("error setting darwin-specific net priority: %d / %s", errno, strerror(errno));
- 	}
-+#elif defined(__FreeBSD__)
- #elif defined(__linux__)
- 	int prio=6;
- 	int res=setsockopt(fd, SOL_SOCKET, SO_PRIORITY, &prio, sizeof(prio));
diff --git a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_webrtc__dsp_rtc__base_platform__thread__types.cc b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_webrtc__dsp_rtc__base_platform__thread__types.cc
deleted file mode 100644
index 319d7658c909..000000000000
--- a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_webrtc__dsp_rtc__base_platform__thread__types.cc
+++ /dev/null
@@ -1,27 +0,0 @@
---- Telegram/ThirdParty/libtgvoip/webrtc_dsp/rtc_base/platform_thread_types.cc.orig	2018-11-23 01:03:16 UTC
-+++ Telegram/ThirdParty/libtgvoip/webrtc_dsp/rtc_base/platform_thread_types.cc
-@@ -11,9 +11,13 @@
- #include "rtc_base/platform_thread_types.h"
- 
- #if defined(WEBRTC_LINUX)
-+#ifdef __FreeBSD__
-+#include <sys/thr.h>
-+#else
- #include <sys/prctl.h>
- #include <sys/syscall.h>
- #endif
-+#endif
- 
- namespace rtc {
- 
-@@ -27,6 +31,10 @@ PlatformThreadId CurrentThreadId() {
-   return gettid();
- #elif defined(WEBRTC_FUCHSIA)
-   return zx_thread_self();
-+#elif defined(__FreeBSD__)
-+  long tid;
-+  thr_self(&tid);
-+  return tid;
- #elif defined(WEBRTC_LINUX)
-   return syscall(__NR_gettid);
- #else
diff --git a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_tgcalls_tgcalls_Manager.cpp b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_tgcalls_tgcalls_Manager.cpp
deleted file mode 100644
index 4ad977ab7480..000000000000
--- a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_tgcalls_tgcalls_Manager.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
---- Telegram/ThirdParty/tgcalls/tgcalls/Manager.cpp.orig	2021-07-21 01:10:26 UTC
-+++ Telegram/ThirdParty/tgcalls/tgcalls/Manager.cpp
-@@ -72,10 +72,6 @@ bool Manager::ResolvedNetworkStatus::operator==(const 
-     return true;
- }
- 
--bool Manager::ResolvedNetworkStatus::operator!=(const ResolvedNetworkStatus &rhs) {
--    return !(*this == rhs);
--}
--
- Manager::Manager(rtc::Thread *thread, Descriptor &&descriptor) :
- _thread(thread),
- _encryptionKey(descriptor.encryptionKey),
diff --git a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_tgcalls_tgcalls_Manager.h b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_tgcalls_tgcalls_Manager.h
deleted file mode 100644
index 9f4cdb075506..000000000000
--- a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_tgcalls_tgcalls_Manager.h
+++ /dev/null
@@ -1,10 +0,0 @@
---- Telegram/ThirdParty/tgcalls/tgcalls/Manager.h.orig	2021-07-21 01:10:21 UTC
-+++ Telegram/ThirdParty/tgcalls/tgcalls/Manager.h
-@@ -17,7 +17,6 @@ class Manager final : public std::enable_shared_from_t
-         bool isLowDataRequested = false;
- 
-         bool operator==(const ResolvedNetworkStatus &rhs);
--        bool operator!=(const ResolvedNetworkStatus &rhs);
-     };
- 
- public:
diff --git a/net-im/telegram-desktop/files/patch-Telegram_lib__base_base_bytes.h b/net-im/telegram-desktop/files/patch-Telegram_lib__base_base_bytes.h
deleted file mode 100644
index 86acdd096d6d..000000000000
--- a/net-im/telegram-desktop/files/patch-Telegram_lib__base_base_bytes.h
+++ /dev/null
@@ -1,20 +0,0 @@
---- Telegram/lib_base/base/bytes.h.orig	2021-10-06 07:02:39 UTC
-+++ Telegram/lib_base/base/bytes.h
-@@ -145,7 +145,7 @@ template <
- vector concatenate(Args &&...args) {
- 	const auto size = details::spansLength(args...);
- 	auto result = vector(size);
--	details::spansAppend(make_span(result), args...);
-+	details::spansAppend(bytes::make_span(result), args...);
- 	return result;
- }
- 
-@@ -156,7 +156,7 @@ vector concatenate(SpanRange args) {
- 		size += bytes::make_span(arg).size();
- 	}
- 	auto result = vector(size);
--	auto buffer = make_span(result);
-+	auto buffer = bytes::make_span(result);
- 	for (const auto &arg : args) {
- 		const auto part = bytes::make_span(arg);
- 		bytes::copy(buffer, part);
diff --git a/net-im/telegram-desktop/files/patch-Telegram_lib__base_base_zlib__help.h b/net-im/telegram-desktop/files/patch-Telegram_lib__base_base_zlib__help.h
deleted file mode 100644
index bea32ef42fa7..000000000000
--- a/net-im/telegram-desktop/files/patch-Telegram_lib__base_base_zlib__help.h
+++ /dev/null
@@ -1,13 +0,0 @@
---- Telegram/lib_base/base/zlib_help.h.orig	2020-05-12 13:19:31 UTC
-+++ Telegram/lib_base/base/zlib_help.h
-@@ -6,8 +6,8 @@
- //
- #pragma once
- 
--#include <zip.h>
--#include <unzip.h>
-+#include "minizip/zip.h"
-+#include "minizip/unzip.h"
- #include "logs.h"
- 
- #ifdef small
diff --git a/net-im/telegram-desktop/files/patch-Telegram_lib__webview_webview_platform_linux_webview__linux__webkit__gtk.h b/net-im/telegram-desktop/files/patch-Telegram_lib__webview_webview_platform_linux_webview__linux__webkit__gtk.h
deleted file mode 100644
index 3d0e797856ff..000000000000
--- a/net-im/telegram-desktop/files/patch-Telegram_lib__webview_webview_platform_linux_webview__linux__webkit__gtk.h
+++ /dev/null
@@ -1,10 +0,0 @@
---- Telegram/lib_webview/webview/platform/linux/webview_linux_webkit_gtk.h.orig	2021-07-07 09:00:15 UTC
-+++ Telegram/lib_webview/webview/platform/linux/webview_linux_webkit_gtk.h
-@@ -6,6 +6,7 @@
- //
- #pragma once
- 
-+#include <type_traits>  // Required for glib/gatomic.h
- #include <JavaScriptCore/JavaScript.h>
- #include <gtk/gtk.h>
- #include <webkit2/webkit2.h>
diff --git a/net-im/telegram-desktop/files/patch-cmake_external_rlottie_CMakeLists.txt b/net-im/telegram-desktop/files/patch-cmake_external_rlottie_CMakeLists.txt
deleted file mode 100644
index 9eb9a6519ffa..000000000000
--- a/net-im/telegram-desktop/files/patch-cmake_external_rlottie_CMakeLists.txt
+++ /dev/null
@@ -1,11 +0,0 @@
---- cmake/external/rlottie/CMakeLists.txt.orig	2020-10-23 14:48:52 UTC
-+++ cmake/external/rlottie/CMakeLists.txt
-@@ -7,7 +7,7 @@
- add_library(external_rlottie INTERFACE IMPORTED GLOBAL)
- add_library(desktop-app::external_rlottie ALIAS external_rlottie)
- 
--if (DESKTOP_APP_USE_PACKAGED)
-+if (0) # DESKTOP_APP_USE_PACKAGED
-     find_package(rlottie QUIET)
- 
-     if (rlottie_FOUND)