Mail archive
alpine-aports

[alpine-aports] [PATCH] testing/telegram-desktop: new aport

From: Alex Raschi <raschi.alex_at_gmail.com>
Date: Sun, 2 Dec 2018 16:31:27 +0100

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
_at_@ -0,0 +1,144 @@
+# Maintainer: Alex Raschi <raschi.alex_at_gmail.com>
+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
_at_@ -0,0 +1,16 @@
+--- a/Telegram/ThirdParty/libtgvoip/libtgvoip.gyp
++++ b/Telegram/ThirdParty/libtgvoip/libtgvoip.gyp
+_at_@ -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
_at_@ -0,0 +1,17 @@
+--- a/Telegram/ThirdParty/libtgvoip/os/linux/AudioPulse.cpp
++++ b/Telegram/ThirdParty/libtgvoip/os/linux/AudioPulse.cpp
+_at_@ -6,6 +6,7 @@
+ 
+ #include "AudioPulse.h"
+ #include <dlfcn.h>
++#include <libgen.h>
+ #include "../../logging.h"
+ 
+ #define DECLARE_DL_FUNCTION(name) typeof(name)* AudioPulse::_import_##name=NULL
+_at_@ -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
_at_@ -0,0 +1,27 @@
+--- a/Telegram/SourceFiles/platform/linux/linux_libs.cpp
++++ b/Telegram/SourceFiles/platform/linux/linux_libs.cpp
+_at_@ -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
_at_@ -0,0 +1,36 @@
+--- a/Telegram/ThirdParty/libtgvoip/config.h.in
++++ b/Telegram/ThirdParty/libtgvoip/config.h.in
+_at_@ -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 <sys/synch.h>,
+    <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+--- a/Telegram/ThirdParty/libtgvoip/libtgvoip.gyp
++++ b/Telegram/ThirdParty/libtgvoip/libtgvoip.gyp
+_at_@ -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
+_at_@ -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
_at_@ -0,0 +1,594 @@
+--- a/Telegram/Resources/qrc/telegram_linux.qrc
++++ b/Telegram/Resources/qrc/telegram_linux.qrc
+_at_@ -1,5 +1,4 @@
+ <RCC>
+   <qresource prefix="/qt">
+-    <file alias="etc/qt.conf">../etc/qt_linux.conf</file>
+   </qresource>
+ </RCC>
+--- a/Telegram/SourceFiles/core/launcher.cpp
++++ b/Telegram/SourceFiles/core/launcher.cpp
+_at_@ -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();
+ }
+_at_@ -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
+_at_@ -17,7 +17,7 @@ extern "C" {
+ } // extern "C"
+ 
+ #ifndef TDESKTOP_DISABLE_UNITY_INTEGRATION
+-#include <unity/unity/unity.h>
++typedef void UnityLauncherEntry;
+ #endif // !TDESKTOP_DISABLE_UNITY_INTEGRATION
+ #endif // !TDESKTOP_DISABLE_GTK_INTEGRATION
+ 
+--- /dev/null
++++ b/Telegram/SourceFiles/qt_functions.cpp
+_at_@ -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
+_at_@ -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
+_at_@ -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
+_at_@ -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
+_at_@ -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
+_at_@ -114,7 +114,7 @@ function(add_precompiled_header _target _input)
+       set(_compiler_FLAGS "_at_${_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)")
+_at_@ -125,7 +125,7 @@ function(add_precompiled_header _target _input)
+       set(_compiler_FLAGS "_at_${_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
+_at_@ -12,7 +12,7 @@
+     'target_name': 'Telegram',
+     'variables': {
+       'variables': {
+-        'libs_loc': '../../../Libraries',
++        'libs_loc': '../../Libraries',
+       },
+       'libs_loc': '<(libs_loc)',
+       'src_loc': '../SourceFiles',
+_at_@ -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',
+_at_@ -84,7 +83,6 @@
+     ],
+ 
+     'defines': [
+-      'AL_LIBTYPE_STATIC',
+       'AL_ALEXT_PROTOTYPES',
+       'TGVOIP_USE_CXX11_LIB',
+       'XXH_INLINE_ALL',
+_at_@ -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
+_at_@ -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
+_at_@ -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
+_at_@ -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
+_at_@ -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',
+             }]
+           ]
+         },
+_at_@ -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',
+               '<_at_(qt_libs)',
+               'Qt5DBus',
+               'Qt5Core',
+-              'qtpcre',
+-              'Xi',
+-              'Xext',
+-              'Xfixes',
+-              'SM',
+-              'ICE',
+-              'fontconfig',
+-              'expat',
+-              'freetype',
+-              'z',
+-              'xcb-shm',
+-              'xcb-xfixes',
+-              'xcb-render',
+-              'xcb-static',
+             ],
+           }],
+         ],
+_at_@ -127,11 +104,6 @@
+     # '<!_at_(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': {
+_at_@ -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',
+_at_@ -204,25 +176,14 @@
+   ],
+   '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',
+-        '<(linux_path_xkbcommon)/lib/libxkbcommon.a',
+         '<_at_(qt_libs_release)',
+-        '<(linux_lib_ssl)',
+-        '<(linux_lib_crypto)',
+-        '<!_at_(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',
+       ],
+_at_@ -230,7 +191,6 @@
+         '<(qt_loc)/mkspecs/linux-g++',
+       ],
+       'ldflags': [
+-        '-static-libstdc++',
+         '-pthread',
+         '-rdynamic',
+       ],
+--- a/Telegram/gyp/settings_linux.gypi
++++ b/Telegram/gyp/settings_linux.gypi
+_at_@ -11,7 +11,6 @@
+         'linux_common_flags': [
+           '-pipe',
+           '-Wall',
+-          '-Werror',
+           '-W',
+           '-fPIC',
+           '-Wno-unused-variable',
+_at_@ -60,7 +59,6 @@
+       ],
+       'defines': [
+         '_REENTRANT',
+-        'QT_STATICPLUGIN',
+         'QT_PLUGIN',
+       ],
+       'cflags_c': [
+--- a/Telegram/gyp/telegram_linux.gypi
++++ b/Telegram/gyp/telegram_linux.gypi
+_at_@ -23,18 +23,20 @@
+       'linux_path_va%': '/usr/local',
+       'linux_path_vdpau%': '/usr/local',
+       'linux_path_breakpad%': '/usr/local',
+-      'linux_path_opus_include%': '<(libs_loc)/opus/include',
++      'linux_path_opus_include%': '/usr/include/opus',
+       'linux_path_range%': '/usr/local',
+     },
+     'include_dirs': [
++      '/usr/include/openssl',
+       '/usr/local/include',
+       '<(linux_path_ffmpeg)/include',
+       '<(linux_path_openal)/include',
+       '<(linux_path_breakpad)/include/breakpad',
+       '<(linux_path_opus_include)',
+-      '<(linux_path_range)/include',
++      '<(libs_loc)/range-v3/include',
+     ],
+     'library_dirs': [
++      '/usr/lib/openssl',
+       '/usr/local/lib',
+       '<(linux_path_ffmpeg)/lib',
+       '<(linux_path_openal)/lib',
+_at_@ -43,25 +45,16 @@
+       '<(linux_path_breakpad)/lib',
+     ],
+     'libraries': [
+-      'breakpad_client',
+-      'composeplatforminputcontextplugin',
+-      'ibusplatforminputcontextplugin',
+-      'fcitxplatforminputcontextplugin',
+-      'himeplatforminputcontextplugin',
+-      'liblzma.a',
+-      'libopenal.a',
+-      'libavformat.a',
+-      'libavcodec.a',
+-      'libswresample.a',
+-      'libswscale.a',
+-      'libavutil.a',
+-      'libopus.a',
+-      'libva-x11.a',
+-      'libva-drm.a',
+-      'libva.a',
+-      'libvdpau.a',
+-      'libdrm.a',
+-      'libz.a',
++      'openal',
++      'avformat',
++      'avcodec',
++      'swresample',
++      'swscale',
++      'avutil',
++      'minizip',
++      'opus',
++      'z',
++      'lzma',
+ #      '<!(pkg-config 2> /dev/null --libs <_at_(pkgconfig_libs))',
+     ],
+     'cflags_cc': [
+_at_@ -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': {
+_at_@ -91,15 +81,10 @@
+     },
+     'conditions': [
+       [ '"<!(uname -p)" != "x86_64"', {
+-        'ldflags': [
+-          '-Wl,-wrap,__divmoddi4',
+-        ],
+       }], ['not_need_gtk!="True"', {
+         'cflags_cc': [
+-          '<!(pkg-config 2> /dev/null --cflags appindicator-0.1)',
+-          '<!(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)',
+         ],
+       }]
+     ],
+--- a/Telegram/gyp/telegram_sources.txt
++++ b/Telegram/gyp/telegram_sources.txt
+_at_@ -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
+_at_@ -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
+_at_@ -11,7 +11,7 @@
+   'targets': [{
+     'target_name': 'Updater',
+     'variables': {
+-      'libs_loc': '../../../Libraries',
++      'libs_loc': '../../Libraries',
+       'src_loc': '../SourceFiles',
+       'res_loc': '../Resources',
+     },
+_at_@ -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
_at_@ -0,0 +1,30 @@
+--- a/lib/xdg/telegramdesktop.desktop
++++ b/lib/xdg/telegramdesktop.desktop
+_at_@ -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
+_at_@ -1,6 +1,6 @@
+ <?xml version="1.0" encoding="utf-8"?>
+ <component type="desktop">
+-    <id>org.telegram.desktop</id>
++    <id>telegram-desktop.desktop</id>
+     <metadata_license>CC0-1.0</metadata_license>
+     <project_license>GPL-3.0</project_license>
+     <name>Telegram Desktop</name>
+--- a/lib/xdg/tg.protocol
++++ b/lib/xdg/tg.protocol
+_at_@ -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_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Sun Dec 02 2018 - 16:31:27 UTC