diff options
Diffstat (limited to 'testing/telegram-desktop')
31 files changed, 921 insertions, 876 deletions
diff --git a/testing/telegram-desktop/0002-tdesktop.patch b/testing/telegram-desktop/0002-tdesktop.patch deleted file mode 100644 index ca2435f23ba..00000000000 --- a/testing/telegram-desktop/0002-tdesktop.patch +++ /dev/null @@ -1,466 +0,0 @@ -diff --git a/Telegram/Resources/qrc/linux.qrc b/Telegram/Resources/qrc/linux.qrc -index 164e8d4f2..12319be14 100644 ---- a/Telegram/Resources/qrc/linux.qrc -+++ b/Telegram/Resources/qrc/linux.qrc -@@ -1,6 +1,5 @@ - <RCC> - <qresource prefix="/qt"> -- <file alias="etc/qt.conf">../etc/qt_linux.conf</file> - </qresource> - <qresource prefix="/fc"> - <file alias="fc-custom.conf">../fc-custom.conf</file> -diff --git a/Telegram/SourceFiles/core/launcher.cpp b/Telegram/SourceFiles/core/launcher.cpp -index b1246588a..7f522cc86 100644 ---- a/Telegram/SourceFiles/core/launcher.cpp -+++ b/Telegram/SourceFiles/core/launcher.cpp -@@ -272,6 +272,19 @@ int Launcher::exec() { - Logs::start(this); // must be started before Platform is started - Platform::start(); // must be started before Sandbox is created - -+ // I don't know why path is not in QT_PLUGIN_PATH by default -+ QCoreApplication::addLibraryPath("/usr/lib/qt5/plugins"); -+ // without this Telegram doesn't start on Ubuntu 17.04 due GTK errors -+ setenv("QT_STYLE_OVERRIDE", "qwerty", false); -+ // Telegram doesn't start when extraordinary theme is set, see launchpad.net/bugs/1680943 -+ unsetenv("QT_QPA_PLATFORMTHEME"); -+ -+ // unset QT screen scale related envvars -+ unsetenv("QT_SCREEN_SCALE_FACTORS"); -+ unsetenv("QT_AUTO_SCREEN_SCALE_FACTOR"); -+ unsetenv("QT_SCALE_FACTOR"); -+ unsetenv("QT_DEVICE_PIXEL_RATIO"); -+ - auto result = executeApplication(); - - DEBUG_LOG(("Telegram finished, result: %1").arg(result)); -diff --git a/Telegram/SourceFiles/qt_functions.cpp b/Telegram/SourceFiles/qt_functions.cpp -new file mode 100644 -index 000000000..4a722b8d7 ---- /dev/null -+++ b/Telegram/SourceFiles/qt_functions.cpp -@@ -0,0 +1,94 @@ -+/**************************************************************************** -+** -+** Copyright (C) 2015 The Qt Company Ltd. -+** Contact: http://www.qt.io/licensing/ -+** -+** This file contains some parts of the Qt Toolkit. -+** -+** $QT_BEGIN_LICENSE:LGPL21$ -+** Commercial License Usage -+** Licensees holding valid commercial Qt licenses may use this file in -+** accordance with the commercial license agreement provided with the -+** Software or, alternatively, in accordance with the terms contained in -+** a written agreement between you and The Qt Company. For licensing terms -+** and conditions see http://www.qt.io/terms-conditions. For further -+** information use the contact form at http://www.qt.io/contact-us. -+** -+** GNU Lesser General Public License Usage -+** Alternatively, this file may be used under the terms of the GNU Lesser -+** General Public License version 2.1 or version 3 as published by the Free -+** Software Foundation and appearing in the file LICENSE.LGPLv21 and -+** LICENSE.LGPLv3 included in the packaging of this file. Please review the -+** following information to ensure the GNU Lesser General Public License -+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -+** -+** As a special exception, The Qt Company gives you certain additional -+** rights. These rights are described in The Qt Company LGPL Exception -+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -+** -+** $QT_END_LICENSE$ -+** -+****************************************************************************/ -+ -+/* TODO: find a dynamic library with these symbols. */ -+ -+/* Debian maintainer: this function is taken from qfiledialog.cpp */ -+/* -+ Makes a list of filters from ;;-separated text. -+ Used by the mac and windows implementations -+*/ -+QStringList qt_make_filter_list(const QString &filter) -+{ -+ QString f(filter); -+ -+ if (f.isEmpty()) -+ return QStringList(); -+ -+ QString sep(QLatin1String(";;")); -+ int i = f.indexOf(sep, 0); -+ if (i == -1) { -+ if (f.indexOf(QLatin1Char('\n'), 0) != -1) { -+ sep = QLatin1Char('\n'); -+ i = f.indexOf(sep, 0); -+ } -+ } -+ -+ return f.split(sep); -+} -+ -+/* Debian maintainer: this constructor is taken from qtextengine.cpp for TextPainter::drawLine */ -+QTextItemInt::QTextItemInt(const QGlyphLayout &g, QFont *font, const QChar *chars_, int numChars, QFontEngine *fe, const QTextCharFormat &format) -+ : flags(0), justified(false), underlineStyle(QTextCharFormat::NoUnderline), charFormat(format), -+ num_chars(numChars), chars(chars_), logClusters(0), f(font), glyphs(g), fontEngine(fe) -+{ -+} -+ -+/* Debian maintainer: this method is also taken from qtextengine.cpp */ -+// Fix up flags and underlineStyle with given info -+void QTextItemInt::initWithScriptItem(const QScriptItem &si) -+{ -+ // explicitly initialize flags so that initFontAttributes can be called -+ // multiple times on the same TextItem -+ flags = 0; -+ if (si.analysis.bidiLevel %2) -+ flags |= QTextItem::RightToLeft; -+ ascent = si.ascent; -+ descent = si.descent; -+ -+ if (charFormat.hasProperty(QTextFormat::TextUnderlineStyle)) { -+ underlineStyle = charFormat.underlineStyle(); -+ } else if (charFormat.boolProperty(QTextFormat::FontUnderline) -+ || f->d->underline) { -+ underlineStyle = QTextCharFormat::SingleUnderline; -+ } -+ -+ // compat -+ if (underlineStyle == QTextCharFormat::SingleUnderline) -+ flags |= QTextItem::Underline; -+ -+ if (f->d->overline || charFormat.fontOverline()) -+ flags |= QTextItem::Overline; -+ if (f->d->strikeOut || charFormat.fontStrikeOut()) -+ flags |= QTextItem::StrikeOut; -+} -diff --git a/Telegram/SourceFiles/qt_static_plugins.cpp b/Telegram/SourceFiles/qt_static_plugins.cpp -index a757d085f..122ff0f5d 100644 ---- a/Telegram/SourceFiles/qt_static_plugins.cpp -+++ b/Telegram/SourceFiles/qt_static_plugins.cpp -@@ -15,14 +15,4 @@ Q_IMPORT_PLUGIN(QWebpPlugin) - Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin) - Q_IMPORT_PLUGIN(QGenericEnginePlugin) - #elif defined Q_OS_LINUX // Q_OS_WIN | Q_OS_MAC --Q_IMPORT_PLUGIN(QWebpPlugin) --Q_IMPORT_PLUGIN(QXcbIntegrationPlugin) --Q_IMPORT_PLUGIN(QConnmanEnginePlugin) --Q_IMPORT_PLUGIN(QGenericEnginePlugin) --Q_IMPORT_PLUGIN(QNetworkManagerEnginePlugin) --Q_IMPORT_PLUGIN(QComposePlatformInputContextPlugin) --Q_IMPORT_PLUGIN(QIbusPlatformInputContextPlugin) --Q_IMPORT_PLUGIN(QFcitxPlatformInputContextPlugin) --Q_IMPORT_PLUGIN(QHimePlatformInputContextPlugin) --Q_IMPORT_PLUGIN(NimfInputContextPlugin) - #endif // Q_OS_WIN | Q_OS_MAC | Q_OS_LINUX -diff --git a/Telegram/SourceFiles/ui/text/text.cpp b/Telegram/SourceFiles/ui/text/text.cpp -index 7891995be..eaeb52b35 100644 ---- a/Telegram/SourceFiles/ui/text/text.cpp -+++ b/Telegram/SourceFiles/ui/text/text.cpp -@@ -1968,11 +1968,11 @@ private: - if (item == -1) - return; - --#ifdef OS_MAC_OLD -+#if defined(OS_MAC_OLD) || QT_VERSION < QT_VERSION_CHECK(5, 6, 0) - auto end = _e->findItem(line.from + line.length - 1); --#else // OS_MAC_OLD -+#else - auto end = _e->findItem(line.from + line.length - 1, item); --#endif // OS_MAC_OLD -+#endif - - auto blockIndex = _lineStartBlock; - auto currentBlock = _t->_blocks[blockIndex].get(); -diff --git a/Telegram/SourceFiles/ui/text/text_block.cpp b/Telegram/SourceFiles/ui/text/text_block.cpp -index 29173c5c2..b47a53d76 100644 ---- a/Telegram/SourceFiles/ui/text/text_block.cpp -+++ b/Telegram/SourceFiles/ui/text/text_block.cpp -@@ -334,6 +334,9 @@ TextBlock::TextBlock(const style::font &font, const QString &str, QFixed minResi - - QStackTextEngine engine(part, blockFont->f); - BlockParser parser(&engine, this, minResizeWidth, _from, part); -+ QTextLayout layout(part, blockFont->f); -+ layout.beginLayout(); -+ layout.createLine(); - } - } - -diff --git a/Telegram/gyp/PrecompiledHeader.cmake b/Telegram/gyp/PrecompiledHeader.cmake -index dfe1193be..0b13fc098 100644 ---- a/Telegram/gyp/PrecompiledHeader.cmake -+++ b/Telegram/gyp/PrecompiledHeader.cmake -@@ -114,7 +114,7 @@ function(add_precompiled_header _target _input) - set(_compiler_FLAGS "@${_pch_c_flags_file}") - add_custom_command( - OUTPUT "${_output_c}" -- COMMAND "${CMAKE_C_COMPILER}" ${_compiler_FLAGS} -x c-header -o "${_output_c}" -c "${_pchfile}" -+ COMMAND "${CMAKE_C_COMPILER}" ${_compiler_FLAGS} "$(C_DEFINES)" "$(C_INCLUDES)" "$(C_FLAGS)" -x c-header -o "${_output_c}" -c "${_pchfile}" - DEPENDS "${_pchfile}" "${_pch_c_flags_file}" - IMPLICIT_DEPENDS C "${_pch_header}" - COMMENT "Precompiling ${_name} for ${_target} (C)") -@@ -125,7 +125,7 @@ function(add_precompiled_header _target _input) - set(_compiler_FLAGS "@${_pch_cpp_flags_file}") - add_custom_command( - OUTPUT "${_output_cxx}" -- COMMAND "${CMAKE_CXX_COMPILER}" ${_compiler_FLAGS} -x c++-header -o "${_output_cxx}" -c "${_pchfile}" -+ COMMAND "${CMAKE_CXX_COMPILER}" ${_compiler_FLAGS} "$(CXX_DEFINES)" "$(CXX_INCLUDES)" "$(CXX_FLAGS)" -x c++-header -o "${_output_cxx}" -c "${_pchfile}" - DEPENDS "${_pchfile}" "${_pch_cpp_flags_file}" - IMPLICIT_DEPENDS CXX "${_pch_header}" - COMMENT "Precompiling header ${_name} for ${_target} (C++)") -diff --git a/Telegram/gyp/common/linux.gypi b/Telegram/gyp/common/linux.gypi -index cdcdef1dc..667fbb7f3 100644 ---- a/Telegram/gyp/common/linux.gypi -+++ b/Telegram/gyp/common/linux.gypi -@@ -11,7 +11,6 @@ - 'linux_common_flags': [ - '-pipe', - '-Wall', -- '-Werror', - '-W', - '-fPIC', - '-Wno-unused-variable', -@@ -86,7 +85,6 @@ - ], - 'defines': [ - '_REENTRANT', -- 'QT_STATICPLUGIN', - 'QT_PLUGIN', - ], - 'cflags_c': [ -diff --git a/Telegram/gyp/modules/qt.gypi b/Telegram/gyp/modules/qt.gypi -index 0b783ec21..3f917765a 100644 ---- a/Telegram/gyp/modules/qt.gypi -+++ b/Telegram/gyp/modules/qt.gypi -@@ -14,25 +14,21 @@ - [ 'build_macold', { - 'qt_version%': '5.3.2', - }, { -- 'qt_version%': '5.6.2', -+ 'qt_version%': '<!(echo /usr/include/QtCore/*/ | grep -Po "\d+\.\d+\.\d+")', - }] - ], - }, - 'qt_libs': [ -- 'qwebp', -- 'Qt5PrintSupport', -- 'Qt5PlatformSupport', - 'Qt5Network', - 'Qt5Widgets', - 'Qt5Gui', -- 'qtharfbuzzng', - ], - 'qt_version%': '<(qt_version)', - 'conditions': [ - [ 'build_macold', { - 'linux_path_qt%': '/usr/local/macold/Qt-<(qt_version)', - }, { -- 'linux_path_qt%': '/usr/local/tdesktop/Qt-<(qt_version)', -+ 'linux_path_qt%': '/usr/lib/qt5', - }] - ] - }, -@@ -72,32 +68,13 @@ - ], - }], - [ 'build_linux', { -- 'qt_lib_prefix': 'lib', -- 'qt_lib_debug_postfix': '.a', -- 'qt_lib_release_postfix': '.a', -+ 'qt_lib_prefix': '', -+ 'qt_lib_debug_postfix': '', -+ 'qt_lib_release_postfix': '', - 'qt_libs': [ -- 'qxcb', -- 'Qt5XcbQpa', -- 'qconnmanbearer', -- 'qgenericbearer', -- 'qnmbearer', - '<@(qt_libs)', - 'Qt5DBus', - 'Qt5Core', -- 'qtpcre', -- 'Xi', -- 'Xext', -- 'Xfixes', -- 'SM', -- 'ICE', -- 'fontconfig', -- 'expat', -- 'freetype', -- 'z', -- 'xcb-shm', -- 'xcb-xfixes', -- 'xcb-render', -- 'xcb-static', - ], - }], - ], -@@ -127,11 +104,6 @@ - # '<!@(python <(DEPTH)/list_sources.py [sources] <(qt_moc_list_sources_arg))' - # where [sources] contains all your source files - 'qt_moc_list_sources_arg': '--moc-prefix SHARED_INTERMEDIATE_DIR/<(_target_name)/moc/moc_', -- -- 'linux_path_xkbcommon%': '/usr/local', -- 'linux_lib_ssl%': '/usr/local/ssl/lib/libssl.a', -- 'linux_lib_crypto%': '/usr/local/ssl/lib/libcrypto.a', -- 'linux_lib_icu%': 'libicutu.a libicui18n.a libicuuc.a libicudata.a', - }, - - 'configurations': { -@@ -180,14 +152,14 @@ - }, - - 'include_dirs': [ -- '<(qt_loc)/include', -- '<(qt_loc)/include/QtCore', -- '<(qt_loc)/include/QtGui', -- '<(qt_loc)/include/QtDBus', -- '<(qt_loc)/include/QtCore/<(qt_version)', -- '<(qt_loc)/include/QtGui/<(qt_version)', -- '<(qt_loc)/include/QtCore/<(qt_version)/QtCore', -- '<(qt_loc)/include/QtGui/<(qt_version)/QtGui', -+ '/usr/include/', -+ '/usr/include/QtCore', -+ '/usr/include/QtGui', -+ '/usr/include/QtDBus', -+ '/usr/include/QtCore/<(qt_version)', -+ '/usr/include/QtGui/<(qt_version)', -+ '/usr/include/QtCore/<(qt_version)/QtCore', -+ '/usr/include/QtGui/<(qt_version)/QtGui', - ], - 'library_dirs': [ - '<(qt_loc)/lib', -@@ -212,17 +184,10 @@ - ], - 'libraries': [ - '<(PRODUCT_DIR)/obj.target/liblinux_glibc_wraps.a', -- '<(linux_path_xkbcommon)/lib/libxkbcommon.a', - '<@(qt_libs_release)', -- '<(linux_lib_ssl)', -- '<(linux_lib_crypto)', -- '<!@(python -c "for s in \'<(linux_lib_icu)\'.split(\' \'): print(s)")', -- '-lxcb', -+ '-lcrypto', - '-lX11', -- '-lX11-xcb', -- '-ldbus-1', - '-ldl', -- '-lgthread-2.0', - '-lglib-2.0', - '-lpthread', - ], -@@ -230,7 +195,6 @@ - '<(qt_loc)/mkspecs/linux-g++', - ], - 'ldflags': [ -- '-static-libstdc++', - '-pthread', - '-rdynamic', - ], -diff --git a/Telegram/gyp/modules/qt_moc.gypi b/Telegram/gyp/modules/qt_moc.gypi -index ebee90a15..75424d4bb 100644 ---- a/Telegram/gyp/modules/qt_moc.gypi -+++ b/Telegram/gyp/modules/qt_moc.gypi -@@ -15,7 +15,7 @@ - '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/moc/moc_<(RULE_INPUT_ROOT).cpp', - ], - 'action': [ -- '<(qt_loc)/bin/moc<(exe_ext)', -+ '/usr/bin/moc', - - # Silence "Note: No relevant classes found. No output generated." - '--no-notes', -diff --git a/Telegram/gyp/modules/qt_rcc.gypi b/Telegram/gyp/modules/qt_rcc.gypi -index f5624a82b..1129a95c5 100644 ---- a/Telegram/gyp/modules/qt_rcc.gypi -+++ b/Telegram/gyp/modules/qt_rcc.gypi -@@ -15,7 +15,7 @@ - '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/qrc/qrc_<(RULE_INPUT_ROOT).cpp', - ], - 'action': [ -- '<(qt_loc)/bin/rcc<(exe_ext)', -+ '/usr/bin/rcc', - '-name', '<(RULE_INPUT_ROOT)', - '-no-compress', - '<(RULE_INPUT_PATH)', -diff --git a/Telegram/gyp/telegram/linux.gypi b/Telegram/gyp/telegram/linux.gypi -index 385f2b89f..f3ddf7e83 100644 ---- a/Telegram/gyp/telegram/linux.gypi -+++ b/Telegram/gyp/telegram/linux.gypi -@@ -19,27 +19,21 @@ - #'xkbcommon', - ], - }, -+ 'library_dirs': [ -+ '/usr/lib', -+ '/usr/lib/openssl', -+ ], - 'libraries': [ -- '-lbreakpad_client', -- '-lcomposeplatforminputcontextplugin', -- '-libusplatforminputcontextplugin', -- '-lfcitxplatforminputcontextplugin', -- '-lhimeplatforminputcontextplugin', -- '-lnimfplatforminputcontextplugin', -- '-llzma', - '-lopenal', - '-lavformat', - '-lavcodec', - '-lswresample', - '-lswscale', - '-lavutil', -+ '-lminizip', - '-lopus', -- '-lva-x11', -- '-lva-drm', -- '-lva', -- '-lvdpau', -- '-ldrm', - '-lz', -+ '-llzma', - # '<!(pkg-config 2> /dev/null --libs <@(pkgconfig_libs))', - ], - 'cflags_cc': [ -@@ -51,7 +45,6 @@ - '-Wl,-wrap,secure_getenv', - '-Wl,-wrap,clock_gettime', - '-Wl,--no-as-needed,-lrt', -- '-Wl,-Bstatic', - ], - 'configurations': { - 'Release': { -@@ -75,9 +68,8 @@ - ], - }], ['not_need_gtk!="True"', { - 'cflags_cc': [ -- '<!(pkg-config 2> /dev/null --cflags gtk+-2.0)', -- '<!(pkg-config 2> /dev/null --cflags glib-2.0)', -- '<!(pkg-config 2> /dev/null --cflags dee-1.0)', -+ '<!(pkg-config 2> /dev/null --cflags appindicator3-0.1)', -+ '<!(pkg-config 2> /dev/null --cflags gtk+-3.0)', - ], - }], ['<!(pkg-config ayatana-appindicator3-0.1; echo $?) == 0', { - 'cflags_cc': [ '<!(pkg-config --cflags ayatana-appindicator3-0.1)' ], -diff --git a/Telegram/gyp/telegram/sources.txt b/Telegram/gyp/telegram/sources.txt -index 38d9d0e64..459919abf 100644 ---- a/Telegram/gyp/telegram/sources.txt -+++ b/Telegram/gyp/telegram/sources.txt -@@ -863,14 +863,7 @@ - <(src_loc)/settings.cpp - <(src_loc)/settings.h - --platforms: !win --<(minizip_loc)/crypt.h --<(minizip_loc)/ioapi.c --<(minizip_loc)/ioapi.h --<(minizip_loc)/zip.c --<(minizip_loc)/zip.h --<(minizip_loc)/unzip.c --<(minizip_loc)/unzip.h -+<(src_loc)/qt_functions.cpp - - platforms: win - <(res_loc)/winrc/Telegram.rc --- -2.23.0 - diff --git a/testing/telegram-desktop/0003-fix-missing-use-of-pch.patch b/testing/telegram-desktop/0003-fix-missing-use-of-pch.patch deleted file mode 100644 index ec297a06c42..00000000000 --- a/testing/telegram-desktop/0003-fix-missing-use-of-pch.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/Telegram/SourceFiles/storage/cache/storage_cache_database_object.cpp -+++ b/Telegram/SourceFiles/storage/cache/storage_cache_database_object.cpp -@@ -14,6 +14,7 @@ - #include "storage/storage_encrypted_file.h" - #include "base/flat_map.h" - #include "base/algorithm.h" -+#include "base/openssl_help.h" - #include <crl/crl.h> - #include <xxhash.h> - #include <QtCore/QDir> - diff --git a/testing/telegram-desktop/0005-system-wide-fonts.patch b/testing/telegram-desktop/0005-system-wide-fonts.patch deleted file mode 100644 index 0c21acc83ff..00000000000 --- a/testing/telegram-desktop/0005-system-wide-fonts.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff --git a/Telegram/Resources/qrc/fonts.qrc b/Telegram/Resources/qrc/fonts.qrc -index 233b8d572..122d89140 100644 ---- a/Telegram/Resources/qrc/fonts.qrc -+++ b/Telegram/Resources/qrc/fonts.qrc -@@ -1,7 +1,4 @@ - <RCC> - <qresource prefix="/gui"> -- <file alias="fonts/OpenSans-Regular.ttf">../fonts/OpenSans-Regular.ttf</file> -- <file alias="fonts/OpenSans-Bold.ttf">../fonts/OpenSans-Bold.ttf</file> -- <file alias="fonts/OpenSans-Semibold.ttf">../fonts/OpenSans-Semibold.ttf</file> - </qresource> - </RCC> -diff --git a/Telegram/SourceFiles/ui/style/style_core_font.cpp b/Telegram/SourceFiles/ui/style/style_core_font.cpp -index 22ccfea7e..36f271f93 100644 ---- a/Telegram/SourceFiles/ui/style/style_core_font.cpp -+++ b/Telegram/SourceFiles/ui/style/style_core_font.cpp -@@ -84,9 +84,9 @@ void StartFonts() { - } - Started = true; - -- auto regular = LoadCustomFont(":/gui/fonts/OpenSans-Regular.ttf", "Open Sans"); -- auto bold = LoadCustomFont(":/gui/fonts/OpenSans-Bold.ttf", "Open Sans", style::internal::FontBold); -- auto semibold = LoadCustomFont(":/gui/fonts/OpenSans-Semibold.ttf", "Open Sans Semibold"); -+ auto regular = ValidateFont("Open Sans"); -+ auto bold = ValidateFont("Open Sans", style::internal::FontBold); -+ auto semibold = ValidateFont("Open Sans Semibold"); - - #ifdef Q_OS_WIN - // Attempt to workaround a strange font bug with Open Sans Semibold not loading. --- -2.23.0 - - diff --git a/testing/telegram-desktop/0006-ppc64le-enable-arch.patch b/testing/telegram-desktop/0006-ppc64le-enable-arch.patch deleted file mode 100644 index aeebc891eae..00000000000 --- a/testing/telegram-desktop/0006-ppc64le-enable-arch.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- a/Telegram/SourceFiles/base/build_config.h -+++ b/Telegram/SourceFiles/base/build_config.h -@@ -51,6 +51,8 @@ - #define ARCH_CPU_64_BITS 1 - #elif defined(_M_ARM) || defined(__arm__) - #define ARCH_CPU_32_BITS 1 -+#elif defined(__PPC64__) -+#define ARCH_CPU_64_BITS 1 - #else - #error Please add support for your architecture in base/build_config.h - #endif ---- a/Telegram/ThirdParty/libtgvoip/webrtc_dsp/rtc_base/system/arch.h -+++ b/Telegram/ThirdParty/libtgvoip/webrtc_dsp/rtc_base/system/arch.h -@@ -27,6 +27,10 @@ - #define WEBRTC_ARCH_ARM_FAMILY - #define WEBRTC_ARCH_64_BITS - #define WEBRTC_ARCH_LITTLE_ENDIAN -+#elif defined(__PPC64__) -+#define WEBRTC_ARCH_PPC64 -+#define WEBRTC_ARCH_64_BITS -+#define WEBRTC_ARCH_LITTLE_ENDIAN - #elif defined(_M_IX86) || defined(__i386__) - #define WEBRTC_ARCH_X86_FAMILY - #define WEBRTC_ARCH_X86 ---- a/Telegram/ThirdParty/libtgvoip/webrtc_dsp/typedefs.h -+++ b/Telegram/ThirdParty/libtgvoip/webrtc_dsp/typedefs.h -@@ -27,6 +27,10 @@ - #define WEBRTC_ARCH_ARM_FAMILY - #define WEBRTC_ARCH_64_BITS - #define WEBRTC_ARCH_LITTLE_ENDIAN -+#elif defined(__PPC64__) -+#define WEBRTC_ARCH_PPC64 -+#define WEBRTC_ARCH_64_BITS -+#define WEBRTC_ARCH_LITTLE_ENDIAN - #elif defined(_M_IX86) || defined(__i386__) - #define WEBRTC_ARCH_X86_FAMILY - #define WEBRTC_ARCH_X86 diff --git a/testing/telegram-desktop/0009-lz4.patch b/testing/telegram-desktop/0009-lz4.patch deleted file mode 100644 index 7bd0d2524d1..00000000000 --- a/testing/telegram-desktop/0009-lz4.patch +++ /dev/null @@ -1,48 +0,0 @@ -diff --git a/Telegram/gyp/lib_lottie.gyp b/Telegram/gyp/lib_lottie.gyp -index ada149e..870f4e6 100644 ---- a/Telegram/gyp/lib_lottie.gyp -+++ b/Telegram/gyp/lib_lottie.gyp -@@ -24,21 +24,18 @@ - 'official_build_target%': '', - 'submodules_loc': '../ThirdParty', - 'rlottie_loc': '<(submodules_loc)/rlottie/inc', -- 'lz4_loc': '<(submodules_loc)/lz4/lib', - }, - 'dependencies': [ - 'crl.gyp:crl', - 'lib_base.gyp:lib_base', - 'lib_rlottie.gyp:lib_rlottie', - 'lib_ffmpeg.gyp:lib_ffmpeg', -- 'lib_lz4.gyp:lib_lz4', - ], - 'export_dependent_settings': [ - 'crl.gyp:crl', - 'lib_base.gyp:lib_base', - 'lib_rlottie.gyp:lib_rlottie', - 'lib_ffmpeg.gyp:lib_ffmpeg', -- 'lib_lz4.gyp:lib_lz4', - ], - 'defines': [ - 'LOT_BUILD', -@@ -50,7 +47,6 @@ - '<(libs_loc)/zlib', - '<(libs_loc)/ffmpeg', - '<(rlottie_loc)', -- '<(lz4_loc)', - '<(submodules_loc)/GSL/include', - '<(submodules_loc)/variant/include', - '<(submodules_loc)/crl/src', - -diff --git a/Telegram/gyp/telegram/linux.gypi b/Telegram/gyp/telegram/linux.gypi -index 9349c68..087c424 100644 ---- a/Telegram/gyp/telegram/linux.gypi -+++ b/Telegram/gyp/telegram/linux.gypi -@@ -34,6 +34,7 @@ - '-lopus', - '-lz', - '-llzma', -+ '-llz4', - # '<!(pkg-config 2> /dev/null --libs <@(pkgconfig_libs))', - ], - 'cflags_cc': [ - diff --git a/testing/telegram-desktop/0010-libtgvoip.patch b/testing/telegram-desktop/0010-libtgvoip.patch deleted file mode 100644 index af146981b40..00000000000 --- a/testing/telegram-desktop/0010-libtgvoip.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/libtgvoip.gyp b/libtgvoip.gyp -index 52fbea1..9a4dfb7 100644 ---- a/Telegram/ThirdParty/libtgvoip/libtgvoip.gyp -+++ b/Telegram/ThirdParty/libtgvoip/libtgvoip.gyp -@@ -13,11 +13,12 @@ - 'variables': { - 'tgvoip_src_loc': '.', - 'official_build_target%': '', -- 'linux_path_opus_include%': '<(DEPTH)/../../../Libraries/opus/include', -+ 'linux_path_opus_include%': '/usr/include/opus', - }, - 'include_dirs': [ - '<(tgvoip_src_loc)/webrtc_dsp', - '<(linux_path_opus_include)', -+ '/usr/include/openssl' - ], - 'direct_dependent_settings': { - 'include_dirs': [ - diff --git a/testing/telegram-desktop/0014-clock_gettime.patch b/testing/telegram-desktop/0014-clock_gettime.patch deleted file mode 100644 index 6b743529283..00000000000 --- a/testing/telegram-desktop/0014-clock_gettime.patch +++ /dev/null @@ -1,44 +0,0 @@ -diff --git a/Telegram/gyp/modules/qt.gypi b/Telegram/gyp/modules/qt.gypi -index c7dff28..c674dc0 100644 ---- a/Telegram/gyp/modules/qt.gypi -+++ b/Telegram/gyp/modules/qt.gypi -@@ -176,14 +176,10 @@ - ], - 'conditions': [ - [ 'build_linux', { -- 'dependencies': [ -- '<(DEPTH)/linux_glibc_wraps.gyp:linux_glibc_wraps', -- ], - 'library_dirs': [ - '<(qt_loc)/plugins/platforminputcontexts', - ], - 'libraries': [ -- '<(PRODUCT_DIR)/obj.target/liblinux_glibc_wraps.a', - '<@(qt_libs_release)', - '-lcrypto', - '-lX11', -diff --git a/Telegram/gyp/telegram/linux.gypi b/Telegram/gyp/telegram/linux.gypi -index f3ddf7e..9349c68 100644 ---- a/Telegram/gyp/telegram/linux.gypi -+++ b/Telegram/gyp/telegram/linux.gypi -@@ -41,9 +41,6 @@ - '-Wno-maybe-uninitialized', - ], - 'ldflags': [ -- '-Wl,-wrap,aligned_alloc', -- '-Wl,-wrap,secure_getenv', -- '-Wl,-wrap,clock_gettime', - '-Wl,--no-as-needed,-lrt', - ], - 'configurations': { -@@ -63,9 +60,6 @@ - }, - 'conditions': [ - [ '"<!(uname -p)" != "x86_64"', { -- 'ldflags': [ -- '-Wl,-wrap,__divmoddi4', -- ], - }], ['not_need_gtk!="True"', { - 'cflags_cc': [ - '<!(pkg-config 2> /dev/null --cflags appindicator3-0.1)', - diff --git a/testing/telegram-desktop/0015-revert-headers.patch b/testing/telegram-desktop/0015-revert-headers.patch deleted file mode 100644 index 7a0208d44a0..00000000000 --- a/testing/telegram-desktop/0015-revert-headers.patch +++ /dev/null @@ -1,40 +0,0 @@ -diff --git a/Telegram/SourceFiles/ui/text/text.h b/Telegram/SourceFiles/ui/text/text.h -index 537c0b6..7906b0e 100644 ---- a/Telegram/SourceFiles/ui/text/text.h -+++ b/Telegram/SourceFiles/ui/text/text.h -@@ -11,7 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL - #include "core/click_handler.h" - #include "base/flags.h" - --#include <private/qfixed_p.h> -+#include <private/qfontengine_p.h> - - static const QChar TextCommand(0x0010); - enum TextCommands { -diff --git a/Telegram/SourceFiles/ui/text/text_block.cpp b/Telegram/SourceFiles/ui/text/text_block.cpp -index c7b3fde..9637a2e 100644 ---- a/Telegram/SourceFiles/ui/text/text_block.cpp -+++ b/Telegram/SourceFiles/ui/text/text_block.cpp -@@ -9,8 +9,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL - - #include "core/crash_reports.h" - --#include <private/qfontengine_p.h> -- - // COPIED FROM qtextlayout.cpp AND MODIFIED - namespace Ui { - namespace Text { -diff --git a/Telegram/SourceFiles/ui/text/text_block.h b/Telegram/SourceFiles/ui/text/text_block.h -index a20b812..38e1e04 100644 ---- a/Telegram/SourceFiles/ui/text/text_block.h -+++ b/Telegram/SourceFiles/ui/text/text_block.h -@@ -7,7 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL - */ - #pragma once - --#include <private/qfixed_p.h> -+#include <private/qfontengine_p.h> - - namespace Ui { - namespace Text { - diff --git a/testing/telegram-desktop/0016-no-gtk2.patch b/testing/telegram-desktop/0016-no-gtk2.patch deleted file mode 100644 index e60038d0e82..00000000000 --- a/testing/telegram-desktop/0016-no-gtk2.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/Telegram/SourceFiles/platform/linux/linux_libs.cpp b/Telegram/SourceFiles/platform/linux/linux_libs.cpp -index 5071d63d1..671d0e661 100644 ---- a/Telegram/SourceFiles/platform/linux/linux_libs.cpp -+++ b/Telegram/SourceFiles/platform/linux/linux_libs.cpp -@@ -243,24 +243,12 @@ void start() { - indicatorLoaded = setupAppIndicator(lib_indicator); - } - } -- if ((!gtkLoaded || !indicatorLoaded) && !isWayland) { -- if (loadLibrary(lib_indicator, "ayatana-appindicator", 1) || loadLibrary(lib_indicator, "appindicator", 1)) { -- if (loadLibrary(lib_gtk, "gtk-x11-2.0", 0)) { -- gtkLoaded = indicatorLoaded = false; -- gtkLoaded = setupGtkBase(lib_gtk); -- indicatorLoaded = setupAppIndicator(lib_indicator); -- } -- } -- } - - // If no appindicator, try at least load gtk. - if (!gtkLoaded && !indicatorLoaded) { - if (loadLibrary(lib_gtk, "gtk-3", 0)) { - gtkLoaded = setupGtkBase(lib_gtk); - } -- if (!gtkLoaded && !isWayland && loadLibrary(lib_gtk, "gtk-x11-2.0", 0)) { -- gtkLoaded = setupGtkBase(lib_gtk); -- } - } - - if (gtkLoaded) { --- -2.23.0 - diff --git a/testing/telegram-desktop/APKBUILD b/testing/telegram-desktop/APKBUILD index b4b40334aab..9acb84229b1 100644 --- a/testing/telegram-desktop/APKBUILD +++ b/testing/telegram-desktop/APKBUILD @@ -1,27 +1,17 @@ # Maintainer: Leo <thinkabit.ukim@gmail.com> # Contributor: Leo <thinkabit.ukim@gmail.com> -# TODO(Leo): remove pulseaudio dep, use system xxhash +# TODO(Leo): remove pulseaudio dep pkgname=telegram-desktop -pkgver=1.8.15 -# https://github.com/telegramdesktop/tdesktop/blob/v$pkgver/docs/building-cmake.md -_catch2_commit=5ca44b68721833ae3731802ed99af67c6f38a53a -_gsl_commit=d846fe50a3f0bb7767c7e087a05f4be95f4da0ec -_crl_commit=52baf11aaeb7f5ea6955a438abaa1aee4c4308d8 -_libtgvoip_commit=d4a0f719ffd8d29e88474f67abc9fc862661c3b9 -_rlottie_commit=589db026ec211bc4979e3bffe074f6e48ce7cedc -_variant_commit=550ac2f159ca883d360c196149b466955c77a573 -_xxhash_commit=7cc9639699f64b750c0b82333dced9ea77e8436e +pkgver=1.9.3 pkgrel=0 +_breakpad_commit=dbd454dbe47e584571388fc3533193416bdce67f pkgdesc="Telegram Desktop messaging app" options="!check" # Requires Catch2 to be packaged. url="https://desktop.telegram.org/" -arch="all !s390x" # ARM are failing due to range-v3 +arch="all !s390x" # Need support on lib_base license="GPL-3.0-or-later WITH OpenSSL" depends="qt5-qtimageformats libappindicator" makedepends=" - dos2unix - gyp - grep cmake zlib-dev opus-dev @@ -38,103 +28,88 @@ makedepends=" minizip-dev alsa-lib-dev libexecinfo-dev - python2 rapidjson-dev lz4-dev pulseaudio-dev qtchooser - range-v3-dev libdbusmenu-glib-dev libappindicator-dev + xxhash-dev + enchant2-dev + range-v3-dev + python " source=" - $pkgname-$pkgver.tar.gz::https://github.com/telegramdesktop/tdesktop/archive/v$pkgver.tar.gz - libtgvoip-$_libtgvoip_commit.tar.gz::https://github.com/telegramdesktop/libtgvoip/archive/$_libtgvoip_commit.tar.gz - GSL-$_gsl_commit.tar.gz::https://github.com/Microsoft/GSL/archive/$_gsl_commit.tar.gz - variant-$_variant_commit.tar.gz::https://github.com/mapbox/variant/archive/$_variant_commit.tar.gz - crl-$_crl_commit.tar.gz::https://github.com/telegramdesktop/crl/archive/$_crl_commit.tar.gz - rlottie-$_rlottie_commit.tar.gz::https://github.com/john-preston/rlottie/archive/$_rlottie_commit.tar.gz - Catch2-$_catch2_commit.tar.gz::https://github.com/catchorg/Catch2/archive/$_catch2_commit.tar.gz - xxhash-$_xxhash_commit.tar.gz::https://github.com/Cyan4973/xxHash/archive/$_xxhash_commit.tar.gz - CMakeLists.inj - 0001-musl.patch - 0002-tdesktop.patch - 0003-fix-missing-use-of-pch.patch - 0004-xdg.patch - 0005-system-wide-fonts.patch - 0006-ppc64le-enable-arch.patch - 0009-lz4.patch - 0010-libtgvoip.patch - 0014-clock_gettime.patch - 0015-revert-headers.patch - 0016-no-gtk2.patch - minizip-includes.patch + https://github.com/telegramdesktop/tdesktop/releases/download/v$pkgver/tdesktop-$pkgver-full.tar.gz + breakpad-$_breakpad_commit.tar.gz::https://github.com/google/breakpad/archive/$_breakpad_commit.tar.gz + xdg.patch + lz4.patch + zlib.patch + opus.patch + openal.patch + openssl.patch + ffmpeg.patch + qt.patch + range-v3.patch + musl-basename.patch + updater.patch + default-shared.patch + exotic-arch-compat.patch + werror-o2.patch + breakpad-loc.patch + qt_functions.patch + ppc.patch + qt-plugin-path.patch + qt_functions.cpp " -builddir="$srcdir/tdesktop-$pkgver" +builddir="$srcdir/tdesktop-$pkgver-full" prepare() { - rmdir Telegram/ThirdParty/libtgvoip - rmdir Telegram/ThirdParty/GSL - rmdir Telegram/ThirdParty/variant - rmdir Telegram/ThirdParty/crl - rmdir Telegram/ThirdParty/rlottie - rmdir Telegram/ThirdParty/Catch - rmdir Telegram/ThirdParty/xxHash + # we have these system-wide + rm -rf Telegram/ThirdParty/minizip Telegram/ThirdParty/lz4 - # Copy fetched libraries to their appropriate locations - mv ../libtgvoip-${_libtgvoip_commit} "$builddir"/Telegram/ThirdParty/libtgvoip - mv ../GSL-${_gsl_commit} "$builddir"/Telegram/ThirdParty/GSL - mv ../variant-${_variant_commit} "$builddir"/Telegram/ThirdParty/variant - mv ../crl-${_crl_commit} "$builddir"/Telegram/ThirdParty/crl - mv ../rlottie-${_rlottie_commit} "$builddir"/Telegram/ThirdParty/rlottie - mv ../Catch2-${_catch2_commit} "$builddir"/Telegram/ThirdParty/Catch - mv ../xxHash-${_xxhash_commit} "$builddir"/Telegram/ThirdParty/xxHash + mv "$srcdir"/breakpad-$_breakpad_commit "$builddir"/Telegram/ThirdParty/breakpad - cd "$builddir/Telegram/ThirdParty" - rm -rf minizip lz4 # we have these system-wide - - dos2unix "$builddir/.appveyor/install.bat" + cp -L "$srcdir"/qt_functions.cpp "$builddir"/Telegram/SourceFiles default_prepare - unix2dos "$builddir/.appveyor/install.bat" - - # disable static-qt for rlottie - sed "/RLOTTIE_WITH_STATIC_QT/d" -i "$builddir/Telegram/gyp/lib_rlottie.gyp" + mkdir "$builddir"/build } build() { - export LANG=en_US.UTF-8 - export GYP_DEFINES="TDESKTOP_DISABLE_CRASH_REPORTS,TDESKTOP_DISABLE_AUTOUPDATE" - export GYP_DEFINES="${GYP_DEFINES},TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME" - export GYP_DEFINES="${GYP_DEFINES},TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION" - export EXTRA_FLAGS="-Winvalid-pch -O2" - export CPPFLAGS="$CPPFLAGS $EXTRA_FLAGS" - export CXXFLAGS="$CXXFLAGS $EXTRA_FLAGS" - - gyp \ - -Dapi_id=17349 \ - -Dapi_hash=344583e45741c457fe1862106095a5eb \ - -Dbuild_defines=${GYP_DEFINES} \ - -Gconfig=Release \ - --depth=Telegram/gyp --generator-output=../.. -Goutput_dir=out \ - Telegram/gyp/Telegram.gyp --format=cmake - - NUM=$(( $(wc -l < out/Release/CMakeLists.txt) - 2)) - sed -i "$NUM r ../CMakeLists.inj" out/Release/CMakeLists.txt - - cd out/Release - cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -UTDESKTOP_OFFICIAL_TARGET + if [ "$CBUILD" != "$CHOST" ]; then + CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux" + fi + cd build + + cmake \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DBUILD_SHARED_LIBS=True \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DDESKTOP_APP_DISABLE_CRASH_REPORTS=True \ + -DDESKTOP_APP_DISABLE_SPELLCHECK=OFF \ + -DDESKTOP_APP_LOTTIE_USE_CACHE=ON \ + -DDESKTOP_APP_USE_GLIBC_WRAPS=OFF \ + -DDESKTOP_APP_USE_PACKAGED=ON \ + -DTDESKTOP_API_ID=17349 \ + -DTDESKTOP_API_HASH=344583e45741c457fe1862106095a5eb \ + -DTDESKTOP_DISABLE_GTK_INTEGRATION=ON \ + ${CMAKE_CROSSOPTS} .. make } package() { - install -dm755 "$pkgdir"/usr/bin - install -m755 "$builddir/out/Release/Telegram" "$pkgdir/usr/bin/telegram-desktop" + install -d "$pkgdir"/usr/bin \ + "$pkgdir"/usr/share/applications \ + "$pkgdir"/usr/share/appdata \ + "$pkgdir"/usr/share/kservices5 \ - install -d "$pkgdir/usr/share/applications" - install -m644 "$builddir/lib/xdg/telegramdesktop.desktop" \ - "$pkgdir/usr/share/applications/telegramdesktop.desktop" + strip -s build/bin/Telegram + install -m755 build/bin/Telegram "$pkgdir"/usr/bin/telegram-desktop + install -m644 lib/xdg/telegramdesktop.desktop -t "$pkgdir"/usr/share/applications + install -m644 lib/xdg/telegramdesktop.appdata.xml -t "$pkgdir"/usr/share/appdata + install -m644 lib/xdg/tg.protocol -t "$pkgdir"/usr/share/kservices5 for icon_size in 16 32 48 64 128 256 512; do icon_dir="$pkgdir/usr/share/icons/hicolor/${icon_size}x$icon_size/apps" @@ -145,24 +120,24 @@ package() { done } -sha512sums="d31fbcc6737a4a00c0d17b000d82cb9c7038aae19a2ea2692a6707623cf83ccd0327d6ff06e4a330a0197073ca9a63b90ebb3d046312b74aaeec318571767a6d telegram-desktop-1.8.15.tar.gz -14eaadcb4ec25e7d603d3965f8dc003f0509bc215916e0f5e092564c76d2a440a8edc9e5e61ae279c0b18edffaa401df6aedc766c1e7355357bfb1c95e2b5f50 libtgvoip-d4a0f719ffd8d29e88474f67abc9fc862661c3b9.tar.gz -83560cb0c39b6a4781e916c6081ad2728296e1b19760ca1b6426a8431fb6d7093760a882c539dd77152f5892fe081b1795af6366ea91385bb10aba6adf27170f GSL-d846fe50a3f0bb7767c7e087a05f4be95f4da0ec.tar.gz -537ce0a1731274da63a5be063311f7113c1391081e43970663a994b82a7b2e860302406c2931184789661d86343b2c60064c7014b73dc42799573f5b93bc12ff variant-550ac2f159ca883d360c196149b466955c77a573.tar.gz -cfe28a69cff822fab8ebb4379b105e3d69e610614359ba7b6b91cbf676c23067f75d34f259500ab7fb61d3e4b45a0dd77ee4bf4f0bdc6d6463dab5f3f447f6fe crl-52baf11aaeb7f5ea6955a438abaa1aee4c4308d8.tar.gz -60f2020b103fc2090d3c89f9ba5aeeba5be2d9e01f1954a4abbd7fdfe8ca64c28e86ead1646292bd9b5cb8beb9cb25d8ab077405ebe286007a437ea969ec4a0a rlottie-589db026ec211bc4979e3bffe074f6e48ce7cedc.tar.gz -5b151e0a8c4594b19258a8aade7132521ffbdc97233c9d4a0e5cb2ea31eb9cb3ee51769884a8a08ab821571215ff32854bd76d2929e3b4c14a39e56657109dd6 Catch2-5ca44b68721833ae3731802ed99af67c6f38a53a.tar.gz -cada36066c14ed735f8f45a2d1e0c2d1bdb564dc18154aaabc12552d41065426d88cdeb8a67b8e697678b01f2e415c0a6caf428baa591d013739d7ac95048d4d xxhash-7cc9639699f64b750c0b82333dced9ea77e8436e.tar.gz -5361828c11d3653552db28d4695891766468a7b785611da5b33a8865e953a9e2c0dac79601bf2b2098f496bdccfdf4d8ede45d466e0187c18b23336d8e5dfddf CMakeLists.inj -74e8adfe9cb6c224b12fb653798be1abb55cff40f326a9542e5ae23fb82b57a117b5f74dc8a2af80efcd8e261bbbc46c8e5c10fdb6a55ae3196429fd67afd183 0001-musl.patch -d9812a06ae4cf3599e74a77ff23b94519cf1469c0ace5dade886f8cddeb0a72e037e82ab6bc61aa587702329a4521ed296173f8b5cf771430021e172c53885f3 0002-tdesktop.patch -6289d5a3eb224ebb05ab64e23ca3d081e617d905cec07edbba423265dc617548005eeb643ce5dfb2fcef9ac774e9f7b64150729bd894ca0e94af0e2aea9c823b 0003-fix-missing-use-of-pch.patch -8de8c0508177da5fcac4f2dcee4d8baef4b99f74f1dca296567bc3689a6bd17a47c1c945df504abc8811b82a687010d0709503c7c32e47d2ebb1cf0e374c80c5 0004-xdg.patch -0a6104710a2d98ba38b97e0a35c08f17d86ece05090d89d9de17b88652bcf6035c13cff31f48f94d9caa4e80bfb9d87448c88ce4c282ff972312daf819f7437d 0005-system-wide-fonts.patch -3647ad5fff6326ba9c75fa98189a08c0909af8d1c2b704c8c62fd9da6603f5162af3176c37daa67eb5896bebe3814bf1fd66b9e93c78cbd9b439e472d0db4b44 0006-ppc64le-enable-arch.patch -d1fc59b573c857a64607a8d08e916ab668facd01404cabe1c7ea451e272133c8819c79b71635df9a23292a8c1c0ebd4d8b95ffe6cbcaaf831726b8af18486bab 0009-lz4.patch -7d5642672f42f435e206acd047a20b7e38346ed95548f16c0059913546e4e4f54a58927fccb8c1da8e43b6a691bbce2a9608d0db032774d7874d4800e7202d53 0010-libtgvoip.patch -e1a3c7c7d593dc50b234202e9fdf5ff145a105b828a8373d4e52009c395e26b10faa58bb028a44aaf122debe1ed60a7e66033687fac686f13c4455084da986df 0014-clock_gettime.patch -d564ee17a610864b1708f7ad1050804e24921b8bb3c4da9713f804b3738ba63d6ee0e594b3fe7c28d0fb9a082a22021b1c7f2b60498265bbca08e89775a4f60a 0015-revert-headers.patch -117b0c2bae3d3d3aa94d41382621be4e05c3314a2831dba59e1bcfb443e7b8ff4bcd0403544fa0cb6def85b444146bf59eef9da25f96b041d3ce8f5429b4a867 0016-no-gtk2.patch -99e3e72a93473b45f2912ed1c553662506c5e332c949b5e879965309bcdf6f8735836a51a0f72ebec617f1afd9cad615cc62dfd57a584d79a0d421066167c3d9 minizip-includes.patch" +sha512sums="af8e5d2c74d0b990958edd75a01f40b70bc21c0f69074acfb943f44fdb1f1e84465b461765a1a584513e54ab30045817b42b6839ad16cb4c1043fda89ea600f7 tdesktop-1.9.3-full.tar.gz +af8c9e8cf151b6aaa94a11b1f3f4d73c117fa25d7ba3b603c25170278bb0a99a9da10facc3b140fa0e3c2c0747a1f5bdcfb1120dfd48913a0d84f78701abb9fc breakpad-dbd454dbe47e584571388fc3533193416bdce67f.tar.gz +8de8c0508177da5fcac4f2dcee4d8baef4b99f74f1dca296567bc3689a6bd17a47c1c945df504abc8811b82a687010d0709503c7c32e47d2ebb1cf0e374c80c5 xdg.patch +438d8008a3513a182ba21aa2f008ee889ff5de24e0a722ea4d690ddba98fba4e781456095801cb4f8eebbce345e86d7a5fdaf1aa8e1f7697b77f1f87b4851d91 lz4.patch +c814f4b944c210cac34964d4261fc838fd3891892cb57d9d9c8ed09bbb317e8e8be9d635b73f720bd9a99cbb71c896b052da4851cec8e4e28ec25b586f4bb152 zlib.patch +f8a22d356dccaf9bfcca5566ecd90c9c6db1566af1f51878cd6239d4b0c893f3c2535e2144f69dd3e19744120b417ebc744a02de185de99e9ef12599de150414 opus.patch +0f714a1c0f0b2b83c39bd699f0b7995ee1bccd9bdf0f5b401bc92ff722837d0f500eb3a410b881ca7e3656256ee1f930c6f7a020e54119045c0539e377b8d63d openal.patch +f808d3c3670415b75b9569276f51f5464ced5146535104826d5736f5febabd1c7587181bb30f6876ae753618fbffa3bf5013ecd4a6e2dadd9cc4ca6ee1957215 openssl.patch +b5ed0d2697491c1008431b596997b7c9b273772efae603d99c8539d8a678e339f9f8e01f63533ac3474c7e3a82619037a33bc25a760cf2204887caca4c521412 ffmpeg.patch +48a6460c24f6bda5b492d26fbff99f7a9ff953e43e856e2669b25cbd6a942ae009d4dbd07462e7fdbd431662bfbd6fd8414d052b78a93bb2cd02a912d88012c7 qt.patch +1852ac9326d73055118ab5cbbd3bf2af1d72523d12913a6378b797551d405d0f397b05d1918494a741864614c3f605bff8a5f595e8c286e46db9696b3220103e range-v3.patch +6062602d02e20917c06f17d12bb21bd4a94b23c2a6744a8a05c2c93d41747ba413e110edd344ecd130c28ebaf997ae46b347d239e69f5856ead42318bd5b01cd musl-basename.patch +3182d2da588fd50c771047550e0d4805cce404836ecc6a4f9ccc95b21c6915391ab3f4d75cd745737836d6c483eac84974659b97e9514384efd032ef33044125 updater.patch +4fb0f0a8c0a57436a10a79d7d1a45c1045d3ac30b9437e65025a4867400b52e52b38c61d447b1392bdf2bd6b241ed25a2c73851c67e08b9198a922c22a316345 default-shared.patch +b40c9948bab21253d54cbf6c609f82f97c80b064ddc2a5b8347b6322e26836c55a9c3eaab429a46f058bac1c7a7f57fd63979a318af13063ce9039fe29bcfd14 exotic-arch-compat.patch +d321da9c960641cd7d8159a0f076670b366afb847607a9f05525d17e3751ddcae2f3fa8b0d5f0f4780f7831033f48ce32373104ab35f8d2762e31e1097b20188 werror-o2.patch +838c5891084344b06fc1b140928e0fed804a8acbb8374147418094d164b5f42d84f72a0fd0941844366f5949ed73301915a78d09de7c309d128852f44cbcd8a9 breakpad-loc.patch +835f5735d6fc52ad0a3b99f21a0a06cb310f21981a6036f4c9b76312eb947af7fa065ef7f530bcd63ee9271d293778cc8ddf098764c2878a8500aa04ee05c2b1 qt_functions.patch +9a3e491e2b2a9ea3f15da3766a2d743bafead7ae1e6a6ca3e6e9c7352dc268221311acd73664e5452622e2bc91cc88a2a7d3b4ebe6634b4da74c54b3bde0bb7f ppc.patch +183767e9a291dd605797cdc46382d8cb6a73a342348a40df7d52864ea27b3aa8709808cd51c46f5e611c247229ed336cb569bed1185c4c97b03171b56bbe5653 qt-plugin-path.patch +edb5e7b1492c4913d2669610c7666a90fd94a615b7e3fc0c84e82bfd56fc61515b0e8ce14b35232a2f60f69db02769b8a05a4d11ccffec771d767cb600c92340 qt_functions.cpp" diff --git a/testing/telegram-desktop/CMakeLists.inj b/testing/telegram-desktop/CMakeLists.inj deleted file mode 100644 index 169bf20d2f7..00000000000 --- a/testing/telegram-desktop/CMakeLists.inj +++ /dev/null @@ -1,21 +0,0 @@ -# The text will be put into the appropriate CMakeLists by the PKGBUILD - -# Avoid rpath compiler parameter -set_target_properties(Telegram PROPERTIES SKIP_BUILD_RPATH TRUE) - -# This makes up for patch of gyp utility, supporting precompiled headers. If -# Telegram/Patches/gyp.diff file will be changed in future, please check these -# lines. -include(../../Telegram/gyp/PrecompiledHeader.cmake) -add_precompiled_header(Telegram ../../Telegram/SourceFiles/stdafx.h) -add_precompiled_header(lib_base ../../Telegram/SourceFiles/base/base_pch.h) -add_precompiled_header(lib_export ../../Telegram/SourceFiles/export/export_pch.h) -add_precompiled_header(lib_storage ../../Telegram/SourceFiles/storage/storage_pch.h) -add_precompiled_header(lib_mtproto ../../Telegram/SourceFiles/mtproto/mtp_pch.h) -add_precompiled_header(lib_ui ../../Telegram/SourceFiles/ui/ui_pch.h) - -# You can discover new PCHs using this link: -# https://github.com/telegramdesktop/tdesktop/search?q=pch_header&unscoped_q=pch_header - -# vim: ft=cmake - diff --git a/testing/telegram-desktop/breakpad-loc.patch b/testing/telegram-desktop/breakpad-loc.patch new file mode 100644 index 00000000000..56281e6e265 --- /dev/null +++ b/testing/telegram-desktop/breakpad-loc.patch @@ -0,0 +1,27 @@ +diff --git a/cmake/external/crash_reports/breakpad/CMakeLists.txt b/cmake/external/crash_reports/breakpad/CMakeLists.txt +index c09243d..89d59f8 100644 +--- a/cmake/external/crash_reports/breakpad/CMakeLists.txt ++++ b/cmake/external/crash_reports/breakpad/CMakeLists.txt +@@ -9,21 +9,5 @@ add_library(desktop-app::external_breakpad ALIAS external_breakpad) + + target_include_directories(external_breakpad SYSTEM + INTERFACE +- ${libs_loc}/breakpad/src ++ ${third_party_loc}/breakpad/src + ) +- +-set(breakpad_lib_loc ${libs_loc}/breakpad/src/out/$<IF:$<CONFIG:Debug>,Debug,Release>/obj/client) +- +-if (WIN32) +- target_link_libraries(external_breakpad +- INTERFACE +- ${breakpad_lib_loc}/windows/common.lib +- ${breakpad_lib_loc}/windows/handler/exception_handler.lib +- ${breakpad_lib_loc}/windows/crash_generation/crash_generation_client.lib +- ) +-elseif (LINUX) +- target_link_static_libraries(external_breakpad +- INTERFACE +- breakpad_client +- ) +-endif() diff --git a/testing/telegram-desktop/default-shared.patch b/testing/telegram-desktop/default-shared.patch new file mode 100644 index 00000000000..9507fae041b --- /dev/null +++ b/testing/telegram-desktop/default-shared.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/init_target.cmake b/cmake/init_target.cmake +index c7a1244..2824a60 100644 +--- a/cmake/init_target.cmake ++++ b/cmake/init_target.cmake +@@ -27,7 +27,7 @@ function(init_target target_name) # init_target(my_target folder_name) + endif() + target_link_libraries(${target_name} PUBLIC desktop-app::common_options) + set_target_properties(${target_name} PROPERTIES +- LINK_SEARCH_START_STATIC 1 ++ LINK_SEARCH_START_STATIC 0 + XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_WEAK YES + XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN YES + XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN YES diff --git a/testing/telegram-desktop/exotic-arch-compat.patch b/testing/telegram-desktop/exotic-arch-compat.patch new file mode 100644 index 00000000000..1631047019f --- /dev/null +++ b/testing/telegram-desktop/exotic-arch-compat.patch @@ -0,0 +1,16 @@ +diff --git a/cmake/variables.cmake b/cmake/variables.cmake +index b3d7ff4..28f0ded 100644 +--- a/cmake/variables.cmake ++++ b/cmake/variables.cmake +@@ -60,7 +60,10 @@ elseif (APPLE) + else() + set(LINUX 1) + execute_process(COMMAND uname -m OUTPUT_VARIABLE machine_uname) +- if (NOT ${machine_uname} MATCHES "x86_64" AND NOT ${machine_uname} MATCHES "aarch64") ++ if (NOT ${machine_uname} MATCHES "x86_64" ++ AND NOT ${machine_uname} MATCHES "aarch64" ++ AND NOT ${machine_uname} MATCHES "ppc64le" ++ AND NOT ${machine_uname} MATCHES "arm") + set(build_linux32 1) + endif() + if (DESKTOP_APP_SPECIAL_TARGET STREQUAL "linux") diff --git a/testing/telegram-desktop/ffmpeg.patch b/testing/telegram-desktop/ffmpeg.patch new file mode 100644 index 00000000000..c106571b2d8 --- /dev/null +++ b/testing/telegram-desktop/ffmpeg.patch @@ -0,0 +1,41 @@ +diff --git a/cmake/external/ffmpeg/CMakeLists.txt b/cmake/external/ffmpeg/CMakeLists.txt +index 014fb06..84a3011 100644 +--- a/cmake/external/ffmpeg/CMakeLists.txt ++++ b/cmake/external/ffmpeg/CMakeLists.txt +@@ -7,32 +7,8 @@ + add_library(external_ffmpeg INTERFACE IMPORTED GLOBAL) + add_library(desktop-app::external_ffmpeg ALIAS external_ffmpeg) + +-target_include_directories(external_ffmpeg SYSTEM +-INTERFACE +- ${libs_loc}/ffmpeg +-) ++find_package(PkgConfig REQUIRED) ++pkg_check_modules(FFMPEG REQUIRED libavcodec libavformat libavutil libswresample libswscale) + +-set(ffmpeg_lib_loc ${libs_loc}/ffmpeg) +- +-target_link_libraries(external_ffmpeg +-INTERFACE +- ${ffmpeg_lib_loc}/libavformat/libavformat.a +- ${ffmpeg_lib_loc}/libavcodec/libavcodec.a +- ${ffmpeg_lib_loc}/libswresample/libswresample.a +- ${ffmpeg_lib_loc}/libswscale/libswscale.a +- ${ffmpeg_lib_loc}/libavutil/libavutil.a +-) +-if (LINUX) +- target_link_static_libraries(external_ffmpeg +- INTERFACE +- va-x11 +- va-drm +- va +- vdpau +- drm +- Xi +- Xext +- Xfixes +- Xrender +- ) +-endif() ++target_include_directories(external_ffmpeg SYSTEM INTERFACE ${FFMPEG_INCLUDE_DIR}) ++target_link_libraries(external_ffmpeg INTERFACE ${FFMPEG_LIBRARIES}) diff --git a/testing/telegram-desktop/lz4.patch b/testing/telegram-desktop/lz4.patch new file mode 100644 index 00000000000..dd7ad977a61 --- /dev/null +++ b/testing/telegram-desktop/lz4.patch @@ -0,0 +1,35 @@ +diff --git a/cmake/external/lz4/CMakeLists.txt b/cmake/external/lz4/CMakeLists.txt +index 49821af..d7bd1d7 100644 +--- a/cmake/external/lz4/CMakeLists.txt ++++ b/cmake/external/lz4/CMakeLists.txt +@@ -4,26 +4,10 @@ + # For license and copyright information please follow this link: + # https://github.com/desktop-app/legal/blob/master/LEGAL + +-add_library(external_lz4 OBJECT) ++add_library(external_lz4 INTERFACE IMPORTED GLOBAL) + add_library(desktop-app::external_lz4 ALIAS external_lz4) +-init_target(external_lz4 "(external)") + +-set(lz4_loc ${third_party_loc}/lz4/lib) ++find_package(PkgConfig REQUIRED) ++pkg_check_modules(LZ4 REQUIRED liblz4) + +-target_sources(external_lz4 +-PRIVATE +- ${lz4_loc}/lz4.c +- ${lz4_loc}/lz4.h +- ${lz4_loc}/lz4frame.c +- ${lz4_loc}/lz4frame.h +- ${lz4_loc}/lz4frame_static.h +- ${lz4_loc}/lz4hc.c +- ${lz4_loc}/lz4hc.h +- ${lz4_loc}/xxhash.c +- ${lz4_loc}/xxhash.h +-) +- +-target_include_directories(external_lz4 +-PUBLIC +- ${lz4_loc} +-) ++target_link_libraries(external_lz4 INTERFACE ${LZ4_LIBRARIES}) diff --git a/testing/telegram-desktop/minizip-includes.patch b/testing/telegram-desktop/minizip-includes.patch deleted file mode 100644 index 49d814d920f..00000000000 --- a/testing/telegram-desktop/minizip-includes.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/Telegram/SourceFiles/base/zlib_help.h b/Telegram/SourceFiles/base/zlib_help.h -index 8c0147c..bca4c72 100644 ---- a/Telegram/SourceFiles/base/zlib_help.h -+++ b/Telegram/SourceFiles/base/zlib_help.h -@@ -10,8 +10,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL - */ - #pragma once - --#include "zip.h" --#include "unzip.h" -+#include "minizip/zip.h" -+#include "minizip/unzip.h" - #include "logs.h" - - #ifdef small - diff --git a/testing/telegram-desktop/0001-musl.patch b/testing/telegram-desktop/musl-basename.patch index e9c6bc03cc4..d55c517eba7 100644 --- a/testing/telegram-desktop/0001-musl.patch +++ b/testing/telegram-desktop/musl-basename.patch @@ -1,3 +1,5 @@ +diff --git a/Telegram/ThirdParty/libtgvoip/os/linux/AudioPulse.cpp b/Telegram/ThirdParty/libtgvoip/os/linux/AudioPulse.cpp +index f02ece8..2237857 100644 --- a/Telegram/ThirdParty/libtgvoip/os/linux/AudioPulse.cpp +++ b/Telegram/ThirdParty/libtgvoip/os/linux/AudioPulse.cpp @@ -6,6 +6,7 @@ @@ -8,4 +10,3 @@ #include "../../logging.h" #define DECLARE_DL_FUNCTION(name) typeof(name)* AudioPulse::_import_##name=NULL - diff --git a/testing/telegram-desktop/openal.patch b/testing/telegram-desktop/openal.patch new file mode 100644 index 00000000000..000cec88034 --- /dev/null +++ b/testing/telegram-desktop/openal.patch @@ -0,0 +1,45 @@ +diff --git a/cmake/external/openal/CMakeLists.txt b/cmake/external/openal/CMakeLists.txt +index e2e4992..d047e96 100644 +--- a/cmake/external/openal/CMakeLists.txt ++++ b/cmake/external/openal/CMakeLists.txt +@@ -7,37 +7,7 @@ + add_library(external_openal INTERFACE IMPORTED GLOBAL) + add_library(desktop-app::external_openal ALIAS external_openal) + +-if (WIN32) +- target_include_directories(external_openal SYSTEM +- INTERFACE +- ${libs_loc}/openal-soft/include +- ) +- target_link_libraries(external_openal +- INTERFACE +- ${libs_loc}/openal-soft/build/$<IF:$<CONFIG:Debug>,Debug,Release>/OpenAL32.lib +- ) +-elseif(APPLE AND NOT build_osx) +- target_include_directories(external_openal SYSTEM +- INTERFACE +- /usr/local/macos/include +- ) +- target_link_libraries(external_openal +- INTERFACE +- /usr/local/macos/lib/libopenal.a +- ) +-else() +- target_include_directories(external_openal SYSTEM +- INTERFACE +- /usr/local/include +- ) +- target_link_static_libraries(external_openal +- INTERFACE +- openal +- ) +-endif() ++find_package(OpenAL REQUIRED) + +-target_compile_definitions(external_openal +-INTERFACE +- AL_LIBTYPE_STATIC +- AL_ALEXT_PROTOTYPES +-) ++target_include_directories(external_openal SYSTEM INTERFACE ${OPENAL_INCLUDE_DIR}) ++target_link_libraries(external_openal INTERFACE ${OPENAL_LIBRARY}) diff --git a/testing/telegram-desktop/openssl.patch b/testing/telegram-desktop/openssl.patch new file mode 100644 index 00000000000..a85090db017 --- /dev/null +++ b/testing/telegram-desktop/openssl.patch @@ -0,0 +1,61 @@ +diff --git a/cmake/external/openssl/CMakeLists.txt b/cmake/external/openssl/CMakeLists.txt +index bcbcbfa..4cd7b55 100644 +--- a/cmake/external/openssl/CMakeLists.txt ++++ b/cmake/external/openssl/CMakeLists.txt +@@ -7,52 +7,12 @@ + add_library(external_openssl INTERFACE IMPORTED GLOBAL) + add_library(desktop-app::external_openssl ALIAS external_openssl) + +-if (LINUX) +- target_include_directories(external_openssl SYSTEM +- INTERFACE +- /usr/local/desktop-app/openssl-1.1.1/include +- ) +-elseif (NOT APPLE OR NOT build_osx) +- target_include_directories(external_openssl SYSTEM +- INTERFACE +- ${libs_loc}/openssl_1_1_1/include +- ) +-else() +- target_include_directories(external_openssl SYSTEM +- INTERFACE +- ${libs_loc}/openssl/include +- ) +-endif() +- +-if (WIN32) +- set(openssl_lib_ext lib) +- set(openssl_lib_loc ${libs_loc}/openssl_1_1_1/out32$<$<CONFIG:Debug>:.dbg>) +-else() +- set(openssl_lib_ext a) +- if (APPLE) +- if (NOT build_osx) +- set(openssl_lib_loc ${libs_loc}/openssl_1_1_1) +- else() +- set(openssl_lib_loc ${libs_loc}/openssl) +- endif() +- else() +- set(openssl_lib_loc /usr/local/desktop-app/openssl-1.1.1/lib) +- endif() +-endif() ++find_package(OpenSSL REQUIRED) + ++target_include_directories(external_openssl SYSTEM INTERFACE ${OpenSSL_INCLUDE_DIR}) + target_link_libraries(external_openssl + INTERFACE +- ${openssl_lib_loc}/libssl.${openssl_lib_ext} +- ${openssl_lib_loc}/libcrypto.${openssl_lib_ext} ++ OpenSSL::Crypto ++ OpenSSL::SSL + ) + +-if (LINUX) +- if (DESKTOP_APP_USE_GLIBC_WRAPS) +- target_link_libraries(external_openssl +- INTERFACE +- desktop-app::linux_glibc_wraps +- $<TARGET_FILE:desktop-app::linux_glibc_wraps> +- ) +- endif() +- target_link_libraries(external_openssl INTERFACE pthread) +-endif() diff --git a/testing/telegram-desktop/opus.patch b/testing/telegram-desktop/opus.patch new file mode 100644 index 00000000000..af6068471ac --- /dev/null +++ b/testing/telegram-desktop/opus.patch @@ -0,0 +1,48 @@ +diff --git a/cmake/external/opus/CMakeLists.txt b/cmake/external/opus/CMakeLists.txt +index 00c2508..35c029a 100644 +--- a/cmake/external/opus/CMakeLists.txt ++++ b/cmake/external/opus/CMakeLists.txt +@@ -7,39 +7,8 @@ + add_library(external_opus INTERFACE IMPORTED GLOBAL) + add_library(desktop-app::external_opus ALIAS external_opus) + +-target_include_directories(external_opus SYSTEM +-INTERFACE +- ${libs_loc}/opus/include +-) ++find_package(PkgConfig REQUIRED) ++pkg_check_modules(OPUS REQUIRED opus) + +-if (WIN32) +- set(opus_lib_loc ${libs_loc}/opus/win32/VS2015/Win32/$<IF:$<CONFIG:Debug>,Debug,Release>) +- +- target_link_libraries(external_opus +- INTERFACE +- ${opus_lib_loc}/opus.lib +- ) +-elseif (APPLE AND NOT build_osx) +- target_include_directories(external_opus +- INTERFACE +- /usr/local/macos/include +- ) +- target_link_libraries(external_opus +- INTERFACE +- /usr/local/macos/lib/libopus.a +- ) +-elseif (APPLE) +- target_include_directories(external_opus +- INTERFACE +- /usr/local/include +- ) +- target_link_libraries(external_opus +- INTERFACE +- /usr/local/lib/libopus.a +- ) +-else() +- target_link_static_libraries(external_opus +- INTERFACE +- opus +- ) +-endif() ++target_include_directories(external_opus SYSTEM INTERFACE ${OPUS_INCLUDE_DIRS}) ++target_link_libraries(external_opus INTERFACE ${OPUS_LIBRARIES}) diff --git a/testing/telegram-desktop/ppc.patch b/testing/telegram-desktop/ppc.patch new file mode 100644 index 00000000000..1b29005ada1 --- /dev/null +++ b/testing/telegram-desktop/ppc.patch @@ -0,0 +1,16 @@ +diff --git a/Telegram/lib_base/base/build_config.h b/Telegram/lib_base/base/build_config.h +index a02c9b0..b3f4860 100644 +--- a/Telegram/lib_base/base/build_config.h ++++ b/Telegram/lib_base/base/build_config.h +@@ -46,9 +46,9 @@ + #define ARCH_CPU_X86_FAMILY 1 + #define ARCH_CPU_X86 1 + #define ARCH_CPU_32_BITS 1 +-#elif defined(__aarch64__) ++#elif defined(__aarch64__) || defined(__powerpc64__) + #define ARCH_CPU_64_BITS 1 +-#elif defined(_M_ARM) || defined(__arm__) ++#elif defined(_M_ARM) || defined(__arm__) || defined(__powerpc__) + #define ARCH_CPU_32_BITS 1 + #else + #error Please add support for your architecture in base/build_config.h diff --git a/testing/telegram-desktop/qt-plugin-path.patch b/testing/telegram-desktop/qt-plugin-path.patch new file mode 100644 index 00000000000..bb877f901d4 --- /dev/null +++ b/testing/telegram-desktop/qt-plugin-path.patch @@ -0,0 +1,24 @@ +diff --git a/Telegram/SourceFiles/core/launcher.cpp b/Telegram/SourceFiles/core/launcher.cpp +index 2547342..8a14dcb 100644 +--- a/Telegram/SourceFiles/core/launcher.cpp ++++ b/Telegram/SourceFiles/core/launcher.cpp +@@ -278,6 +278,19 @@ int Launcher::exec() { + Platform::start(); + Ui::DisableCustomScaling(); + ++ // I don't know why path is not in QT_PLUGIN_PATH by default ++ QCoreApplication::addLibraryPath("/usr/lib/qt5/plugins"); ++ // without this Telegram doesn't start on Ubuntu 17.04 due GTK errors ++ setenv("QT_STYLE_OVERRIDE", "qwerty", false); ++ // Telegram doesn't start when extraordinary theme is set, see launchpad.net/bugs/1680943 ++ unsetenv("QT_QPA_PLATFORMTHEME"); ++ ++ // unset QT screen scale related envvars ++ unsetenv("QT_SCREEN_SCALE_FACTORS"); ++ unsetenv("QT_AUTO_SCREEN_SCALE_FACTOR"); ++ unsetenv("QT_SCALE_FACTOR"); ++ unsetenv("QT_DEVICE_PIXEL_RATIO"); ++ + auto result = executeApplication(); + + DEBUG_LOG(("Telegram finished, result: %1").arg(result)); diff --git a/testing/telegram-desktop/qt.patch b/testing/telegram-desktop/qt.patch new file mode 100644 index 00000000000..a1e4fb0843c --- /dev/null +++ b/testing/telegram-desktop/qt.patch @@ -0,0 +1,245 @@ +diff --git a/cmake/external/qt/CMakeLists.txt b/cmake/external/qt/CMakeLists.txt +index 1a56319..8f9eb74 100644 +--- a/cmake/external/qt/CMakeLists.txt ++++ b/cmake/external/qt/CMakeLists.txt +@@ -7,211 +7,43 @@ + add_library(external_qt INTERFACE IMPORTED GLOBAL) + add_library(desktop-app::external_qt ALIAS external_qt) + ++find_package(Qt5 REQUIRED COMPONENTS Core DBus Gui Widgets Network) ++get_target_property(QTCORE_INCLUDE_DIRS Qt5::Core INTERFACE_INCLUDE_DIRECTORIES) ++list(GET QTCORE_INCLUDE_DIRS 0 QT_INCLUDE_DIR) ++ ++foreach(__qt_module IN ITEMS QtCore QtGui) ++ list(APPEND QT_PRIVATE_INCLUDE_DIRS ++ ${QT_INCLUDE_DIR}/${__qt_module}/${Qt5_VERSION} ++ ${QT_INCLUDE_DIR}/${__qt_module}/${Qt5_VERSION}/${__qt_module} ++ ) ++endforeach() ++message(STATUS "Using Qt private include directories: ${QT_PRIVATE_INCLUDE_DIRS}") ++ + if (LINUX) +- if (NOT build_linux32) +- target_compile_definitions(external_qt INTERFACE Q_OS_LINUX64) +- else() +- target_compile_definitions(external_qt INTERFACE Q_OS_LINUX32) +- endif() ++ if (NOT build_linux32) ++ target_compile_definitions(external_qt INTERFACE Q_OS_LINUX64) ++ else() ++ target_compile_definitions(external_qt INTERFACE Q_OS_LINUX32) ++ endif() + endif() + +-target_include_directories(external_qt SYSTEM +-INTERFACE +- ${qt_loc}/include +- ${qt_loc}/include/QtCore +- ${qt_loc}/include/QtGui +- ${qt_loc}/include/QtDBus +- ${qt_loc}/include/QtCore/${qt_version} +- ${qt_loc}/include/QtGui/${qt_version} +- ${qt_loc}/include/QtCore/${qt_version}/QtCore +- ${qt_loc}/include/QtGui/${qt_version}/QtGui +-) +- + target_compile_definitions(external_qt + INTERFACE +- _REENTRANT +- QT_STATICPLUGIN +- QT_PLUGIN +- QT_WIDGETS_LIB +- QT_NETWORK_LIB +- QT_GUI_LIB +- QT_CORE_LIB ++ _REENTRANT ++ QT_PLUGIN ++ QT_WIDGETS_LIB ++ QT_NETWORK_LIB ++ QT_GUI_LIB ++ QT_CORE_LIB + ) + +-if (WIN32) +- set(qt_lib_prefix "") +- set(qt_lib_suffix $<$<CONFIG:Debug>:d>.lib) +-else() +- set(qt_lib_prefix lib) +- if (APPLE) +- set(qt_lib_suffix $<$<CONFIG:Debug>:_debug>.a) +- else() +- set(qt_lib_suffix .a) +- endif() +-endif() +- +-set(common_qt_libs +- plugins/imageformats/${qt_lib_prefix}qwebp +- plugins/imageformats/${qt_lib_prefix}qgif +- plugins/imageformats/${qt_lib_prefix}qjpeg +- lib/${qt_lib_prefix}Qt5PrintSupport +- lib/${qt_lib_prefix}Qt5AccessibilitySupport +- lib/${qt_lib_prefix}Qt5FontDatabaseSupport +- lib/${qt_lib_prefix}Qt5EventDispatcherSupport +- lib/${qt_lib_prefix}Qt5ThemeSupport +- lib/${qt_lib_prefix}Qt5Network +- lib/${qt_lib_prefix}Qt5Widgets +- lib/${qt_lib_prefix}Qt5Gui +- lib/${qt_lib_prefix}qtharfbuzz +- lib/${qt_lib_prefix}qtlibpng ++target_include_directories(external_qt SYSTEM ++INTERFACE ++ ${QT_PRIVATE_INCLUDE_DIRS} + ) +- +-set(qt_libs_list "") +-if (WIN32) +- set(qt_libs +- ${common_qt_libs} +- lib/${qt_lib_prefix}Qt5Core +- lib/${qt_lib_prefix}Qt5WindowsUIAutomationSupport +- lib/${qt_lib_prefix}qtmain +- lib/${qt_lib_prefix}qtfreetype +- lib/${qt_lib_prefix}qtpcre2 +- plugins/platforms/${qt_lib_prefix}qwindows +- ) +- foreach (lib ${qt_libs}) +- list(APPEND qt_libs_list "${qt_loc}/${lib}${qt_lib_suffix}") +- endforeach() +-elseif (APPLE) +- if (NOT build_osx) +- set(qt_libs +- ${common_qt_libs} +- lib/${qt_lib_prefix}Qt5Core +- lib/${qt_lib_prefix}Qt5GraphicsSupport +- lib/${qt_lib_prefix}Qt5ClipboardSupport +- lib/${qt_lib_prefix}qtfreetype +- lib/${qt_lib_prefix}qtpcre2 +- plugins/platforms/${qt_lib_prefix}qcocoa +- plugins/bearer/${qt_lib_prefix}qgenericbearer +- ) +- else() +- set(qt_libs +- lib/${qt_lib_prefix}Qt5PrintSupport +- lib/${qt_lib_prefix}Qt5PlatformSupport +- lib/${qt_lib_prefix}Qt5Network +- lib/${qt_lib_prefix}Qt5Widgets +- lib/${qt_lib_prefix}Qt5Gui +- lib/${qt_lib_prefix}Qt5Core +- lib/${qt_lib_prefix}qtharfbuzzng +- lib/${qt_lib_prefix}qtfreetype +- lib/${qt_lib_prefix}qtpcre +- plugins/platforms/${qt_lib_prefix}qcocoa +- plugins/imageformats/${qt_lib_prefix}qwebp +- plugins/bearer/${qt_lib_prefix}qgenericbearer +- ) +- endif() +- foreach (lib ${qt_libs}) +- list(APPEND qt_libs_list "${qt_loc}/${lib}${qt_lib_suffix}") +- endforeach() +- target_link_libraries(external_qt +- INTERFACE +- desktop-app::external_zlib +- cups +- ) +-else() +- set(qt_libs +- plugins/platforminputcontexts/${qt_lib_prefix}composeplatforminputcontextplugin +- plugins/platforminputcontexts/${qt_lib_prefix}ibusplatforminputcontextplugin +- plugins/platforminputcontexts/${qt_lib_prefix}fcitxplatforminputcontextplugin +- plugins/platforminputcontexts/${qt_lib_prefix}himeplatforminputcontextplugin +- plugins/platforminputcontexts/${qt_lib_prefix}nimfplatforminputcontextplugin +- plugins/platforms/${qt_lib_prefix}qxcb +- lib/${qt_lib_prefix}Qt5XcbQpa +- lib/${qt_lib_prefix}Qt5LinuxAccessibilitySupport +- lib/${qt_lib_prefix}Qt5ServiceSupport +- lib/${qt_lib_prefix}Qt5EdidSupport +- plugins/bearer/${qt_lib_prefix}qconnmanbearer +- plugins/bearer/${qt_lib_prefix}qgenericbearer +- plugins/bearer/${qt_lib_prefix}qnmbearer +- ${common_qt_libs} +- lib/${qt_lib_prefix}Qt5DBus +- lib/${qt_lib_prefix}Qt5Core +- lib/${qt_lib_prefix}qtpcre2 +- lib/${qt_lib_prefix}xcb-static +- ) +- foreach (lib ${qt_libs}) +- list(APPEND qt_libs_list "${qt_loc}/${lib}${qt_lib_suffix}") +- endforeach() +-endif() +- + target_link_libraries(external_qt + INTERFACE +- ${qt_libs_list} ++ Qt5::DBus ++ Qt5::Network ++ Qt5::Widgets + ) +- +-if (LINUX) +- target_include_directories(external_qt SYSTEM +- INTERFACE +- ${qt_loc}/mkspecs/linux-g++ +- ) +- target_link_options(external_qt +- INTERFACE +- -static-libstdc++ +- -pthread +- -rdynamic +- ) +- if (DESKTOP_APP_USE_GLIBC_WRAPS) +- target_link_options(external_qt +- INTERFACE +- -Wl,-wrap,aligned_alloc +- -Wl,-wrap,secure_getenv +- -Wl,-wrap,clock_gettime +- -Wl,--no-as-needed,-lrt +- ) +- if (NOT build_linux32) +- target_link_options(external_qt +- INTERFACE +- -Wl,-wrap,__divmodti4 +- ) +- else() +- target_link_options(external_qt +- INTERFACE +- -Wl,-wrap,__divmoddi4 +- ) +- endif() +- endif() +- target_link_static_libraries(external_qt +- INTERFACE +- SM +- ICE +- fontconfig +- freetype +- expat +- z +- xcb-shm +- xcb-xfixes +- xcb-render +- xkbcommon +- xkbcommon-x11 +- Xrender +- icutu +- icui18n +- icuuc +- icudata +- ) +- 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() +- target_link_libraries(external_qt +- INTERFACE +- xcb +- X11 +- X11-xcb +- dbus-1 +- dl +- glib-2.0 +- pthread +- ) +-endif() diff --git a/testing/telegram-desktop/qt_functions.cpp b/testing/telegram-desktop/qt_functions.cpp new file mode 100644 index 00000000000..a7c697f2561 --- /dev/null +++ b/testing/telegram-desktop/qt_functions.cpp @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file contains some parts of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <private/qfixed_p.h> +#include <private/qfontengine_p.h> + +/* TODO: find a dynamic library with these symbols. */ + +/* Debian maintainer: this function is taken from qfiledialog.cpp */ +/* + Makes a list of filters from ;;-separated text. + Used by the mac and windows implementations +*/ +QStringList qt_make_filter_list(const QString &filter) +{ + QString f(filter); + + if (f.isEmpty()) + return QStringList(); + + QString sep(QLatin1String(";;")); + int i = f.indexOf(sep, 0); + if (i == -1) { + if (f.indexOf(QLatin1Char('\n'), 0) != -1) { + sep = QLatin1Char('\n'); + i = f.indexOf(sep, 0); + } + } + + return f.split(sep); +} + +/* Debian maintainer: this constructor is taken from qtextengine.cpp for TextPainter::drawLine */ +QTextItemInt::QTextItemInt(const QGlyphLayout &g, QFont *font, const QChar *chars_, int numChars, QFontEngine *fe, const QTextCharFormat &format) + : flags(0), justified(false), underlineStyle(QTextCharFormat::NoUnderline), charFormat(format), + num_chars(numChars), chars(chars_), logClusters(0), f(font), glyphs(g), fontEngine(fe) +{ +} + +/* Debian maintainer: this method is also taken from qtextengine.cpp */ +// Fix up flags and underlineStyle with given info +void QTextItemInt::initWithScriptItem(const QScriptItem &si) +{ + // explicitly initialize flags so that initFontAttributes can be called + // multiple times on the same TextItem + flags = 0; + if (si.analysis.bidiLevel %2) + flags |= QTextItem::RightToLeft; + ascent = si.ascent; + descent = si.descent; + + if (charFormat.hasProperty(QTextFormat::TextUnderlineStyle)) { + underlineStyle = charFormat.underlineStyle(); + } else if (charFormat.boolProperty(QTextFormat::FontUnderline) + || f->d->underline) { + underlineStyle = QTextCharFormat::SingleUnderline; + } + + // compat + if (underlineStyle == QTextCharFormat::SingleUnderline) + flags |= QTextItem::Underline; + + if (f->d->overline || charFormat.fontOverline()) + flags |= QTextItem::Overline; + if (f->d->strikeOut || charFormat.fontStrikeOut()) + flags |= QTextItem::StrikeOut; +} diff --git a/testing/telegram-desktop/qt_functions.patch b/testing/telegram-desktop/qt_functions.patch new file mode 100644 index 00000000000..1fecbe97573 --- /dev/null +++ b/testing/telegram-desktop/qt_functions.patch @@ -0,0 +1,13 @@ +diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt +index d8c623a..f3ca079 100644 +--- a/Telegram/CMakeLists.txt ++++ b/Telegram/CMakeLists.txt +@@ -936,7 +936,7 @@ PRIVATE + mainwindow.h + observer_peer.cpp + observer_peer.h +- qt_static_plugins.cpp ++ qt_functions.cpp + settings.cpp + settings.h + ) diff --git a/testing/telegram-desktop/range-v3.patch b/testing/telegram-desktop/range-v3.patch new file mode 100644 index 00000000000..3a444c04a7f --- /dev/null +++ b/testing/telegram-desktop/range-v3.patch @@ -0,0 +1,24 @@ +diff --git a/cmake/external/ranges/CMakeLists.txt b/cmake/external/ranges/CMakeLists.txt +index 4c75ecb..fc6febc 100644 +--- a/cmake/external/ranges/CMakeLists.txt ++++ b/cmake/external/ranges/CMakeLists.txt +@@ -7,15 +7,9 @@ + add_library(external_ranges INTERFACE IMPORTED GLOBAL) + add_library(desktop-app::external_ranges ALIAS external_ranges) + ++find_package(range-v3 REQUIRED) ++ + target_include_directories(external_ranges SYSTEM + INTERFACE +- ${libs_loc}/range-v3/include ++ ${RANGE_V3_INCLUDE_DIRS} + ) +- +-if (WIN32) +- target_compile_options(external_ranges +- INTERFACE +- /experimental:preprocessor # need for range-v3 see https://github.com/ericniebler/range-v3#supported-compilers +- /wd5105 # needed for `/experimental:preprocessor`, suppressing C5105 "macro expansion producing 'defined' has undefined behavior" +- ) +-endif() +\ No newline at end of file diff --git a/testing/telegram-desktop/updater.patch b/testing/telegram-desktop/updater.patch new file mode 100644 index 00000000000..4209a0b62f2 --- /dev/null +++ b/testing/telegram-desktop/updater.patch @@ -0,0 +1,48 @@ +diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt +index d8c623a..bd7cea0 100644 +--- a/Telegram/CMakeLists.txt ++++ b/Telegram/CMakeLists.txt +@@ -1117,43 +1117,3 @@ else() + endif() + + set_target_properties(Telegram PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${output_folder}) +- +-if (NOT build_macstore AND NOT build_winstore) +- add_executable(Updater WIN32) +- init_target(Updater) +- +- add_dependencies(Telegram Updater) +- +- nice_target_sources(Updater ${src_loc} +- PRIVATE +- _other/updater_win.cpp +- _other/updater_linux.cpp +- _other/updater_osx.m +- _other/updater.h +- ) +- +- set_target_properties(Updater PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${output_folder}) +- +- if (DESKTOP_APP_SPECIAL_TARGET) +- add_executable(Packer WIN32) +- init_target(Packer) +- +- add_dependencies(Telegram Packer) +- +- nice_target_sources(Packer ${src_loc} +- PRIVATE +- _other/packer.cpp +- _other/packer.h +- ) +- +- target_link_libraries(Packer +- PRIVATE +- desktop-app::external_qt +- desktop-app::external_zlib +- desktop-app::external_auto_updates +- desktop-app::external_openssl +- ) +- +- set_target_properties(Packer PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${output_folder}) +- endif() +-endif() diff --git a/testing/telegram-desktop/werror-o2.patch b/testing/telegram-desktop/werror-o2.patch new file mode 100644 index 00000000000..644bd3b9212 --- /dev/null +++ b/testing/telegram-desktop/werror-o2.patch @@ -0,0 +1,28 @@ +diff --git a/cmake/options_linux.cmake b/cmake/options_linux.cmake +index a6a13c9..20af0ae 100644 +--- a/cmake/options_linux.cmake ++++ b/cmake/options_linux.cmake +@@ -9,7 +9,7 @@ INTERFACE + $<IF:$<CONFIG:Debug>,,-Ofast -fno-strict-aliasing> + -pipe + -Wall +- -Werror ++ -O2 + -W + -fPIC + -Wno-unused-variable +@@ -28,13 +28,5 @@ INTERFACE + ) + target_link_options(common_options + INTERFACE +- $<IF:$<CONFIG:Debug>,,-Ofast> ++ $<IF:$<CONFIG:Debug>,,-O2> + ) +-if (build_linux32) +- target_compile_options(common_options INTERFACE -g0) +- target_link_options(common_options INTERFACE -g0) +-else() +- target_compile_options(common_options INTERFACE $<IF:$<CONFIG:Debug>,,-g -flto>) +- target_link_options(common_options INTERFACE $<IF:$<CONFIG:Debug>,,-g -flto -fuse-linker-plugin>) +-endif() +- diff --git a/testing/telegram-desktop/0004-xdg.patch b/testing/telegram-desktop/xdg.patch index e26bda0bc78..e26bda0bc78 100644 --- a/testing/telegram-desktop/0004-xdg.patch +++ b/testing/telegram-desktop/xdg.patch diff --git a/testing/telegram-desktop/zlib.patch b/testing/telegram-desktop/zlib.patch new file mode 100644 index 00000000000..8e474f67dfb --- /dev/null +++ b/testing/telegram-desktop/zlib.patch @@ -0,0 +1,55 @@ +diff --git a/cmake/external/zlib/CMakeLists.txt b/cmake/external/zlib/CMakeLists.txt +index d2bc1fc..8bf38a9 100644 +--- a/cmake/external/zlib/CMakeLists.txt ++++ b/cmake/external/zlib/CMakeLists.txt +@@ -7,45 +7,9 @@ + add_library(external_zlib INTERFACE IMPORTED GLOBAL) + add_library(desktop-app::external_zlib ALIAS external_zlib) + +-if (NOT WIN32) +- add_library(external_minizip STATIC) +- init_target(external_minizip "(external)") ++find_package(PkgConfig REQUIRED) ++find_package(ZLIB REQUIRED) ++pkg_check_modules(MINIZIP REQUIRED minizip) + +- set(minizip_loc ${third_party_loc}/minizip) +- +- target_sources(external_minizip +- PRIVATE +- ${minizip_loc}/crypt.h +- ${minizip_loc}/ioapi.c +- ${minizip_loc}/ioapi.h +- ${minizip_loc}/zip.c +- ${minizip_loc}/zip.h +- ${minizip_loc}/unzip.c +- ${minizip_loc}/unzip.h +- ) +- +- target_include_directories(external_minizip SYSTEM +- INTERFACE +- ${minizip_loc} +- ) +- +- target_link_libraries(external_zlib INTERFACE external_minizip) +-endif() +- +-target_include_directories(external_zlib SYSTEM +-INTERFACE +- ${libs_loc}/zlib +- ${libs_loc}/zlib/contrib/minizip +-) +- +-if (WIN32) +- target_compile_definitions(external_zlib INTERFACE ZLIB_WINAPI) +- +- set(zlib_lib_loc ${libs_loc}/zlib/contrib/vstudio/vc14/x86/ZlibStat$<IF:$<CONFIG:Debug>,Debug,ReleaseWithoutAsm>) +- +- target_link_libraries(external_zlib INTERFACE ${zlib_lib_loc}/zlibstat.lib) +-elseif (APPLE) +- target_link_libraries(external_zlib INTERFACE /usr/local/lib/libz.a) +-else() +- target_link_static_libraries(external_zlib INTERFACE z) +-endif() ++target_include_directories(external_zlib SYSTEM INTERFACE ${ZLIB_INCLUDE_DIR} ${MINIZIP_INCLUDE_DIRS}) ++target_link_libraries (external_zlib INTERFACE ${ZLIB_LIBRARY_RELEASE} ${MINIZIP_LIBRARIES}) |