commit 5deaebbc054807298fa7830951019bebe20e5697
Author: Vitaly Zaitsev <vitaly(a)easycoding.org>
Date: Fri Mar 9 14:19:21 2018 +0100
Fixed build under Rawhide.
telegram-desktop-build-fixes.patch | 99 ++++++++++++++++++++++++++++++++------
telegram-desktop.spec | 1 +
2 files changed, 86 insertions(+), 14 deletions(-)
---
diff --git a/telegram-desktop-build-fixes.patch b/telegram-desktop-build-fixes.patch
index 3df70da..55563c6 100644
--- a/telegram-desktop-build-fixes.patch
+++ b/telegram-desktop-build-fixes.patch
@@ -1,4 +1,4 @@
-From a9e7e1727145cef91fcf40f5950ab09df9e10656 Mon Sep 17 00:00:00 2001
+From 6fa7caa33fa5604dc9099389b8381e3f160320cd 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.
@@ -9,16 +9,17 @@ Subject: [PATCH] Fixed build under Fedora using rpmbuild and mock.
Telegram/SourceFiles/qt_functions.cpp | 94 +++++++++++++++++++++++++++++++
Telegram/gyp/CMakeLists.inj | 3 +
Telegram/gyp/PrecompiledHeader.cmake | 4 +-
- Telegram/gyp/Telegram.gyp | 27 ++-------
- Telegram/gyp/qt.gypi | 81 +++++++-------------------
- Telegram/gyp/qt_moc.gypi | 3 +-
+ Telegram/gyp/Telegram.gyp | 29 +++-------
+ Telegram/gyp/codegen_rules.gypi | 8 +--
+ Telegram/gyp/qt.gypi | 87 ++++++++--------------------
+ Telegram/gyp/qt_moc.gypi | 5 +-
Telegram/gyp/qt_rcc.gypi | 2 +-
Telegram/gyp/settings_linux.gypi | 5 --
- Telegram/gyp/telegram_linux.gypi | 84 +++++++--------------------
+ Telegram/gyp/telegram_linux.gypi | 86 +++++++---------------------
Telegram/gyp/telegram_sources.txt | 9 +--
lib/xdg/telegramdesktop.appdata.xml | 2 +-
lib/xdg/telegramdesktop.desktop | 6 +-
- 14 files changed, 156 insertions(+), 167 deletions(-)
+ 15 files changed, 166 insertions(+), 177 deletions(-)
create mode 100644 Telegram/SourceFiles/qt_functions.cpp
create mode 100644 Telegram/gyp/CMakeLists.inj
@@ -177,7 +178,7 @@ index 5d6830e9..c3f08d3f 100644
IMPLICIT_DEPENDS CXX "${_pch_header}"
COMMENT "Precompiling ${_name} for ${_target} (C++)")
diff --git a/Telegram/gyp/Telegram.gyp b/Telegram/gyp/Telegram.gyp
-index 62a4197f..a500611a 100644
+index 62a4197f..9e5379b9 100644
--- a/Telegram/gyp/Telegram.gyp
+++ b/Telegram/gyp/Telegram.gyp
@@ -18,7 +18,6 @@
@@ -188,7 +189,13 @@ index 62a4197f..a500611a 100644
'sp_media_key_tap_loc': '<(submodules_loc)/SPMediaKeyTap',
'emoji_suggestions_loc':
'<(submodules_loc)/emoji_suggestions',
'style_files': [
-@@ -54,8 +53,6 @@
+@@ -49,13 +48,11 @@
+ 'pt-BR',
+ ],
+ 'build_defines%': '',
+- 'list_sources_command': 'python <(DEPTH)/list_sources.py --input
<(DEPTH)/telegram_sources.txt --replace src_loc=<(src_loc)',
++ 'list_sources_command': 'python2 <(DEPTH)/list_sources.py --input
<(DEPTH)/telegram_sources.txt --replace src_loc=<(src_loc)',
+ },
'includes': [
'common_executable.gypi',
'telegram_qrc.gypi',
@@ -246,8 +253,46 @@ index 62a4197f..a500611a 100644
],
}],
],
+diff --git a/Telegram/gyp/codegen_rules.gypi b/Telegram/gyp/codegen_rules.gypi
+index bb611a87..a2e54f67 100644
+--- a/Telegram/gyp/codegen_rules.gypi
++++ b/Telegram/gyp/codegen_rules.gypi
+@@ -15,7 +15,7 @@
+ '<(SHARED_INTERMEDIATE_DIR)/update_dependent_styles.timestamp',
+ ],
+ 'action': [
+- 'python', '<(DEPTH)/update_dependent.py', '--styles',
++ 'python2', '<(DEPTH)/update_dependent.py', '--styles',
+ '-I', '<(res_loc)', '-I', '<(src_loc)',
+ '-o',
'<(SHARED_INTERMEDIATE_DIR)/update_dependent_styles.timestamp',
+ '<@(style_files)',
+@@ -26,13 +26,13 @@
+ 'inputs': [
+ '<(DEPTH)/update_dependent.py',
+ '<@(qrc_files)',
+- '<!@(python <(DEPTH)/update_dependent.py --qrc_list
<@(qrc_files))',
++ '<!@(python2 <(DEPTH)/update_dependent.py --qrc_list
<@(qrc_files))',
+ ],
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/update_dependent_qrc.timestamp',
+ ],
+ 'action': [
+- 'python', '<(DEPTH)/update_dependent.py', '--qrc',
++ 'python2', '<(DEPTH)/update_dependent.py', '--qrc',
+ '-o',
'<(SHARED_INTERMEDIATE_DIR)/update_dependent_qrc.timestamp',
+ '<@(qrc_files)',
+ ],
+@@ -109,7 +109,7 @@
+ '<(SHARED_INTERMEDIATE_DIR)/scheme.h',
+ ],
+ 'action': [
+- 'python', '<(src_loc)/codegen/scheme/codegen_scheme.py',
++ 'python2', '<(src_loc)/codegen/scheme/codegen_scheme.py',
+ '-o', '<(SHARED_INTERMEDIATE_DIR)',
'<(res_loc)/scheme.tl',
+ ],
+ 'message': 'codegen_scheme-ing scheme.tl..',
diff --git a/Telegram/gyp/qt.gypi b/Telegram/gyp/qt.gypi
-index 0b783ec2..2d42d344 100644
+index 0b783ec2..653562ff 100644
--- a/Telegram/gyp/qt.gypi
+++ b/Telegram/gyp/qt.gypi
@@ -14,25 +14,21 @@
@@ -278,7 +323,7 @@ index 0b783ec2..2d42d344 100644
}]
]
},
-@@ -72,32 +68,13 @@
+@@ -72,44 +68,25 @@
],
}],
[ 'build_linux', {
@@ -314,6 +359,21 @@ index 0b783ec2..2d42d344 100644
],
}],
],
+ },
+ 'qt_version%': '<(qt_version)',
+ 'qt_loc_unix': '<(qt_loc_unix)',
+- 'qt_version_loc': '<!(python -c
"print(\'<(qt_version)\'.replace(\'.\',
\'_\'))")',
++ 'qt_version_loc': '<!(python2 -c
"print(\'<(qt_version)\'.replace(\'.\',
\'_\'))")',
+ 'qt_libs_debug': [
+- '<!@(python -c "for s in \'<(a)(qt_libs)\'.split(\'
\'): print(\'<(qt_lib_prefix)\' + s +
\'<(qt_lib_debug_postfix)\')")',
++ '<!@(python2 -c "for s in \'<(a)(qt_libs)\'.split(\'
\'): print(\'<(qt_lib_prefix)\' + s +
\'<(qt_lib_debug_postfix)\')")',
+ ],
+ 'qt_libs_release': [
+- '<!@(python -c "for s in \'<(a)(qt_libs)\'.split(\'
\'): print(\'<(qt_lib_prefix)\' + s +
\'<(qt_lib_release_postfix)\')")',
++ '<!@(python2 -c "for s in \'<(a)(qt_libs)\'.split(\'
\'): print(\'<(qt_lib_prefix)\' + s +
\'<(qt_lib_release_postfix)\')")',
+ ],
+ },
+ 'qt_libs_debug': [ '<@(qt_libs_debug)' ],
@@ -122,16 +99,11 @@
'qt_loc': '<(qt_loc_unix)',
}],
@@ -403,10 +463,10 @@ index 0b783ec2..2d42d344 100644
'-rdynamic',
],
diff --git a/Telegram/gyp/qt_moc.gypi b/Telegram/gyp/qt_moc.gypi
-index 464d3c81..4f4d9cef 100644
+index 464d3c81..909c4c5a 100644
--- a/Telegram/gyp/qt_moc.gypi
+++ b/Telegram/gyp/qt_moc.gypi
-@@ -12,11 +12,12 @@
+@@ -12,12 +12,13 @@
'<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/moc/moc_<(RULE_INPUT_ROOT).cpp',
],
'action': [
@@ -416,10 +476,12 @@ index 464d3c81..4f4d9cef 100644
# Silence "Note: No relevant classes found. No output generated."
'--no-notes',
+- '<!@(python -c "for s in \'<(a)(_defines)\'.split(\'
\'): print(\'-D\' + s)")',
+ '<!@(rpm --eval "%{optflags}" | grep -Po
"[-]([IDU]\s*\S*|E)")',
- '<!@(python -c "for s in \'<(a)(_defines)\'.split(\'
\'): print(\'-D\' + s)")',
++ '<!@(python2 -c "for s in \'<(a)(_defines)\'.split(\'
\'): print(\'-D\' + s)")',
# '<!@(python -c "for s in
\'<(a)(_include_dirs)\'.split(\' \'): print(\'-I\' +
s)")',
'<(RULE_INPUT_PATH)',
+ '-o',
'<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/moc/moc_<(RULE_INPUT_ROOT).cpp',
diff --git a/Telegram/gyp/qt_rcc.gypi b/Telegram/gyp/qt_rcc.gypi
index f5624a82..b644ce29 100644
--- a/Telegram/gyp/qt_rcc.gypi
@@ -457,9 +519,18 @@ index a4b5f58a..9658b5c3 100644
],
'cflags_c': [
diff --git a/Telegram/gyp/telegram_linux.gypi b/Telegram/gyp/telegram_linux.gypi
-index a5b4b197..05d3dca2 100644
+index a5b4b197..19aefb6b 100644
--- a/Telegram/gyp/telegram_linux.gypi
+++ b/Telegram/gyp/telegram_linux.gypi
+@@ -7,7 +7,7 @@
+ {
+ 'conditions': [[ 'build_linux', {
+ 'variables': {
+- 'not_need_gtk%': '<!(python -c
"print(\'TDESKTOP_DISABLE_GTK_INTEGRATION\' in
\'<(build_defines)\')")',
++ 'not_need_gtk%': '<!(python2 -c
"print(\'TDESKTOP_DISABLE_GTK_INTEGRATION\' in
\'<(build_defines)\')")',
+ 'pkgconfig_libs': [
+ # In order to work libxkbcommon must be linked statically,
+ # PKGCONFIG links it like "-L/usr/local/lib -lxkbcommon"
@@ -15,99 +15,53 @@
# QApplication() -> createPlatformIntegration -> QXcbIntegrationPlugin::create
#'xkbcommon',
diff --git a/telegram-desktop.spec b/telegram-desktop.spec
index 07625a5..0c41aba 100644
--- a/telegram-desktop.spec
+++ b/telegram-desktop.spec
@@ -57,6 +57,7 @@ BuildRequires: opus-devel
BuildRequires: gtk3-devel
BuildRequires: dee-devel
BuildRequires: xz-devel
+BuildRequires: python2
%description
Telegram is a messaging app with a focus on speed and security, it’s super