commit e076945e44a8510f12981e4f3947982c4f97fbf0
Author: Vitaly Zaitsev <vitaly(a)easycoding.org>
Date: Tue Sep 15 16:11:22 2020 +0200
Updated to version 2.3.2.
.gitignore | 2 +
sources | 3 +-
telegram-desktop-fix-night-theme.patch | 33 ------
telegram-desktop-libatomic-linkage.patch | 61 ----------
telegram-desktop-webrtc-packaged.patch | 191 +++++++++++++++++++++++++++++++
telegram-desktop.spec | 127 +++++++++++++++-----
tg_owt-dlopen-linkage.patch | 38 ++++++
7 files changed, 334 insertions(+), 121 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 0905619..55694d9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -146,3 +146,5 @@
/tdesktop-2.1.12-full.tar.gz
/tdesktop-2.1.13-full.tar.gz
/tdesktop-2.2.0-full.tar.gz
+/owt-a803835.tar.gz
+/tdesktop-2.3.2-full.tar.gz
diff --git a/sources b/sources
index 557d958..8f19fd2 100644
--- a/sources
+++ b/sources
@@ -1 +1,2 @@
-SHA512 (tdesktop-2.2.0-full.tar.gz) =
2aeca83be7bc385bd7537d56ecf66996facedd0af588e743fedbb08c3158fc76436d6cf3b1fb5dd7c8d37b4471f739872ca54ba300aa1d0e0202e87c005703fd
+SHA512 (owt-a803835.tar.gz) =
709b7a179f890267c5c1a125bb18f65a77c83f901f4458f8a739d9e74e3ce44e52d43bdced760aaeb0c26f989ea9361771517717815bc87d9c13d384e2ec6e4c
+SHA512 (tdesktop-2.3.2-full.tar.gz) =
757e57389ce24656c1d6676d6f0808e3d444785394e916b9f5fb47511662f01b6742c88c2a27274c4d9bb58263ae281218579c78cce7db119e2c863c1eaacc90
diff --git a/telegram-desktop-webrtc-packaged.patch
b/telegram-desktop-webrtc-packaged.patch
new file mode 100644
index 0000000..fb37918
--- /dev/null
+++ b/telegram-desktop-webrtc-packaged.patch
@@ -0,0 +1,191 @@
+From d955882cb4d4c94f61a9b1df62b7f93d3c5bff7d Mon Sep 17 00:00:00 2001
+From: Ilya Fedin <fedin-ilja2010(a)ya.ru>
+Date: Sat, 29 Aug 2020 20:48:37 +0400
+Subject: [PATCH] Update webrtc packaged build for tg_owt
+
+---
+ external/webrtc/CMakeLists.txt | 136 ++++++++++++++++-----------------
+ variables.cmake | 1 -
+ 2 files changed, 68 insertions(+), 69 deletions(-)
+
+diff --git a/cmake/external/webrtc/CMakeLists.txt b/cmake/external/webrtc/CMakeLists.txt
+index 1273291..a354057 100644
+--- a/cmake/external/webrtc/CMakeLists.txt
++++ b/cmake/external/webrtc/CMakeLists.txt
+@@ -7,96 +7,96 @@
+ add_library(external_webrtc INTERFACE IMPORTED GLOBAL)
+ add_library(desktop-app::external_webrtc ALIAS external_webrtc)
+
+-if (DESKTOP_APP_WEBRTC_LOCATION)
+- set(webrtc_loc ${DESKTOP_APP_WEBRTC_LOCATION})
++if (DESKTOP_APP_USE_PACKAGED)
++ find_package(tg_owt REQUIRED)
++ target_link_libraries(external_webrtc INTERFACE tg_owt::tg_owt)
+ else()
+ set(webrtc_loc ${libs_loc}/tg_owt/src)
+-endif()
+-
+-set(webrtc_build_loc ${libs_loc}/tg_owt/out/$<CONFIG>)
+-
+-target_compile_definitions(external_webrtc
+-INTERFACE
+- WEBRTC_ENABLE_PROTOBUF=0
+- WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE
+- RTC_ENABLE_VP9
+- HAVE_SCTP
+- WEBRTC_USE_H264
+- WEBRTC_LIBRARY_IMPL
+- WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=1
+- ABSL_ALLOCATOR_NOTHROW=1
+-)
+-
+-if (WIN32)
+- set(webrtc_lib_prefix "")
+- set(webrtc_lib_suffix .lib)
++ set(webrtc_build_loc ${libs_loc}/tg_owt/out/$<CONFIG>)
+
+ target_compile_definitions(external_webrtc
+ INTERFACE
+- WEBRTC_WIN
++ WEBRTC_ENABLE_PROTOBUF=0
++ WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE
++ RTC_ENABLE_VP9
++ HAVE_SCTP
++ WEBRTC_USE_H264
++ WEBRTC_LIBRARY_IMPL
++ WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=1
++ ABSL_ALLOCATOR_NOTHROW=1
+ )
+-else()
+- set(webrtc_lib_prefix lib)
+- set(webrtc_lib_suffix .a)
+
+- if (APPLE)
++ if (WIN32)
++ set(webrtc_lib_prefix "")
++ set(webrtc_lib_suffix .lib)
++
+ target_compile_definitions(external_webrtc
+ INTERFACE
+- WEBRTC_MAC
++ WEBRTC_WIN
+ )
+ else()
++ set(webrtc_lib_prefix lib)
++ set(webrtc_lib_suffix .a)
++
++ if (APPLE)
++ target_compile_definitions(external_webrtc
++ INTERFACE
++ WEBRTC_MAC
++ )
++ else()
++ target_compile_definitions(external_webrtc
++ INTERFACE
++ WEBRTC_LINUX
++ )
++ endif()
++
+ target_compile_definitions(external_webrtc
+ INTERFACE
+- WEBRTC_LINUX
++ WEBRTC_POSIX
+ )
+ endif()
+
+- target_compile_definitions(external_webrtc
+- INTERFACE
+- WEBRTC_POSIX
+- )
+-endif()
+-
+-target_include_directories(external_webrtc
+-INTERFACE
+- ${webrtc_loc}
+- ${webrtc_loc}/third_party/abseil-cpp
+-)
+-
+-set(webrtc_libs
+- ${webrtc_lib_prefix}tg_owt
+-)
+-if (APPLE)
+ target_include_directories(external_webrtc
+ INTERFACE
+- ${webrtc_loc}/sdk/objc
+- ${webrtc_loc}/sdk/objc/base
+- ${webrtc_loc}/sdk/objc/components/video_codec
+- ${webrtc_loc}/third_party/libyuv/include
++ ${webrtc_loc}
++ ${webrtc_loc}/third_party/abseil-cpp
+ )
+-endif()
+-foreach (lib ${webrtc_libs})
+- list(APPEND webrtc_libs_list
"${webrtc_build_loc}/${lib}${webrtc_lib_suffix}")
+-endforeach()
+
+-if (WIN32)
+- target_link_libraries(external_webrtc
+- INTERFACE
+- Secur32.lib # Required for rtc_base/http_common.cc
+- dmoguids.lib # Required for the built-in WASAPI AEC, see
modules/audio_device/BUILD.gn
+- wmcodecdspuuid.lib
+- amstrmid.lib
+- msdmo.lib
++ set(webrtc_libs
++ ${webrtc_lib_prefix}tg_owt
+ )
+-elseif (APPLE)
++ if (APPLE)
++ target_include_directories(external_webrtc
++ INTERFACE
++ ${webrtc_loc}/sdk/objc
++ ${webrtc_loc}/sdk/objc/base
++ ${webrtc_loc}/sdk/objc/components/video_codec
++ ${webrtc_loc}/third_party/libyuv/include
++ )
++ endif()
++ foreach (lib ${webrtc_libs})
++ list(APPEND webrtc_libs_list
"${webrtc_build_loc}/${lib}${webrtc_lib_suffix}")
++ endforeach()
++
++ if (WIN32)
++ target_link_libraries(external_webrtc
++ INTERFACE
++ Secur32.lib # Required for rtc_base/http_common.cc
++ dmoguids.lib # Required for the built-in WASAPI AEC, see
modules/audio_device/BUILD.gn
++ wmcodecdspuuid.lib
++ amstrmid.lib
++ msdmo.lib
++ )
++ elseif (APPLE)
++ target_link_libraries(external_webrtc
++ INTERFACE
++ -ObjC
++ )
++ endif()
++
+ target_link_libraries(external_webrtc
+ INTERFACE
+- -ObjC
++ ${webrtc_libs_list}
++ desktop-app::external_openssl
+ )
+ endif()
+-
+-target_link_libraries(external_webrtc
+-INTERFACE
+- ${webrtc_libs_list}
+- desktop-app::external_openssl
+-)
+diff --git a/variables.cmake b/variables.cmake
+index 04a18bd..9e7f41f 100644
+--- a/cmake/variables.cmake
++++ b/cmake/variables.cmake
+@@ -40,7 +40,6 @@ option(DESKTOP_APP_DISABLE_AUTOUPDATE "Disable autoupdate."
${disable_autoupdate
+ option(DESKTOP_APP_USE_HUNSPELL_ONLY "Disable system spellchecker and use bundled
Hunspell only. (For debugging purposes)" OFF)
+ option(DESKTOP_APP_USE_ENCHANT "Use Enchant instead of bundled Hunspell. (Linux
only)" OFF)
+ set(DESKTOP_APP_QTWAYLANDCLIENT_PRIVATE_HEADERS "" CACHE STRING
"QtWaylandClient headers location.")
+-set(DESKTOP_APP_WEBRTC_LOCATION "" CACHE STRING "WebRTC source root
location.")
+
+ set(dont_bundle_fonts 0)
+ if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_USE_PACKAGED_LAZY)
diff --git a/telegram-desktop.spec b/telegram-desktop.spec
index d1c26fa..516521a 100644
--- a/telegram-desktop.spec
+++ b/telegram-desktop.spec
@@ -2,15 +2,26 @@
%define _lto_cflags %{nil}
# Build conditionals (with - OFF, without - ON)...
-%bcond_without rlottie
+%bcond_with rlottie
%bcond_without ipo
+%bcond_without webrtc
%bcond_with gtk3
%bcond_with clang
+%if 0%{?fedora} && 0%{?fedora} >= 33
+%bcond_with mapbox
+%else
+%bcond_without mapbox
+%endif
+
# Telegram Desktop's constants...
%global appname tdesktop
%global launcher telegramdesktop
+# Git revision of WebRTC...
+%global commit1 a80383535367dd8961f55f960938d943d6975808
+%global shortcommit1 %(c=%{commit1}; echo ${c:0:7})
+
# Applying workaround to RHBZ#1559007...
%if %{with clang}
%if 0%{?fedora} && 0%{?fedora} >= 33
@@ -28,22 +39,29 @@
%endif
Name: telegram-desktop
-Version: 2.2.0
-Release: 2%{?dist}
+Version: 2.3.2
+Release: 1%{?dist}
# Application and 3rd-party modules licensing:
# * Telegram Desktop - GPLv3+ with OpenSSL exception -- main tarball;
+# * tg_owt - BSD -- static dependency;
# * rlottie - LGPLv2+ -- static dependency;
# * qt_functions.cpp - LGPLv3 -- build-time dependency.
License: GPLv3+ and LGPLv2+ and LGPLv3
URL:
https://github.com/telegramdesktop/%{appname}
Summary: Telegram Desktop official messaging app
+
Source0: %{url}/releases/download/v%{version}/%{appname}-%{version}-full.tar.gz
-ExclusiveArch: x86_64
+Source1:
https://github.com/desktop-app/tg_owt/archive/%{commit1}/owt-%{shortcommi...
+
+#
https://github.com/desktop-app/cmake_helpers/commit/d955882cb4d4c94f61a9b...
+Patch100: %{name}-webrtc-packaged.patch
+#
https://github.com/desktop-app/tg_owt/pull/25
+Patch101: tg_owt-dlopen-linkage.patch
-# Upstream patches...
-Patch100: %{name}-fix-night-theme.patch
-Patch101: %{name}-libatomic-linkage.patch
+# Telegram Desktop require more than 8 GB of RAM on linking stage.
+# Disabling all low-memory architectures.
+ExclusiveArch: x86_64
# Telegram Desktop require exact version of Qt due to Qt private API usage.
%{?_qt5:Requires: %{_qt5}%{?_isa} = %{_qt5_version}}
@@ -63,6 +81,13 @@ BuildRequires: rlottie-devel
Provides: bundled(rlottie) = 0~git
%endif
+# Breaking API changes in version 1.2.0.
+%if %{with mapbox}
+BuildRequires: mapbox-variant-devel < 1.2.0
+%else
+Provides: bundled(mapbox-variant) = 1.1.6
+%endif
+
# Telegram Desktop require patched version of lxqt-qtplugin.
# Pull Request pending:
https://github.com/lxqt/lxqt-qtplugin/pull/52
Provides: bundled(lxqt-qtplugin) = 0.14.0~git
@@ -76,7 +101,6 @@ BuildRequires: gcc
# Development packages for Telegram Desktop...
BuildRequires: guidelines-support-library-devel >= 3.0.1
-BuildRequires: mapbox-variant-devel >= 0.3.6
BuildRequires: qt5-qtbase-private-devel
BuildRequires: libtgvoip-devel >= 2.4.4
BuildRequires: range-v3-devel >= 0.10.0
@@ -103,6 +127,23 @@ BuildRequires: lz4-devel
BuildRequires: xz-devel
BuildRequires: python3
+%if %{with webrtc}
+BuildRequires: pulseaudio-libs-devel
+BuildRequires: libjpeg-turbo-devel
+BuildRequires: alsa-lib-devel
+BuildRequires: yasm
+
+Provides: bundled(tg_owt) = 0~git
+Provides: bundled(openh264) = 0~git
+Provides: bundled(abseil-cpp) = 0~git
+Provides: bundled(libsrtp) = 0~git
+Provides: bundled(libvpx) = 0~git
+Provides: bundled(libyuv) = 0~git
+Provides: bundled(pffft) = 0~git
+Provides: bundled(rnnoise) = 0~git
+Provides: bundled(usrsctp) = 0~git
+%endif
+
%if %{with clang}
BuildRequires: compiler-rt
BuildRequires: clang
@@ -129,30 +170,74 @@ business messaging needs.
%prep
# Unpacking Telegram Desktop source archive...
-%autosetup -n %{appname}-%{version}-full -p1
+%setup -q -n %{appname}-%{version}-full
+%patch100 -p1
+
+# Unpacking WebRTC...
+%if %{with webrtc}
+tar -xf %{SOURCE1}
+mv tg_owt-%{commit1} tg_owt
+%patch101 -p1
+%endif
# Unbundling libraries...
-rm -rf
Telegram/ThirdParty/{Catch,GSL,QR,SPMediaKeyTap,expected,fcitx-qt5,fcitx5-qt,hime,hunspell,libdbusmenu-qt,libqtxdg,libtgvoip,lxqt-qtplugin,lz4,materialdecoration,minizip,nimf,qt5ct,range-v3,variant,xxHash}
+rm -rf
Telegram/ThirdParty/{Catch,GSL,QR,SPMediaKeyTap,expected,fcitx-qt5,fcitx5-qt,hime,hunspell,libdbusmenu-qt,libqtxdg,libtgvoip,lxqt-qtplugin,lz4,materialdecoration,minizip,nimf,qt5ct,range-v3,xxHash}
# Unbundling rlottie if build against packaged version...
%if %{with rlottie}
rm -rf Telegram/ThirdParty/rlottie
%endif
+# Unbundling mapbox-variant if build against packaged version...
+%if %{with mapbox}
+rm -rf Telegram/ThirdParty/variant
+%endif
+
%build
+# Building WebRTC using cmake...
+%if %{with webrtc}
+pushd tg_owt
+%cmake -G Ninja \
+ -DCMAKE_BUILD_TYPE=Release \
+%ifarch x86_64
+%if %{with ipo} && %{without clang}
+ -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=ON \
+%endif
+%endif
+%if %{with clang}
+ -DCMAKE_C_COMPILER=%{_bindir}/clang \
+ -DCMAKE_CXX_COMPILER=%{_bindir}/clang++ \
+ -DCMAKE_AR=%{_bindir}/llvm-ar \
+ -DCMAKE_RANLIB=%{_bindir}/llvm-ranlib \
+ -DCMAKE_LINKER=%{_bindir}/llvm-ld \
+ -DCMAKE_OBJDUMP=%{_bindir}/llvm-objdump \
+ -DCMAKE_NM=%{_bindir}/llvm-nm \
+%else
+ -DCMAKE_AR=%{_bindir}/gcc-ar \
+ -DCMAKE_RANLIB=%{_bindir}/gcc-ranlib \
+ -DCMAKE_NM=%{_bindir}/gcc-nm \
+%endif
+ -DTG_OWT_PACKAGED_BUILD:BOOL=ON
+%cmake_build
+popd
+%endif
+
# Building Telegram Desktop using cmake...
%cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
%ifarch x86_64
%if %{with ipo} && %{without clang}
- -DDESKTOP_APP_ENABLE_IPO_OPTIMIZATIONS:BOOL=ON \
+ -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=ON \
%endif
%endif
%if %{with rlottie}
- -DDESKTOP_APP_USE_PACKAGED_RLOTTIE:BOOL=ON \
-DDESKTOP_APP_LOTTIE_USE_CACHE:BOOL=OFF \
+%endif
+%if %{with webrtc}
+ -DDESKTOP_APP_DISABLE_WEBRTC_INTEGRATION:BOOL=OFF \
+ -Dtg_owt_DIR:PATH=%{_builddir}/%{appname}-%{version}-full/tg_owt/%_vpath_builddir \
%else
- -DDESKTOP_APP_USE_PACKAGED_RLOTTIE:BOOL=OFF \
+ -DDESKTOP_APP_DISABLE_WEBRTC_INTEGRATION:BOOL=ON \
%endif
%if %{with clang}
-DCMAKE_C_COMPILER=%{_bindir}/clang \
@@ -170,22 +255,15 @@ rm -rf Telegram/ThirdParty/rlottie
-DTDESKTOP_API_ID=611335 \
-DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c \
-DDESKTOP_APP_USE_PACKAGED:BOOL=ON \
- -DDESKTOP_APP_USE_PACKAGED_GSL:BOOL=ON \
- -DDESKTOP_APP_USE_PACKAGED_EXPECTED:BOOL=ON \
- -DDESKTOP_APP_USE_PACKAGED_VARIANT:BOOL=ON \
- -DDESKTOP_APP_USE_PACKAGED_QRCODE:BOOL=ON \
-DDESKTOP_APP_USE_PACKAGED_FONTS:BOOL=ON \
-DDESKTOP_APP_USE_GLIBC_WRAPS:BOOL=OFF \
-DDESKTOP_APP_DISABLE_CRASH_REPORTS:BOOL=ON \
- -DTDESKTOP_USE_PACKAGED_TGVOIP:BOOL=ON \
%if %{with gtk3}
-DTDESKTOP_DISABLE_GTK_INTEGRATION:BOOL=OFF \
%else
-DTDESKTOP_DISABLE_GTK_INTEGRATION:BOOL=ON \
%endif
-DTDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME:BOOL=ON \
- -DTDESKTOP_DISABLE_DESKTOP_FILE_GENERATION:BOOL=ON \
- -DTDESKTOP_USE_FONTCONFIG_FALLBACK:BOOL=OFF \
-DTDESKTOP_LAUNCHER_BASENAME=%{launcher}
%cmake_build
@@ -205,14 +283,11 @@ desktop-file-validate
%{buildroot}%{_datadir}/applications/%{launcher}.desktop
%{_metainfodir}/%{launcher}.appdata.xml
%changelog
+* Sun Aug 30 2020 Vitaly Zaitsev <vitaly(a)easycoding.org> - 2.3.2-1
+- Updated to version 2.3.2.
+
* Tue Aug 18 2020 RPM Fusion Release Engineering <leigh123linux(a)gmail.com> -
2.2.0-2
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Sun Jul 26 2020 Vitaly Zaitsev <vitaly(a)easycoding.org> - 2.2.0-1
- Updated to version 2.2.0.
-
-* Wed Jun 24 2020 Vitaly Zaitsev <vitaly(a)easycoding.org> - 2.1.13-1
-- Updated to version 2.1.13.
-
-* Thu Jun 18 2020 Vitaly Zaitsev <vitaly(a)easycoding.org> - 2.1.12-1
-- Updated to version 2.1.12.
diff --git a/tg_owt-dlopen-linkage.patch b/tg_owt-dlopen-linkage.patch
new file mode 100644
index 0000000..8718ed2
--- /dev/null
+++ b/tg_owt-dlopen-linkage.patch
@@ -0,0 +1,38 @@
+From 5fc2e9c95291c5864d3c41676942d28ab56acb0f Mon Sep 17 00:00:00 2001
+From: Vitaly Zaitsev <vitaly(a)easycoding.org>
+Date: Tue, 15 Sep 2020 13:40:41 +0200
+Subject: [PATCH] Fixed linkage against dl library.
+
+Signed-off-by: Vitaly Zaitsev <vitaly(a)easycoding.org>
+---
+ tg_owt/CMakeLists.txt | 1 +
+ tg_owt/cmake/external.cmake | 7 +++++++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 2c238bd7..68e142af 100644
+--- a/tg_owt/CMakeLists.txt
++++ b/tg_owt/CMakeLists.txt
+@@ -108,6 +108,7 @@ link_opus(tg_owt)
+ if (UNIX AND NOT APPLE)
+ link_libalsa(tg_owt)
+ link_libpulse(tg_owt)
++ link_dl(tg_owt)
+ endif()
+
+ nice_target_sources(tg_owt ${webrtc_loc}
+diff --git a/cmake/external.cmake b/cmake/external.cmake
+index 60683340..c0dff620 100644
+--- a/tg_owt/cmake/external.cmake
++++ b/tg_owt/cmake/external.cmake
+@@ -121,3 +121,10 @@ function(link_libpulse target_name)
+ target_include_directories(${target_name} PRIVATE ${PULSEAUDIO_INCLUDE_DIRS})
+ endif()
+ endfunction()
++
++# dl
++function(link_dl target_name)
++ if (TG_OWT_PACKAGED_BUILD)
++ target_link_libraries(${target_name} PRIVATE ${CMAKE_DL_LIBS})
++ endif()
++endfunction()