1
0
Xu Zhao 2016-11-13 02:07:38 +00:00 committed by Git OBS Bridge
parent 9b7d63374a
commit ca23f4b9a8
6 changed files with 616 additions and 2080 deletions

3
gyp-master.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d1aadeb32f93abfef23c120497403d36b69c9d13a377580450fd561bacaf99c3
size 625904

494
patch.diff Normal file
View File

@ -0,0 +1,494 @@
diff --git a/Telegram/SourceFiles/platform/linux/linux_libs.cpp b/Telegram/SourceFiles/platform/linux/linux_libs.cpp
index a9731ce..2bb4468 100644
--- a/Telegram/SourceFiles/platform/linux/linux_libs.cpp
+++ b/Telegram/SourceFiles/platform/linux/linux_libs.cpp
@@ -45,6 +45,7 @@ bool loadLibrary(QLibrary &lib, const char *name, int version) {
}
bool setupGtkBase(QLibrary &lib_gtk) {
+ load(lib_gtk, "gdk_set_allowed_backends", gdk_set_allowed_backends);
if (!load(lib_gtk, "gtk_init_check", gtk_init_check)) return false;
if (!load(lib_gtk, "gtk_menu_new", gtk_menu_new)) return false;
if (!load(lib_gtk, "gtk_menu_get_type", gtk_menu_get_type)) return false;
@@ -106,6 +107,10 @@ bool setupGtkBase(QLibrary &lib_gtk) {
if (!load(lib_gtk, "g_slist_free", g_slist_free)) return false;
DEBUG_LOG(("Library gtk functions loaded!"));
+ if (gdk_set_allowed_backends != nullptr) {
+ gdk_set_allowed_backends("x11");
+ }
+
if (!gtk_init_check(0, 0)) {
gtk_init_check = nullptr;
DEBUG_LOG(("Failed to gtk_init_check(0, 0)!"));
@@ -128,6 +133,7 @@ bool setupAppIndicator(QLibrary &lib_indicator) {
} // namespace
+f_gdk_set_allowed_backends gdk_set_allowed_backends = nullptr;
f_gtk_init_check gtk_init_check = nullptr;
f_gtk_menu_new gtk_menu_new = nullptr;
f_gtk_menu_get_type gtk_menu_get_type = nullptr;
diff --git a/Telegram/SourceFiles/platform/linux/linux_libs.h b/Telegram/SourceFiles/platform/linux/linux_libs.h
index bc3dce6..07c5042 100644
--- a/Telegram/SourceFiles/platform/linux/linux_libs.h
+++ b/Telegram/SourceFiles/platform/linux/linux_libs.h
@@ -52,6 +52,9 @@ bool load(QLibrary &lib, const char *name, Function &func) {
return false;
}
+typedef void (*f_gdk_set_allowed_backends)(const gchar *backends);
+extern f_gdk_set_allowed_backends gdk_set_allowed_backends;
+
typedef gboolean (*f_gtk_init_check)(int *argc, char ***argv);
extern f_gtk_init_check gtk_init_check;
diff --git a/Telegram/gyp/Telegram.gyp b/Telegram/gyp/Telegram.gyp
index f6609c1..76cd33b 100644
--- a/Telegram/gyp/Telegram.gyp
+++ b/Telegram/gyp/Telegram.gyp
@@ -78,19 +78,17 @@
],
'defines': [
- 'AL_LIBTYPE_STATIC',
'<!@(python -c "for s in \'<(travis_defines)\'.split(\',\'): print(s)")',
+ '__STDC_FORMAT_MACROS',
+ 'TDESKTOP_DISABLE_AUTOUPDATE',
+ 'TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME',
+ '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)',
],
diff --git a/Telegram/gyp/qt.gypi b/Telegram/gyp/qt.gypi
index 24ededb..bb9b56b 100644
--- a/Telegram/gyp/qt.gypi
+++ b/Telegram/gyp/qt.gypi
@@ -38,7 +38,6 @@
'Qt5Network',
'Qt5Widgets',
'Qt5Gui',
- 'qtharfbuzzng',
],
'qt_version%': '<(qt_version)',
'linux_path_qt%': '/usr/local/tdesktop/Qt-<(qt_version)',
@@ -91,19 +90,6 @@
'<@(qt_libs)',
'Qt5DBus',
'Qt5Core',
- 'qtpcre',
- 'Xi',
- 'Xext',
- 'Xfixes',
- 'SM',
- 'ICE',
- 'fontconfig',
- 'expat',
- 'freetype',
- 'xcb-shm',
- 'xcb-xfixes',
- 'xcb-render',
- 'xcb-static',
],
}],
],
@@ -208,7 +194,6 @@
'<(qt_loc)/plugins/platforminputcontexts',
],
'libraries': [
- '<(linux_path_xkbcommon)/lib/libxkbcommon.a',
'<@(qt_libs_release)',
'<(linux_lib_ssl)',
'<(linux_lib_crypto)',
@@ -221,12 +206,31 @@
'gthread-2.0',
'glib-2.0',
'pthread',
+
+ 'Xi',
+ 'Xext',
+ 'Xfixes',
+ 'SM',
+ 'ICE',
+ 'fontconfig',
+ 'expat',
+ 'freetype',
+
+ '<!(pkg-config 2> /dev/null --libs xkbcommon xkbcommon-x11)',
+ '<!(pkg-config 2> /dev/null --libs harfbuzz)',
+ '<!(pkg-config 2> /dev/null --libs libpcre16)',
+ '<!(pkg-config 2> /dev/null --libs zlib)',
+ '<!(pkg-config 2> /dev/null --libs libpng16)',
+ '<!(pkg-config 2> /dev/null --libs libjpeg)',
+ '<!(pkg-config 2> /dev/null --libs libwebp)',
+ '<!(pkg-config 2> /dev/null --libs xcb-shm xcb-xfixes xcb-render xcb-renderutil xcb-sync xcb-randr xcb-xinerama xcb-xkb xcb-icccm xcb-image xcb-shape xcb-keysyms xcb-util)',
+ 'proxy',
+ 'GL',
],
'include_dirs': [
'<(qt_loc)/mkspecs/linux-g++',
],
'ldflags': [
- '-static-libstdc++',
'-pthread',
'-g',
'-rdynamic',
diff --git a/Telegram/gyp/qt.gypi.orig b/Telegram/gyp/qt.gypi.orig
new file mode 100644
index 0000000..bb9b56b
--- /dev/null
+++ b/Telegram/gyp/qt.gypi.orig
@@ -0,0 +1,261 @@
+# 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.
+#
+# In addition, as a special exception, the copyright holders give permission
+# to link the code of portions of this program with the OpenSSL library.
+#
+# Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
+# Copyright (c) 2014 John Preston, https://desktop.telegram.org
+
+{
+ 'variables': {
+ 'variables': {
+ 'variables': {
+ 'variables': {
+ 'variables': {
+ 'conditions': [
+ [ 'build_macold', {
+ 'qt_version%': '5.3.2',
+ }, {
+ 'qt_version%': '5.6.2',
+ }]
+ ],
+ },
+ 'qt_libs': [
+ 'qwebp',
+ 'Qt5PrintSupport',
+ 'Qt5PlatformSupport',
+ 'Qt5Network',
+ 'Qt5Widgets',
+ 'Qt5Gui',
+ ],
+ 'qt_version%': '<(qt_version)',
+ 'linux_path_qt%': '/usr/local/tdesktop/Qt-<(qt_version)',
+ },
+ 'qt_version%': '<(qt_version)',
+ 'qt_loc_unix': '<(linux_path_qt)',
+ 'conditions': [
+ [ 'build_win', {
+ 'qt_lib_prefix': '<(ld_lib_prefix)',
+ 'qt_lib_debug_postfix': 'd<(ld_lib_postfix)',
+ 'qt_lib_release_postfix': '<(ld_lib_postfix)',
+ 'qt_libs': [
+ '<@(qt_libs)',
+ 'Qt5Core',
+ 'qtmain',
+ 'qwindows',
+ 'qtfreetype',
+ 'qtpcre',
+ ],
+ }],
+ [ 'build_mac', {
+ 'qt_lib_prefix': '<(ld_lib_prefix)',
+ 'qt_lib_debug_postfix': '_debug<(ld_lib_postfix)',
+ 'qt_lib_release_postfix': '<(ld_lib_postfix)',
+ 'qt_libs': [
+ '<@(qt_libs)',
+ 'Qt5Core',
+ 'qgenericbearer',
+ 'qcocoa',
+ ],
+ }],
+ [ 'build_mac and not build_macold', {
+ 'qt_libs': [
+ '<@(qt_libs)',
+ 'Qt5Core',
+ 'qtfreetype',
+ 'qtpcre',
+ ],
+ }],
+ [ 'build_linux', {
+ 'qt_lib_prefix': 'lib',
+ 'qt_lib_debug_postfix': '.a',
+ 'qt_lib_release_postfix': '.a',
+ 'qt_libs': [
+ 'qxcb',
+ 'Qt5XcbQpa',
+ 'qconnmanbearer',
+ 'qgenericbearer',
+ 'qnmbearer',
+ '<@(qt_libs)',
+ 'Qt5DBus',
+ 'Qt5Core',
+ ],
+ }],
+ ],
+ },
+ 'qt_version%': '<(qt_version)',
+ 'qt_loc_unix': '<(qt_loc_unix)',
+ 'qt_version_loc': '<!(python -c "print(\'<(qt_version)\'.replace(\'.\', \'_\'))")',
+ 'qt_libs_debug': [
+ '<!@(python -c "for s in \'<@(qt_libs)\'.split(\' \'): print(\'<(qt_lib_prefix)\' + s + \'<(qt_lib_debug_postfix)\')")',
+ ],
+ 'qt_libs_release': [
+ '<!@(python -c "for s in \'<@(qt_libs)\'.split(\' \'): print(\'<(qt_lib_prefix)\' + s + \'<(qt_lib_release_postfix)\')")',
+ ],
+ },
+ 'qt_libs_debug': [ '<@(qt_libs_debug)' ],
+ 'qt_libs_release': [ '<@(qt_libs_release)' ],
+ 'qt_version%': '<(qt_version)',
+ 'conditions': [
+ [ 'build_win', {
+ 'qt_loc': '../../../Libraries/qt<(qt_version_loc)/qtbase',
+ }, {
+ 'qt_loc': '<(qt_loc_unix)',
+ }],
+ ],
+
+ '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': {
+ 'Debug': {
+ 'conditions' : [
+ [ 'build_win', {
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'AdditionalDependencies': [
+ '<@(qt_libs_debug)',
+ ],
+ },
+ },
+ }],
+ [ 'build_mac', {
+ 'xcode_settings': {
+ 'OTHER_LDFLAGS': [
+ '<@(qt_libs_debug)',
+ '/usr/local/lib/libz.a',
+ ],
+ },
+ }],
+ ],
+ },
+ 'Release': {
+ 'conditions' : [
+ [ 'build_win', {
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'AdditionalDependencies': [
+ '<@(qt_libs_release)',
+ ],
+ },
+ },
+ }],
+ [ 'build_mac', {
+ 'xcode_settings': {
+ 'OTHER_LDFLAGS': [
+ '<@(qt_libs_release)',
+ '/usr/local/lib/libz.a',
+ ],
+ },
+ }],
+ ],
+ },
+ },
+
+ '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',
+ ],
+ 'library_dirs': [
+ '<(qt_loc)/lib',
+ '<(qt_loc)/plugins',
+ '<(qt_loc)/plugins/bearer',
+ '<(qt_loc)/plugins/platforms',
+ '<(qt_loc)/plugins/imageformats',
+ ],
+ 'defines': [
+ 'QT_WIDGETS_LIB',
+ 'QT_NETWORK_LIB',
+ 'QT_GUI_LIB',
+ 'QT_CORE_LIB',
+ ],
+ 'conditions': [
+ [ 'build_linux', {
+ 'library_dirs': [
+ '<(qt_loc)/plugins/platforminputcontexts',
+ ],
+ 'libraries': [
+ '<@(qt_libs_release)',
+ '<(linux_lib_ssl)',
+ '<(linux_lib_crypto)',
+ '<!@(python -c "for s in \'<(linux_lib_icu)\'.split(\' \'): print(s)")',
+ 'xcb',
+ 'X11',
+ 'X11-xcb',
+ 'dbus-1',
+ 'dl',
+ 'gthread-2.0',
+ 'glib-2.0',
+ 'pthread',
+
+ 'Xi',
+ 'Xext',
+ 'Xfixes',
+ 'SM',
+ 'ICE',
+ 'fontconfig',
+ 'expat',
+ 'freetype',
+
+ '<!(pkg-config 2> /dev/null --libs xkbcommon xkbcommon-x11)',
+ '<!(pkg-config 2> /dev/null --libs harfbuzz)',
+ '<!(pkg-config 2> /dev/null --libs libpcre16)',
+ '<!(pkg-config 2> /dev/null --libs zlib)',
+ '<!(pkg-config 2> /dev/null --libs libpng16)',
+ '<!(pkg-config 2> /dev/null --libs libjpeg)',
+ '<!(pkg-config 2> /dev/null --libs libwebp)',
+ '<!(pkg-config 2> /dev/null --libs xcb-shm xcb-xfixes xcb-render xcb-renderutil xcb-sync xcb-randr xcb-xinerama xcb-xkb xcb-icccm xcb-image xcb-shape xcb-keysyms xcb-util)',
+ 'proxy',
+ 'GL',
+ ],
+ 'include_dirs': [
+ '<(qt_loc)/mkspecs/linux-g++',
+ ],
+ 'ldflags': [
+ '-pthread',
+ '-g',
+ '-rdynamic',
+ ],
+ }],
+ ],
+
+ 'rules': [{
+ 'rule_name': 'qt_moc',
+ 'extension': 'h',
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/moc/moc_<(RULE_INPUT_ROOT).cpp',
+ ],
+ 'action': [
+ '<(qt_loc)/bin/moc<(exe_ext)',
+
+ # Silence "Note: No relevant classes found. No output generated."
+ '--no-notes',
+
+ '<!@(python -c "for s in \'<@(_defines)\'.split(\' \'): print(\'-D\' + s)")',
+ # '<!@(python -c "for s in \'<@(_include_dirs)\'.split(\' \'): print(\'-I\' + s)")',
+ '<(RULE_INPUT_PATH)',
+ '-o', '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/moc/moc_<(RULE_INPUT_ROOT).cpp',
+ ],
+ 'message': 'Moc-ing <(RULE_INPUT_ROOT).h..',
+ 'process_outputs_as_sources': 1,
+ }],
+}
diff --git a/Telegram/gyp/telegram_linux.gypi b/Telegram/gyp/telegram_linux.gypi
index d07b592..eeb9b25 100644
--- a/Telegram/gyp/telegram_linux.gypi
+++ b/Telegram/gyp/telegram_linux.gypi
@@ -21,11 +21,20 @@
'conditions': [[ 'build_linux', {
'variables': {
'pkgconfig_libs': [
-# In order to work libxkbcommon must be linked statically,
-# PKGCONFIG links it like "-L/usr/local/lib -lxkbcommon"
-# which makes a dynamic link which leads to segfault in
-# QApplication() -> createPlatformIntegration -> QXcbIntegrationPlugin::create
- #'xkbcommon',
+ 'liblzma',
+ 'openal',
+ 'libavformat',
+ 'libavcodec',
+ 'libswresample',
+ 'libswscale',
+ 'libavutil',
+ 'opus',
+ 'libva-x11',
+ 'libva-drm',
+ 'libva',
+ 'libdrm',
+ 'zlib',
+ 'glib-2.0',
],
'linux_path_ffmpeg%': '/usr/local',
'linux_path_openal%': '/usr/local',
@@ -34,44 +43,26 @@
'linux_path_breakpad%': '<(libs_loc)/breakpad',
},
'include_dirs': [
- '/usr/local/include',
- '<(linux_path_ffmpeg)/include',
- '<(linux_path_openal)/include',
'<(linux_path_breakpad)/include/breakpad',
+ '/usr/include',
],
'library_dirs': [
- '/usr/local/lib',
- '<(linux_path_ffmpeg)/lib',
- '<(linux_path_openal)/lib',
- '<(linux_path_libexif_lib)',
- '<(linux_path_va)/lib',
- '<(linux_path_breakpad)/lib',
+ '<(linux_path_breakpad)/src/client/linux',
+ '/usr/lib',
],
'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',
- 'libdrm.a',
- 'libz.a',
-# '<!(pkg-config 2> /dev/null --libs <@(pkgconfig_libs))',
+ '<!(pkg-config 2> /dev/null --libs <@(pkgconfig_libs))',
+ 'libbreakpad_client.a',
],
'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 <@(pkgconfig_libs))',
],
'configurations': {
'Release': {

3
tdesktop-0.10.19.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0620d2c6e2dc254e3d69659d311a6117efef251a16270ba908fec150712b50b4
size 11485857

View File

@ -1,107 +1,84 @@
#
# spec file for package telegram-desktop
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
Name: telegram-desktop
Summary: A new era of messaging
Version: 0.10.19
Release: 1
License: GPL-3.0
URL: https://github.com/telegramdesktop/tdesktop
Source: tdesktop-%{version}.tar.gz
Source1: breakpad-refs-heads-master.tar.gz
Source2: linux-syscall-support-refs-heads-master.tar.gz
Source3: gyp-master.tar.gz
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: telegram-desktop
Version: 0.9.56
Release: 0
Summary: A new era of messaging
License: GPL-3.0
Url: https://github.com/telegramdesktop/tdesktop
Source: https://github.com/telegramdesktop/tdesktop/archive/v%{version}.tar.gz
Source1: breakpad-refs-heads-master.tar.gz
Source2: linux-syscall-support-refs-heads-master.tar.gz
Source3: unity.h
BuildRequires: desktop-file-utils
BuildRequires: gcc5-c++
BuildRequires: hicolor-icon-theme
BuildRequires: libappindicator-devel
BuildRequires: libavdevice-devel
BuildRequires: libavfilter-devel
BuildRequires: libmng-devel
BuildRequires: libopus-devel
BuildRequires: libpng16-devel
BuildRequires: libtelegram-qt5-devel-static
BuildRequires: libtiff-devel
BuildRequires: libwebp-devel
BuildRequires: mtdev-devel
BuildRequires: openal-soft-devel
BuildRequires: pkgconfig
BuildRequires: tslib-devel
BuildRequires: xcb-util-devel
BuildRequires: xcb-util-image-devel
BuildRequires: xcb-util-keysyms-devel
BuildRequires: xcb-util-renderutil-devel
BuildRequires: xcb-util-wm-devel
BuildRequires: xorg-x11-devel
BuildRequires: xz
BuildRequires: pkgconfig(dee-1.0)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(gtk+-2.0)
BuildRequires: pkgconfig(libavcodec)
BuildRequires: pkgconfig(libavformat)
BuildRequires: pkgconfig(libavutil)
BuildRequires: pkgconfig(libcrypto)
BuildRequires: pkgconfig(liblzma)
BuildRequires: pkgconfig(libva)
BuildRequires: pkgconfig(libva-glx)
BuildRequires: pkgconfig(libva-x11)
BuildRequires: pkgconfig(libwebp)
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(xkbcommon)
BuildRequires: pkgconfig(xkbcommon-x11)
# Runtime requirements
Requires: ffmpeg
Requires: hicolor-icon-theme
Requires: icu
Requires: jasper
Requires: openssl
Requires(post): desktop-file-utils
Requires(postun): desktop-file-utils
ExclusiveArch: x86_64
BuildRequires: libtelegram-qt5-devel-static
BuildRequires: gcc5-c++
BuildRequires: libappindicator-devel
BuildRequires: libpng16-devel
BuildRequires: libtiff-devel
BuildRequires: libmng-devel
BuildRequires: libwebp-devel
BuildRequires: cmake
BuildRequires: pkgconfig(libwebp)
BuildRequires: libopus-devel
BuildRequires: xorg-x11-devel
BuildRequires: xz
BuildRequires: openal-soft-devel
BuildRequires: xcb-util-wm-devel
BuildRequires: xcb-util-devel
BuildRequires: xcb-util-image-devel
BuildRequires: xcb-util-renderutil-devel
BuildRequires: xcb-util-keysyms-devel
BuildRequires: mtdev-devel
BuildRequires: tslib-devel
BuildRequires: harfbuzz-devel
BuildRequires: pkgconfig(xkbcommon)
BuildRequires: pkgconfig(xkbcommon-x11)
BuildRequires: pkgconfig(dee-1.0)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(libavcodec)
BuildRequires: pkgconfig(libavformat)
BuildRequires: pkgconfig(libavutil)
BuildRequires: pkgconfig(liblzma)
BuildRequires: libavfilter-devel
BuildRequires: libavdevice-devel
BuildRequires: libproxy-devel
BuildRequires: pkgconfig(libcrypto)
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(gtk+-2.0)
BuildRequires: pkgconfig(libva)
BuildRequires: pkgconfig(fontconfig)
BuildRequires: pcre-devel
BuildRequires: xcb-util-image-devel
BuildRequires: xcb-util-keysyms-devel
BuildRequires: xcb-util-renderutil-devel
BuildRequires: xcb-util-wm-devel
BuildRequires: pkgconfig(freetype2)
BuildRequires: pkgconfig(libva-glx)
BuildRequires: pkgconfig(libva-x11)
BuildRequires: ffmpeg-devel
BuildRequires: libopus-devel
BuildRequires: zlib-devel
BuildRequires: portaudio-devel
BuildRequires: desktop-file-utils
BuildRequires: chrpath
# Runtime requirements
Requires: ffmpeg
Requires: openssl
Requires: hicolor-icon-theme
Requires: icu
Requires: jasper
%description
Telegram Desktop app. A new era of messaging.
%prep
%setup -q -n tdesktop-%{version}
cp %{_sourcedir}/unity.h ./Telegram/SourceFiles/
sed -i 's/CUSTOM_API_ID//g' "./Telegram/Telegram.pro"
sed -i 's,LIBS += %{_prefix}/local/lib/libxkbcommon.a,,g' "./Telegram/Telegram.pro"
sed -i 's,LIBS += %{_prefix}/local/lib/libz.a,LIBS += -lz,g' "./Telegram/Telegram.pro"
sed -i 's,<unity/unity/unity\.h>,"unity.h",g' "./Telegram/SourceFiles/pspecific_linux.cpp"
sed -i 's,<unity/unity/unity\.h>,"unity.h",g' "./Telegram/SourceFiles/platform/linux/linux_libs.h"
sed -i 's/c++11/c++14/g' "./Telegram/Telegram.pro"
# sed -i "s,/usr/local/tdesktop/Qt-5.6.0,%{_builddir}/Libraries/QtStatic,g" "./Telegram/Telegram.pro"
# sed -i "s,5\.6\.0,5.6.0,g" "./Telegram/Telegram.pro"
%setup -n tdesktop-%{version}
cp %{_sourcedir}/patch.diff .
(
echo "DEFINES += TDESKTOP_DISABLE_AUTOUPDATE"
echo "DEFINES += TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME"
echo 'INCLUDEPATH += "%{_libdir}/glib-2.0/include"'
echo 'INCLUDEPATH += "%{_libdir}/gtk-2.0/include"'
echo 'INCLUDEPATH += "%{_includedir}/ffmpeg"'
echo 'INCLUDEPATH += "%{_includedir}/libdbusmenu-glib-0.4"'
echo 'INCLUDEPATH += "%{_includedir}/opus"'
echo 'LIBS += -lcrypto -lssl -lqwebp -lwebp'
) >> "./Telegram/Telegram.pro"
%setup -T -c -n breakpad -b 1
%setup -T -c -n breakpad -b 1
%setup -T -c -n breakpad-lss -b 2
%setup -T -c -n gyp -b 3
%build
# Setup compiler variables
@ -111,9 +88,16 @@ export AR="gcc-ar-5"
mv %{_builddir}/tdesktop-%{version} %{_builddir}/tdesktop
mkdir -p %{_builddir}/Libraries
# patch gyp
cd %{_builddir}/Libraries
ln -s %{_builddir}/gyp ./gyp
cp %{_builddir}/tdesktop/Telegram/Patches/gyp.diff ./gyp/
cd gyp
patch -p1 < ./gyp.diff
# Link with patched Qt Static Library
cd %{_builddir}/Libraries
ln -s %{_libdir}/libtelegram-qt5 ./QtStatic
ln -s /usr/lib64/libtelegram-qt5 ./QtStatic
# Build breakpad
cd %{_builddir}/Libraries
@ -123,89 +107,61 @@ ln -s %{_builddir}/breakpad-lss ./src/third_party/lss
./configure
make
export PATH="%{_libdir}/libtelegram-qt5/bin/:$PATH"
# patch with aur_fixes.diff
cd %{_builddir}/tdesktop
patch -p1 < patch.diff
# Build codegen_style
mkdir -p "%{_builddir}/tdesktop/Linux/obj/codegen_style/Release"
cd %{_builddir}/tdesktop/Linux/obj/codegen_style/Release
qmake QMAKE_CXX="g++-5" QMAKE_LINK="g++-5" \
QT_TDESKTOP_VERSION="5.6.0" \
QT_TDESKTOP_PATH="%{_builddir}/Libraries/QtStatic" \
CONFIG+=release ../../../../Telegram/build/qmake/codegen_style/codegen_style.pro
make
# Build codegen_numbers
mkdir -p "%{_builddir}/tdesktop/Linux/obj/codegen_numbers/Release"
cd %{_builddir}/tdesktop/Linux/obj/codegen_numbers/Release
qmake QMAKE_CXX="g++-5" QMAKE_LINK="g++-5" \
QT_TDESKTOP_VERSION="5.6.0" \
QT_TDESKTOP_PATH="%{_builddir}/Libraries/QtStatic" \
CONFIG+=release ../../../../Telegram/build/qmake/codegen_numbers/codegen_numbers.pro
make
# Build MetaLang
mkdir -p "%{_builddir}/tdesktop/Linux/ReleaseIntermediateLang"
cd %{_builddir}/tdesktop/Linux/ReleaseIntermediateLang
qmake QMAKE_CXX="g++-5" QMAKE_LINK="g++-5" \
QT_TDESKTOP_VERSION="5.6.0" \
QT_TDESKTOP_PATH="%{_builddir}/Libraries/QtStatic" \
CONFIG+=release "../../Telegram/MetaLang.pro"
make
# Build Telegram Desktop
mkdir -p "%{_builddir}/tdesktop/Linux/ReleaseIntermediate"
cd %{_builddir}/tdesktop/Linux/ReleaseIntermediate
./../codegen/Release/codegen_style "-I./../../Telegram/Resources" "-I./../../Telegram/SourceFiles" "-o./../../Telegram/GeneratedFiles/styles" all_files.style --rebuild
./../codegen/Release/codegen_numbers "-o./../../Telegram/GeneratedFiles" "./../../Telegram/Resources/numbers.txt"
./../ReleaseLang/MetaLang -lang_in ./../../Telegram/Resources/langs/lang.strings -lang_out ./../../Telegram/GeneratedFiles/lang_auto
qmake QMAKE_CXX="g++-5" QMAKE_LINK="g++-5" CONFIG+=release \
QT_TDESKTOP_VERSION="5.6.0" \
QT_TDESKTOP_PATH="%{_builddir}/Libraries/QtStatic" \
"../../Telegram/Telegram.pro"
# use gyp to generate cmake files
cd %{_builddir}/tdesktop/Telegram/gyp
# patch qt.gypi to change libxkbcommon path
../../../Libraries/gyp/gyp \
-Dlinux_path_qt="%{_builddir}/Libraries/QtStatic" \
-Dqt_version="5.6.0" \
-Dlinux_lib_ssl=-lssl \
-Dlinux_lib_crypto=-lcrypto \
-Dlinux_lib_icu="-licuuc -licutu -licui18n" \
--depth=. --generator-output="../../" -Goutput_dir=out Telegram.gyp --format=cmake
# build Telegram
cd %{_builddir}/tdesktop/out/Release
cmake . -DCMAKE_ASM_COMPILER=${AR} -DCMAKE_CXX_COMPILER=${CXX}
make
chrpath --delete Telegram
%install
# Install binary
install -dm755 %{buildroot}%{_prefix}/bin
install -m755 %{_builddir}/tdesktop/Linux/Release/Telegram \
%{buildroot}%{_bindir}/telegram-desktop
install -dm755 %{buildroot}/usr/bin
install -m755 %{_builddir}/tdesktop/out/Release/Telegram \
%{buildroot}/usr/bin/telegram-desktop
# Install desktop file
install -d %{buildroot}%{_datadir}/applications
# # Install desktop file
install -d %{buildroot}/usr/share/applications
desktop-file-install \
--dir %{buildroot}%{_datadir}/applications \
--add-category InstantMessaging \
%{_builddir}/tdesktop/lib/xdg/telegramdesktop.desktop
# Install protocol
install -d %{buildroot}%{_datadir}/kde4/services
# # Install protocol
install -d %{buildroot}/usr/share/kde4/services
install -m644 %{_builddir}/tdesktop/lib/xdg/tg.protocol \
%{buildroot}%{_datadir}/kde4/services/tg.protocol
%{buildroot}/usr/share/kde4/services/tg.protocol
# Install icons
# # Install icons
for icon_size in 16 32 48 64 128 256 512; do
icon_dir="%{buildroot}%{_datadir}/icons/hicolor/${icon_size}x${icon_size}/apps"
icon_dir="%{buildroot}/usr/share/icons/hicolor/${icon_size}x${icon_size}/apps"
install -d "${icon_dir}"
install -m644 "%{_builddir}/tdesktop/Telegram/Resources/art/icon${icon_size}.png" \
"${icon_dir}/telegram-desktop.png"
done
%post
%desktop_database_post
%icon_theme_cache_post
%postun
%desktop_database_postun
%icon_theme_cache_postun
%clean
rm -rf %{buildroot}
%files
%defattr (-, root, root, -)
%{_bindir}/telegram-desktop
%{_datadir}/applications/telegramdesktop.desktop
%dir %{_datadir}/kde4
%dir %{_datadir}/kde4/services
%{_datadir}/kde4/services/tg.protocol
%{_datadir}/icons/hicolor/*/apps/telegram-desktop.png
%changelog
/usr/bin/telegram-desktop
/usr/share/applications/telegramdesktop.desktop
%dir /usr/share/kde4
%dir /usr/share/kde4/services
/usr/share/kde4/services/tg.protocol
/usr/share/icons/hicolor/*/apps/telegram-desktop.png

1917
unity.h

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:69ed7364e87f8f24d6f68ddc0a5b98dfd5dae74ecc93e456cede9e65878ef404
size 11472682