forked from alexlarsson/nightly-build-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
telegram.patch
339 lines (331 loc) · 9.83 KB
/
telegram.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
From a1c65e2d7400afcfff9046461584f94ac518229b Mon Sep 17 00:00:00 2001
From: Jan Grulich <[email protected]>
Date: Fri, 23 Sep 2016 11:38:38 +0200
Subject: init
diff --git a/Telegram/gyp/Telegram.gyp b/Telegram/gyp/Telegram.gyp
index 0e8db70..c954788 100644
--- a/Telegram/gyp/Telegram.gyp
+++ b/Telegram/gyp/Telegram.gyp
@@ -69,19 +69,18 @@
],
'defines': [
- 'AL_LIBTYPE_STATIC',
+ '__STDC_FORMAT_MACROS',
+ 'TDESKTOP_DISABLE_AUTOUPDATE',
+ 'TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME',
+ 'TDESKTOP_DISABLE_UNITY_INTEGRATION',
+ 'TDESKTOP_DISABLE_CRASH_REPORTS',
],
'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)',
+ '/usr/include/breakpad',
],
'sources': [
'<@(qrc_files)',
diff --git a/Telegram/gyp/qt.gypi b/Telegram/gyp/qt.gypi
index 2a8f010..b52a540 100644
--- a/Telegram/gyp/qt.gypi
+++ b/Telegram/gyp/qt.gypi
@@ -29,7 +29,6 @@
'Qt5Network',
'Qt5Widgets',
'Qt5Gui',
- 'qtharfbuzzng',
],
'conditions': [
[ 'build_macold', {
@@ -78,7 +77,7 @@
],
}],
[ 'build_linux', {
- 'qt_loc_unix': '/usr/local/tdesktop/Qt-<(qt_version)',
+ 'qt_loc_unix': '/app',
'qt_lib_prefix': 'lib',
'qt_lib_debug_postfix': '.a',
'qt_lib_release_postfix': '.a',
@@ -92,17 +91,6 @@
'Qt5DBus',
'Qt5Core',
'qtpcre',
- 'Xi',
- 'Xext',
- 'SM',
- 'ICE',
- 'fontconfig',
- 'expat',
- 'freetype',
- 'xcb-shm',
- 'xcb-xfixes',
- 'xcb-render',
- 'xcb-static',
],
}],
],
@@ -189,6 +177,18 @@
'<(qt_loc)/plugins/bearer',
'<(qt_loc)/plugins/platforms',
'<(qt_loc)/plugins/imageformats',
+ '/app/lib/',
+ '/app/lib64',
+ '/app/usr/lib',
+ '/app/usr/lib64',
+ '/app/usr/lib/plugins/bearer',
+ '/app/usr/lib/plugins/platforms',
+ '/app/usr/lib/plugins/imageformats',
+ '/usr/lib',
+ '/usr/lib64',
+ '/usr/lib/plugins/bearer',
+ '/usr/lib/plugins/platforms',
+ '/usr/lib/plugins/imageformats',
],
'defines': [
'QT_WIDGETS_LIB',
@@ -200,23 +200,41 @@
[ 'build_linux', {
'library_dirs': [
'<(qt_loc)/plugins/platforminputcontexts',
+ '/usr/lib/plugins/platforminputcontexts',
],
'libraries': [
- '/usr/local/lib/libxkbcommon.a',
'<@(qt_libs_release)',
- '/usr/local/ssl/lib/libssl.a',
- '/usr/local/ssl/lib/libcrypto.a',
+ 'z',
+ 'harfbuzz',
+ 'icuuc',
+ 'icutu',
+ 'icui18n',
+ 'png16',
+ 'jpeg',
+ 'ssl',
+ 'crypto',
'xcb',
+ 'xcb-shm',
+ 'xcb-xfixes',
+ 'xcb-render',
'X11',
'X11-xcb',
+ 'GL',
'dbus-1',
'dl',
'gthread-2.0',
'glib-2.0',
'pthread',
+ 'Xi',
+ 'Xext',
+ 'SM',
+ 'ICE',
+ 'fontconfig',
+ 'expat',
+ 'freetype',
],
'include_dirs': [
- '<(qt_loc)/mkspecs/linux-g++',
+ '/usr/lib/mkspecs/linux-g++',
],
'ldflags': [
'-static-libstdc++',
diff --git a/Telegram/gyp/refresh.sh b/Telegram/gyp/refresh.sh
index 5a456ce..483abae 100755
--- a/Telegram/gyp/refresh.sh
+++ b/Telegram/gyp/refresh.sh
@@ -8,18 +8,18 @@ MySystem=`uname -s`
cd $FullScriptPath
if [ "$MySystem" == "Linux" ]; then
- ../../../Libraries/gyp/gyp --depth=. --generator-output=../.. -Goutput_dir=out Telegram.gyp --format=cmake
+ ../../Libraries/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
#gyp --depth=. --generator-output=../.. -Goutput_dir=out Telegram.gyp --format=xcode-ninja
#gyp --depth=. --generator-output=../.. -Goutput_dir=out Telegram.gyp --format=xcode
# use patched gyp with Xcode project generator
- ../../../Libraries/gyp/gyp --depth=. --generator-output=../.. -Goutput_dir=out Telegram.gyp -Gxcode_upgrade_check_project_version=800 --format=xcode
+ ../../Libraries/gyp/gyp --depth=. --generator-output=../.. -Goutput_dir=out Telegram.gyp -Gxcode_upgrade_check_project_version=800 --format=xcode
fi
cd ../..
diff --git a/lib/xdg/telegramdesktop.appdata.xml b/lib/xdg/telegramdesktop.appdata.xml
new file mode 100644
index 0000000..74dc9dd
--- /dev/null
+++ b/lib/xdg/telegramdesktop.appdata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component type="desktop">
+ <id>telegram-desktop.desktop</id>
+ <metadata_license>CC0-1.0</metadata_license>
+ <project_license>GPL-2.0+</project_license>
+ <name>Telegram desktop</name>
+ <summary>Telegram Desktop messenger</summary>
+ <description>
+ <p>Telegram Desktop messenger.</p>
+ </description>
+ <url type="homepage">https://github.com/telegramdesktop/tdesktop</url>
+ <url type="bugtracker">https://github.com/telegramdesktop/tdesktop/issues</url>
+ <provides>
+ <binary>telegram-desktop</binary>
+ </provides>
+</component>
diff --git a/lib/xdg/telegramdesktop.desktop b/lib/xdg/telegramdesktop.desktop
index 35a5c61..ee6b9c6 100644
--- a/lib/xdg/telegramdesktop.desktop
+++ b/lib/xdg/telegramdesktop.desktop
@@ -3,7 +3,7 @@ Encoding=UTF-8
Version=1.0
Name=Telegram Desktop
Comment=Official desktop version of Telegram messaging app
-Exec=/usr/bin/telegram-desktop -- %u
+Exec=telegram-desktop -- %u
Icon=telegram-desktop
Terminal=false
StartupWMClass=Telegram
diff --git a/Telegram/SourceFiles/platform/linux/linux_libs.cpp b/Telegram/SourceFiles/platform/linux/linux_libs.cpp
index 484b6c5..ab77e35 100644
--- a/Telegram/SourceFiles/platform/linux/linux_libs.cpp
+++ b/Telegram/SourceFiles/platform/linux/linux_libs.cpp
@@ -201,6 +201,10 @@ f_unity_launcher_entry_get_for_desktop_id unity_launcher_entry_get_for_desktop_i
void start() {
DEBUG_LOG(("Loading libraries"));
+ // Workaround for wayland support
+ if (QString(getenv("QT_QPA_PLATFORM")).startsWith(qstr("wayland"), Qt::CaseInsensitive))
+ return;
+
bool gtkLoaded = false;
bool indicatorLoaded = false;
QLibrary lib_gtk, lib_indicator;
diff --git a/Telegram/SourceFiles/stdafx.cpp b/Telegram/SourceFiles/stdafx.cpp
index 06bd4af..755d97f 100644
--- a/Telegram/SourceFiles/stdafx.cpp
+++ b/Telegram/SourceFiles/stdafx.cpp
@@ -34,6 +34,7 @@ Q_IMPORT_PLUGIN(QGenericEnginePlugin)
#elif defined Q_OS_LINUX // Q_OS_LINUX
Q_IMPORT_PLUGIN(QWebpPlugin)
Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)
+Q_IMPORT_PLUGIN(QWaylandIntegrationPlugin)
Q_IMPORT_PLUGIN(QConnmanEnginePlugin)
Q_IMPORT_PLUGIN(QGenericEnginePlugin)
Q_IMPORT_PLUGIN(QNetworkManagerEnginePlugin)
diff --git a/Telegram/gyp/telegram_linux.gypi b/Telegram/gyp/telegram_linux.gypi
index 15bfbb6..5ed7872 100644
--- a/Telegram/gyp/telegram_linux.gypi
+++ b/Telegram/gyp/telegram_linux.gypi
@@ -29,31 +29,46 @@
],
},
'include_dirs': [
- '/usr/local/include',
- '<(libs_loc)/openssl-xcode/include'
+ '/usr/include',
],
'library_dirs': [
- '/usr/local/lib',
- '<(libs_loc)/libexif-0.6.20/libexif/.libs',
- '<(libs_loc)/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',
- 'libz.a',
+ 'Qt5WaylandClient',
+ 'qwayland-generic',
+ 'qwayland-egl',
+ 'xkbcommon',
+ 'xkbcommon-x11',
+ 'xcb-randr',
+ 'xcb-xinerama',
+ 'xcb-xkb',
+ 'xcb-shape',
+ 'xcb-icccm',
+ 'xcb-sync',
+ 'xcb-keysyms',
+ 'xcb-image',
+ 'xcb-render-util',
+ 'wayland-client',
+ 'wayland-cursor',
+ 'proxy',
+ 'lzma',
+ 'openal',
+ 'avformat',
+ 'avcodec',
+ 'swresample',
+ 'swscale',
+ 'avutil',
+ 'opus',
+ 'va-x11',
+ 'va-drm',
+ 'va',
+ 'z',
+ 'webp',
# '<!(pkg-config 2> /dev/null --libs <@(pkgconfig_libs))',
],
'cflags_cc': [
diff --git a/Telegram/gyp/utils.gyp b/Telegram/gyp/utils.gyp
index 209c737..41425f1 100644
--- a/Telegram/gyp/utils.gyp
+++ b/Telegram/gyp/utils.gyp
@@ -109,8 +109,6 @@
],
'include_dirs': [
'<(src_loc)',
- '<(libs_loc)/lzma/C',
- '<(libs_loc)/zlib-1.2.8',
],
'sources': [
'<(src_loc)/_other/packer.cpp',
@@ -130,11 +128,10 @@
],
}, {
'include_dirs': [
- '/usr/local/include',
- '<(libs_loc)/openssl-xcode/include'
+ '/usr/include',
],
'library_dirs': [
- '/usr/local/lib',
+ '/usr/lib',
],
}]
],
@@ -152,11 +149,10 @@
],
}, {
'include_dirs': [
- '/usr/local/include',
- '<(libs_loc)/openssl-xcode/include'
+ '/usr/include',
],
'library_dirs': [
- '/usr/local/lib',
+ '/usr/lib',
],
}]
],