X-Original-To: alpine-aports@lists.alpinelinux.org Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by lists.alpinelinux.org (Postfix) with ESMTP id 88D095C5C86 for ; Sun, 2 Dec 2018 15:31:38 +0000 (GMT) Received: by mail-wm1-f67.google.com with SMTP id a18so3274035wmj.1 for ; Sun, 02 Dec 2018 07:31:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=reguTRJMdNB59VBEnDIiBGZaINy6AC9YJ7CveKICvgY=; b=ScPYIgY2MuDyk2xUO8nnDwKXBZGbf7pJKVquDxshFrTiWvlVJcndwpyJMHHLcNJzou DvaAwSEtMPCZvb5t6EMW761fkxb6+SUcftOM1a7/rDkSUtKaeuuLbPGGmOXMtSW5Qn/2 Oz437bfPGCCJrfRTo14b3qgoRAynh60bo2Daxp7WRA+vrqywyRtecZ4vWB8X39/rl7Sh 2ia7BfDF+3FpBzj3rwtAsmpZ3lQwkuW212euDfLgxvnczrrmdzmV+ZJ7WCtMot6XfB7Z EGsespsArCWazKa8fUu3V9CtLqPhbTuFjHA/ajs87i9mFB/XxNdTqfE99Js9wRQVb8tw ES2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=reguTRJMdNB59VBEnDIiBGZaINy6AC9YJ7CveKICvgY=; b=J4WJPBp1g7fWdHzbjOlfVyTDIC2DzZcw+EWcRCOrY174wN37YcyCKZbWrJQWnCtHvt n5OfyfzXWAjOaWm0kirFJcIs91qw9BPbI1guwBT5EDDpUrrf3JAgedxc7o3PzdmZhlqk uL4Qp/GIGf+LUmeG2YGbrpkuwnE3uuhOnYA1NJKgKb/SPr6/roOOdQGiKGxl2SUb5qb2 DUxg6fbrBN/76XQqFv4CqReAHoF55l/NizurW1TVmbqTU2ORVbyvrL/MKuGEFSnl4xE0 Vs1JHL9RKnPcCVa6eGLKTlRBvZujupMm1Ec1Ey2uj9f/HyB5WUq86pGBRUTBZyHz77aY XygA== X-Gm-Message-State: AA+aEWavLgg8Ch9oiR0xQghib77M1Zwhxv2oZFbkPGTlXOAr4Rvsr6ki GLsa7zrUxU+FxfX8O1vnizbCygMu5OM= X-Google-Smtp-Source: AFSGD/XnPYdu+UyiQh/EcbdfxHJbNb2wyHcQ/g2B/BB0EP7Cob4l9o0L7AILXK6P3rENqelSbDBiQA== X-Received: by 2002:a1c:87cc:: with SMTP id j195mr5222696wmd.2.1543764696819; Sun, 02 Dec 2018 07:31:36 -0800 (PST) Received: from alpine.nodomain (host-31-193-36-105-dynamic.telecomitaliasm.net. [31.193.36.105]) by smtp.gmail.com with ESMTPSA id e130sm13933351wmf.25.2018.12.02.07.31.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Dec 2018 07:31:36 -0800 (PST) From: Alex Raschi To: alpine-aports@lists.alpinelinux.org Subject: [alpine-aports] [PATCH] testing/telegram-desktop: new aport Date: Sun, 2 Dec 2018 16:31:27 +0100 Message-Id: <20181202153127.30412-1-raschi.alex@gmail.com> X-Mailer: git-send-email 2.19.2 X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit https://desktop.telegram.org/ Telegram Desktop messaging app --- testing/telegram-desktop/APKBUILD | 144 ++++++ testing/telegram-desktop/libtgvoip.patch | 16 + testing/telegram-desktop/musl.patch | 17 + testing/telegram-desktop/no-gtk2.patch | 27 ++ testing/telegram-desktop/no-pulse.patch | 36 ++ testing/telegram-desktop/tdesktop.patch | 594 +++++++++++++++++++++++ testing/telegram-desktop/xdg.patch | 30 ++ 7 files changed, 864 insertions(+) create mode 100644 testing/telegram-desktop/APKBUILD create mode 100644 testing/telegram-desktop/libtgvoip.patch create mode 100644 testing/telegram-desktop/musl.patch create mode 100644 testing/telegram-desktop/no-gtk2.patch create mode 100644 testing/telegram-desktop/no-pulse.patch create mode 100644 testing/telegram-desktop/tdesktop.patch create mode 100644 testing/telegram-desktop/xdg.patch diff --git a/testing/telegram-desktop/APKBUILD b/testing/telegram-desktop/APKBUILD new file mode 100644 index 0000000000..f113d92af0 --- /dev/null +++ b/testing/telegram-desktop/APKBUILD @@ -0,0 +1,144 @@ +# Maintainer: Alex Raschi +pkgname=telegram-desktop +pkgver=1.4.3 +_pkgurl="https://github.com/telegramdesktop/tdesktop.git" +# https://github.com/telegramdesktop/tdesktop/blob/v$pkgver/docs/building-cmake.md +_gypver=702ac58e477214c635d9b541932e75a95d349352 +_gypurl="https://chromium.googlesource.com/external/gyp" +_rangever=0.4.0 +_rangeurl="https://github.com/ericniebler/range-v3.git" +pkgrel=0 +pkgdesc="Telegram Desktop messaging app" +url="https://desktop.telegram.org/" +arch="all" +license="GPL-3.0-or-later WITH OpenSSL" +depends="qt5-qtimageformats" +makedepends="cmake + zlib-dev + opus-dev + libva-dev + libvdpau-dev + ffmpeg-dev + portaudio-dev + openal-soft-dev + openssl-dev + libxkbcommon-dev + qt5-qtbase-dev + libexif-dev + xz-dev + minizip-dev + alsa-lib-dev + libexecinfo-dev + python2 + grep" +source="http://dev.alpinelinux.org/archive/$pkgname/$pkgname-$pkgver.tar.gz + libtgvoip.patch + musl.patch + no-gtk2.patch + no-pulse.patch + tdesktop.patch + xdg.patch" +builddir="$srcdir/$pkgname-$pkgver" +_reldir="$builddir/out/Release" + +snapshot() { + local libs="$builddir"/Libraries + + mkdir -p "$srcdir" + cd "$srcdir" + git clone --recurse-submodules "$_pkgurl" -b "v$pkgver" "$builddir" + + # clone also gyp and range-v3 + mkdir "$libs" + cd "$libs" + git clone --recurse-submodules "$_gypurl" -b "master" gyp + git clone --recurse-submodules "$_rangeurl" -b "$_rangever" range-v3 + cd gyp + # chromium.googlesource.com doesn't support cloning commits + git reset --hard "$_gypver" + + cd "$srcdir" + find "$builddir" -name .git -exec rm -rf {} + + # git archive doesn't support submodules + tar czf "$builddir".tar.gz "${builddir##*/}" + scp "$builddir".tar.gz dev.alpinelinux.org:/archive/$pkgname/ +} + +prepare() { + cd "$builddir/Telegram/ThirdParty" + rm -rf minizip # we have this system-wide + + cd "$builddir/Libraries" + patch -p1 -i "$builddir"/Telegram/Patches/gyp.diff -d "gyp" + + default_prepare +} + +build() { + cd "$builddir/Telegram/gyp" + export CPPFLAGS="$CPPFLAGS -Winvalid-pch" + export CXXFLAGS="$CXXFLAGS -Winvalid-pch" + ../../Libraries/gyp/gyp \ + -Dbuild_defines="TDESKTOP_DISABLE_CRASH_REPORTS,TDESKTOP_DISABLE_AUTOUPDATE,TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME,TDESKTOP_DISABLE_GTK_INTEGRATION" \ + -Gconfig=Release \ + --depth=. \ + --generator-output=../.. \ + -Goutput_dir=out \ + Telegram.gyp \ + --format=cmake + + cd "$_reldir" + printf '%s\n' 'set_target_properties(Telegram PROPERTIES SKIP_BUILD_RPATH TRUE)' >> CMakeLists.txt + + if [ "$CBUILD" != "$CHOST" ]; then + CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux" + fi + cmake \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DBUILD_SHARED_LIBS=True \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_FLAGS="$CXXFLAGS" \ + -DCMAKE_C_FLAGS="$CFLAGS" \ + -DCMAKE_ASM_COMPILER=as \ + ${CMAKE_CROSSOPTS} + make +} + +check() { + local test + + cd "$_reldir" + for test in tests_*; do + ./"$test" + done +} + +package() { + local size + + cd "$_reldir" + mkdir -p "$pkgdir"/usr/bin + mv Telegram "$pkgdir"/usr/bin/telegram-desktop + + cd "$builddir" + mkdir -p "$pkgdir"/usr/share/applications + mv lib/xdg/telegramdesktop.desktop "$pkgdir"/usr/share/applications/telegram-desktop.desktop + + mkdir -p "$pkgdir"/usr/share/kservices5 + mv lib/xdg/tg.protocol "$pkgdir"/usr/share/kservices5 + + cd Telegram/Resources/art + mkdir -p "$pkgdir"/usr/share/icons/hicolor + for size in 16 32 48 64 128 256 512; do + mkdir -p "$pkgdir"/usr/share/icons/hicolor/"$size"x"$size"/apps + mv icon"$size".png "$pkgdir"/usr/share/icons/hicolor/"$size"x"$size"/apps/telegram.png + done +} + +sha512sums="8e60e1b4decb5162694aad0c74b07d12fd91185b2c527e2a67c11155bffb3a502f1805ba20daa5b102c4a679e7b286b938fa6af93dfacf4d5a5c1c00f2ad59d7 telegram-desktop-1.4.3.tar.gz +47da04e4d174658376026fa17643aac9c78e0edc42969cdce3bb99e81cc84f930d5687a99f0707e22692101cf21efe828da849ed18e63199d80ee34316d77863 libtgvoip.patch +1ae9efaed0ec2dc0e82d30a10875cbb4a29489d97c674dc09467b7c5cccc554f829ac4d09659cedc1d7ca3fd4d3b8976fd536d799f8de0b79f6c38961fa1a992 musl.patch +e3b57ca67a977e3147fc1554a59caa79df63bcb70c05f5830db6fed5d8333b944478477e86a62a950fa23e7160224abfd1c576e9edff909f244aa65123bb987e no-gtk2.patch +188fd61ce3fb1183a152ba3739a042cdacb8a695b722a2be6484a730e73dc99d8305bc4d14589c85a1f395162f1d38c79c1c39faeb75737f0b20726c0e5d6fdf no-pulse.patch +5933063ad5d4fda7f31be23a129bb1958384aee3607acbcd25dbbf9e6c2d6d131565f31b02caa7c774830733743d086d0d6bb971e87c3eb2deb10d0c5e3b9551 tdesktop.patch +8de8c0508177da5fcac4f2dcee4d8baef4b99f74f1dca296567bc3689a6bd17a47c1c945df504abc8811b82a687010d0709503c7c32e47d2ebb1cf0e374c80c5 xdg.patch" diff --git a/testing/telegram-desktop/libtgvoip.patch b/testing/telegram-desktop/libtgvoip.patch new file mode 100644 index 0000000000..fcd1166bf1 --- /dev/null +++ b/testing/telegram-desktop/libtgvoip.patch @@ -0,0 +1,16 @@ +--- 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/musl.patch b/testing/telegram-desktop/musl.patch new file mode 100644 index 0000000000..ddd2058279 --- /dev/null +++ b/testing/telegram-desktop/musl.patch @@ -0,0 +1,17 @@ +--- a/Telegram/ThirdParty/libtgvoip/os/linux/AudioPulse.cpp ++++ b/Telegram/ThirdParty/libtgvoip/os/linux/AudioPulse.cpp +@@ -6,6 +6,7 @@ + + #include "AudioPulse.h" + #include ++#include + #include "../../logging.h" + + #define DECLARE_DL_FUNCTION(name) typeof(name)* AudioPulse::_import_##name=NULL +@@ -283,4 +284,4 @@ bool AudioPulse::DoOneOperation(std::fun + } + pa_mainloop_iterate(ml, 1, NULL); + } +-} +\ No newline at end of file ++} diff --git a/testing/telegram-desktop/no-gtk2.patch b/testing/telegram-desktop/no-gtk2.patch new file mode 100644 index 0000000000..109032d23f --- /dev/null +++ b/testing/telegram-desktop/no-gtk2.patch @@ -0,0 +1,27 @@ +--- a/Telegram/SourceFiles/platform/linux/linux_libs.cpp ++++ b/Telegram/SourceFiles/platform/linux/linux_libs.cpp +@@ -253,24 +253,12 @@ + indicatorLoaded = setupAppIndicator(lib_indicator); + } + } +- if (!gtkLoaded || !indicatorLoaded) { +- if (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 && loadLibrary(lib_gtk, "gtk-x11-2.0", 0)) { +- gtkLoaded = setupGtkBase(lib_gtk); +- } + } + + if (gtkLoaded) { diff --git a/testing/telegram-desktop/no-pulse.patch b/testing/telegram-desktop/no-pulse.patch new file mode 100644 index 0000000000..48f3847e92 --- /dev/null +++ b/testing/telegram-desktop/no-pulse.patch @@ -0,0 +1,36 @@ +--- a/Telegram/ThirdParty/libtgvoip/config.h.in ++++ b/Telegram/ThirdParty/libtgvoip/config.h.in +@@ -197,7 +197,7 @@ + #undef WITHOUT_ALSA + + /* Define to disable PulseAudio support */ +-#undef WITHOUT_PULSE ++#define WITHOUT_PULSE + + /* Define for Solaris 2.5.1 so the uint32_t typedef from , + , or is not used. If the typedef were allowed, the +--- a/Telegram/ThirdParty/libtgvoip/libtgvoip.gyp ++++ b/Telegram/ThirdParty/libtgvoip/libtgvoip.gyp +@@ -97,12 +97,6 @@ + '<(tgvoip_src_loc)/os/linux/AudioInputALSA.h', + '<(tgvoip_src_loc)/os/linux/AudioOutputALSA.cpp', + '<(tgvoip_src_loc)/os/linux/AudioOutputALSA.h', +- '<(tgvoip_src_loc)/os/linux/AudioOutputPulse.cpp', +- '<(tgvoip_src_loc)/os/linux/AudioOutputPulse.h', +- '<(tgvoip_src_loc)/os/linux/AudioInputPulse.cpp', +- '<(tgvoip_src_loc)/os/linux/AudioInputPulse.h', +- '<(tgvoip_src_loc)/os/linux/AudioPulse.cpp', +- '<(tgvoip_src_loc)/os/linux/AudioPulse.h', + + # POSIX + '<(tgvoip_src_loc)/os/posix/NetworkSocketPosix.cpp', +--- a/Telegram/ThirdParty/libtgvoip/libtgvoip.gyp ++++ b/Telegram/ThirdParty/libtgvoip/libtgvoip.gyp +@@ -9,6 +9,7 @@ + 'defines': [ + 'WEBRTC_APM_DEBUG_DUMP=0', + 'TGVOIP_USE_DESKTOP_DSP', ++ 'WITHOUT_PULSE', + ], + 'variables': { + 'tgvoip_src_loc': '.', diff --git a/testing/telegram-desktop/tdesktop.patch b/testing/telegram-desktop/tdesktop.patch new file mode 100644 index 0000000000..51ac3d15f5 --- /dev/null +++ b/testing/telegram-desktop/tdesktop.patch @@ -0,0 +1,594 @@ +--- a/Telegram/Resources/qrc/telegram_linux.qrc ++++ b/Telegram/Resources/qrc/telegram_linux.qrc +@@ -1,5 +1,4 @@ + + +- ../etc/qt_linux.conf + + +--- a/Telegram/SourceFiles/core/launcher.cpp ++++ b/Telegram/SourceFiles/core/launcher.cpp +@@ -39,9 +39,10 @@ void Launcher::init() { + + QCoreApplication::setApplicationName(qsl("TelegramDesktop")); + +-#ifndef OS_MAC_OLD ++#if !defined(Q_OS_MAC) && QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) ++ // Retina display support is working fine, others are not. + QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling, true); +-#endif // OS_MAC_OLD ++#endif // not defined Q_OS_MAC and QT_VERSION >= 5.6.0 + + initHook(); + } +@@ -59,6 +60,13 @@ int Launcher::exec() { + Logs::start(this); // must be started before Platform is started + Platform::start(); // must be started before QApplication 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"); ++ + auto result = executeApplication(); + + DEBUG_LOG(("Telegram finished, result: %1").arg(result)); +--- a/Telegram/SourceFiles/platform/linux/linux_libs.h ++++ b/Telegram/SourceFiles/platform/linux/linux_libs.h +@@ -17,7 +17,7 @@ extern "C" { + } // extern "C" + + #ifndef TDESKTOP_DISABLE_UNITY_INTEGRATION +-#include ++typedef void UnityLauncherEntry; + #endif // !TDESKTOP_DISABLE_UNITY_INTEGRATION + #endif // !TDESKTOP_DISABLE_GTK_INTEGRATION + +--- /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; ++} +--- a/Telegram/SourceFiles/qt_static_plugins.cpp ++++ b/Telegram/SourceFiles/qt_static_plugins.cpp +@@ -15,13 +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) + #endif // Q_OS_WIN | Q_OS_MAC | Q_OS_LINUX +--- a/Telegram/SourceFiles/ui/text/text.cpp ++++ b/Telegram/SourceFiles/ui/text/text.cpp +@@ -1750,11 +1750,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(); +--- a/Telegram/SourceFiles/ui/text/text_block.cpp ++++ b/Telegram/SourceFiles/ui/text/text_block.cpp +@@ -332,6 +332,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(); + + CrashReports::ClearAnnotationRef("CrashString"); + } +--- a/Telegram/SourceFiles/ui/twidget.cpp ++++ b/Telegram/SourceFiles/ui/twidget.cpp +@@ -233,9 +233,9 @@ void sendSynteticMouseEvent(QWidget *widget, QEvent::Type type, Qt::MouseButton + , button + , QGuiApplication::mouseButtons() | button + , QGuiApplication::keyboardModifiers() +-#ifndef OS_MAC_OLD ++#if !defined(OS_MAC_OLD) && QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) + , Qt::MouseEventSynthesizedByApplication +-#endif // OS_MAC_OLD ++#endif + ); + ev.setTimestamp(getms()); + QGuiApplication::sendEvent(windowHandle, &ev); +--- 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++)") +--- a/Telegram/gyp/Telegram.gyp ++++ b/Telegram/gyp/Telegram.gyp +@@ -12,7 +12,7 @@ + 'target_name': 'Telegram', + 'variables': { + 'variables': { +- 'libs_loc': '../../../Libraries', ++ 'libs_loc': '../../Libraries', + }, + 'libs_loc': '<(libs_loc)', + 'src_loc': '../SourceFiles', +@@ -75,7 +75,6 @@ + 'codegen.gyp:codegen_numbers', + 'codegen.gyp:codegen_style', + 'tests/tests.gyp:tests', +- 'utils.gyp:Updater', + '../ThirdParty/libtgvoip/libtgvoip.gyp:libtgvoip', + 'crl.gyp:crl', + 'lib_base.gyp:lib_base', +@@ -84,7 +83,6 @@ + ], + + 'defines': [ +- 'AL_LIBTYPE_STATIC', + 'AL_ALEXT_PROTOTYPES', + 'TGVOIP_USE_CXX11_LIB', + 'XXH_INLINE_ALL', +@@ -94,16 +92,9 @@ + 'include_dirs': [ + '<(src_loc)', + '<(SHARED_INTERMEDIATE_DIR)', +- '<(libs_loc)/breakpad/src', +- '<(libs_loc)/lzma/C', +- '<(libs_loc)/zlib', +- '<(libs_loc)/ffmpeg', +- '<(libs_loc)/openal-soft/include', +- '<(libs_loc)/opus/include', + '<(libs_loc)/range-v3/include', +- '<(minizip_loc)', +- '<(sp_media_key_tap_loc)', + '<(emoji_suggestions_loc)', ++ '/usr/include/minizip', + '<(submodules_loc)/GSL/include', + '<(submodules_loc)/variant/include', + '<(submodules_loc)/crl/src', +--- a/Telegram/gyp/lib_base.gyp ++++ b/Telegram/gyp/lib_base.gyp +@@ -23,7 +23,7 @@ + 'variables': { + 'src_loc': '../SourceFiles', + 'res_loc': '../Resources', +- 'libs_loc': '../../../Libraries', ++ 'libs_loc': '../../Libraries', + 'official_build_target%': '', + 'submodules_loc': '../ThirdParty', + 'pch_source': '<(src_loc)/base/base_pch.cpp', +--- a/Telegram/gyp/lib_export.gyp ++++ b/Telegram/gyp/lib_export.gyp +@@ -22,7 +22,7 @@ + 'variables': { + 'src_loc': '../SourceFiles', + 'res_loc': '../Resources', +- 'libs_loc': '../../../Libraries', ++ 'libs_loc': '../../Libraries', + 'official_build_target%': '', + 'submodules_loc': '../ThirdParty', + 'pch_source': '<(src_loc)/export/export_pch.cpp', +--- a/Telegram/gyp/lib_storage.gyp ++++ b/Telegram/gyp/lib_storage.gyp +@@ -23,7 +23,7 @@ + 'variables': { + 'src_loc': '../SourceFiles', + 'res_loc': '../Resources', +- 'libs_loc': '../../../Libraries', ++ 'libs_loc': '../../Libraries', + 'official_build_target%': '', + 'submodules_loc': '../ThirdParty', + 'pch_source': '<(src_loc)/storage/storage_pch.cpp', +--- a/Telegram/gyp/qt.gypi ++++ b/Telegram/gyp/qt.gypi +@@ -14,25 +14,21 @@ + [ 'build_macold', { + 'qt_version%': '5.3.2', + }, { +- 'qt_version%': '5.6.2', ++ 'qt_version%': ' /dev/null --libs <@(pkgconfig_libs))', + ], + 'cflags_cc': [ +@@ -69,9 +62,6 @@ + '-Wno-maybe-uninitialized', + ], + 'ldflags': [ +- '-Wl,-wrap,aligned_alloc', +- '-Wl,-wrap,secure_getenv', +- '-Wl,-wrap,clock_gettime', + '-Wl,--no-as-needed,-lrt', + ], + 'configurations': { +@@ -91,15 +81,10 @@ + }, + 'conditions': [ + [ '" /dev/null --cflags appindicator-0.1)', +- ' /dev/null --cflags gtk+-2.0)', +- ' /dev/null --cflags glib-2.0)', +- ' /dev/null --cflags dee-1.0)', ++ ' /dev/null --cflags appindicator3-0.1)', ++ ' /dev/null --cflags gtk+-3.0)', + ], + }] + ], +--- a/Telegram/gyp/telegram_sources.txt ++++ b/Telegram/gyp/telegram_sources.txt +@@ -761,14 +761,7 @@ + <(emoji_suggestions_loc)/emoji_suggestions.cpp + <(emoji_suggestions_loc)/emoji_suggestions.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 +--- a/Telegram/gyp/tests/tests.gyp ++++ b/Telegram/gyp/tests/tests.gyp +@@ -9,7 +9,7 @@ + '../common.gypi', + ], + 'variables': { +- 'libs_loc': '../../../../Libraries', ++ 'libs_loc': '../../../Libraries', + 'src_loc': '../../SourceFiles', + 'submodules_loc': '../../ThirdParty', + 'mac_target': '10.10', +--- a/Telegram/gyp/utils.gyp ++++ b/Telegram/gyp/utils.gyp +@@ -11,7 +11,7 @@ + 'targets': [{ + 'target_name': 'Updater', + 'variables': { +- 'libs_loc': '../../../Libraries', ++ 'libs_loc': '../../Libraries', + 'src_loc': '../SourceFiles', + 'res_loc': '../Resources', + }, +@@ -57,7 +57,7 @@ + }, { + 'target_name': 'Packer', + 'variables': { +- 'libs_loc': '../../../Libraries', ++ 'libs_loc': '../../Libraries', + 'src_loc': '../SourceFiles', + 'mac_target': '10.10', + }, diff --git a/testing/telegram-desktop/xdg.patch b/testing/telegram-desktop/xdg.patch new file mode 100644 index 0000000000..e26bda0bc7 --- /dev/null +++ b/testing/telegram-desktop/xdg.patch @@ -0,0 +1,30 @@ +--- a/lib/xdg/telegramdesktop.desktop ++++ b/lib/xdg/telegramdesktop.desktop +@@ -1,6 +1,8 @@ + [Desktop Entry] + Version=1.0 + Name=Telegram Desktop ++GenericName=Telegram Desktop ++Keywords=IM;Chat; + Comment=Official desktop version of Telegram messaging app + Exec=telegram-desktop -- %u + Icon=telegram +--- a/lib/xdg/telegramdesktop.appdata.xml ++++ b/lib/xdg/telegramdesktop.appdata.xml +@@ -1,6 +1,6 @@ + + +- org.telegram.desktop ++ telegram-desktop.desktop + CC0-1.0 + GPL-3.0 + Telegram Desktop +--- a/lib/xdg/tg.protocol ++++ b/lib/xdg/tg.protocol +@@ -1,5 +1,5 @@ + [Protocol] +-exec=/usr/bin/telegram-desktop -- %u ++exec=telegram-desktop -- %u + protocol=tg + input=none + output=none -- 2.19.2 --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---