[telegram-desktop/el7: 2/2] Fix builds for other Archs.
by Vitaly Zaitsev
commit 34ac31abcbb1d768cdacdf8b7572158518b9b0e6
Author: Vitaly Zaitsev <vitaly(a)easycoding.org>
Date: Fri Apr 14 22:23:21 2017 +0500
Fix builds for other Archs.
fix_build_under_fedora.patch | 72 ++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 70 insertions(+), 2 deletions(-)
---
diff --git a/fix_build_under_fedora.patch b/fix_build_under_fedora.patch
index 40c53e4..527d763 100644
--- a/fix_build_under_fedora.patch
+++ b/fix_build_under_fedora.patch
@@ -1,9 +1,10 @@
-From de8b9890618a7c7cebb2ea66ca1bbf133c8a4b13 Mon Sep 17 00:00:00 2001
+From 73eb322805ef31e9fbcb00f0f26200ab77766f5c Mon Sep 17 00:00:00 2001
From: Vitaly Zaitsev <vitaly(a)easycoding.org>
Date: Fri, 31 Mar 2017 14:29:58 +0200
Subject: [PATCH] Fixed build under Fedora using rpmbuild and mock.
---
+ Telegram/SourceFiles/base/build_config.h | 52 ++++++++++++++++
Telegram/SourceFiles/main.cpp | 7 ++-
Telegram/SourceFiles/qt_functions.cpp | 94 +++++++++++++++++++++++++++++
Telegram/SourceFiles/qt_static_plugins.cpp | 8 ---
@@ -21,9 +22,76 @@ Subject: [PATCH] Fixed build under Fedora using rpmbuild and mock.
Telegram/gyp/utils.gyp | 4 +-
lib/xdg/telegramdesktop.appdata.xml | 2 +-
lib/xdg/telegramdesktop.desktop | 6 +-
- 17 files changed, 197 insertions(+), 145 deletions(-)
+ 18 files changed, 249 insertions(+), 145 deletions(-)
create mode 100644 Telegram/SourceFiles/qt_functions.cpp
+diff --git a/Telegram/SourceFiles/base/build_config.h b/Telegram/SourceFiles/base/build_config.h
+index 1731630..8826feb 100644
+--- a/Telegram/SourceFiles/base/build_config.h
++++ b/Telegram/SourceFiles/base/build_config.h
+@@ -56,10 +56,62 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
+ #define ARCH_CPU_X86_FAMILY 1
+ #define ARCH_CPU_X86_64 1
+ #define ARCH_CPU_64_BITS 1
++#define ARCH_CPU_LITTLE_ENDIAN 1
+ #elif defined(_M_IX86) || defined(__i386__)
+ #define ARCH_CPU_X86_FAMILY 1
+ #define ARCH_CPU_X86 1
+ #define ARCH_CPU_32_BITS 1
++#define ARCH_CPU_LITTLE_ENDIAN 1
++#elif defined(__s390x__)
++#define ARCH_CPU_S390_FAMILY 1
++#define ARCH_CPU_S390X 1
++#define ARCH_CPU_64_BITS 1
++#define ARCH_CPU_BIG_ENDIAN 1
++#elif defined(__s390__)
++#define ARCH_CPU_S390_FAMILY 1
++#define ARCH_CPU_S390 1
++#define ARCH_CPU_31_BITS 1
++#define ARCH_CPU_BIG_ENDIAN 1
++#elif defined(__PPC64__) && defined(__BIG_ENDIAN__)
++#define ARCH_CPU_PPC64_FAMILY 1
++#define ARCH_CPU_PPC64 1
++#define ARCH_CPU_64_BITS 1
++#define ARCH_CPU_BIG_ENDIAN 1
++#elif defined(__PPC64__) && defined(__LITTLE_ENDIAN__)
++#define ARCH_CPU_PPC64_FAMILY 1
++#define ARCH_CPU_PPC64 1
++#define ARCH_CPU_64_BITS 1
++#define ARCH_CPU_LITTLE_ENDIAN 1
++#elif defined(__PPC__)
++#define ARCH_CPU_PPC_FAMILY 1
++#define ARCH_CPU_PPC 1
++#define ARCH_CPU_32_BITS 1
++#define ARCH_CPU_BIG_ENDIAN 1
++#elif defined(__ARMEL__)
++#define ARCH_CPU_ARM_FAMILY 1
++#define ARCH_CPU_ARMEL 1
++#define ARCH_CPU_32_BITS 1
++#define ARCH_CPU_LITTLE_ENDIAN 1
++#elif defined(__aarch64__)
++#define ARCH_CPU_ARM_FAMILY 1
++#define ARCH_CPU_ARM64 1
++#define ARCH_CPU_64_BITS 1
++#define ARCH_CPU_LITTLE_ENDIAN 1
++#elif defined(__pnacl__)
++#define ARCH_CPU_32_BITS 1
++#define ARCH_CPU_LITTLE_ENDIAN 1
++#elif defined(__MIPSEL__)
++#if defined(__LP64__)
++#define ARCH_CPU_MIPS_FAMILY 1
++#define ARCH_CPU_MIPS64EL 1
++#define ARCH_CPU_64_BITS 1
++#define ARCH_CPU_LITTLE_ENDIAN 1
++#else
++#define ARCH_CPU_MIPS_FAMILY 1
++#define ARCH_CPU_MIPSEL 1
++#define ARCH_CPU_32_BITS 1
++#define ARCH_CPU_LITTLE_ENDIAN 1
++#endif
+ #else
+ #error Please add support for your architecture in base/build_config.h
+ #endif
diff --git a/Telegram/SourceFiles/main.cpp b/Telegram/SourceFiles/main.cpp
index 6cd942e..0268e39 100644
--- a/Telegram/SourceFiles/main.cpp
7 years, 7 months
[telegram-desktop/f24] Initial package import (#4285).
by Vitaly Zaitsev
commit c7ecbe4014f6e758e5e0dc0afb7e240202253eb7
Author: Vitaly Zaitsev <vitaly(a)easycoding.org>
Date: Fri Apr 14 20:40:52 2017 +0500
Initial package import (#4285).
.gitignore | 4 +
add_russian_locale.patch | 61 ++++
fix_build_under_fedora.patch | 708 ++++++++++++++++++++++++++++++++++++++++
sources | 4 +
tdesktop-1.0.32-russian.strings | Bin 0 -> 126480 bytes
telegram-desktop.spec | 462 ++++++++++++++++++++++++++
6 files changed, 1239 insertions(+)
---
diff --git a/.gitignore b/.gitignore
index e69de29..2f68468 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1,4 @@
+/GSL-3819df6.tar.gz
+/gyp-a7055b3.tar.gz
+/tdesktop-1.0.32.tar.gz
+/variant-916139a.tar.gz
diff --git a/add_russian_locale.patch b/add_russian_locale.patch
new file mode 100644
index 0000000..062464b
--- /dev/null
+++ b/add_russian_locale.patch
@@ -0,0 +1,61 @@
+From 2f40bf4f9a894195e9d6103f6181313c04622198 Mon Sep 17 00:00:00 2001
+From: Vitaly Zaitsev <vitaly(a)easycoding.org>
+Date: Fri, 31 Mar 2017 14:31:01 +0200
+Subject: [PATCH 2/5] Added russian localization from Transifex.
+
+---
+ Telegram/Resources/langs/ru.lproj/Localizable.strings | 17 +++++++++++++++++
+ Telegram/Resources/qrc/telegram.qrc | 1 +
+ Telegram/SourceFiles/lang.h | 1 +
+ 3 files changed, 19 insertions(+)
+ create mode 100644 Telegram/Resources/langs/ru.lproj/Localizable.strings
+
+diff --git a/Telegram/Resources/langs/ru.lproj/Localizable.strings b/Telegram/Resources/langs/ru.lproj/Localizable.strings
+new file mode 100644
+index 0000000..affee91
+--- /dev/null
++++ b/Telegram/Resources/langs/ru.lproj/Localizable.strings
+@@ -0,0 +1,17 @@
++/*
++This file is part of Telegram Desktop,
++the official desktop version of Telegram messaging app, see https://telegram.org
++
++Telegram Desktop is free software: you can redistribute it and/or modify
++it under the terms of the GNU General Public License as published by
++the Free Software Foundation, either version 3 of the License, or
++(at your option) any later version.
++
++It is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++GNU General Public License for more details.
++
++Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
++Copyright (c) 2014 John Preston, https://desktop.telegram.org
++*/
+diff --git a/Telegram/Resources/qrc/telegram.qrc b/Telegram/Resources/qrc/telegram.qrc
+index bd68d3b..c385625 100644
+--- a/Telegram/Resources/qrc/telegram.qrc
++++ b/Telegram/Resources/qrc/telegram.qrc
+@@ -20,5 +20,6 @@
+ <file alias="lang_nl.strings">../langs/lang_nl.strings</file>
+ <file alias="lang_pt_BR.strings">../langs/lang_pt_BR.strings</file>
+ <file alias="lang_ko.strings">../langs/lang_ko.strings</file>
++ <file alias="lang_ru.strings">../langs/lang_ru.strings</file>
+ </qresource>
+ </RCC>
+diff --git a/Telegram/SourceFiles/lang.h b/Telegram/SourceFiles/lang.h
+index 7d992f4..83e0e87 100644
+--- a/Telegram/SourceFiles/lang.h
++++ b/Telegram/SourceFiles/lang.h
+@@ -28,6 +28,7 @@ constexpr const str_const LanguageCodes[] = {
+ "nl",
+ "pt_BR",
+ "ko",
++ "ru",
+ };
+ constexpr const int languageTest = -1, languageDefault = 0, languageCount = base::array_size(LanguageCodes);
+
+--
+2.9.3
+
diff --git a/fix_build_under_fedora.patch b/fix_build_under_fedora.patch
new file mode 100644
index 0000000..40c53e4
--- /dev/null
+++ b/fix_build_under_fedora.patch
@@ -0,0 +1,708 @@
+From de8b9890618a7c7cebb2ea66ca1bbf133c8a4b13 Mon Sep 17 00:00:00 2001
+From: Vitaly Zaitsev <vitaly(a)easycoding.org>
+Date: Fri, 31 Mar 2017 14:29:58 +0200
+Subject: [PATCH] Fixed build under Fedora using rpmbuild and mock.
+
+---
+ Telegram/SourceFiles/main.cpp | 7 ++-
+ Telegram/SourceFiles/qt_functions.cpp | 94 +++++++++++++++++++++++++++++
+ Telegram/SourceFiles/qt_static_plugins.cpp | 8 ---
+ Telegram/SourceFiles/ui/text/text.cpp | 6 +-
+ Telegram/SourceFiles/ui/text/text_block.cpp | 2 +-
+ Telegram/SourceFiles/ui/twidget.cpp | 4 +-
+ Telegram/gyp/PrecompiledHeader.cmake | 4 +-
+ Telegram/gyp/Telegram.gyp | 16 ++---
+ Telegram/gyp/qt.gypi | 80 +++++++-----------------
+ Telegram/gyp/qt_rcc.gypi | 2 +-
+ Telegram/gyp/refresh.sh | 6 +-
+ Telegram/gyp/settings_linux.gypi | 14 ++++-
+ Telegram/gyp/telegram_linux.gypi | 79 ++++++++++++------------
+ Telegram/gyp/telegram_sources.txt | 8 +--
+ Telegram/gyp/utils.gyp | 4 +-
+ lib/xdg/telegramdesktop.appdata.xml | 2 +-
+ lib/xdg/telegramdesktop.desktop | 6 +-
+ 17 files changed, 197 insertions(+), 145 deletions(-)
+ create mode 100644 Telegram/SourceFiles/qt_functions.cpp
+
+diff --git a/Telegram/SourceFiles/main.cpp b/Telegram/SourceFiles/main.cpp
+index 6cd942e..0268e39 100644
+--- a/Telegram/SourceFiles/main.cpp
++++ b/Telegram/SourceFiles/main.cpp
+@@ -23,9 +23,10 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
+ #include "storage/localstorage.h"
+
+ int main(int argc, char *argv[]) {
+-#ifndef Q_OS_MAC // Retina display support is working fine, others are not.
++#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 // Q_OS_MAC
++#endif // not defined Q_OS_MAC and QT_VERSION >= 5.6.0
+ QCoreApplication::setApplicationName(qsl("TelegramDesktop"));
+
+ settingsParseArgs(argc, argv);
+@@ -38,6 +39,8 @@ int main(int argc, char *argv[]) {
+ // both are finished in Application::closeApplication
+ Logs::start(); // must be started before Platform is started
+ Platform::start(); // must be started before QApplication is created
++ QCoreApplication::addLibraryPath("/usr/lib64/qt5/plugins");
++ QCoreApplication::addLibraryPath("/usr/lib/qt5/plugins");
+
+ int result = 0;
+ {
+diff --git a/Telegram/SourceFiles/qt_functions.cpp b/Telegram/SourceFiles/qt_functions.cpp
+new file mode 100644
+index 0000000..4a722b8
+--- /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 1d4896a..f2f876b 100644
+--- a/Telegram/SourceFiles/qt_static_plugins.cpp
++++ b/Telegram/SourceFiles/qt_static_plugins.cpp
+@@ -28,12 +28,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)
+ #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 089a17f..a3b979c 100644
+--- a/Telegram/SourceFiles/ui/text/text.cpp
++++ b/Telegram/SourceFiles/ui/text/text.cpp
+@@ -1692,11 +1692,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
+
+ int blockIndex = _lineStartBlock;
+ ITextBlock *currentBlock = _t->_blocks[blockIndex];
+diff --git a/Telegram/SourceFiles/ui/text/text_block.cpp b/Telegram/SourceFiles/ui/text/text_block.cpp
+index f89644e..35230cf 100644
+--- a/Telegram/SourceFiles/ui/text/text_block.cpp
++++ b/Telegram/SourceFiles/ui/text/text_block.cpp
+@@ -330,7 +330,7 @@ TextBlock::TextBlock(const style::font &font, const QString &str, QFixed minResi
+ SignalHandlers::setCrashAnnotationRef("CrashString", &part);
+
+ QStackTextEngine engine(part, blockFont->f);
+- QTextLayout layout(&engine);
++ QTextLayout layout(part, blockFont->f);
+ layout.beginLayout();
+ layout.createLine();
+
+diff --git a/Telegram/SourceFiles/ui/twidget.cpp b/Telegram/SourceFiles/ui/twidget.cpp
+index abfcd27..1e1049b 100644
+--- a/Telegram/SourceFiles/ui/twidget.cpp
++++ b/Telegram/SourceFiles/ui/twidget.cpp
+@@ -107,9 +107,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);
+diff --git a/Telegram/gyp/PrecompiledHeader.cmake b/Telegram/gyp/PrecompiledHeader.cmake
+index 5d6830e..c3f08d3 100644
+--- a/Telegram/gyp/PrecompiledHeader.cmake
++++ b/Telegram/gyp/PrecompiledHeader.cmake
+@@ -112,7 +112,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}" "$(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)")
+@@ -123,7 +123,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}" "$(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 ${_name} for ${_target} (C++)")
+diff --git a/Telegram/gyp/Telegram.gyp b/Telegram/gyp/Telegram.gyp
+index 5b7ead4..91a6eb6 100644
+--- a/Telegram/gyp/Telegram.gyp
++++ b/Telegram/gyp/Telegram.gyp
+@@ -32,7 +32,6 @@
+ 'res_loc': '../Resources',
+ 'submodules_loc': '../../third_party',
+ 'third_party_loc': '../ThirdParty',
+- 'minizip_loc': '<(third_party_loc)/minizip',
+ 'sp_media_key_tap_loc': '<(third_party_loc)/SPMediaKeyTap',
+ 'style_files': [
+ '<(res_loc)/colors.palette',
+@@ -82,20 +81,17 @@
+ ],
+
+ 'defines': [
+- 'AL_LIBTYPE_STATIC',
+- '<!@(python -c "for s in \'<(build_defines)\'.split(\',\'): print(s)")',
++ '__STDC_FORMAT_MACROS',
++ 'TDESKTOP_DISABLE_AUTOUPDATE',
++ 'TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME',
++ 'TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION',
++ 'TDESKTOP_DISABLE_CRASH_REPORTS',
++ 'TDESKTOP_DISABLE_UNITY_INTEGRATION',
+ ],
+
+ 'include_dirs': [
+ '<(src_loc)',
+ '<(SHARED_INTERMEDIATE_DIR)',
+- '<(libs_loc)/breakpad/src',
+- '<(libs_loc)/lzma/C',
+- '<(libs_loc)/libexif-0.6.20',
+- '<(libs_loc)/zlib-1.2.8',
+- '<(libs_loc)/ffmpeg',
+- '<(libs_loc)/openal-soft/include',
+- '<(minizip_loc)',
+ '<(sp_media_key_tap_loc)',
+ '<(submodules_loc)/GSL/include',
+ '<(submodules_loc)/variant/include',
+diff --git a/Telegram/gyp/qt.gypi b/Telegram/gyp/qt.gypi
+index c12e450..f244fa6 100644
+--- a/Telegram/gyp/qt.gypi
++++ b/Telegram/gyp/qt.gypi
+@@ -27,25 +27,21 @@
+ [ 'build_macold', {
+ 'qt_version%': '5.3.2',
+ }, {
+- 'qt_version%': '5.6.2',
++ 'qt_version%': '<!(rpm -qa --queryformat "%{VERSION}" qt5-qtbase)',
+ }]
+ ],
+ },
+ '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%': '<!(rpm --eval "%{_qt5_libdir}")',
+ }]
+ ]
+ },
+@@ -85,32 +81,12 @@
+ ],
+ }],
+ [ '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',
+ ],
+ }],
+ ],
+@@ -135,16 +111,11 @@
+ 'qt_loc': '<(qt_loc_unix)',
+ }],
+ ],
+-
+ # If you need moc sources include a line in your 'sources':
+ # '<!@(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%': '/usr/lib/libicutu.a /usr/lib/libicui18n.a /usr/lib/libicuuc.a /usr/lib/libicudata.a',
+ },
+
+ 'configurations': {
+@@ -193,20 +164,20 @@
+ },
+
+ 'include_dirs': [
+- '<(qt_loc)/include',
+- '<(qt_loc)/include/QtCore',
+- '<(qt_loc)/include/QtGui',
+- '<(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',
++ '<!(rpm --eval "%{_includedir}")/qt5',
++ '<!(rpm --eval "%{_includedir}")/qt5/QtCore',
++ '<!(rpm --eval "%{_includedir}")/qt5/QtGui',
++ '<!(rpm --eval "%{_includedir}")/qt5/QtCore/<(qt_version)',
++ '<!(rpm --eval "%{_includedir}")/qt5/QtGui/<(qt_version)',
++ '<!(rpm --eval "%{_includedir}")/qt5/QtCore/<(qt_version)/QtCore',
++ '<!(rpm --eval "%{_includedir}")/qt5/QtGui/<(qt_version)/QtGui',
+ ],
+ 'library_dirs': [
+- '<(qt_loc)/lib',
+- '<(qt_loc)/plugins',
+- '<(qt_loc)/plugins/bearer',
+- '<(qt_loc)/plugins/platforms',
+- '<(qt_loc)/plugins/imageformats',
++ '<(qt_loc)',
++ '<(qt_loc)/qt5/plugins',
++ '<(qt_loc)/qt5/plugins/bearer',
++ '<(qt_loc)/qt5/plugins/platforms',
++ '<(qt_loc)/qt5/plugins/imageformats',
+ ],
+ 'defines': [
+ 'QT_WIDGETS_LIB',
+@@ -217,28 +188,19 @@
+ 'conditions': [
+ [ 'build_linux', {
+ 'library_dirs': [
+- '<(qt_loc)/plugins/platforminputcontexts',
++ '<(qt_loc)/qt5/plugins/platforminputcontexts',
+ ],
+ 'libraries': [
+- '<(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)")',
+- 'xcb',
++ 'crypto',
+ 'X11',
+- 'X11-xcb',
+- 'dbus-1',
+- 'dl',
+- 'gthread-2.0',
+ 'glib-2.0',
+ 'pthread',
+ ],
+ 'include_dirs': [
+- '<(qt_loc)/mkspecs/linux-g++',
++ '<(qt_loc)/qt5/mkspecs/linux-g++',
+ ],
+ 'ldflags': [
+- '-static-libstdc++',
+ '-pthread',
+ '-g',
+ '-rdynamic',
+@@ -260,7 +222,7 @@
+ '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/moc/moc_<(RULE_INPUT_ROOT).cpp',
+ ],
+ 'action': [
+- '<(qt_loc)/bin/moc<(exe_ext)',
++ '<(qt_loc)/qt5/bin/moc<(exe_ext)',
+
+ # Silence "Note: No relevant classes found. No output generated."
+ '--no-notes',
+diff --git a/Telegram/gyp/qt_rcc.gypi b/Telegram/gyp/qt_rcc.gypi
+index eebc696..3efa7d0 100644
+--- a/Telegram/gyp/qt_rcc.gypi
++++ b/Telegram/gyp/qt_rcc.gypi
+@@ -28,7 +28,7 @@
+ '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/qrc/qrc_<(RULE_INPUT_ROOT).cpp',
+ ],
+ 'action': [
+- '<(qt_loc)/bin/rcc<(exe_ext)',
++ '<(qt_loc)/qt5/bin/rcc<(exe_ext)',
+ '-name', '<(RULE_INPUT_ROOT)',
+ '-no-compress',
+ '<(RULE_INPUT_PATH)',
+diff --git a/Telegram/gyp/refresh.sh b/Telegram/gyp/refresh.sh
+index 87f16da..cfd93d8 100755
+--- a/Telegram/gyp/refresh.sh
++++ b/Telegram/gyp/refresh.sh
+@@ -9,11 +9,11 @@ MySystem=`uname -s`
+ cd $FullScriptPath
+
+ if [ "$MySystem" == "Linux" ]; then
+- ../../../Libraries/gyp/gyp --depth=. --generator-output=../.. -Goutput_dir=out Telegram.gyp --format=cmake
++ ../../third_party/gyp/gyp --depth=. --generator-output=../.. -Goutput_dir=out Telegram.gyp --format=cmake
+ cd ../../out/Debug
+- ../../../Libraries/cmake-3.6.2/bin/cmake .
++ cmake .
+ cd ../Release
+- ../../../Libraries/cmake-3.6.2/bin/cmake .
++ cmake .
+ cd ../../Telegram/gyp
+ else
+ #gyp --depth=. --generator-output=../.. -Goutput_dir=out Telegram.gyp --format=ninja
+diff --git a/Telegram/gyp/settings_linux.gypi b/Telegram/gyp/settings_linux.gypi
+index fde88dc..f45fc09 100644
+--- a/Telegram/gyp/settings_linux.gypi
++++ b/Telegram/gyp/settings_linux.gypi
+@@ -22,12 +22,18 @@
+ [ 'build_linux', {
+ 'variables': {
+ 'linux_common_flags': [
++ '-O2',
++ '-flto',
+ '-pipe',
+ '-g',
+ '-Wall',
+- '-Werror',
+ '-W',
+ '-fPIC',
++ '-Werror=format-security',
++ '-D_FORTIFY_SOURCE=2',
++ '-fexceptions',
++ '-fstack-protector-strong --param=ssp-buffer-size=4',
++ '-grecord-gcc-switches',
+ '-Wno-unused-variable',
+ '-Wno-unused-parameter',
+ '-Wno-unused-function',
+@@ -36,6 +42,7 @@
+ '-Wno-unused-but-set-variable',
+ '-Wno-missing-field-initializers',
+ '-Wno-sign-compare',
++ '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1',
+ ],
+ },
+ 'conditions': [
+@@ -61,7 +68,6 @@
+ ],
+ 'defines': [
+ '_REENTRANT',
+- 'QT_STATICPLUGIN',
+ 'QT_PLUGIN',
+ ],
+ 'cflags_c': [
+@@ -72,6 +78,10 @@
+ '<@(linux_common_flags)',
+ '-std=gnu++14',
+ ],
++ 'ldflags': [
++ '-flto',
++ '-specs=/usr/lib/rpm/redhat/redhat-hardened-ld',
++ ],
+ 'configurations': {
+ 'Debug': {
+ },
+diff --git a/Telegram/gyp/telegram_linux.gypi b/Telegram/gyp/telegram_linux.gypi
+index b42e744..d89d9cd 100644
+--- a/Telegram/gyp/telegram_linux.gypi
++++ b/Telegram/gyp/telegram_linux.gypi
+@@ -27,70 +27,69 @@
+ # QApplication() -> createPlatformIntegration -> QXcbIntegrationPlugin::create
+ #'xkbcommon',
+ ],
+- 'linux_path_ffmpeg%': '/usr/local',
+- 'linux_path_openal%': '/usr/local',
+- 'linux_path_libexif_lib%': '<(libs_loc)/libexif-0.6.20/libexif/.libs',
+- 'linux_path_va%': '/usr/local',
+- 'linux_path_vdpau%': '/usr/local',
+- 'linux_path_breakpad%': '<(libs_loc)/breakpad',
+ },
+ 'include_dirs': [
+- '/usr/local/include',
+- '<(linux_path_ffmpeg)/include',
+- '<(linux_path_openal)/include',
+- '<(linux_path_breakpad)/include/breakpad',
++ '<!(rpm --eval "%{_includedir}")',
++ '<!(rpm --eval "%{_includedir}")/ffmpeg',
++ '<!(rpm --eval "%{_includedir}")/minizip',
+ ],
+ 'library_dirs': [
+- '/usr/local/lib',
+- '<(linux_path_ffmpeg)/lib',
+- '<(linux_path_openal)/lib',
+- '<(linux_path_libexif_lib)',
+- '<(linux_path_va)/lib',
+- '<(linux_path_vdpau)/lib',
+- '<(linux_path_breakpad)/lib',
++ '<!(rpm --eval "%{_libdir}")',
+ ],
+ 'libraries': [
+- 'breakpad_client',
+- 'composeplatforminputcontextplugin',
+- 'ibusplatforminputcontextplugin',
+- 'fcitxplatforminputcontextplugin',
+- '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',
++ 'z',
++ 'minizip',
+ # '<!(pkg-config 2> /dev/null --libs <@(pkgconfig_libs))',
+ ],
+ '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 gtk+-3.0)',
+ '<!(pkg-config 2> /dev/null --cflags dee-1.0)',
+ ],
+ 'configurations': {
+ 'Release': {
+ 'cflags': [
+- '-Ofast',
++ '-O2',
+ '-flto',
++ '-pipe',
++ '-g',
++ '-Wall',
++ '-W',
++ '-fPIC',
++ '-Werror=format-security',
++ '-D_FORTIFY_SOURCE=2',
++ '-fexceptions',
++ '-fstack-protector-strong --param=ssp-buffer-size=4',
++ '-grecord-gcc-switches',
+ '-fno-strict-aliasing',
++ '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1',
+ ],
+ 'cflags_cc': [
+- '-Ofast',
++ '-O2',
+ '-flto',
++ '-pipe',
++ '-g',
++ '-Wall',
++ '-W',
++ '-fPIC',
++ '-Werror=format-security',
++ '-D_FORTIFY_SOURCE=2',
++ '-fexceptions',
++ '-fstack-protector-strong --param=ssp-buffer-size=4',
++ '-grecord-gcc-switches',
+ '-fno-strict-aliasing',
++ '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1',
+ ],
+ 'ldflags': [
+- '-Ofast',
++ '-O2',
+ '-flto',
++ '-specs=/usr/lib/rpm/redhat/redhat-hardened-ld',
+ ],
+ },
+ },
+diff --git a/Telegram/gyp/telegram_sources.txt b/Telegram/gyp/telegram_sources.txt
+index a08b77b..e9cdfdd 100644
+--- a/Telegram/gyp/telegram_sources.txt
++++ b/Telegram/gyp/telegram_sources.txt
+@@ -535,13 +535,7 @@
+ <(src_loc)/structs.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: mac
+ <(sp_media_key_tap_loc)/SPMediaKeyTap.m
+diff --git a/Telegram/gyp/utils.gyp b/Telegram/gyp/utils.gyp
+index 209c737..27ce77f 100644
+--- a/Telegram/gyp/utils.gyp
++++ b/Telegram/gyp/utils.gyp
+@@ -134,7 +134,7 @@
+ '<(libs_loc)/openssl-xcode/include'
+ ],
+ 'library_dirs': [
+- '/usr/local/lib',
++ '<!(rpm --eval "%{_libdir}")',
+ ],
+ }]
+ ],
+@@ -156,7 +156,7 @@
+ '<(libs_loc)/openssl-xcode/include'
+ ],
+ 'library_dirs': [
+- '/usr/local/lib',
++ '<!(rpm --eval "%{_libdir}")',
+ ],
+ }]
+ ],
+diff --git a/lib/xdg/telegramdesktop.appdata.xml b/lib/xdg/telegramdesktop.appdata.xml
+index 7bcf8d8..4508c01 100644
+--- a/lib/xdg/telegramdesktop.appdata.xml
++++ b/lib/xdg/telegramdesktop.appdata.xml
+@@ -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>
+diff --git a/lib/xdg/telegramdesktop.desktop b/lib/xdg/telegramdesktop.desktop
+index 0a80695..550b9f7 100644
+--- a/lib/xdg/telegramdesktop.desktop
++++ b/lib/xdg/telegramdesktop.desktop
+@@ -1,9 +1,11 @@
+ [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
++Exec=/usr/bin/telegram-desktop -- %u
++Icon=telegram-desktop
+ Terminal=false
+ StartupWMClass=TelegramDesktop
+ Type=Application
+--
+2.9.3
+
diff --git a/sources b/sources
index e69de29..47359eb 100644
--- a/sources
+++ b/sources
@@ -0,0 +1,4 @@
+1ac9a7ddda444ccaa53f26887dd07700 GSL-3819df6.tar.gz
+25f0e2a2cd43ab48eedc61244e02952f gyp-a7055b3.tar.gz
+c7bc514a4b73272aec4e896f5738d975 tdesktop-1.0.32.tar.gz
+8cb2c878f46705b0295f77e9f1a8890c variant-916139a.tar.gz
diff --git a/tdesktop-1.0.32-russian.strings b/tdesktop-1.0.32-russian.strings
new file mode 100644
index 0000000..9105ef8
Binary files /dev/null and b/tdesktop-1.0.32-russian.strings differ
diff --git a/telegram-desktop.spec b/telegram-desktop.spec
new file mode 100644
index 0000000..41c8fda
--- /dev/null
+++ b/telegram-desktop.spec
@@ -0,0 +1,462 @@
+# Telegram Desktop's constants...
+%global appname tdesktop
+
+# Git revision of GYP...
+%global commit1 a7055b3989c1074adca03b4b4829e7f0e57f6efd
+%global shortcommit1 %(c=%{commit1}; echo ${c:0:7})
+
+# Git revision of GSL...
+%global commit2 3819df6e378ffccf0e29465afe99c3b324c2aa70
+%global shortcommit2 %(c=%{commit2}; echo ${c:0:7})
+
+# Git revision of Variant...
+%global commit3 916139a2e51e125816efce6e19d428385601273f
+%global shortcommit3 %(c=%{commit3}; echo ${c:0:7})
+
+Summary: Telegram is a new era of messaging
+Name: telegram-desktop
+Version: 1.0.32
+Release: 1%{?dist}
+
+# Application and 3rd-party modules licensing:
+# * S0 (Telegram Desktop) - GPLv3+ with OpenSSL exception -- main source;
+# * S1 (GYP) - BSD -- build-time dependency;
+# * S2 (GSL) - MIT -- build-time dependency;
+# * S3 (Variant) - BSD -- build-time dependency;
+# * S4 (Russian language pack) - GPLv3 -- bundled into executable.
+License: GPLv3+ and GPLv3 and LGPLv3 and BSD and MIT
+Group: Applications/Internet
+URL: https://github.com/telegramdesktop/%{appname}
+
+Source0: %{url}/archive/v%{version}.tar.gz#/%{appname}-%{version}.tar.gz
+Source1: https://chromium.googlesource.com/external/gyp/+archive/%{commit1}.tar.gz...
+Source2: https://github.com/Microsoft/GSL/archive/%{commit2}.tar.gz#/GSL-%{shortco...
+Source3: https://github.com/mapbox/variant/archive/%{commit3}.tar.gz#/variant-%{sh...
+Source4: https://tlgrm.ru/files/locales/tdesktop/Russian.strings#/%{appname}-%{ver...
+
+Patch0: fix_build_under_fedora.patch
+Patch1: add_russian_locale.patch
+
+Requires: hicolor-icon-theme
+Requires: qt5-qtimageformats%{?_isa}
+Recommends: libappindicator-gtk3%{?_isa}
+
+BuildRequires: desktop-file-utils
+BuildRequires: libappstream-glib
+BuildRequires: ffmpeg-devel >= 3.1
+BuildRequires: gcc
+BuildRequires: gcc-c++
+BuildRequires: qt5-qtbase-devel
+BuildRequires: qt5-qtimageformats
+BuildRequires: chrpath
+BuildRequires: cmake
+BuildRequires: libproxy-devel
+BuildRequires: libxcb-devel
+BuildRequires: libogg-devel
+BuildRequires: xz-devel
+BuildRequires: minizip-devel
+BuildRequires: libappindicator-devel
+BuildRequires: libunity-devel
+BuildRequires: libstdc++-devel
+BuildRequires: libwebp-devel
+BuildRequires: libpng-devel
+BuildRequires: xorg-x11-util-macros
+BuildRequires: gettext-devel
+BuildRequires: libICE-devel
+BuildRequires: libSM-devel
+BuildRequires: libXi-devel
+BuildRequires: zlib-devel
+BuildRequires: opus-devel
+BuildRequires: portaudio-devel
+BuildRequires: openal-soft-devel
+BuildRequires: xcb-util-devel
+BuildRequires: xcb-util-wm-devel
+BuildRequires: xcb-util-xrm-devel
+BuildRequires: xcb-util-image-devel
+BuildRequires: xcb-util-cursor-devel
+BuildRequires: xcb-util-keysyms-devel
+BuildRequires: xcb-util-renderutil-devel
+BuildRequires: libva-devel
+BuildRequires: libvdpau-devel
+BuildRequires: libxkbcommon-devel
+BuildRequires: libxkbcommon-x11-devel
+BuildRequires: harfbuzz-devel
+BuildRequires: gtk3-devel
+%if 0%{?fedora} >= 26
+BuildRequires: compat-openssl10-devel
+%else
+BuildRequires: openssl-devel
+%endif
+
+%description
+Telegram is a messaging app with a focus on speed and security, it’s super
+fast, simple and free. You can use Telegram on all your devices at the same
+time — your messages sync seamlessly across any of your phones, tablets or
+computers.
+
+With Telegram, you can send messages, photos, videos and files of any type
+(doc, zip, mp3, etc), as well as create groups for up to 200 people. You can
+write to your phone contacts and find people by their usernames. As a result,
+Telegram is like SMS and email combined — and can take care of all your
+personal or business messaging needs.
+
+%prep
+# Unpacking Telegram Desktop source archive...
+%autosetup -n %{appname}-%{version} -p1
+
+# Unpacking GYP...
+mkdir -p third_party/gyp
+pushd third_party/gyp
+ tar -xf %{SOURCE1}
+ patch -p1 -i ../../Telegram/Patches/gyp.diff
+popd
+
+# Unpacking GSL...
+pushd third_party
+ rm -rf GSL
+ tar -xf %{SOURCE2}
+ mv GSL-%{commit2} GSL
+popd
+
+# Unpacking Variant...
+pushd third_party
+ rm -rf variant
+ tar -xf %{SOURCE3}
+ mv variant-%{commit3} variant
+popd
+
+# Unpacking additional locales from sources...
+iconv -f "UTF-16" -t "UTF-8" "%{SOURCE4}" > Telegram/Resources/langs/lang_ru.strings
+
+%build
+# Exporting correct build flags...
+export CFLAGS="%{optflags}"
+export CXXFLAGS="%{optflags}"
+export LDFLAGS="%{__global_ldflags}"
+
+# Generating cmake script using GYP...
+pushd Telegram
+ gyp/refresh.sh
+popd
+
+# Building Telegram Desktop...
+pushd out/Release
+ %make_build
+popd
+
+%install
+# Installing executables...
+mkdir -p "%{buildroot}%{_bindir}"
+chrpath -d out/Release/Telegram
+install -m 755 out/Release/Telegram "%{buildroot}%{_bindir}/%{name}"
+
+# Installing desktop shortcut...
+mv lib/xdg/telegramdesktop.desktop lib/xdg/%{name}.desktop
+desktop-file-install --dir="%{buildroot}%{_datadir}/applications" lib/xdg/%{name}.desktop
+
+# Installing icons...
+for size in 16 32 48 64 128 256 512; do
+ dir="%{buildroot}%{_datadir}/icons/hicolor/${size}x${size}/apps"
+ install -d "$dir"
+ install -m 644 -p Telegram/Resources/art/icon${size}.png "$dir/%{name}.png"
+done
+
+# Installing tg protocol handler...
+install -d "%{buildroot}%{_datadir}/kde4/services"
+install -m 644 -p lib/xdg/tg.protocol "%{buildroot}%{_datadir}/kde4/services/tg.protocol"
+
+# Installing appdata for Gnome Software...
+install -d "%{buildroot}%{_datadir}/appdata"
+install -m 644 -p lib/xdg/telegramdesktop.appdata.xml "%{buildroot}%{_datadir}/appdata/%{name}.appdata.xml"
+
+%check
+appstream-util validate-relax --nonet "%{buildroot}%{_datadir}/appdata/%{name}.appdata.xml"
+
+%post
+%if 0%{?fedora} <= 23 || 0%{?rhel} == 7
+/bin/touch --no-create %{_datadir}/mime/packages &>/dev/null || :
+%endif
+/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
+%if 0%{?fedora} <= 24 || 0%{?rhel} == 7
+/usr/bin/update-desktop-database &> /dev/null || :
+%endif
+
+%postun
+if [ $1 -eq 0 ] ; then
+ %if 0%{?fedora} <= 23 || 0%{?rhel} == 7
+ /usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
+ %endif
+ /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
+ /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
+fi
+%if 0%{?fedora} <= 24 || 0%{?rhel} == 7
+/usr/bin/update-desktop-database &> /dev/null || :
+%endif
+
+%posttrans
+%if 0%{?fedora} <= 23 || 0%{?rhel} == 7
+/usr/bin/update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :
+%endif
+/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
+
+%files
+%doc README.md changelog.txt
+%license LICENSE
+%{_bindir}/%{name}
+%{_datadir}/applications/%{name}.desktop
+%{_datadir}/kde4/services/tg.protocol
+%{_datadir}/icons/hicolor/*/apps/%{name}.png
+%{_datadir}/appdata/%{name}.appdata.xml
+
+%changelog
+* Thu Apr 13 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.32-1
+- Updated to 1.0.32 (alpha).
+
+* Tue Apr 11 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.31-1
+- Updated to 1.0.31 (alpha).
+
+* Wed Apr 05 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.29-1
+- Updated to 1.0.29.
+
+* Tue Apr 04 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.28-1
+- Updated to 1.0.28 (alpha).
+
+* Mon Apr 03 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.27-3
+- Strip binary into debuginfo subpackage.
+
+* Sat Apr 01 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.27-2
+- Built against system Qt.
+
+* Fri Mar 31 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.27-1
+- Updated to 1.0.27.
+
+* Thu Mar 30 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.26-3
+- Fixed build under GCC 7.0.
+
+* Thu Mar 30 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.26-2
+- Backported patch to fix build under Fedora 26+.
+
+* Thu Mar 30 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.26-1
+- Updated to 1.0.26.
+
+* Wed Mar 22 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.25-1
+- Updated to 1.0.25 (alpha).
+
+* Sun Mar 19 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.24-1
+- Updated to 1.0.24 (alpha).
+
+* Fri Mar 17 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.23-2
+- Added additional russian locale.
+
+* Wed Mar 15 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.23-1
+- Updated to 1.0.23 (alpha).
+
+* Mon Mar 13 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.22-1
+- Updated to 1.0.22 (alpha).
+
+* Sat Mar 11 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.21-1
+- Updated to 1.0.21 (alpha).
+- Updated GSL build stage. Added Variant to build.
+
+* Thu Mar 09 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.20-1
+- Updated to 1.0.20 (alpha).
+
+* Wed Mar 08 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.19-1
+- Updated to 1.0.19 (alpha).
+
+* Sat Mar 04 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.18-2
+- Fixed build of latest commits. Added GSL support.
+
+* Thu Mar 02 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.18-1
+- Updated to 1.0.18 (alpha).
+
+* Tue Feb 28 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.17-1
+- Updated to 1.0.17 (alpha).
+
+* Mon Feb 27 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.15-1
+- Updated to 1.0.15 (alpha).
+
+* Tue Feb 21 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.14-1
+- Updated to 1.0.14.
+
+* Mon Feb 20 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.13-1
+- Updated to 1.0.13.
+- Added changelog.txt to documents.
+
+* Sun Feb 19 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.12-1
+- Updated to 1.0.12.
+
+* Fri Feb 17 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.11-1
+- Updated to 1.0.11 (alpha).
+
+* Sun Feb 12 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.9-1
+- Updated to 1.0.9 (alpha).
+- Updated GYP, Breakpad and LSS to latest commits.
+
+* Thu Feb 02 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.6-2
+- Backported QTBUG-56514 patch to fix building under GCC 7.0.
+
+* Wed Feb 01 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.6-1
+- Updated to 1.0.6.
+
+* Fri Jan 27 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.3-1
+- Updated to 1.0.3 (alpha).
+
+* Thu Jan 19 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.2-1
+- Updated to 1.0.2.
+
+* Tue Jan 17 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.1-1
+- Updated to 1.0.1.
+
+* Thu Jan 12 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.0.0-1
+- Updated to 1.0.0.
+
+* Wed Jan 11 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 0.10.27-1
+- Updated to 0.10.27 (alpha).
+
+* Sat Jan 07 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 0.10.26-1
+- Updated to 0.10.26 (alpha).
+
+* Thu Jan 05 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 0.10.25-1
+- Updated to 0.10.25 (alpha). Added patch to build with GCC 6.3.1.
+
+* Mon Jan 02 2017 Vitaly Zaitsev <vitaly(a)easycoding.org> - 0.10.23-1
+- Updated to 0.10.23 (alpha). Updated externals to latest commits.
+
+* Tue Dec 20 2016 Vitaly Zaitsev <vitaly(a)easycoding.org> - 0.10.20-1
+- Updated to 0.10.20.
+
+* Sun Oct 30 2016 Vitaly Zaitsev <vitaly(a)easycoding.org> - 0.10.19-2
+- Fixed build under Fedora Rawhide (26).
+
+* Tue Oct 25 2016 Vitaly Zaitsev <vitaly(a)easycoding.org> - 0.10.19-1
+- Updated to 0.10.19.
+
+* Fri Oct 21 2016 Vitaly Zaitsev <vitaly(a)easycoding.org> - 0.10.16-2
+- Use specified revisions of 3rd-party libraries.
+
+* Thu Oct 20 2016 Vitaly Zaitsev <vitaly(a)easycoding.org> - 0.10.16-1
+- Updated to 0.10.16.
+
+* Wed Oct 19 2016 Vitaly Zaitsev <vitaly(a)easycoding.org> - 0.10.15-1
+- Updated to 0.10.15.
+
+* Tue Oct 18 2016 Vitaly Zaitsev <vitaly(a)easycoding.org> - 0.10.14-1
+- Updated to 0.10.14.
+
+* Sat Oct 08 2016 Vitaly Zaitsev <vitaly(a)easycoding.org> - 0.10.11-3
+- GYP will now export correct build flags for project.
+
+* Sat Oct 08 2016 Vitaly Zaitsev <vitaly(a)easycoding.org> - 0.10.11-2
+- Will use configure macro to export correct build flags.
+
+* Mon Oct 03 2016 Vitaly Zaitsev <vitaly(a)easycoding.org> - 0.10.11-1
+- Updated to 0.10.11.
+
+* Wed Sep 21 2016 Vitaly Zaitsev <vitaly(a)easycoding.org> - 0.10.7-1
+- Updated to 0.10.7.
+
+* Tue Sep 20 2016 Vitaly Zaitsev <vitaly(a)easycoding.org> - 0.10.6-3
+- Added new patch to build project using systemwide cmake.
+
+* Sat Sep 17 2016 Vitaly Zaitsev <vitaly(a)easycoding.org> - 0.10.6-2
+- Created new SPEC.
+- Added installation of tg protocol and mime-handler.
+
+* Wed Sep 14 2016 Arkady L. Shane <ashejn(a)russianfedora.pro> 0.10.6-1
+- update to 0.10.6
+
+* Mon Aug 8 2016 Arkady L. Shane <ashejn(a)russianfedora.pro> 0.10.1-2
+- added appdata file
+
+* Mon Aug 8 2016 Arkady L. Shane <ashejn(a)russianfedora.pro> 0.10.1-1
+- update to 0.10.1
+
+* Thu Aug 4 2016 Arkady L. Shane <ashejn(a)russianfedora.pro> 0.10.0-1
+- update to 0.10.0
+
+* Mon Jun 27 2016 Arkady L. Shane <ashejn(a)russianfedora.pro> - 0.9.56-1.R
+- update to 0.9.56
+
+* Thu Jun 16 2016 Arkady L. Shane <ashejn(a)russianfedora.pro> - 0.9.51-1.R
+- update to 0.9.51
+
+* Wed May 25 2016 Arkady L. Shane <ashejn(a)russianfedora.pro> - 0.9.49-1.R
+- update to 0.9.49
+
+* Wed May 11 2016 Arkady L. Shane <ashejn(a)russianfedora.pro> - 0.9.48-1.R
+- update to 0.9.48
+
+* Thu Apr 14 2016 Arkady L. Shane <ashejn(a)russianfedora.pro> - 0.9.42-1.R
+- update to 0.9.42
+
+* Wed Apr 13 2016 Arkady L. Shane <ashejn(a)russianfedora.pro> - 0.9.41-1.R
+- update to 0.9.41
+
+* Tue Apr 5 2016 Arkady L. Shane <ashejn(a)russianfedora.pro> - 0.9.40-1.R
+- update to 0.9.40
+
+* Wed Mar 16 2016 Arkady L. Shane <ashejn(a)russianfedora.pro> - 0.9.33-1.R
+- update to 0.9.33
+
+* Tue Mar 15 2016 Arkady L. Shane <ashejn(a)russianfedora.pro> - 0.9.32-1.R
+- update to 0.9.32
+
+* Mon Feb 29 2016 Arkady L. Shane <ashejn(a)russianfedora.pro> - 0.9.28-1.R
+- update to 0.9.28
+
+* Tue Feb 23 2016 Arkady L. Shane <ashejn(a)russianfedora.pro> - 0.9.26-1.R
+- update to 0.9.26
+
+* Wed Feb 17 2016 Arkady L. Shane <ashejn(a)russianfedora.pro> - 0.9.24-1.R
+- update to 0.9.18
+
+* Sun Jan 10 2016 Arkady L. Shane <ashejn(a)russianfedora.pro> - 0.9.18-1.R
+- update to 0.9.18
+
+* Thu Dec 10 2015 Arkady L. Shane <ashejn(a)russianfedora.pro> - 0.9.15-1.R
+- update to 0.9.15
+
+* Thu Nov 26 2015 Arkady L. Shane <ashejn(a)russianfedora.pro> - 0.9.13-1.R
+- update to 0.9.13
+
+* Fri Nov 13 2015 Arkady L. Shane <ashejn(a)russianfedora.pro> - 0.9.10-1.R
+- update to 0.9.10
+
+* Tue Oct 27 2015 Arkady L. Shane <ashejn(a)russianfedora.pro> - 0.9.6-1.R
+- clean up spec
+- update to 0.9.6
+
+* Mon Aug 03 2015 rommon <rommon(a)t-online.de> - 0.8.45-1
+- update to new version
+
+* Sat Jul 18 2015 rommon <rommon(a)t-online.de> - 0.8.38-1
+- update to new version
+
+* Fri Jun 26 2015 rommon <rommon(a)t-online.de> - 0.8.32-1
+- update to new version
+- rename from telegram to telegram-desktop
+
+* Tue Jun 9 2015 rommon <rommon(a)t-online.de> - 0.8.24-1
+- update to new version
+
+* Fri May 1 2015 rommon <rommon(a)t-online.de> - 0.8.11-1
+- update to new version
+
+* Mon Apr 27 2015 rommon <rommon(a)t-online.de> - 0.8.7-1
+- update to new version
+
+* Mon Apr 27 2015 rommon <rommon(a)t-online.de> - 0.8.4-5
+- fix icon permissions
+
+* Fri Apr 24 2015 rommon <rommon(a)t-online.de> - 0.8.4-4
+- fix desktop file
+
+* Tue Apr 21 2015 rommon <rommon(a)t-online.de> - 0.8.4-3
+- changed desktop file
+
+* Tue Apr 21 2015 rommon <rommon(a)t-online.de> - 0.8.4-2
+- adaption for 32/64 bit builds
+
+* Tue Apr 21 2015 rommon <rommon(a)t-online.de> - 0.8.4-1
+- initial package
7 years, 7 months