commit d769a5f75ddb9609e3c0fc64ed47838414dfeec5
Author: Vitaly Zaitsev <vitaly(a)easycoding.org>
Date: Wed Jul 29 11:59:31 2020 +0200
Updated to version 2.2.0.
.gitignore | 1 +
sources | 2 +-
telegram-desktop-fix-night-theme.patch | 33 +++++++++++++++++
telegram-desktop-libatomic-linkage.patch | 61 ++++++++++++++++++++++++++++++++
telegram-desktop.spec | 35 +++++++++++-------
5 files changed, 119 insertions(+), 13 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index bc0891c..0905619 100644
--- a/.gitignore
+++ b/.gitignore
@@ -145,3 +145,4 @@
/tdesktop-2.1.11-full.tar.gz
/tdesktop-2.1.12-full.tar.gz
/tdesktop-2.1.13-full.tar.gz
+/tdesktop-2.2.0-full.tar.gz
diff --git a/sources b/sources
index 25620d6..557d958 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (tdesktop-2.1.13-full.tar.gz) =
f28ae7c8c9a9eb8094fc52784742b470235234a3df7487902152858bc7c297b2dcfe5c8b939cdb9653a356b3835609e7289f53cdf7d5fb3f009823d3dbeb1bd8
+SHA512 (tdesktop-2.2.0-full.tar.gz) =
2aeca83be7bc385bd7537d56ecf66996facedd0af588e743fedbb08c3158fc76436d6cf3b1fb5dd7c8d37b4471f739872ca54ba300aa1d0e0202e87c005703fd
diff --git a/telegram-desktop-fix-night-theme.patch
b/telegram-desktop-fix-night-theme.patch
new file mode 100644
index 0000000..8bddc5b
--- /dev/null
+++ b/telegram-desktop-fix-night-theme.patch
@@ -0,0 +1,33 @@
+From fe639078a698acb692192c6416d2bb15858c9545 Mon Sep 17 00:00:00 2001
+From: John Preston <johnprestonmail(a)gmail.com>
+Date: Sun, 26 Jul 2020 16:55:04 +0400
+Subject: [PATCH] Version 2.2: Fix default-night mode.
+
+---
+ Telegram/SourceFiles/storage/localstorage.cpp | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Telegram/SourceFiles/storage/localstorage.cpp
b/Telegram/SourceFiles/storage/localstorage.cpp
+index 39bf065158..9091d2cae1 100644
+--- a/Telegram/SourceFiles/storage/localstorage.cpp
++++ b/Telegram/SourceFiles/storage/localstorage.cpp
+@@ -363,9 +363,8 @@ void start() {
+ _readOldMtpData(false, context); // needed further in _readMtpData
+ applyReadContext(std::move(context));
+
+- if (!ApplyDefaultNightMode()) {
+- writeSettings();
+- }
++ _settingsRewriteNeeded = true;
++ ApplyDefaultNightMode();
+ return;
+ }
+ LOG(("App Info: reading settings..."));
+@@ -1072,6 +1071,7 @@ bool ApplyDefaultNightMode() {
+ || _themeKeyLegacy) {
+ return false;
+ }
++ Core::App().startSettingsAndBackground();
+ Window::Theme::ToggleNightMode();
+ Window::Theme::KeepApplied();
+ return true;
diff --git a/telegram-desktop-libatomic-linkage.patch
b/telegram-desktop-libatomic-linkage.patch
new file mode 100644
index 0000000..34a8188
--- /dev/null
+++ b/telegram-desktop-libatomic-linkage.patch
@@ -0,0 +1,61 @@
+From 28ff839711926438018da162c4bb9591e1559015 Mon Sep 17 00:00:00 2001
+From: John Preston <johnprestonmail(a)gmail.com>
+Date: Sun, 26 Jul 2020 12:13:01 +0400
+Subject: [PATCH] Fix linking with glibc wraps, libatomic.
+
+---
+ external/openssl/openssl_common/CMakeLists.txt | 1 +
+ external/qt/CMakeLists.txt | 1 +
+ options_linux.cmake | 14 +++++++-------
+ 3 files changed, 9 insertions(+), 7 deletions(-)
+
+diff --git a/external/openssl/openssl_common/CMakeLists.txt
b/external/openssl/openssl_common/CMakeLists.txt
+index bae71ed..1e7656f 100644
+--- a/cmake/external/openssl/openssl_common/CMakeLists.txt
++++ b/cmake/external/openssl/openssl_common/CMakeLists.txt
+@@ -29,6 +29,7 @@ if (NOT DESKTOP_APP_USE_PACKAGED)
+ if (DESKTOP_APP_USE_GLIBC_WRAPS)
+ target_link_libraries(external_openssl_common
+ INTERFACE
++ desktop-app::linux_glibc_wraps
+ $<TARGET_FILE:desktop-app::linux_glibc_wraps>
+ )
+ endif()
+diff --git a/external/qt/CMakeLists.txt b/external/qt/CMakeLists.txt
+index 885c358..aa5a3a8 100644
+--- a/cmake/external/qt/CMakeLists.txt
++++ b/cmake/external/qt/CMakeLists.txt
+@@ -357,6 +357,7 @@ else()
+ if (DESKTOP_APP_USE_GLIBC_WRAPS)
+ target_link_libraries(external_qt
+ INTERFACE
++ desktop-app::linux_glibc_wraps
+ $<TARGET_FILE:desktop-app::linux_glibc_wraps>
+ )
+ endif()
+diff --git a/options_linux.cmake b/options_linux.cmake
+index e630ebf..a23ec02 100644
+--- a/cmake/options_linux.cmake
++++ b/cmake/options_linux.cmake
+@@ -48,14 +48,14 @@ if (NOT DESKTOP_APP_USE_PACKAGED)
+ endif()
+
+ if (DESKTOP_APP_USE_PACKAGED)
+- target_link_libraries(common_options
+- INTERFACE
+- atomic
+- )
++ find_library(ATOMIC_LIBRARY atomic)
+ else()
+- target_link_static_libraries(common_options
++ find_library(ATOMIC_LIBRARY libatomic.a)
++endif()
++
++if (ATOMIC_LIBRARY)
++ target_link_libraries(common_options
+ INTERFACE
+- atomic
++ ${ATOMIC_LIBRARY}
+ )
+ endif()
+-
diff --git a/telegram-desktop.spec b/telegram-desktop.spec
index f7cfd9d..0a3195b 100644
--- a/telegram-desktop.spec
+++ b/telegram-desktop.spec
@@ -1,3 +1,6 @@
+%undefine __cmake_in_source_build
+%define _lto_cflags %{nil}
+
# Build conditionals (with - OFF, without - ON)...
%bcond_without rlottie
%bcond_without ipo
@@ -10,8 +13,12 @@
# Applying workaround to RHBZ#1559007...
%if %{with clang}
+%if 0%{?fedora} && 0%{?fedora} >= 33
+%global toolchain clang
+%else
%global optflags %(echo %{optflags} | sed -e 's/-mcet//g' -e
's/-fcf-protection//g' -e 's/-fstack-clash-protection//g' -e 's/$/
-Qunused-arguments -Wno-unknown-warning-option -Wno-deprecated-declarations/')
%endif
+%endif
# Decrease debuginfo verbosity to reduce memory consumption...
%ifarch x86_64
@@ -21,7 +28,7 @@
%endif
Name: telegram-desktop
-Version: 2.1.13
+Version: 2.2.0
Release: 1%{?dist}
# Application and 3rd-party modules licensing:
@@ -34,6 +41,10 @@ Summary: Telegram Desktop official messaging app
Source0: %{url}/releases/download/v%{version}/%{appname}-%{version}-full.tar.gz
ExclusiveArch: x86_64
+# Upstream patches...
+Patch100: %{name}-fix-night-theme.patch
+Patch101: %{name}-libatomic-linkage.patch
+
# Telegram Desktop require exact version of Qt due to Qt private API usage.
%{?_qt5:Requires: %{_qt5}%{?_isa} = %{_qt5_version}}
Requires: qt5-qtimageformats%{?_isa}
@@ -71,19 +82,23 @@ BuildRequires: libtgvoip-devel >= 2.4.4
BuildRequires: range-v3-devel >= 0.10.0
BuildRequires: libqrcodegencpp-devel
BuildRequires: minizip-compat-devel
+BuildRequires: qt5-qtwayland-devel
BuildRequires: ffmpeg-devel >= 3.1
BuildRequires: dbusmenu-qt5-devel
BuildRequires: openal-soft-devel
+BuildRequires: qt5-qtbase-static
BuildRequires: qt5-qtbase-devel
BuildRequires: libstdc++-devel
BuildRequires: expected-devel
BuildRequires: hunspell-devel
BuildRequires: openssl-devel
+BuildRequires: wayland-devel
BuildRequires: xxhash-devel
BuildRequires: json11-devel
BuildRequires: ninja-build
BuildRequires: glib2-devel
BuildRequires: opus-devel
+BuildRequires: libatomic
BuildRequires: lz4-devel
BuildRequires: xz-devel
BuildRequires: python3
@@ -115,7 +130,6 @@ business messaging needs.
%prep
# Unpacking Telegram Desktop source archive...
%autosetup -n %{appname}-%{version}-full -p1
-mkdir -p %{_target_platform}
# 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}
@@ -127,8 +141,7 @@ rm -rf Telegram/ThirdParty/rlottie
%build
# Building Telegram Desktop using cmake...
-pushd %{_target_platform}
- %cmake -G Ninja \
+%cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
%ifarch x86_64
%if %{with ipo} && %{without clang}
@@ -173,13 +186,11 @@ pushd %{_target_platform}
-DTDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME:BOOL=ON \
-DTDESKTOP_DISABLE_DESKTOP_FILE_GENERATION:BOOL=ON \
-DTDESKTOP_USE_FONTCONFIG_FALLBACK:BOOL=OFF \
- -DTDESKTOP_LAUNCHER_BASENAME=%{launcher} \
- ..
-popd
-%ninja_build -C %{_target_platform}
+ -DTDESKTOP_LAUNCHER_BASENAME=%{launcher}
+%cmake_build
%install
-%ninja_install -C %{_target_platform}
+%cmake_install
%check
appstream-util validate-relax --nonet
%{buildroot}%{_metainfodir}/%{launcher}.appdata.xml
@@ -194,11 +205,11 @@ desktop-file-validate
%{buildroot}%{_datadir}/applications/%{launcher}.desktop
%{_metainfodir}/%{launcher}.appdata.xml
%changelog
+* 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.
-
-* Mon Jun 15 2020 Vitaly Zaitsev <vitaly(a)easycoding.org> - 2.1.11-2
-- Rebuilt due to Qt 5.14.2 update.