X-Original-To: alpine-aports@lists.alpinelinux.org Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) by lists.alpinelinux.org (Postfix) with ESMTP id 81730F8570B for ; Wed, 2 Jan 2019 11:51:53 +0000 (UTC) Received: by mail-lf1-f68.google.com with SMTP id z13so20776369lfe.11 for ; Wed, 02 Jan 2019 03:51:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=z4t5Bsggqt2GdgaXnR7gzI1QrTQh6YfUZTL/Ktc+Oj8=; b=N/hbpgOc4TsLEdwe2DwrBYb9lMWKUcKtSyn50478JUwnUH3sIZr0Kbp/+DhH7JaYn6 fwrh5oNBklZMr6BR4VTfqXfeVst4xwYWNVeXqUvqtJ6V7HIESmDewP6yl3IP4WWk1Gj/ HeuLC48NymVMdRTsTfCuExbHDGww7Dc69i7lNdydC1L3Tt+cgO1rCBW6QX5Fw7PDerBD dMQseUbvG+sOTxgZ/P4XKfVJ+FSmEZ3yWKGPLsxYAZqWkdgf6m/Z7dvwaC7edf/vMZtk 9Qq5FYaNv8jy1WaDk49q2Jq98l9JMBgjgrU0GgtiNkIwtQS18PWqeA5wPjUskCT5JoaH BY2A== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=z4t5Bsggqt2GdgaXnR7gzI1QrTQh6YfUZTL/Ktc+Oj8=; b=d/gwdStEkG4er3SQOzB2Kg7kXhmgROxMoZ285qi5529UD8bfp/7XkGzLINqOkgQ5e8 5H8OvD4sUTC5SqIvRfZ1s+2HWGVXoKEcNy2EPCIBv2OT7eJEWyQ+5ndWzAVlk0hsKywz yIq0mG0pA+bXquh1gYvdprUrg/Q7VMzjNeD/puKCFQx3av53Qxq0f2KUsou45cqdqY9v Wyk2tGlTRVd1J+JCumqlmKHiqCG3Ud27UTt2ixBhnucGgI5zslWjec6ooO+6JR3jsJsd UOvZHsaqthWmPvDbiNCQCbDZ2ewWEL8uR9nUKlQhmEVrM7U0u9uAmB2y0QrIO7FF23MB gtnw== X-Gm-Message-State: AA+aEWYOHJDGz/MPJtWIi1pUUh9pzPsEbGL2gBzV8dGyeQV7dqsXREAV NBAWxeN6Z71aF1lw8283gWxYNpG6 X-Google-Smtp-Source: AFSGD/VBTCuOJONfUqzpb+Xl/9WMzft1jZWiH3vb3lDNPUUJ8l5LRoxvbTY2dbnd+TDoAVKw1jUiBg== X-Received: by 2002:ac2:41cb:: with SMTP id d11mr22502398lfi.3.1546429911443; Wed, 02 Jan 2019 03:51:51 -0800 (PST) Received: from alpine.nodomain (host-77-242-219-166.telecomitalia.sm. [77.242.219.166]) by smtp.gmail.com with ESMTPSA id b128sm10201942lfe.91.2019.01.02.03.51.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Jan 2019 03:51:50 -0800 (PST) From: Alex Raschi To: alpine-aports@lists.alpinelinux.org Subject: [alpine-aports] [PATCH v3] testing/telegram-desktop: new aport Date: Wed, 2 Jan 2019 12:51:39 +0100 Message-Id: <20190102115139.25968-1-raschi.alex@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20181223215227.29723-1-raschi.alex@gmail.com> References: <20181223215227.29723-1-raschi.alex@gmail.com> 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 --- Changes v2 -> v3: - update to 1.5.4 testing/telegram-desktop/APKBUILD | 150 +++++ testing/telegram-desktop/libtgvoip.patch | 16 + testing/telegram-desktop/musl.patch | 10 + testing/telegram-desktop/no-gtk2.patch | 27 + testing/telegram-desktop/no-pulse.patch | 34 + .../telegram-desktop/system-wide-fonts.patch | 34 + testing/telegram-desktop/tdesktop.patch | 596 ++++++++++++++++++ testing/telegram-desktop/xdg.patch | 30 + 8 files changed, 897 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/system-wide-fonts.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..22e14522ea --- /dev/null +++ b/testing/telegram-desktop/APKBUILD @@ -0,0 +1,150 @@ +# Maintainer: Alex Raschi +pkgname=telegram-desktop +pkgver=1.5.4 +_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 + system-wide-fonts.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" + + # https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/telegram-desktop#n80 + ../../Libraries/gyp/gyp \ + -Dapi_id=17349 \ + -Dapi_hash=344583e45741c457fe1862106095a5eb \ + -Dbuild_defines="TDESKTOP_DISABLE_CRASH_REPORTS,TDESKTOP_DISABLE_AUTOUPDATE,TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME,TDESKTOP_DISABLE_GTK_INTEGRATION,TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION" \ + -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="c3fa3d558c35cae124b84b714a56beafd72d1ab4899776517d25943cc4bd4e86c725f6af11f2af93b635389b2cc6d171dd6260fbf266d9428f33827faf8241b9 telegram-desktop-1.5.4.tar.gz +9ee0dbc4b04454a2f440daa381df765616962e8e8c4330e96851dbc5f2a283da687282d666d2667aac67c3467d2079a94e4fef358dbb18eb24a064d55adc7a40 libtgvoip.patch +fc672d8168f6b2807e596570bc57f3b89296891b5d62b8e12b38193ed4919e4eb17efd72691c4086fb0ff4383de54695a9faf9874a0727a0980ef35e5ca4bee7 musl.patch +cb01655dd097b68e89b15e6e4b1f6da10c52e8bec681eeef9807ca376283b10cb3da34acc976c790f3c8dea05acbef1ba1967612920a2e4acb3b9da79e251a0d no-gtk2.patch +9df70f5057fd9938cab87529693ad9617da0fdbb9084ff57395cd540343a0dcc1ecfba4f868b0043b252fe1aca33d0d214fb07931860296e66fbf11825f95fb9 no-pulse.patch +3cbfe1cb1bf9eb18e79c49ac67560e3290b70a7ceb1e397f4623bbfc39227468b3ab489a5813d371de31438b45751505bf3af7424f92e0e8905e23ab0d2b565d tdesktop.patch +8de8c0508177da5fcac4f2dcee4d8baef4b99f74f1dca296567bc3689a6bd17a47c1c945df504abc8811b82a687010d0709503c7c32e47d2ebb1cf0e374c80c5 xdg.patch +ce6be003220267bac5483caf8302b492e1581892bc36d35a61236ebf9f9d766b8bd2159557a1c36256aa85f461797a38bfaae57b12da7a72101b21c0b17ed653 system-wide-fonts.patch" diff --git a/testing/telegram-desktop/libtgvoip.patch b/testing/telegram-desktop/libtgvoip.patch new file mode 100644 index 0000000000..b41166198d --- /dev/null +++ b/testing/telegram-desktop/libtgvoip.patch @@ -0,0 +1,16 @@ +--- a/Telegram/ThirdParty/libtgvoip/libtgvoip.gyp ++++ b/Telegram/ThirdParty/libtgvoip/libtgvoip.gyp +@@ -14,11 +14,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..70e7415e1e --- /dev/null +++ b/testing/telegram-desktop/musl.patch @@ -0,0 +1,10 @@ +--- 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 diff --git a/testing/telegram-desktop/no-gtk2.patch b/testing/telegram-desktop/no-gtk2.patch new file mode 100644 index 0000000000..839a49bea5 --- /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 +@@ -240,24 +240,12 @@ void start() { + indicatorLoaded = setupAppIndicator(lib_indicator); + } + } +- if (!gtkLoaded || !indicatorLoaded) { +- 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 && 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..39c965490f --- /dev/null +++ b/testing/telegram-desktop/no-pulse.patch @@ -0,0 +1,34 @@ +--- 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 +@@ -10,6 +10,7 @@ + 'WEBRTC_APM_DEBUG_DUMP=0', + 'TGVOIP_USE_DESKTOP_DSP', + 'WEBRTC_NS_FLOAT', ++ 'WITHOUT_PULSE', + ], + 'variables': { + 'tgvoip_src_loc': '.', +@@ -105,12 +106,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', diff --git a/testing/telegram-desktop/system-wide-fonts.patch b/testing/telegram-desktop/system-wide-fonts.patch new file mode 100644 index 0000000000..c89222986b --- /dev/null +++ b/testing/telegram-desktop/system-wide-fonts.patch @@ -0,0 +1,34 @@ +Description: Remove links to packaged Open Sans font + This makes Telegram Desktop use system-wide fonts. + Warnings about non-existent fonts in resources are also disabled. +Author: Nicholas Guriev +Bug-Debian: https://bugs.debian.org/890341 +Last-Update: Sat, 31 Mar 2018 14:36:39 +0300 + +--- a/Telegram/Resources/qrc/telegram.qrc ++++ b/Telegram/Resources/qrc/telegram.qrc +@@ -42,9 +42,6 @@ + ../export_html/js/script.js + + +- ../fonts/OpenSans-Regular.ttf +- ../fonts/OpenSans-Bold.ttf +- ../fonts/OpenSans-Semibold.ttf + ../art/bg.jpg + ../art/bg_initial.jpg + ../art/logo_256.png +--- a/Telegram/SourceFiles/ui/twidget.cpp ++++ b/Telegram/SourceFiles/ui/twidget.cpp +@@ -70,9 +70,9 @@ void Start() { + } + Started = true; + +- auto regular = LoadCustomFont(qsl(":/gui/fonts/OpenSans-Regular.ttf"), qsl("Open Sans")); +- auto bold = LoadCustomFont(qsl(":/gui/fonts/OpenSans-Bold.ttf"), qsl("Open Sans"), style::internal::FontBold); +- auto semibold = LoadCustomFont(qsl(":/gui/fonts/OpenSans-Semibold.ttf"), qsl("Open Sans Semibold")); ++ auto regular = ValidateFont(qsl("Open Sans")); ++ auto bold = ValidateFont(qsl("Open Sans"), style::internal::FontBold); ++ auto semibold = ValidateFont(qsl("Open Sans Semibold")); + + #ifdef Q_OS_WIN + // Attempt to workaround a strange font bug with Open Sans Semibold not loading. diff --git a/testing/telegram-desktop/tdesktop.patch b/testing/telegram-desktop/tdesktop.patch new file mode 100644 index 0000000000..1fc6fcdf0c --- /dev/null +++ b/testing/telegram-desktop/tdesktop.patch @@ -0,0 +1,596 @@ +--- a/Telegram/Resources/qrc/telegram_linux.qrc ++++ b/Telegram/Resources/qrc/telegram_linux.qrc +@@ -1,6 +1,5 @@ + + +- ../etc/qt_linux.conf + + + ../fc-custom.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 +@@ -21,7 +21,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,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 +--- a/Telegram/SourceFiles/ui/text/text.cpp ++++ b/Telegram/SourceFiles/ui/text/text.cpp +@@ -1760,11 +1760,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 +@@ -250,9 +250,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', +@@ -96,16 +94,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': [ +@@ -70,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': { +@@ -92,14 +81,10 @@ + }, + 'conditions': [ + [ '" /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)', + ], + }], [' + +- 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.20.1 --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---