View | Details | Raw Unified | Return to bug 227571
Collapse All | Expand All

(-)./distinfo (-9 / +11 lines)
Lines 1-11 Link Here
1
TIMESTAMP = 1512711381
1
TIMESTAMP = 1523832839
2
SHA256 (telegramdesktop-tdesktop-v1.1.23_GH0.tar.gz) = 56b7fce84adf85a4af1c3174353169f32d0b0c052a4e7a284fc741fa96b04030
2
SHA256 (telegramdesktop-tdesktop-v1.2.17_GH0.tar.gz) = 775614e70372b2e18ef1b2940fa043599240975597e4c5e4431c6deb041a613d
3
SIZE (telegramdesktop-tdesktop-v1.1.23_GH0.tar.gz) = 16863984
3
SIZE (telegramdesktop-tdesktop-v1.2.17_GH0.tar.gz) = 16916625
4
SHA256 (Microsoft-GSL-c5851a8_GH0.tar.gz) = 32fae541af0bc21cdf83922740db6a3a00fbb9cb9ace323fbc038b608ac36956
5
SIZE (Microsoft-GSL-c5851a8_GH0.tar.gz) = 54462
6
SHA256 (mapbox-variant-550ac2f_GH0.tar.gz) = 7ab3aa7c9fa672027f13721584df5f7ec09c0ecca499d374c6ac76e147ef7354
7
SIZE (mapbox-variant-550ac2f_GH0.tar.gz) = 108686
8
SHA256 (catchorg-Catch2-5ca44b68_GH0.tar.gz) = 8cdf2a345897bda1aaabffd4496dffe263768cef3e4254e74ae63545c8e12cc2
4
SHA256 (catchorg-Catch2-5ca44b68_GH0.tar.gz) = 8cdf2a345897bda1aaabffd4496dffe263768cef3e4254e74ae63545c8e12cc2
9
SIZE (catchorg-Catch2-5ca44b68_GH0.tar.gz) = 375264
5
SIZE (catchorg-Catch2-5ca44b68_GH0.tar.gz) = 375264
10
SHA256 (telegramdesktop-libtgvoip-757a5d8e_GH0.tar.gz) = a745c2c097f6a98bf9443d0cee9e375f279571a18dcb51bf06684eccf82eb9c6
6
SHA256 (mapbox-variant-550ac2f_GH0.tar.gz) = 7ab3aa7c9fa672027f13721584df5f7ec09c0ecca499d374c6ac76e147ef7354
11
SIZE (telegramdesktop-libtgvoip-757a5d8e_GH0.tar.gz) = 408328
7
SIZE (mapbox-variant-550ac2f_GH0.tar.gz) = 108686
8
SHA256 (Microsoft-GSL-9d65e74_GH0.tar.gz) = c2270ade74bd74831e2e854970c04db77f00e0dfdb0a3c3bce356da6019dd18d
9
SIZE (Microsoft-GSL-9d65e74_GH0.tar.gz) = 57320
10
SHA256 (telegramdesktop-libtgvoip-6e0e102_GH0.tar.gz) = 53f2d27f8bc76d454cd933fe0d598155d091967e9cb98b095cd44f2a70137220
11
SIZE (telegramdesktop-libtgvoip-6e0e102_GH0.tar.gz) = 411964
12
SHA256 (telegramdesktop-crl-344cbde9_GH0.tar.gz) = ec7d04bc36ed6dda88574e317e78d332b36cbd3378c3a8218ac5a3f37ee6d90f
13
SIZE (telegramdesktop-crl-344cbde9_GH0.tar.gz) = 18308
(-)./files/gyp-patches (-75 / +135 lines)
Lines 1-6 Link Here
1
--- Telegram/gyp/qt_rcc.gypi.orig	2017-09-05 17:38:38 UTC
1
--- Telegram/gyp/qt_rcc.gypi.orig	2018-01-03 10:46:01 UTC
2
+++ Telegram/gyp/qt_rcc.gypi
2
+++ Telegram/gyp/qt_rcc.gypi
3
@@ -28,7 +28,7 @@
3
@@ -15,7 +15,7 @@
4
       '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/qrc/qrc_<(RULE_INPUT_ROOT).cpp',
4
       '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/qrc/qrc_<(RULE_INPUT_ROOT).cpp',
5
     ],
5
     ],
6
     'action': [
6
     'action': [
Lines 9-17 Link Here
9
       '-name', '<(RULE_INPUT_ROOT)',
9
       '-name', '<(RULE_INPUT_ROOT)',
10
       '-no-compress',
10
       '-no-compress',
11
       '<(RULE_INPUT_PATH)',
11
       '<(RULE_INPUT_PATH)',
12
--- Telegram/gyp/qt.gypi.orig	2017-09-05 17:38:38 UTC
12
--- Telegram/gyp/qt_moc.gypi.orig	2018-01-03 10:46:01 UTC
13
+++ Telegram/gyp/qt_moc.gypi
14
@@ -12,12 +12,12 @@
15
       '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/moc/moc_<(RULE_INPUT_ROOT).cpp',
16
     ],
17
     'action': [
18
-      '<(qt_loc)/bin/moc<(exe_ext)',
19
+      '%%QT_BINDIR%%/moc',
20
 
21
       # Silence "Note: No relevant classes found. No output generated."
22
       '--no-notes',
23
 
24
-      '<!@(python -c "for s in \'<@(_defines)\'.split(\' \'): print(\'-D\' + s)")',
25
+      '<!@(%%PYTHON_CMD%% -c "for s in \'<@(_defines)\'.split(\' \'): print(\'-D\' + s)")',
26
       # '<!@(python -c "for s in \'<@(_include_dirs)\'.split(\' \'): print(\'-I\' + s)")',
27
       '<(RULE_INPUT_PATH)',
28
       '-o', '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/moc/moc_<(RULE_INPUT_ROOT).cpp',
29
--- Telegram/gyp/qt.gypi.orig	2018-01-03 10:46:01 UTC
13
+++ Telegram/gyp/qt.gypi
30
+++ Telegram/gyp/qt.gypi
14
@@ -27,25 +27,21 @@
31
@@ -14,25 +14,21 @@
15
               [ 'build_macold', {
32
               [ 'build_macold', {
16
                 'qt_version%': '5.3.2',
33
                 'qt_version%': '5.3.2',
17
               }, {
34
               }, {
Lines 39-45 Link Here
39
             }]
56
             }]
40
           ]
57
           ]
41
         },
58
         },
42
@@ -85,44 +81,24 @@
59
@@ -72,44 +68,25 @@
43
             ],
60
             ],
44
           }],
61
           }],
45
           [ 'build_linux', {
62
           [ 'build_linux', {
Lines 56-62 Link Here
56
-              'qgenericbearer',
73
-              'qgenericbearer',
57
-              'qnmbearer',
74
-              'qnmbearer',
58
               '<@(qt_libs)',
75
               '<@(qt_libs)',
59
-              'Qt5DBus',
76
               'Qt5DBus',
60
               'Qt5Core',
77
               'Qt5Core',
61
-              'qtpcre',
78
-              'qtpcre',
62
-              'Xi',
79
-              'Xi',
Lines 90-96 Link Here
90
       ],
107
       ],
91
     },
108
     },
92
     'qt_libs_debug': [ '<@(qt_libs_debug)' ],
109
     'qt_libs_debug': [ '<@(qt_libs_debug)' ],
93
@@ -140,11 +116,6 @@
110
@@ -127,11 +104,6 @@
94
     # '<!@(python <(DEPTH)/list_sources.py [sources] <(qt_moc_list_sources_arg))'
111
     # '<!@(python <(DEPTH)/list_sources.py [sources] <(qt_moc_list_sources_arg))'
95
     # where [sources] contains all your source files
112
     # where [sources] contains all your source files
96
     'qt_moc_list_sources_arg': '--moc-prefix SHARED_INTERMEDIATE_DIR/<(_target_name)/moc/moc_',
113
     'qt_moc_list_sources_arg': '--moc-prefix SHARED_INTERMEDIATE_DIR/<(_target_name)/moc/moc_',
Lines 98-114 Link Here
98
-    'linux_path_xkbcommon%': '/usr/local',
115
-    'linux_path_xkbcommon%': '/usr/local',
99
-    'linux_lib_ssl%': '/usr/local/ssl/lib/libssl.a',
116
-    'linux_lib_ssl%': '/usr/local/ssl/lib/libssl.a',
100
-    'linux_lib_crypto%': '/usr/local/ssl/lib/libcrypto.a',
117
-    'linux_lib_crypto%': '/usr/local/ssl/lib/libcrypto.a',
101
-    'linux_lib_icu%': '/usr/lib/libicutu.a /usr/lib/libicui18n.a /usr/lib/libicuuc.a /usr/lib/libicudata.a',
118
-    'linux_lib_icu%': 'libicutu.a libicui18n.a libicuuc.a libicudata.a',
102
   },
119
   },
103
 
120
 
104
   'configurations': {
121
   'configurations': {
105
@@ -193,15 +164,17 @@
122
@@ -180,18 +152,18 @@
106
   },
123
   },
107
 
124
 
108
   'include_dirs': [
125
   'include_dirs': [
109
-    '<(qt_loc)/include',
126
-    '<(qt_loc)/include',
110
-    '<(qt_loc)/include/QtCore',
127
-    '<(qt_loc)/include/QtCore',
111
-    '<(qt_loc)/include/QtGui',
128
-    '<(qt_loc)/include/QtGui',
129
-    '<(qt_loc)/include/QtDBus',
112
-    '<(qt_loc)/include/QtCore/<(qt_version)',
130
-    '<(qt_loc)/include/QtCore/<(qt_version)',
113
-    '<(qt_loc)/include/QtGui/<(qt_version)',
131
-    '<(qt_loc)/include/QtGui/<(qt_version)',
114
-    '<(qt_loc)/include/QtCore/<(qt_version)/QtCore',
132
-    '<(qt_loc)/include/QtCore/<(qt_version)/QtCore',
Lines 116-148 Link Here
116
+    '%%QT_INCDIR%%',
134
+    '%%QT_INCDIR%%',
117
+    '%%QT_INCDIR%%/QtCore',
135
+    '%%QT_INCDIR%%/QtCore',
118
+    '%%QT_INCDIR%%/QtGui',
136
+    '%%QT_INCDIR%%/QtGui',
137
+    '%%QT_INCDIR%%/QtDBus',
119
+    '%%QT_INCDIR%%/QtCore/<(qt_version)',
138
+    '%%QT_INCDIR%%/QtCore/<(qt_version)',
120
+    '%%QT_INCDIR%%/QtGui/<(qt_version)',
139
+    '%%QT_INCDIR%%/QtGui/<(qt_version)',
121
+    '%%QT_INCDIR%%/QtCore/<(qt_version)/QtCore',
140
+    '%%QT_INCDIR%%/QtCore/<(qt_version)/QtCore',
122
+    '%%QT_INCDIR%%/QtGui/<(qt_version)/QtGui',
141
+    '%%QT_INCDIR%%/QtGui/<(qt_version)/QtGui',
123
   ],
142
   ],
124
   'library_dirs': [
143
   'library_dirs': [
144
-    '<(qt_loc)/lib',
145
-    '<(qt_loc)/plugins',
125
+    '%%LOCALBASE%%/lib',
146
+    '%%LOCALBASE%%/lib',
126
+    '%%QT_LIBDIR%%/',
147
+    '%%QT_LIBDIR%%/',
127
     '<(qt_loc)/lib',
128
     '<(qt_loc)/plugins',
129
     '<(qt_loc)/plugins/bearer',
148
     '<(qt_loc)/plugins/bearer',
130
@@ -220,25 +193,20 @@
149
     '<(qt_loc)/plugins/platforms',
150
     '<(qt_loc)/plugins/imageformats',
151
@@ -204,33 +176,20 @@
152
   ],
153
   'conditions': [
154
     [ 'build_linux', {
155
-      'dependencies': [
156
-        '<(DEPTH)/linux_glibc_wraps.gyp:linux_glibc_wraps',
157
-      ],
158
       'library_dirs': [
131
         '<(qt_loc)/plugins/platforminputcontexts',
159
         '<(qt_loc)/plugins/platforminputcontexts',
132
       ],
160
       ],
133
       'libraries': [
161
       'libraries': [
162
-        '<(PRODUCT_DIR)/obj.target/liblinux_glibc_wraps.a',
134
-        '<(linux_path_xkbcommon)/lib/libxkbcommon.a',
163
-        '<(linux_path_xkbcommon)/lib/libxkbcommon.a',
135
         '<@(qt_libs_release)',
164
         '<@(qt_libs_release)',
136
-        '<(linux_lib_ssl)',
165
-        '<(linux_lib_ssl)',
137
-        '<(linux_lib_crypto)',
166
-        '<(linux_lib_crypto)',
138
-        '<!@(python -c "for s in \'<(linux_lib_icu)\'.split(\' \'): print(s)")',
167
-        '<!@(python -c "for s in \'<(linux_lib_icu)\'.split(\' \'): print(s)")',
168
-        '-lxcb',
139
+        '-lcrypto',
169
+        '-lcrypto',
140
         '-lxcb',
141
         '-lX11',
170
         '-lX11',
142
         '-lX11-xcb',
171
-        '-lX11-xcb',
143
         '-ldbus-1',
172
-        '-ldbus-1',
144
-        '-ldl',
173
-        '-ldl',
145
         '-lgthread-2.0',
174
-        '-lgthread-2.0',
146
         '-lglib-2.0',
175
         '-lglib-2.0',
147
         '-lpthread',
176
         '-lpthread',
148
       ],
177
       ],
Lines 153-187 Link Here
153
       'ldflags': [
182
       'ldflags': [
154
-        '-static-libstdc++',
183
-        '-static-libstdc++',
155
         '-pthread',
184
         '-pthread',
156
         '-g',
157
         '-rdynamic',
185
         '-rdynamic',
158
@@ -260,12 +228,12 @@
186
       ],
159
       '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/moc/moc_<(RULE_INPUT_ROOT).cpp',
187
--- Telegram/gyp/telegram_linux.gypi.orig	2018-01-03 10:46:01 UTC
160
     ],
161
     'action': [
162
-      '<(qt_loc)/bin/moc<(exe_ext)',
163
+      '%%QT_BINDIR%%/moc',
164
 
165
       # Silence "Note: No relevant classes found. No output generated."
166
       '--no-notes',
167
 
168
-      '<!@(python -c "for s in \'<@(_defines)\'.split(\' \'): print(\'-D\' + s)")',
169
+      '<!@(%%PYTHON_CMD%% -c "for s in \'<@(_defines)\'.split(\' \'): print(\'-D\' + s)")',
170
       # '<!@(python -c "for s in \'<@(_include_dirs)\'.split(\' \'): print(\'-I\' + s)")',
171
       '<(RULE_INPUT_PATH)',
172
       '-o', '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/moc/moc_<(RULE_INPUT_ROOT).cpp',
173
--- Telegram/gyp/telegram_linux.gypi.orig	2017-09-05 17:38:38 UTC
174
+++ Telegram/gyp/telegram_linux.gypi
188
+++ Telegram/gyp/telegram_linux.gypi
175
@@ -33,7 +33,7 @@
189
@@ -7,7 +7,7 @@
190
 {
191
   'conditions': [[ 'build_linux', {
192
     'variables': {
193
-      'not_need_gtk%': '<!(python -c "print(\'TDESKTOP_DISABLE_GTK_INTEGRATION\' in \'<(build_defines)\')")',
194
+      'not_need_gtk%': '<!(%%PYTHON_CMD%% -c "print(\'TDESKTOP_DISABLE_GTK_INTEGRATION\' in \'<(build_defines)\')")',
195
       'pkgconfig_libs': [
196
 # In order to work libxkbcommon must be linked statically,
197
 # PKGCONFIG links it like "-L/usr/local/lib -lxkbcommon"
198
@@ -20,10 +20,11 @@
176
       'linux_path_va%': '/usr/local',
199
       'linux_path_va%': '/usr/local',
177
       'linux_path_vdpau%': '/usr/local',
200
       'linux_path_vdpau%': '/usr/local',
178
       'linux_path_breakpad%': '<(libs_loc)/breakpad',
201
       'linux_path_breakpad%': '/usr/local',
179
-      'linux_path_opus_include%': '<(libs_loc)/opus/include',
202
-      'linux_path_opus_include%': '<(libs_loc)/opus/include',
180
+      'linux_path_opus_include%': '%%LOCALBASE%%/include/opus',
203
+      'linux_path_opus_include%': '%%LOCALBASE%%/include/opus',
204
       'linux_path_range%': '/usr/local',
181
     },
205
     },
182
     'include_dirs': [
206
     'include_dirs': [
207
+      '/usr/include/openssl-1.0',
183
       '/usr/local/include',
208
       '/usr/local/include',
184
@@ -52,48 +52,34 @@
209
       '<(linux_path_ffmpeg)/include',
210
       '<(linux_path_openal)/include',
211
@@ -32,6 +33,7 @@
212
       '<(linux_path_range)/include',
213
     ],
214
     'library_dirs': [
215
+      '/usr/lib/openssl-1.0',
216
       '/usr/local/lib',
217
       '<(linux_path_ffmpeg)/lib',
218
       '<(linux_path_openal)/lib',
219
@@ -40,25 +42,15 @@
185
       '<(linux_path_breakpad)/lib',
220
       '<(linux_path_breakpad)/lib',
186
     ],
221
     ],
187
     'libraries': [
222
     'libraries': [
Lines 216-252 Link Here
216
 #      '<!(pkg-config 2> /dev/null --libs <@(pkgconfig_libs))',
251
 #      '<!(pkg-config 2> /dev/null --libs <@(pkgconfig_libs))',
217
     ],
252
     ],
218
     'cflags_cc': [
253
     'cflags_cc': [
219
-      '<!(pkg-config 2> /dev/null --cflags appindicator-0.1)',
254
@@ -67,7 +59,6 @@
220
-      '<!(pkg-config 2> /dev/null --cflags gtk+-2.0)',
255
     'ldflags': [
221
-      '<!(pkg-config 2> /dev/null --cflags glib-2.0)',
256
       '-Wl,-wrap,aligned_alloc',
222
+#      '<!(pkg-config 2> /dev/null --cflags appindicator-0.1)',
257
       '-Wl,-wrap,secure_getenv',
223
+      '<!(pkg-config 2> /dev/null --cflags gtk+-3.0)',
258
-      '-Wl,-wrap,clock_gettime',
224
       '<!(pkg-config 2> /dev/null --cflags dee-1.0)',
259
       '-Wl,--no-as-needed,-lrt',
225
     ],
260
     ],
226
     'configurations': {
261
     'configurations': {
227
       'Release': {
262
@@ -86,7 +77,7 @@
228
         'cflags': [
263
       },
229
-          '-Ofast',
264
     },
230
-          '-flto',
265
     'conditions': [
231
+          %%CFLAGS%%
266
-      [ '"<!(uname -p)" == "x86_64"', {
232
           '-fno-strict-aliasing',
267
+      [ '"<!(uname -m)" == "x86_64"', {
268
         # 32 bit version can't be linked with debug info or LTO,
269
         # virtual memory exhausted :(
270
         'cflags_c': [ '-g' ],
271
@@ -94,9 +85,9 @@
272
         'ldflags': [ '-g' ],
273
         'configurations': {
274
           'Release': {
275
-            'cflags_c': [ '-flto' ],
276
-            'cflags_cc': [ '-flto' ],
277
-            'ldflags': [ '-flto' ],
278
+            'cflags_c': [ %%CFLAGS%% ],
279
+            'cflags_cc': [ %%CXXFLAGS%% ],
280
+            'ldflags': [ %%LDFLAGS%% ],
281
           },
282
         },
283
       }, {
284
@@ -105,10 +96,7 @@
233
         ],
285
         ],
286
       }], ['not_need_gtk!="True"', {
234
         'cflags_cc': [
287
         'cflags_cc': [
235
-          '-Ofast',
288
-          '<!(pkg-config 2> /dev/null --cflags appindicator-0.1)',
236
-          '-flto',
289
-          '<!(pkg-config 2> /dev/null --cflags gtk+-2.0)',
237
+          %%CXXFLAGS%%
290
-          '<!(pkg-config 2> /dev/null --cflags glib-2.0)',
238
           '-fno-strict-aliasing',
291
-          '<!(pkg-config 2> /dev/null --cflags dee-1.0)',
239
         ],
292
+          '<!(pkg-config 2> /dev/null --cflags gtk+-3.0)',
240
         'ldflags': [
241
-          '-Ofast',
242
-          '-flto',
243
+          %%LDFLAGS%%
244
         ],
293
         ],
245
       },
294
       }]
246
     },
295
     ],
247
--- Telegram/gyp/Telegram.gyp.orig	2017-09-05 17:38:38 UTC
296
--- Telegram/gyp/Telegram.gyp.orig	2018-01-03 10:46:01 UTC
248
+++ Telegram/gyp/Telegram.gyp
297
+++ Telegram/gyp/Telegram.gyp
249
@@ -61,7 +61,7 @@
298
@@ -49,7 +49,7 @@
250
         'pt-BR',
299
         'pt-BR',
251
       ],
300
       ],
252
       'build_defines%': '',
301
       'build_defines%': '',
Lines 255-266 Link Here
255
     },
304
     },
256
     'includes': [
305
     'includes': [
257
       'common_executable.gypi',
306
       'common_executable.gypi',
258
@@ -80,28 +80,19 @@
307
@@ -69,30 +69,20 @@
259
       'codegen.gyp:codegen_numbers',
308
       'codegen.gyp:codegen_numbers',
260
       'codegen.gyp:codegen_style',
309
       'codegen.gyp:codegen_style',
261
       'tests/tests.gyp:tests',
310
       'tests/tests.gyp:tests',
262
-      'utils.gyp:Updater',
311
-      'utils.gyp:Updater',
263
       '../ThirdParty/libtgvoip/libtgvoip.gyp:libtgvoip',
312
       '../ThirdParty/libtgvoip/libtgvoip.gyp:libtgvoip',
313
       'crl.gyp:crl',
264
     ],
314
     ],
265
 
315
 
266
     'defines': [
316
     'defines': [
Lines 276-293 Link Here
276
       '<(SHARED_INTERMEDIATE_DIR)',
326
       '<(SHARED_INTERMEDIATE_DIR)',
277
-      '<(libs_loc)/breakpad/src',
327
-      '<(libs_loc)/breakpad/src',
278
-      '<(libs_loc)/lzma/C',
328
-      '<(libs_loc)/lzma/C',
279
-      '<(libs_loc)/libexif-0.6.20',
329
-      '<(libs_loc)/zlib',
280
-      '<(libs_loc)/zlib-1.2.8',
281
-      '<(libs_loc)/ffmpeg',
330
-      '<(libs_loc)/ffmpeg',
282
-      '<(libs_loc)/openal-soft/include',
331
-      '<(libs_loc)/openal-soft/include',
283
-      '<(libs_loc)/opus/include',
332
-      '<(libs_loc)/opus/include',
333
-      '<(libs_loc)/range-v3/include',
284
-      '<(minizip_loc)',
334
-      '<(minizip_loc)',
335
-      '<(sp_media_key_tap_loc)',
285
+      '%%LOCALBASE%%/include/minizip',
336
+      '%%LOCALBASE%%/include/minizip',
286
       '<(sp_media_key_tap_loc)',
287
       '<(emoji_suggestions_loc)',
337
       '<(emoji_suggestions_loc)',
288
       '<(submodules_loc)/GSL/include',
338
       '<(submodules_loc)/GSL/include',
289
@@ -113,7 +104,7 @@
339
       '<(submodules_loc)/variant/include',
290
       '<!@(<(list_sources_command) <(qt_moc_list_sources_arg))',
340
@@ -105,7 +95,7 @@
341
       'telegram_sources.txt',
291
     ],
342
     ],
292
     'sources!': [
343
     'sources!': [
293
-      '<!@(<(list_sources_command) <(qt_moc_list_sources_arg) --exclude_for <(build_os))',
344
-      '<!@(<(list_sources_command) <(qt_moc_list_sources_arg) --exclude_for <(build_os))',
Lines 295-301 Link Here
295
     ],
346
     ],
296
     'conditions': [
347
     'conditions': [
297
       [ '"<(official_build_target)" != ""', {
348
       [ '"<(official_build_target)" != ""', {
298
--- Telegram/ThirdParty/libtgvoip/libtgvoip.gyp.orig	2017-07-06 17:16:18 UTC
349
--- Telegram/ThirdParty/libtgvoip/libtgvoip.gyp.orig	2018-02-06 06:51:56 UTC
299
+++ Telegram/ThirdParty/libtgvoip/libtgvoip.gyp
350
+++ Telegram/ThirdParty/libtgvoip/libtgvoip.gyp
300
@@ -13,11 +13,12 @@
351
@@ -13,11 +13,12 @@
301
         'variables': {
352
         'variables': {
Lines 311-317 Link Here
311
         ],
362
         ],
312
         'direct_dependent_settings': {
363
         'direct_dependent_settings': {
313
           'include_dirs': [
364
           'include_dirs': [
314
@@ -371,12 +372,13 @@
365
@@ -259,7 +260,7 @@
366
             },
367
           ],
368
           [
369
-            '"<(OS)" != "linux"', {
370
+            '"<(OS)" != "freebsd"', {
371
               'sources/': [['exclude', '<(tgvoip_src_loc)/os/linux/']],
372
             },
373
           ],
374
@@ -378,12 +379,13 @@
315
             },
375
             },
316
           ],
376
           ],
317
           [
377
           [
Lines 326-334 Link Here
326
               ],
386
               ],
327
               'direct_dependent_settings': {
387
               'direct_dependent_settings': {
328
                 'libraries': [
388
                 'libraries': [
329
--- Telegram/gyp/codegen_rules.gypi.orig	2017-12-11 17:08:58 UTC
389
--- Telegram/gyp/codegen_rules.gypi.orig	2018-02-06 06:53:18 UTC
330
+++ Telegram/gyp/codegen_rules.gypi
390
+++ Telegram/gyp/codegen_rules.gypi
331
@@ -28,7 +28,7 @@
391
@@ -15,7 +15,7 @@
332
       '<(SHARED_INTERMEDIATE_DIR)/update_dependent_styles.timestamp',
392
       '<(SHARED_INTERMEDIATE_DIR)/update_dependent_styles.timestamp',
333
     ],
393
     ],
334
     'action': [
394
     'action': [
Lines 337-343 Link Here
337
       '-I', '<(res_loc)', '-I', '<(src_loc)',
397
       '-I', '<(res_loc)', '-I', '<(src_loc)',
338
       '-o', '<(SHARED_INTERMEDIATE_DIR)/update_dependent_styles.timestamp',
398
       '-o', '<(SHARED_INTERMEDIATE_DIR)/update_dependent_styles.timestamp',
339
       '<@(style_files)',
399
       '<@(style_files)',
340
@@ -39,13 +39,13 @@
400
@@ -26,13 +26,13 @@
341
     'inputs': [
401
     'inputs': [
342
       '<(DEPTH)/update_dependent.py',
402
       '<(DEPTH)/update_dependent.py',
343
       '<@(qrc_files)',
403
       '<@(qrc_files)',
Lines 353-359 Link Here
353
       '-o', '<(SHARED_INTERMEDIATE_DIR)/update_dependent_qrc.timestamp',
413
       '-o', '<(SHARED_INTERMEDIATE_DIR)/update_dependent_qrc.timestamp',
354
       '<@(qrc_files)',
414
       '<@(qrc_files)',
355
     ],
415
     ],
356
@@ -122,7 +122,7 @@
416
@@ -109,7 +109,7 @@
357
       '<(SHARED_INTERMEDIATE_DIR)/scheme.h',
417
       '<(SHARED_INTERMEDIATE_DIR)/scheme.h',
358
     ],
418
     ],
359
     'action': [
419
     'action': [
Lines 362-370 Link Here
362
       '-o', '<(SHARED_INTERMEDIATE_DIR)', '<(res_loc)/scheme.tl',
422
       '-o', '<(SHARED_INTERMEDIATE_DIR)', '<(res_loc)/scheme.tl',
363
     ],
423
     ],
364
     'message': 'codegen_scheme-ing scheme.tl..',
424
     'message': 'codegen_scheme-ing scheme.tl..',
365
--- Telegram/gyp/tests/tests.gyp.orig	2017-12-11 17:12:35 UTC
425
--- Telegram/gyp/tests/tests.gyp.orig	2018-02-06 06:53:50 UTC
366
+++ Telegram/gyp/tests/tests.gyp
426
+++ Telegram/gyp/tests/tests.gyp
367
@@ -26,7 +26,7 @@
427
@@ -13,7 +13,7 @@
368
     'src_loc': '../../SourceFiles',
428
     'src_loc': '../../SourceFiles',
369
     'submodules_loc': '../../ThirdParty',
429
     'submodules_loc': '../../ThirdParty',
370
     'mac_target': '10.10',
430
     'mac_target': '10.10',
(-)./files/patch-lib_xdg_tg.protocol (-1 / +1 lines)
Lines 1-4 Link Here
1
--- lib/xdg/tg.protocol.orig	2017-09-05 17:38:38 UTC
1
--- lib/xdg/tg.protocol.orig	2018-02-06 05:50:37 UTC
2
+++ lib/xdg/tg.protocol
2
+++ lib/xdg/tg.protocol
3
@@ -1,5 +1,5 @@
3
@@ -1,5 +1,5 @@
4
 [Protocol]
4
 [Protocol]
(-)./files/patch-Telegram_gyp_common.gypi (-2 / +2 lines)
Lines 1-6 Link Here
1
--- Telegram/gyp/common.gypi.orig	2017-09-05 17:38:38 UTC
1
--- Telegram/gyp/common.gypi.orig	2018-02-06 06:29:27 UTC
2
+++ Telegram/gyp/common.gypi
2
+++ Telegram/gyp/common.gypi
3
@@ -42,7 +42,7 @@
3
@@ -29,7 +29,7 @@
4
             }, {
4
             }, {
5
               'build_mac': 0,
5
               'build_mac': 0,
6
             }],
6
             }],
(-)./files/patch-Telegram_gyp_PrecompiledHeader.cmake (-1 / +1 lines)
Lines 1-4 Link Here
1
--- Telegram/gyp/PrecompiledHeader.cmake.orig	2017-09-05 17:38:38 UTC
1
--- Telegram/gyp/PrecompiledHeader.cmake.orig	2018-01-03 10:46:01 UTC
2
+++ Telegram/gyp/PrecompiledHeader.cmake
2
+++ Telegram/gyp/PrecompiledHeader.cmake
3
@@ -79,7 +79,7 @@ function(export_all_flags _filename _sou
3
@@ -79,7 +79,7 @@ function(export_all_flags _filename _sou
4
 endfunction()
4
 endfunction()
(-)./files/patch-Telegram_gyp_settings__linux.gypi (-4 / +13 lines)
Lines 1-14 Link Here
1
--- Telegram/gyp/settings_linux.gypi.orig	2017-09-05 17:38:38 UTC
1
--- Telegram/gyp/settings_linux.gypi.orig	2018-01-03 10:46:01 UTC
2
+++ Telegram/gyp/settings_linux.gypi
2
+++ Telegram/gyp/settings_linux.gypi
3
@@ -25,7 +25,6 @@
3
@@ -11,7 +11,6 @@
4
         'linux_common_flags': [
4
           '-pipe',
5
           '-pipe',
5
           '-g',
6
           '-Wall',
6
           '-Wall',
7
-          '-Werror',
7
-          '-Werror',
8
           '-W',
8
           '-W',
9
           '-fPIC',
9
           '-fPIC',
10
           '-Wno-unused-variable',
10
           '-Wno-unused-variable',
11
@@ -61,7 +60,6 @@
11
@@ -25,7 +24,7 @@
12
         ],
13
       },
14
       'conditions': [
15
-        [ '"<!(uname -m)" == "x86_64" or "<!(uname -m)" == "aarch64"', {
16
+        [ '"<!(uname -m)" == "amd64" or "<!(uname -m)" == "arm64"', {
17
           'defines': [
18
             'Q_OS_LINUX64',
19
           ],
20
@@ -47,7 +46,6 @@
12
       ],
21
       ],
13
       'defines': [
22
       'defines': [
14
         '_REENTRANT',
23
         '_REENTRANT',
(-)./files/patch-Telegram_gyp_telegram__sources.txt (-2 / +2 lines)
Lines 1-6 Link Here
1
--- Telegram/gyp/telegram_sources.txt.orig	2017-09-05 17:38:38 UTC
1
--- Telegram/gyp/telegram_sources.txt.orig	2018-04-08 17:34:33 UTC
2
+++ Telegram/gyp/telegram_sources.txt
2
+++ Telegram/gyp/telegram_sources.txt
3
@@ -598,14 +598,7 @@
3
@@ -760,14 +760,7 @@
4
 <(emoji_suggestions_loc)/emoji_suggestions.cpp
4
 <(emoji_suggestions_loc)/emoji_suggestions.cpp
5
 <(emoji_suggestions_loc)/emoji_suggestions.h
5
 <(emoji_suggestions_loc)/emoji_suggestions.h
6
 
6
 
(-)./files/patch-Telegram_Resources_qrc_telegram__linux.qrc (+8 lines)
Line 0 Link Here
1
--- Telegram/Resources/qrc/telegram_linux.qrc.orig	2018-01-03 10:46:01 UTC
2
+++ Telegram/Resources/qrc/telegram_linux.qrc
3
@@ -1,5 +1,4 @@
4
 <RCC>
5
   <qresource prefix="/qt">
6
-    <file alias="etc/qt.conf">../etc/qt_linux.conf</file>
7
   </qresource>
8
 </RCC>
(-)./files/patch-Telegram_SourceFiles___other_packer.cpp (-2 / +2 lines)
Lines 1-6 Link Here
1
--- Telegram/SourceFiles/_other/packer.cpp.orig	2017-09-05 17:38:38 UTC
1
--- Telegram/SourceFiles/_other/packer.cpp.orig	2018-02-06 05:52:28 UTC
2
+++ Telegram/SourceFiles/_other/packer.cpp
2
+++ Telegram/SourceFiles/_other/packer.cpp
3
@@ -246,7 +246,7 @@ int main(int argc, char *argv[])
3
@@ -233,7 +233,7 @@ int main(int argc, char *argv[])
4
 			}
4
 			}
5
 			QByteArray inner = f.readAll();
5
 			QByteArray inner = f.readAll();
6
 			stream << name << quint32(inner.size()) << inner;
6
 			stream << name << quint32(inner.size()) << inner;
(-)./files/patch-Telegram_SourceFiles_base_build__config.h (-3 / +3 lines)
Lines 1-11 Link Here
1
--- Telegram/SourceFiles/base/build_config.h.orig	2017-09-05 17:38:38 UTC
1
--- Telegram/SourceFiles/base/build_config.h.orig	2018-02-06 05:52:11 UTC
2
+++ Telegram/SourceFiles/base/build_config.h
2
+++ Telegram/SourceFiles/base/build_config.h
3
@@ -26,7 +26,7 @@ Copyright (c) 2014-2017 John Preston, ht
3
@@ -13,7 +13,7 @@ https://github.com/telegramdesktop/tdesk
4
 
4
 
5
 #if defined(__APPLE__)
5
 #if defined(__APPLE__)
6
 #define OS_MAC 1
6
 #define OS_MAC 1
7
-#elif defined(__linux__) // __APPLE__
7
-#elif defined(__linux__) // __APPLE__
8
+#elif defined(__linux__) || defined(__FreeBSD__)// __APPLE__
8
+#elif defined(__linux__) || defined(__FreeBSD__) // __APPLE__
9
 #define OS_LINUX 1
9
 #define OS_LINUX 1
10
 #elif defined(_WIN32) // __APPLE__ || __linux__
10
 #elif defined(_WIN32) // __APPLE__ || __linux__
11
 #define OS_WIN 1
11
 #define OS_WIN 1
(-)./files/patch-Telegram_SourceFiles_base_lambda.h (-7 / +7 lines)
Lines 1-6 Link Here
1
--- Telegram/SourceFiles/base/lambda.h.orig	2017-09-05 17:38:38 UTC
1
--- Telegram/SourceFiles/base/lambda.h.orig	2018-01-03 10:46:01 UTC
2
+++ Telegram/SourceFiles/base/lambda.h
2
+++ Telegram/SourceFiles/base/lambda.h
3
@@ -212,11 +212,14 @@ protected:
3
@@ -226,11 +226,14 @@ protected:
4
 
4
 
5
 template <typename Lambda, typename Return, typename ...Args>
5
 template <typename Lambda, typename Return, typename ...Args>
6
 struct vtable_once : public vtable_once_impl<Lambda, is_large<Lambda>, Return, Args...> {
6
 struct vtable_once : public vtable_once_impl<Lambda, is_large<Lambda>, Return, Args...> {
Lines 17-23 Link Here
17
 
17
 
18
 template <typename Lambda, bool IsLarge, typename Return, typename ...Args> struct vtable_impl;
18
 template <typename Lambda, bool IsLarge, typename Return, typename ...Args> struct vtable_impl;
19
 
19
 
20
@@ -262,12 +265,14 @@ struct vtable_impl<Lambda, false, Return
20
@@ -276,12 +279,14 @@ struct vtable_impl<Lambda, false, Return
21
 
21
 
22
 template <typename Lambda, typename Return, typename ...Args>
22
 template <typename Lambda, typename Return, typename ...Args>
23
 struct vtable : public vtable_impl<Lambda, is_large<Lambda>, Return, Args...> {
23
 struct vtable : public vtable_impl<Lambda, is_large<Lambda>, Return, Args...> {
Lines 35-41 Link Here
35
 } // namespace lambda_internal
35
 } // namespace lambda_internal
36
 
36
 
37
 template <typename Return, typename ...Args>
37
 template <typename Return, typename ...Args>
38
@@ -346,7 +351,7 @@ public:
38
@@ -360,7 +365,7 @@ public:
39
 	// Copy / move construct / assign from an arbitrary type.
39
 	// Copy / move construct / assign from an arbitrary type.
40
 	template <typename Lambda, typename = std::enable_if_t<std::is_convertible<decltype(std::declval<Lambda>()(std::declval<Args>()...)),Return>::value>>
40
 	template <typename Lambda, typename = std::enable_if_t<std::is_convertible<decltype(std::declval<Lambda>()(std::declval<Args>()...)),Return>::value>>
41
 	lambda_once(Lambda other) {
41
 	lambda_once(Lambda other) {
Lines 44-50 Link Here
44
 		lambda_internal::vtable_once<Lambda, Return, Args...>::construct_move_lambda_method(data_.storage, &other);
44
 		lambda_internal::vtable_once<Lambda, Return, Args...>::construct_move_lambda_method(data_.storage, &other);
45
 	}
45
 	}
46
 	template <typename Lambda, typename = std::enable_if_t<std::is_convertible<decltype(std::declval<Lambda>()(std::declval<Args>()...)),Return>::value>>
46
 	template <typename Lambda, typename = std::enable_if_t<std::is_convertible<decltype(std::declval<Lambda>()(std::declval<Args>()...)),Return>::value>>
47
@@ -354,7 +359,7 @@ public:
47
@@ -368,7 +373,7 @@ public:
48
 		if (data_.vtable) {
48
 		if (data_.vtable) {
49
 			data_.vtable->destruct(data_.storage);
49
 			data_.vtable->destruct(data_.storage);
50
 		}
50
 		}
Lines 53-59 Link Here
53
 		lambda_internal::vtable_once<Lambda, Return, Args...>::construct_move_lambda_method(data_.storage, &other);
53
 		lambda_internal::vtable_once<Lambda, Return, Args...>::construct_move_lambda_method(data_.storage, &other);
54
 		return *this;
54
 		return *this;
55
 	}
55
 	}
56
@@ -424,7 +429,7 @@ public:
56
@@ -443,7 +448,7 @@ public:
57
 
57
 
58
 	// Copy / move construct / assign from an arbitrary type.
58
 	// Copy / move construct / assign from an arbitrary type.
59
 	template <typename Lambda, typename = std::enable_if_t<std::is_convertible<decltype(std::declval<Lambda>()(std::declval<Args>()...)),Return>::value>>
59
 	template <typename Lambda, typename = std::enable_if_t<std::is_convertible<decltype(std::declval<Lambda>()(std::declval<Args>()...)),Return>::value>>
Lines 62-68 Link Here
62
 		lambda_internal::vtable<Lambda, Return, Args...>::construct_move_lambda_method(this->data_.storage, &other);
62
 		lambda_internal::vtable<Lambda, Return, Args...>::construct_move_lambda_method(this->data_.storage, &other);
63
 	}
63
 	}
64
 	template <typename Lambda, typename = std::enable_if_t<std::is_convertible<decltype(std::declval<Lambda>()(std::declval<Args>()...)),Return>::value>>
64
 	template <typename Lambda, typename = std::enable_if_t<std::is_convertible<decltype(std::declval<Lambda>()(std::declval<Args>()...)),Return>::value>>
65
@@ -432,7 +437,7 @@ public:
65
@@ -451,7 +456,7 @@ public:
66
 		if (this->data_.vtable) {
66
 		if (this->data_.vtable) {
67
 			this->data_.vtable->destruct(this->data_.storage);
67
 			this->data_.vtable->destruct(this->data_.storage);
68
 		}
68
 		}
(-)./files/patch-Telegram_SourceFiles_boxes_notifications__box.cpp (+17 lines)
Line 0 Link Here
1
--- Telegram/SourceFiles/boxes/notifications_box.cpp.orig	2018-02-06 06:26:42 UTC
2
+++ Telegram/SourceFiles/boxes/notifications_box.cpp
3
@@ -84,11 +84,11 @@ private:
4
 		_deleted = true;
5
 
6
 		// Ubuntu has a lag if deleteLater() called immediately.
7
-#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
8
+#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64 || defined Q_OS_FREEBSD
9
 		QTimer::singleShot(1000, [this] { delete this; });
10
-#else // Q_OS_LINUX32 || Q_OS_LINUX64
11
+#else // Q_OS_LINUX32 || Q_OS_LINUX64 || defined Q_OS_FREEBSD
12
 		deleteLater();
13
-#endif // Q_OS_LINUX32 || Q_OS_LINUX64
14
+#endif // Q_OS_LINUX32 || Q_OS_LINUX64 || defined Q_OS_FREEBSD
15
 	}
16
 
17
 	NotificationsBox *_owner;
(-)./files/patch-Telegram_SourceFiles_config.h (-3 / +3 lines)
Lines 1-6 Link Here
1
--- Telegram/SourceFiles/config.h.orig	2017-09-05 17:38:38 UTC
1
--- Telegram/SourceFiles/config.h.orig	2018-04-08 17:34:33 UTC
2
+++ Telegram/SourceFiles/config.h
2
+++ Telegram/SourceFiles/config.h
3
@@ -270,7 +270,7 @@ inline const char *cApiDeviceModel() {
3
@@ -240,7 +240,7 @@ inline const char *cApiDeviceModel() {
4
 	return "PC";
4
 	return "PC";
5
 #elif defined Q_OS_MAC
5
 #elif defined Q_OS_MAC
6
 	return "Mac";
6
 	return "Mac";
Lines 9-15 Link Here
9
 	return "PC";
9
 	return "PC";
10
 #endif
10
 #endif
11
 }
11
 }
12
@@ -281,6 +281,8 @@ inline const char *cApiSystemVersion() {
12
@@ -251,6 +251,8 @@ inline const char *cApiSystemVersion() {
13
 	return "OS X";
13
 	return "OS X";
14
 #elif defined Q_OS_LINUX
14
 #elif defined Q_OS_LINUX
15
 	return "Linux";
15
 	return "Linux";
(-)./files/patch-Telegram_SourceFiles_core_launcher.cpp (+47 lines)
Line 0 Link Here
1
--- Telegram/SourceFiles/core/launcher.cpp.orig	2018-01-03 10:46:01 UTC
2
+++ Telegram/SourceFiles/core/launcher.cpp
3
@@ -13,6 +13,8 @@ https://github.com/telegramdesktop/tdesk
4
 #include "core/main_queue_processor.h"
5
 #include "application.h"
6
 
7
+#include "FREEBSD_QT_PLUGINDIR.h"
8
+
9
 namespace Core {
10
 
11
 std::unique_ptr<Launcher> Launcher::Create(int argc, char *argv[]) {
12
@@ -31,9 +33,10 @@ void Launcher::init() {
13
 
14
 	QCoreApplication::setApplicationName(qsl("TelegramDesktop"));
15
 
16
-#ifndef OS_MAC_OLD
17
+#if !defined(Q_OS_MAC) && QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
18
+	// Retina display support is working fine, others are not.
19
 	QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling, true);
20
-#endif // OS_MAC_OLD
21
+#endif // not defined Q_OS_MAC and QT_VERSION >= 5.6.0
22
 
23
 	initHook();
24
 }
25
@@ -51,6 +54,11 @@ int Launcher::exec() {
26
 	Logs::start(this); // must be started before Platform is started
27
 	Platform::start(); // must be started before QApplication is created
28
 
29
+	// I don't know why path is not in QT_PLUGIN_PATH by default
30
+	QCoreApplication::addLibraryPath(FREEBSD_QT_PLUGINDIR);
31
+	// Telegram doesn't start when extraordinary theme is set, see launchpad.net/bugs/1680943
32
+	unsetenv("QT_QPA_PLATFORMTHEME");
33
+
34
 	auto result = executeApplication();
35
 
36
 	DEBUG_LOG(("Telegram finished, result: %1").arg(result));
37
@@ -136,6 +144,10 @@ void Launcher::prepareSettings() {
38
 		gUpdateURL = QUrl(qsl("http://tdesktop.com/linux32/tupdates/current"));
39
 		gPlatformString = qsl("Linux32bit");
40
 	break;
41
+	case dbipFreeBSD:
42
+		gUpdateURL = QUrl(qsl(""));
43
+		gPlatformString = qsl("FreeBSD");
44
+	break;
45
 	}
46
 
47
 	auto path = Platform::CurrentExecutablePath(_argc, _argv);
(-)./files/patch-Telegram_SourceFiles_core_utils.h (+10 lines)
Line 0 Link Here
1
--- Telegram/SourceFiles/core/utils.h.orig	2018-04-08 17:34:33 UTC
2
+++ Telegram/SourceFiles/core/utils.h
3
@@ -451,6 +451,7 @@ enum DBIPlatform {
4
 	dbipLinux64 = 2,
5
 	dbipLinux32 = 3,
6
 	dbipMacOld = 4,
7
+	dbipFreeBSD = 5,
8
 };
9
 
10
 enum DBIPeerReportSpamStatus {
(-)./files/patch-Telegram_SourceFiles_data_data__document.cpp (+11 lines)
Line 0 Link Here
1
--- Telegram/SourceFiles/data/data_document.cpp.orig	2018-04-08 17:34:33 UTC
2
+++ Telegram/SourceFiles/data/data_document.cpp
3
@@ -76,7 +76,7 @@ QString FileNameUnsafe(
4
 	name = name.replace(QRegularExpression(qsl("[\\\\\\/\\:\\*\\?\\\"\\<\\>\\|]")), qsl("_"));
5
 #elif defined Q_OS_MAC
6
 	name = name.replace(QRegularExpression(qsl("[\\:]")), qsl("_"));
7
-#elif defined Q_OS_LINUX
8
+#elif defined Q_OS_LINUX || defined Q_OS_FREEBSD
9
 	name = name.replace(QRegularExpression(qsl("[\\/]")), qsl("_"));
10
 #endif
11
 	if (Global::AskDownloadPath() || savingAs) {
(-)./files/patch-Telegram_SourceFiles_history_admin__log_history__admin__log__inner.cpp (+18 lines)
Line 0 Link Here
1
--- Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp.orig	2018-04-08 17:34:33 UTC
2
+++ Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp
3
@@ -1388,13 +1388,13 @@ void InnerWidget::mouseActionFinish(cons
4
 	_mouseSelectType = TextSelectType::Letters;
5
 	//_widget->noSelectingScroll(); // TODO
6
 
7
-#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
8
+#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64 || defined Q_OS_FREEBSD
9
 	if (_selectedItem && _selectedText.from != _selectedText.to) {
10
 		SetClipboardWithEntities(
11
 			_selectedItem->selectedText(_selectedText),
12
 			QClipboard::Selection);
13
 	}
14
-#endif // Q_OS_LINUX32 || Q_OS_LINUX64
15
+#endif // Q_OS_LINUX32 || Q_OS_LINUX64 || Q_OS_FREEBSD
16
 }
17
 
18
 void InnerWidget::updateSelected() {
(-)./files/patch-Telegram_SourceFiles_history_history__inner__widget.cpp (+20 lines)
Line 0 Link Here
1
--- Telegram/SourceFiles/history/history_inner_widget.cpp.orig	2018-04-08 17:34:33 UTC
2
+++ Telegram/SourceFiles/history/history_inner_widget.cpp
3
@@ -1336,7 +1336,7 @@ void HistoryInner::mouseActionFinish(
4
 	_widget->noSelectingScroll();
5
 	_widget->updateTopBarSelection();
6
 
7
-#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
8
+#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64 || defined Q_OS_FREEBSD
9
 	if (!_selected.empty() && _selected.cbegin()->second != FullSelection) {
10
 		const auto [item, selection] = *_selected.cbegin();
11
 		if (const auto view = item->mainView()) {
12
@@ -1345,7 +1345,7 @@ void HistoryInner::mouseActionFinish(
13
 				QClipboard::Selection);
14
 		}
15
 	}
16
-#endif // Q_OS_LINUX32 || Q_OS_LINUX64
17
+#endif // Q_OS_LINUX32 || Q_OS_LINUX64 || Q_OS_FREEBSD
18
 }
19
 
20
 void HistoryInner::mouseReleaseEvent(QMouseEvent *e) {
(-)./files/patch-Telegram_SourceFiles_history_view_history__view__list__widget.cpp (+11 lines)
Line 0 Link Here
1
--- Telegram/SourceFiles/history/view/history_view_list_widget.cpp.orig	2018-04-15 23:31:46 UTC
2
+++ Telegram/SourceFiles/history/view/history_view_list_widget.cpp
3
@@ -2014,7 +2014,7 @@ void ListWidget::mouseActionFinish(
4
 	_mouseSelectType = TextSelectType::Letters;
5
 	//_widget->noSelectingScroll(); // #TODO select scroll
6
 
7
-#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
8
+#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64 || defined Q_OS_FREEBSD
9
 	if (_selectedTextItem
10
 		&& _selectedTextRange.from != _selectedTextRange.to) {
11
 		if (const auto view = viewForItem(_selectedTextItem)) {
(-)./files/patch-Telegram_SourceFiles_layout.cpp (-3 / +3 lines)
Lines 1-6 Link Here
1
--- Telegram/SourceFiles/layout.cpp.orig	2017-09-05 17:38:38 UTC
1
--- Telegram/SourceFiles/layout.cpp.orig	2018-04-08 17:34:33 UTC
2
+++ Telegram/SourceFiles/layout.cpp
2
+++ Telegram/SourceFiles/layout.cpp
3
@@ -264,16 +264,16 @@ bool documentIsExecutableName(const QStr
3
@@ -206,16 +206,16 @@ bool documentIsExecutableName(const QStr
4
 		*result = qsl("\
4
 		*result = qsl("\
5
 action app bin command csh osx workflow\
5
 action app bin command csh osx workflow\
6
 ").split(' ');
6
 ").split(' ');
Lines 16-22 Link Here
16
 msp mst paf pif ps1 reg rgs sct shb shs u3p vb vbe vbs vbscript ws wsf\
16
 msp mst paf pif ps1 reg rgs sct shb shs u3p vb vbe vbs vbscript ws wsf\
17
 ").split(' ');
17
 ").split(' ');
18
-#endif // !Q_OS_MAC && !Q_OS_LINUX
18
-#endif // !Q_OS_MAC && !Q_OS_LINUX
19
+#endif // !Q_OS_MAC && !Q_OS_LINUX && ! Q_OS_FREEBSD
19
+#endif // !Q_OS_MAC && !Q_OS_LINUX && !Q_OS_FREEBSD
20
 		return result.release();
20
 		return result.release();
21
 	})());
21
 	})());
22
 
22
 
(-)./files/patch-Telegram_SourceFiles_logs.cpp (-23 / +27 lines)
Lines 1-35 Link Here
1
--- Telegram/SourceFiles/logs.cpp.orig	2017-09-05 17:38:38 UTC
1
--- Telegram/SourceFiles/logs.cpp.orig	2018-02-06 05:51:11 UTC
2
+++ Telegram/SourceFiles/logs.cpp
2
+++ Telegram/SourceFiles/logs.cpp
3
@@ -311,7 +311,7 @@ namespace Logs {
3
@@ -321,7 +321,7 @@ void start(not_null<Core::Launcher*> lau
4
 		QString initialWorkingDir = QDir(cWorkingDir()).absolutePath() + '/', moveOldDataFrom;
4
 	if (cBetaVersion()) {
5
 		if (cBetaVersion()) {
5
 		cSetDebug(true);
6
 			cSetDebug(true);
6
 		workingDirChosen = true;
7
-#if defined Q_OS_MAC || defined Q_OS_LINUX
7
-#if defined Q_OS_MAC || defined Q_OS_LINUX
8
+#if defined Q_OS_MAC || defined Q_OS_LINUX || defined Q_OS_FREEBSD
8
+#if defined Q_OS_MAC || defined Q_OS_LINUX || defined Q_OS_FREEBSD
9
 		} else {
9
 	} else {
10
 #ifdef _DEBUG
10
 #ifdef _DEBUG
11
 			cForceWorkingDir(cExeDir());
11
 		cForceWorkingDir(cExeDir());
12
@@ -322,11 +322,11 @@ namespace Logs {
12
@@ -335,15 +335,15 @@ void start(not_null<Core::Launcher*> lau
13
 #endif // else for _DEBUG
13
 #endif // !_DEBUG
14
 			workingDirChosen = true;
14
 		workingDirChosen = true;
15
 
15
 
16
-#if defined Q_OS_LINUX && !defined _DEBUG // fix first version
16
-#if defined Q_OS_LINUX && !defined _DEBUG // fix first version
17
+#if (defined Q_OS_LINUX || defined Q_OS_FREEBSD) && !defined _DEBUG // fix first version
17
+#if (defined Q_OS_LINUX || defined Q_OS_FREEBSD) && !defined _DEBUG // fix first version
18
 			moveOldDataFrom = initialWorkingDir;
18
 		moveOldDataFrom = initialWorkingDir;
19
-#endif // Q_OS_LINUX && !_DEBUG
19
 #endif // Q_OS_LINUX && !_DEBUG
20
+#endif // (Q_OS_LINUX || Q_OS_FREEBSD) && !_DEBUG
21
 
20
 
22
-#elif defined Q_OS_WINRT // Q_OS_MAC || Q_OS_LINUX
21
-#elif defined Q_OS_WINRT // Q_OS_MAC || Q_OS_LINUX
23
+#elif defined Q_OS_WINRT // Q_OS_MAC || Q_OS_LINUX || Q_OS_FREEBSD
22
+#elif defined Q_OS_WINRT // Q_OS_MAC || Q_OS_LINUX || Q_OS_FREEBSD
24
 		} else {
23
 	} else {
25
 			cForceWorkingDir(psAppDataPath());
24
 		cForceWorkingDir(psAppDataPath());
25
 		workingDirChosen = true;
26
-#elif defined OS_WIN_STORE // Q_OS_MAC || Q_OS_LINUX || Q_OS_WINRT
27
+#elif defined OS_WIN_STORE // Q_OS_MAC || Q_OS_LINUX || Q_OS_WINRT || Q_OS_FREEBSD
28
 #ifdef _DEBUG
29
 		cForceWorkingDir(cExeDir());
30
 #else // _DEBUG
31
@@ -357,7 +357,7 @@ void start(not_null<Core::Launcher*> lau
32
 			cForceWorkingDir(cWorkingDir());
26
 			workingDirChosen = true;
33
 			workingDirChosen = true;
27
@@ -502,7 +502,7 @@ namespace Logs {
34
 		}
28
 		//OutputDebugString(reinterpret_cast<const wchar_t *>(msg.utf16()));
35
-#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WINRT || OS_WIN_STORE
29
 #elif defined Q_OS_MAC
36
+#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WINRT || OS_WIN_STORE || Q_OS_FREEBSD
30
 		//objc_outputDebugString(msg);
31
-#elif defined Q_OS_LINUX && defined _DEBUG
32
+#elif (defined Q_OS_LINUX || defined Q_OS_FREEBSD) && defined _DEBUG
33
 		//std::cout << msg.toUtf8().constData();
34
 #endif
35
 	}
37
 	}
38
 
39
 	LogsData = new LogsDataFields();
(-)./files/patch-Telegram_SourceFiles_main.cpp (-30 lines)
Lines 1-30 Link Here
1
--- Telegram/SourceFiles/main.cpp.orig	2017-09-05 17:38:38 UTC
2
+++ Telegram/SourceFiles/main.cpp
3
@@ -22,10 +22,13 @@ Copyright (c) 2014-2017 John Preston, ht
4
 #include "platform/platform_specific.h"
5
 #include "storage/localstorage.h"
6
 
7
+#include "FREEBSD_QT_PLUGINDIR.h"
8
+
9
 int main(int argc, char *argv[]) {
10
-#ifndef Q_OS_MAC // Retina display support is working fine, others are not.
11
+#if !defined(Q_OS_MAC) && QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
12
+	// Retina display support is working fine, others are not.
13
 	QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling, true);
14
-#endif // Q_OS_MAC
15
+#endif // not defined Q_OS_MAC and QT_VERSION >= 5.6.0
16
 	QCoreApplication::setApplicationName(qsl("TelegramDesktop"));
17
 
18
 	InitFromCommandLine(argc, argv);
19
@@ -39,6 +42,11 @@ int main(int argc, char *argv[]) {
20
 	Logs::start(); // must be started before Platform is started
21
 	Platform::start(); // must be started before QApplication is created
22
 
23
+	// I don't know why path is not in QT_PLUGIN_PATH by default
24
+	QCoreApplication::addLibraryPath(FREEBSD_QT_PLUGINDIR);
25
+	// without this Telegram doesn't start on Ubuntu 17.04 due GTK errors
26
+	setenv("QT_STYLE_OVERRIDE", "qwerty", false);
27
+
28
 	int result = 0;
29
 	{
30
 		Application app(argc, argv);
(-)./files/patch-Telegram_SourceFiles_mainwindow.cpp (-19 lines)
Lines 1-19 Link Here
1
--- Telegram/SourceFiles/mainwindow.cpp.orig	2017-09-05 17:38:38 UTC
2
+++ Telegram/SourceFiles/mainwindow.cpp
3
@@ -460,6 +460,7 @@ void MainWindow::ui_hideMediaPreview() {
4
 void MainWindow::showConnecting(const QString &text, const QString &reconnect) {
5
 	if (_connecting) {
6
 		_connecting->set(text, reconnect);
7
+		_connecting->show();
8
 	} else {
9
 		_connecting.create(bodyWidget(), text, reconnect);
10
 		_connecting->show();
11
@@ -470,7 +471,7 @@ void MainWindow::showConnecting(const QS
12
 
13
 void MainWindow::hideConnecting() {
14
 	if (_connecting) {
15
-		_connecting.destroyDelayed();
16
+		_connecting->hide();
17
 	}
18
 }
19
 
(-)./files/patch-Telegram_SourceFiles_platform_linux_linux__libs.cpp (-7 / +7 lines)
Lines 1-6 Link Here
1
--- Telegram/SourceFiles/platform/linux/linux_libs.cpp.orig	2017-09-05 17:38:38 UTC
1
--- Telegram/SourceFiles/platform/linux/linux_libs.cpp.orig	2018-02-06 05:57:25 UTC
2
+++ Telegram/SourceFiles/platform/linux/linux_libs.cpp
2
+++ Telegram/SourceFiles/platform/linux/linux_libs.cpp
3
@@ -133,6 +133,7 @@ bool setupGtkBase(QLibrary &lib_gtk) {
3
@@ -121,6 +121,7 @@ bool setupGtkBase(QLibrary &lib_gtk) {
4
 	return true;
4
 	return true;
5
 }
5
 }
6
 
6
 
Lines 8-22 Link Here
8
 bool setupAppIndicator(QLibrary &lib_indicator) {
8
 bool setupAppIndicator(QLibrary &lib_indicator) {
9
 	if (!load(lib_indicator, "app_indicator_new", app_indicator_new)) return false;
9
 	if (!load(lib_indicator, "app_indicator_new", app_indicator_new)) return false;
10
 	if (!load(lib_indicator, "app_indicator_set_status", app_indicator_set_status)) return false;
10
 	if (!load(lib_indicator, "app_indicator_set_status", app_indicator_set_status)) return false;
11
@@ -142,6 +143,7 @@ bool setupAppIndicator(QLibrary &lib_ind
11
@@ -130,6 +131,7 @@ bool setupAppIndicator(QLibrary &lib_ind
12
 	DEBUG_LOG(("Library appindicator functions loaded!"));
12
 	DEBUG_LOG(("Library appindicator functions loaded!"));
13
 	return true;
13
 	return true;
14
 }
14
 }
15
+#endif
15
+#endif
16
 #endif // !TDESKTOP_DISABLE_GTK_INTEGRATION
16
 
17
 
17
 } // namespace
18
 } // namespace
18
 
19
@@ -191,10 +193,12 @@ f_g_type_check_instance_cast g_type_chec
19
@@ -201,10 +203,12 @@ f_g_type_check_instance_cast g_type_chec
20
 f_g_type_check_instance_is_a g_type_check_instance_is_a = nullptr;
20
 f_g_type_check_instance_is_a g_type_check_instance_is_a = nullptr;
21
 f_g_signal_connect_data g_signal_connect_data = nullptr;
21
 f_g_signal_connect_data g_signal_connect_data = nullptr;
22
 f_g_signal_handler_disconnect g_signal_handler_disconnect = nullptr;
22
 f_g_signal_handler_disconnect g_signal_handler_disconnect = nullptr;
Lines 29-35 Link Here
29
 f_gdk_init_check gdk_init_check = nullptr;
29
 f_gdk_init_check gdk_init_check = nullptr;
30
 f_gdk_pixbuf_new_from_data gdk_pixbuf_new_from_data = nullptr;
30
 f_gdk_pixbuf_new_from_data gdk_pixbuf_new_from_data = nullptr;
31
 f_gdk_pixbuf_new_from_file gdk_pixbuf_new_from_file = nullptr;
31
 f_gdk_pixbuf_new_from_file gdk_pixbuf_new_from_file = nullptr;
32
@@ -242,6 +246,7 @@ void start() {
32
@@ -234,6 +238,7 @@ void start() {
33
 	bool gtkLoaded = false;
33
 	bool gtkLoaded = false;
34
 	bool indicatorLoaded = false;
34
 	bool indicatorLoaded = false;
35
 	QLibrary lib_gtk, lib_indicator;
35
 	QLibrary lib_gtk, lib_indicator;
Lines 37-43 Link Here
37
 	if (loadLibrary(lib_indicator, "appindicator3", 1)) {
37
 	if (loadLibrary(lib_indicator, "appindicator3", 1)) {
38
 		if (loadLibrary(lib_gtk, "gtk-3", 0)) {
38
 		if (loadLibrary(lib_gtk, "gtk-3", 0)) {
39
 			gtkLoaded = setupGtkBase(lib_gtk);
39
 			gtkLoaded = setupGtkBase(lib_gtk);
40
@@ -257,6 +262,7 @@ void start() {
40
@@ -249,6 +254,7 @@ void start() {
41
 			}
41
 			}
42
 		}
42
 		}
43
 	}
43
 	}
(-)./files/patch-Telegram_SourceFiles_platform_linux_linux__libs.h (-6 / +6 lines)
Lines 1-7 Link Here
1
--- Telegram/SourceFiles/platform/linux/linux_libs.h.orig	2017-09-05 17:38:38 UTC
1
--- Telegram/SourceFiles/platform/linux/linux_libs.h.orig	2018-02-06 05:56:56 UTC
2
+++ Telegram/SourceFiles/platform/linux/linux_libs.h
2
+++ Telegram/SourceFiles/platform/linux/linux_libs.h
3
@@ -22,14 +22,16 @@ Copyright (c) 2014-2017 John Preston, ht
3
@@ -10,14 +10,16 @@ https://github.com/telegramdesktop/tdesk
4
 
4
 #ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
5
 extern "C" {
5
 extern "C" {
6
 #undef signals
6
 #undef signals
7
+#ifdef HAVE_APPINDICATOR
7
+#ifdef HAVE_APPINDICATOR
Lines 16-24 Link Here
16
-#include <unity/unity/unity.h>
16
-#include <unity/unity/unity.h>
17
+typedef void UnityLauncherEntry;
17
+typedef void UnityLauncherEntry;
18
 #endif // !TDESKTOP_DISABLE_UNITY_INTEGRATION
18
 #endif // !TDESKTOP_DISABLE_UNITY_INTEGRATION
19
 #endif // !TDESKTOP_DISABLE_GTK_INTEGRATION
19
 
20
 
20
 namespace Platform {
21
@@ -274,6 +276,7 @@ inline gulong g_signal_connect_swapped_h
21
@@ -284,6 +286,7 @@ inline gulong g_signal_connect_swapped_h
22
 typedef void (*f_g_signal_handler_disconnect)(gpointer instance, gulong handler_id);
22
 typedef void (*f_g_signal_handler_disconnect)(gpointer instance, gulong handler_id);
23
 extern f_g_signal_handler_disconnect g_signal_handler_disconnect;
23
 extern f_g_signal_handler_disconnect g_signal_handler_disconnect;
24
 
24
 
Lines 26-32 Link Here
26
 typedef AppIndicator* (*f_app_indicator_new)(const gchar *id, const gchar *icon_name, AppIndicatorCategory category);
26
 typedef AppIndicator* (*f_app_indicator_new)(const gchar *id, const gchar *icon_name, AppIndicatorCategory category);
27
 extern f_app_indicator_new app_indicator_new;
27
 extern f_app_indicator_new app_indicator_new;
28
 
28
 
29
@@ -295,6 +298,7 @@ extern f_app_indicator_set_menu app_indi
29
@@ -285,6 +288,7 @@ extern f_app_indicator_set_menu app_indi
30
 
30
 
31
 typedef void (*f_app_indicator_set_icon_full)(AppIndicator *self, const gchar *icon_name, const gchar *icon_desc);
31
 typedef void (*f_app_indicator_set_icon_full)(AppIndicator *self, const gchar *icon_name, const gchar *icon_desc);
32
 extern f_app_indicator_set_icon_full app_indicator_set_icon_full;
32
 extern f_app_indicator_set_icon_full app_indicator_set_icon_full;
(-)./files/patch-Telegram_SourceFiles_platform_linux_main__window__linux.cpp (-14 / +14 lines)
Lines 1-18 Link Here
1
--- Telegram/SourceFiles/platform/linux/main_window_linux.cpp.orig	2017-09-05 17:38:38 UTC
1
--- Telegram/SourceFiles/platform/linux/main_window_linux.cpp.orig	2018-04-08 17:34:33 UTC
2
+++ Telegram/SourceFiles/platform/linux/main_window_linux.cpp
2
+++ Telegram/SourceFiles/platform/linux/main_window_linux.cpp
3
@@ -36,7 +36,9 @@ namespace {
3
@@ -25,7 +25,9 @@ bool noQtTrayIcon = false, tryAppIndicat
4
 bool noQtTrayIcon = false, tryAppIndicator = false;
5
 bool useGtkBase = false, useAppIndicator = false, useStatusIcon = false, trayIconChecked = false, useUnityCount = false;
4
 bool useGtkBase = false, useAppIndicator = false, useStatusIcon = false, trayIconChecked = false, useUnityCount = false;
6
 
5
 
6
 #ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
7
+#ifdef HAVE_APPINDICATOR
7
+#ifdef HAVE_APPINDICATOR
8
 AppIndicator *_trayIndicator = 0;
8
 AppIndicator *_trayIndicator = 0;
9
+#endif
9
+#endif
10
 GtkStatusIcon *_trayIcon = 0;
10
 GtkStatusIcon *_trayIcon = 0;
11
 GtkWidget *_trayMenu = 0;
11
 GtkWidget *_trayMenu = 0;
12
 GdkPixbuf *_trayPixbuf = 0;
12
 GdkPixbuf *_trayPixbuf = 0;
13
@@ -274,7 +276,9 @@ void MainWindow::workmodeUpdated(DBIWork
13
@@ -279,7 +281,9 @@ void MainWindow::workmodeUpdated(DBIWork
14
 	if (mode == dbiwmWindowOnly) {
15
 		if (noQtTrayIcon) {
14
 		if (noQtTrayIcon) {
15
 #ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
16
 			if (useAppIndicator) {
16
 			if (useAppIndicator) {
17
+#ifdef HAVE_APPINDICATOR
17
+#ifdef HAVE_APPINDICATOR
18
 				Libs::app_indicator_set_status(_trayIndicator, APP_INDICATOR_STATUS_PASSIVE);
18
 				Libs::app_indicator_set_status(_trayIndicator, APP_INDICATOR_STATUS_PASSIVE);
Lines 20-28 Link Here
20
 			} else if (useStatusIcon) {
20
 			} else if (useStatusIcon) {
21
 				Libs::gtk_status_icon_set_visible(_trayIcon, false);
21
 				Libs::gtk_status_icon_set_visible(_trayIcon, false);
22
 			}
22
 			}
23
@@ -288,7 +292,9 @@ void MainWindow::workmodeUpdated(DBIWork
23
@@ -295,7 +299,9 @@ void MainWindow::workmodeUpdated(DBIWork
24
 	} else {
25
 		if (noQtTrayIcon) {
24
 		if (noQtTrayIcon) {
25
 #ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
26
 			if (useAppIndicator) {
26
 			if (useAppIndicator) {
27
+#ifdef HAVE_APPINDICATOR
27
+#ifdef HAVE_APPINDICATOR
28
 				Libs::app_indicator_set_status(_trayIndicator, APP_INDICATOR_STATUS_ACTIVE);
28
 				Libs::app_indicator_set_status(_trayIndicator, APP_INDICATOR_STATUS_ACTIVE);
Lines 30-36 Link Here
30
 			} else if (useStatusIcon) {
30
 			} else if (useStatusIcon) {
31
 				Libs::gtk_status_icon_set_visible(_trayIcon, true);
31
 				Libs::gtk_status_icon_set_visible(_trayIcon, true);
32
 			}
32
 			}
33
@@ -305,7 +311,9 @@ void MainWindow::psUpdateIndicator() {
33
@@ -314,7 +320,9 @@ void MainWindow::psUpdateIndicator() {
34
 	if (iconFile.exists()) {
34
 	if (iconFile.exists()) {
35
 		QByteArray path = QFile::encodeName(iconFile.absoluteFilePath()), name = QFile::encodeName(iconFile.fileName());
35
 		QByteArray path = QFile::encodeName(iconFile.absoluteFilePath()), name = QFile::encodeName(iconFile.fileName());
36
 		name = name.mid(0, name.size() - 4);
36
 		name = name.mid(0, name.size() - 4);
Lines 40-46 Link Here
40
 	} else {
40
 	} else {
41
 		useAppIndicator = false;
41
 		useAppIndicator = false;
42
 	}
42
 	}
43
@@ -392,11 +400,15 @@ void MainWindow::LibsLoaded() {
43
@@ -407,11 +415,15 @@ void MainWindow::LibsLoaded() {
44
 			&& (Libs::g_object_ref_sink != nullptr)
44
 			&& (Libs::g_object_ref_sink != nullptr)
45
 			&& (Libs::g_object_unref != nullptr);
45
 			&& (Libs::g_object_unref != nullptr);
46
 
46
 
Lines 51-70 Link Here
51
 			&& (Libs::app_indicator_set_menu != nullptr)
51
 			&& (Libs::app_indicator_set_menu != nullptr)
52
 			&& (Libs::app_indicator_set_icon_full != nullptr);
52
 			&& (Libs::app_indicator_set_icon_full != nullptr);
53
+#else
53
+#else
54
+    useAppIndicator = false;
54
+	useAppIndicator = false;
55
+#endif
55
+#endif
56
 
56
 
57
 	if (tryAppIndicator && useGtkBase && useAppIndicator) {
57
 	if (tryAppIndicator && useGtkBase && useAppIndicator) {
58
 		noQtTrayIcon = true;
58
 		noQtTrayIcon = true;
59
@@ -439,6 +451,7 @@ void MainWindow::psCreateTrayIcon() {
59
@@ -456,6 +468,7 @@ void MainWindow::psCreateTrayIcon() {
60
 		return;
61
 	}
60
 	}
62
 
61
 
62
 #ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
63
+#ifdef HAVE_APPINDICATOR
63
+#ifdef HAVE_APPINDICATOR
64
 	if (useAppIndicator) {
64
 	if (useAppIndicator) {
65
 		DEBUG_LOG(("Trying to create AppIndicator"));
65
 		DEBUG_LOG(("Trying to create AppIndicator"));
66
 		_trayMenu = Libs::gtk_menu_new();
66
 		_trayMenu = Libs::gtk_menu_new();
67
@@ -469,6 +482,7 @@ void MainWindow::psCreateTrayIcon() {
67
@@ -486,6 +499,7 @@ void MainWindow::psCreateTrayIcon() {
68
 			useAppIndicator = false;
68
 			useAppIndicator = false;
69
 		}
69
 		}
70
 	}
70
 	}
Lines 72-78 Link Here
72
 	if (useStatusIcon) {
72
 	if (useStatusIcon) {
73
 		if (Libs::gdk_init_check(0, 0)) {
73
 		if (Libs::gdk_init_check(0, 0)) {
74
 			if (!_trayMenu) _trayMenu = Libs::gtk_menu_new();
74
 			if (!_trayMenu) _trayMenu = Libs::gtk_menu_new();
75
@@ -585,10 +599,12 @@ MainWindow::~MainWindow() {
75
@@ -604,10 +618,12 @@ MainWindow::~MainWindow() {
76
 		Libs::g_object_unref(_trayMenu);
76
 		Libs::g_object_unref(_trayMenu);
77
 		_trayMenu = nullptr;
77
 		_trayMenu = nullptr;
78
 	}
78
 	}
(-)./files/patch-Telegram_SourceFiles_platform_platform__audio.h (-3 / +3 lines)
Lines 1-6 Link Here
1
--- Telegram/SourceFiles/platform/platform_audio.h.orig	2017-09-05 17:38:38 UTC
1
--- Telegram/SourceFiles/platform/platform_audio.h.orig	2018-02-06 05:55:32 UTC
2
+++ Telegram/SourceFiles/platform/platform_audio.h
2
+++ Telegram/SourceFiles/platform/platform_audio.h
3
@@ -32,7 +32,7 @@ void DeInit();
3
@@ -19,7 +19,7 @@ void DeInit();
4
 
4
 
5
 // Platform dependent implementations.
5
 // Platform dependent implementations.
6
 
6
 
Lines 9-15 Link Here
9
 namespace Platform {
9
 namespace Platform {
10
 namespace Audio {
10
 namespace Audio {
11
 
11
 
12
@@ -44,6 +44,6 @@ inline void DeInit() {
12
@@ -31,6 +31,6 @@ inline void DeInit() {
13
 
13
 
14
 } // namespace Audio
14
 } // namespace Audio
15
 } // namespace Platform
15
 } // namespace Platform
(-)./files/patch-Telegram_SourceFiles_platform_platform__file__utilities.h (-3 / +3 lines)
Lines 1-11 Link Here
1
--- Telegram/SourceFiles/platform/platform_file_utilities.h.orig	2017-09-05 17:38:38 UTC
1
--- Telegram/SourceFiles/platform/platform_file_utilities.h.orig	2018-02-06 05:55:41 UTC
2
+++ Telegram/SourceFiles/platform/platform_file_utilities.h
2
+++ Telegram/SourceFiles/platform/platform_file_utilities.h
3
@@ -51,8 +51,8 @@ bool Get(QStringList &files, QByteArray 
3
@@ -38,8 +38,8 @@ bool Get(QStringList &files, QByteArray 
4
 
4
 
5
 #ifdef Q_OS_MAC
5
 #ifdef Q_OS_MAC
6
 #include "platform/mac/file_utilities_mac.h"
6
 #include "platform/mac/file_utilities_mac.h"
7
-#elif defined Q_OS_LINUX // Q_OS_MAC
7
-#elif defined Q_OS_LINUX // Q_OS_MAC
8
+#elif defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) // Q_OS_MAC
8
+#elif defined Q_OS_LINUX || defined Q_OS_FREEBSD // Q_OS_MAC
9
 #include "platform/linux/file_utilities_linux.h"
9
 #include "platform/linux/file_utilities_linux.h"
10
-#elif defined Q_OS_WINRT || defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
10
-#elif defined Q_OS_WINRT || defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
11
+#elif defined Q_OS_WINRT || defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX || Q_OS_FREEBSD
11
+#elif defined Q_OS_WINRT || defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX || Q_OS_FREEBSD
(-)./files/patch-Telegram_SourceFiles_platform_platform__launcher.h (+14 lines)
Line 0 Link Here
1
--- Telegram/SourceFiles/platform/platform_launcher.h.orig	2018-02-07 00:52:41 UTC
2
+++ Telegram/SourceFiles/platform/platform_launcher.h
3
@@ -23,8 +23,8 @@ namespace Platform {
4
 
5
 #ifdef Q_OS_MAC
6
 #include "platform/mac/launcher_mac.h"
7
-#elif defined Q_OS_LINUX // Q_OS_MAC
8
+#elif defined Q_OS_LINUX || defined Q_OS_FREEBSD // Q_OS_MAC
9
 #include "platform/linux/launcher_linux.h"
10
-#elif defined Q_OS_WINRT || defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
11
+#elif defined Q_OS_WINRT || defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX || Q_OS_FREEBSD
12
 #include "platform/win/launcher_win.h"
13
-#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WINRT || Q_OS_WIN
14
+#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WINRT || Q_OS_WIN || Q_OS_FREEBSD
(-)./files/patch-Telegram_SourceFiles_platform_platform__main__window.h (-3 / +3 lines)
Lines 1-11 Link Here
1
--- Telegram/SourceFiles/platform/platform_main_window.h.orig	2017-09-05 17:38:38 UTC
1
--- Telegram/SourceFiles/platform/platform_main_window.h.orig	2018-02-06 05:55:51 UTC
2
+++ Telegram/SourceFiles/platform/platform_main_window.h
2
+++ Telegram/SourceFiles/platform/platform_main_window.h
3
@@ -32,8 +32,8 @@ class MainWindow;
3
@@ -19,8 +19,8 @@ class MainWindow;
4
 
4
 
5
 #ifdef Q_OS_MAC
5
 #ifdef Q_OS_MAC
6
 #include "platform/mac/main_window_mac.h"
6
 #include "platform/mac/main_window_mac.h"
7
-#elif defined Q_OS_LINUX // Q_OS_MAC
7
-#elif defined Q_OS_LINUX // Q_OS_MAC
8
+#elif defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) // Q_OS_MAC
8
+#elif defined Q_OS_LINUX || defined Q_OS_FREEBSD // Q_OS_MAC
9
 #include "platform/linux/main_window_linux.h"
9
 #include "platform/linux/main_window_linux.h"
10
-#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
10
-#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
11
+#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX || Q_OS_FREEBSD
11
+#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX || Q_OS_FREEBSD
(-)./files/patch-Telegram_SourceFiles_platform_platform__notifications__manager.h (-3 / +3 lines)
Lines 1-11 Link Here
1
--- Telegram/SourceFiles/platform/platform_notifications_manager.h.orig	2017-09-05 17:38:38 UTC
1
--- Telegram/SourceFiles/platform/platform_notifications_manager.h.orig	2018-02-06 05:55:59 UTC
2
+++ Telegram/SourceFiles/platform/platform_notifications_manager.h
2
+++ Telegram/SourceFiles/platform/platform_notifications_manager.h
3
@@ -39,8 +39,8 @@ void FlashBounce();
3
@@ -26,8 +26,8 @@ void FlashBounce();
4
 
4
 
5
 #ifdef Q_OS_MAC
5
 #ifdef Q_OS_MAC
6
 #include "platform/mac/notifications_manager_mac.h"
6
 #include "platform/mac/notifications_manager_mac.h"
7
-#elif defined Q_OS_LINUX // Q_OS_MAC
7
-#elif defined Q_OS_LINUX // Q_OS_MAC
8
+#elif defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) // Q_OS_MAC
8
+#elif defined Q_OS_LINUX || defined Q_OS_FREEBSD // Q_OS_MAC
9
 #include "platform/linux/notifications_manager_linux.h"
9
 #include "platform/linux/notifications_manager_linux.h"
10
-#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
10
-#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
11
+#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX || Q_OS_FREEBSD
11
+#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX || Q_OS_FREEBSD
(-)./files/patch-Telegram_SourceFiles_platform_platform__specific.h (-3 / +3 lines)
Lines 1-11 Link Here
1
--- Telegram/SourceFiles/platform/platform_specific.h.orig	2017-09-05 17:38:38 UTC
1
--- Telegram/SourceFiles/platform/platform_specific.h.orig	2018-02-06 05:56:11 UTC
2
+++ Telegram/SourceFiles/platform/platform_specific.h
2
+++ Telegram/SourceFiles/platform/platform_specific.h
3
@@ -45,8 +45,8 @@ void finish();
3
@@ -32,8 +32,8 @@ void finish();
4
 
4
 
5
 #ifdef Q_OS_MAC
5
 #ifdef Q_OS_MAC
6
 #include "platform/mac/specific_mac.h"
6
 #include "platform/mac/specific_mac.h"
7
-#elif defined Q_OS_LINUX // Q_OS_MAC
7
-#elif defined Q_OS_LINUX // Q_OS_MAC
8
+#elif defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) // Q_OS_MAC
8
+#elif defined Q_OS_LINUX || defined Q_OS_FREEBSD // Q_OS_MAC
9
 #include "platform/linux/specific_linux.h"
9
 #include "platform/linux/specific_linux.h"
10
-#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
10
-#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
11
+#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX || Q_OS_FREEBSD
11
+#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX || Q_OS_FREEBSD
(-)./files/patch-Telegram_SourceFiles_platform_platform__window__title.h (-4 / +4 lines)
Lines 1-15 Link Here
1
--- Telegram/SourceFiles/platform/platform_window_title.h.orig	2017-09-05 17:38:38 UTC
1
--- Telegram/SourceFiles/platform/platform_window_title.h.orig	2018-02-06 05:56:19 UTC
2
+++ Telegram/SourceFiles/platform/platform_window_title.h
2
+++ Telegram/SourceFiles/platform/platform_window_title.h
3
@@ -38,7 +38,7 @@ void PreviewWindowFramePaint(QImage &pre
3
@@ -25,7 +25,7 @@ void PreviewWindowFramePaint(QImage &pre
4
 #include "platform/mac/window_title_mac.h"
4
 #include "platform/mac/window_title_mac.h"
5
 #elif defined Q_OS_WIN // Q_OS_MAC
5
 #elif defined Q_OS_WIN // Q_OS_MAC
6
 #include "platform/win/window_title_win.h"
6
 #include "platform/win/window_title_win.h"
7
-#elif defined Q_OS_WINRT || defined Q_OS_LINUX // Q_OS_MAC || Q_OS_WIN
7
-#elif defined Q_OS_WINRT || defined Q_OS_LINUX // Q_OS_MAC || Q_OS_WIN
8
+#elif defined Q_OS_WINRT || defined Q_OS_LINUX  || defined Q_OS_FREEBSD // Q_OS_MAC || Q_OS_WIN
8
+#elif defined Q_OS_WINRT || defined Q_OS_LINUX || defined Q_OS_FREEBSD // Q_OS_MAC || Q_OS_WIN
9
 
9
 
10
 namespace Platform {
10
 namespace Platform {
11
 
11
 
12
@@ -56,4 +56,4 @@ inline void PreviewWindowFramePaint(QIma
12
@@ -43,4 +43,4 @@ inline void PreviewWindowFramePaint(QIma
13
 
13
 
14
 } // namespace Platform
14
 } // namespace Platform
15
 
15
 
(-)./files/patch-Telegram_SourceFiles_qt__functions.cpp (-1 / +1 lines)
Lines 1-4 Link Here
1
--- Telegram/SourceFiles/qt_functions.cpp.orig	2017-12-11 10:10:37 UTC
1
--- Telegram/SourceFiles/qt_functions.cpp.orig	2018-02-06 05:16:48 UTC
2
+++ Telegram/SourceFiles/qt_functions.cpp
2
+++ Telegram/SourceFiles/qt_functions.cpp
3
@@ -0,0 +1,94 @@
3
@@ -0,0 +1,94 @@
4
+/****************************************************************************
4
+/****************************************************************************
(-)./files/patch-Telegram_SourceFiles_qt__static__plugins.cpp (-2 / +2 lines)
Lines 1-6 Link Here
1
--- Telegram/SourceFiles/qt_static_plugins.cpp.orig	2017-09-05 17:38:38 UTC
1
--- Telegram/SourceFiles/qt_static_plugins.cpp.orig	2018-01-03 10:46:01 UTC
2
+++ Telegram/SourceFiles/qt_static_plugins.cpp
2
+++ Telegram/SourceFiles/qt_static_plugins.cpp
3
@@ -27,14 +27,5 @@ Q_IMPORT_PLUGIN(QWindowsIntegrationPlugi
3
@@ -14,14 +14,5 @@ Q_IMPORT_PLUGIN(QWindowsIntegrationPlugi
4
 Q_IMPORT_PLUGIN(QWebpPlugin)
4
 Q_IMPORT_PLUGIN(QWebpPlugin)
5
 Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)
5
 Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)
6
 Q_IMPORT_PLUGIN(QGenericEnginePlugin)
6
 Q_IMPORT_PLUGIN(QGenericEnginePlugin)
(-)./files/patch-Telegram_SourceFiles_settings_settings__notifications__widget.cpp (+14 lines)
Line 0 Link Here
1
--- Telegram/SourceFiles/settings/settings_notifications_widget.cpp.orig	2018-02-06 06:27:16 UTC
2
+++ Telegram/SourceFiles/settings/settings_notifications_widget.cpp
3
@@ -69,9 +69,9 @@ void NotificationsWidget::createNotifica
4
 	if (Platform::Notifications::Supported()) {
5
 #ifdef Q_OS_WIN
6
 		nativeNotificationsLabel = lang(lng_settings_use_windows);
7
-#elif defined Q_OS_LINUX64 || defined Q_OS_LINUX32 // Q_OS_WIN
8
+#elif defined Q_OS_LINUX64 || defined Q_OS_LINUX32 || defined Q_OS_FREEBSD // Q_OS_WIN
9
 		nativeNotificationsLabel = lang(lng_settings_use_native_notifications);
10
-#endif // Q_OS_WIN || Q_OS_LINUX64 || Q_OS_LINUX32
11
+#endif // Q_OS_WIN || Q_OS_LINUX64 || Q_OS_LINUX32 || Q_OS_FREEBSD
12
 	}
13
 	if (!nativeNotificationsLabel.isEmpty()) {
14
 		createChildRow(_nativeNotifications, margin, nativeNotificationsLabel, [this](bool) { onNativeNotifications(); }, Global::NativeNotifications());
(-)./files/patch-Telegram_SourceFiles_settings.cpp (+11 lines)
Line 0 Link Here
1
--- Telegram/SourceFiles/settings.cpp.orig	2018-02-06 06:26:16 UTC
2
+++ Telegram/SourceFiles/settings.cpp
3
@@ -83,6 +83,8 @@ DBIPlatform gPlatform = dbipMac;
4
 DBIPlatform gPlatform = dbipLinux64;
5
 #elif defined Q_OS_LINUX32
6
 DBIPlatform gPlatform = dbipLinux32;
7
+#elif defined Q_OS_FREEBSD
8
+DBIPlatform gPlatform = dbipFreeBSD;
9
 #else
10
 #error Unknown platform
11
 #endif
(-)./files/patch-Telegram_SourceFiles_structs.cpp (-11 lines)
Lines 1-11 Link Here
1
--- Telegram/SourceFiles/structs.cpp.orig	2017-09-05 17:38:38 UTC
2
+++ Telegram/SourceFiles/structs.cpp
3
@@ -1280,7 +1280,7 @@ QString saveFileName(const QString &titl
4
 	name = name.replace(QRegularExpression(qsl("[\\\\\\/\\:\\*\\?\\\"\\<\\>\\|]")), qsl("_"));
5
 #elif defined Q_OS_MAC
6
 	name = name.replace(QRegularExpression(qsl("[\\:]")), qsl("_"));
7
-#elif defined Q_OS_LINUX
8
+#elif defined Q_OS_LINUX || defined Q_OS_FREEBSD
9
 	name = name.replace(QRegularExpression(qsl("[\\/]")), qsl("_"));
10
 #endif
11
 	if (Global::AskDownloadPath() || savingAs) {
(-)./files/patch-Telegram_SourceFiles_ui_text_text__block.cpp (-6 / +7 lines)
Lines 1-11 Link Here
1
--- Telegram/SourceFiles/ui/text/text_block.cpp.orig	2017-09-05 17:38:38 UTC
1
--- Telegram/SourceFiles/ui/text/text_block.cpp.orig	2018-04-08 17:34:33 UTC
2
+++ Telegram/SourceFiles/ui/text/text_block.cpp
2
+++ Telegram/SourceFiles/ui/text/text_block.cpp
3
@@ -330,7 +330,7 @@ TextBlock::TextBlock(const style::font &
3
@@ -332,6 +332,9 @@ TextBlock::TextBlock(const style::font &
4
 		SignalHandlers::setCrashAnnotationRef("CrashString", &part);
5
 
4
 
6
 		QStackTextEngine engine(part, blockFont->f);
5
 		QStackTextEngine engine(part, blockFont->f);
7
-		QTextLayout layout(&engine);
6
 		BlockParser parser(&engine, this, minResizeWidth, _from, part);
8
+		QTextLayout layout(part, blockFont->f);
7
+		QTextLayout layout(part, blockFont->f);
9
 		layout.beginLayout();
8
+		layout.beginLayout();
10
 		layout.createLine();
9
+		layout.createLine();
11
 
10
 
11
 		CrashReports::ClearAnnotationRef("CrashString");
12
 	}
(-)./files/patch-Telegram_SourceFiles_ui_text_text.cpp (-2 / +2 lines)
Lines 1-6 Link Here
1
--- Telegram/SourceFiles/ui/text/text.cpp.orig	2017-09-05 17:38:38 UTC
1
--- Telegram/SourceFiles/ui/text/text.cpp.orig	2018-04-08 17:34:33 UTC
2
+++ Telegram/SourceFiles/ui/text/text.cpp
2
+++ Telegram/SourceFiles/ui/text/text.cpp
3
@@ -1689,11 +1689,11 @@ private:
3
@@ -1748,11 +1748,11 @@ private:
4
 		if (item == -1)
4
 		if (item == -1)
5
 			return;
5
 			return;
6
 
6
 
(-)./files/patch-Telegram_SourceFiles_ui_twidget.cpp (-2 / +2 lines)
Lines 1-6 Link Here
1
--- Telegram/SourceFiles/ui/twidget.cpp.orig	2017-09-05 17:38:38 UTC
1
--- Telegram/SourceFiles/ui/twidget.cpp.orig	2018-01-03 10:46:01 UTC
2
+++ Telegram/SourceFiles/ui/twidget.cpp
2
+++ Telegram/SourceFiles/ui/twidget.cpp
3
@@ -191,9 +191,9 @@ void sendSynteticMouseEvent(QWidget *wid
3
@@ -235,9 +235,9 @@ void sendSynteticMouseEvent(QWidget *wid
4
 			, button
4
 			, button
5
 			, QGuiApplication::mouseButtons() | button
5
 			, QGuiApplication::mouseButtons() | button
6
 			, QGuiApplication::keyboardModifiers()
6
 			, QGuiApplication::keyboardModifiers()
(-)./files/patch-Telegram_SourceFiles_ui_widgets_labels.cpp (+16 lines)
Line 0 Link Here
1
--- Telegram/SourceFiles/ui/widgets/labels.cpp.orig	2018-02-06 06:28:03 UTC
2
+++ Telegram/SourceFiles/ui/widgets/labels.cpp
3
@@ -359,11 +359,11 @@ Text::StateResult FlatLabel::dragActionF
4
 		}
5
 	}
6
 
7
-#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
8
+#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64 || defined Q_OS_FREEBSD
9
 	if (!_selection.empty()) {
10
 		QApplication::clipboard()->setText(_text.originalText(_selection, _contextExpandLinksMode), QClipboard::Selection);
11
 	}
12
-#endif // Q_OS_LINUX32 || Q_OS_LINUX64
13
+#endif // Q_OS_LINUX32 || Q_OS_LINUX64 || Q_OS_FREEBSD
14
 
15
 	return state;
16
 }
(-)./files/patch-Telegram_SourceFiles_window_main__window.h (+11 lines)
Line 0 Link Here
1
--- Telegram/SourceFiles/window/main_window.h.orig	2018-04-08 17:34:33 UTC
2
+++ Telegram/SourceFiles/window/main_window.h
3
@@ -57,7 +57,7 @@ public:
4
 	}
5
 
6
 	void reActivateWindow() {
7
-#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
8
+#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64 || defined Q_OS_FREEBSD
9
 		onReActivate();
10
 		QTimer::singleShot(200, this, SLOT(onReActivate()));
11
 #endif // Q_OS_LINUX32 || Q_OS_LINUX64
(-)./files/patch-Telegram_ThirdParty_libtgvoip_audio_AudioInput.cpp (-2 / +20 lines)
Lines 1-6 Link Here
1
--- Telegram/ThirdParty/libtgvoip/audio/AudioInput.cpp.orig	2017-07-06 17:16:18 UTC
1
--- Telegram/ThirdParty/libtgvoip/audio/AudioInput.cpp.orig	2017-12-27 18:47:58 UTC
2
+++ Telegram/ThirdParty/libtgvoip/audio/AudioInput.cpp
2
+++ Telegram/ThirdParty/libtgvoip/audio/AudioInput.cpp
3
@@ -20,7 +20,7 @@
3
@@ -19,7 +19,7 @@
4
 #include "../os/windows/AudioInputWave.h"
4
 #include "../os/windows/AudioInputWave.h"
5
 #endif
5
 #endif
6
 #include "../os/windows/AudioInputWASAPI.h"
6
 #include "../os/windows/AudioInputWASAPI.h"
Lines 9-11 Link Here
9
 #include "../os/linux/AudioInputALSA.h"
9
 #include "../os/linux/AudioInputALSA.h"
10
 #include "../os/linux/AudioInputPulse.h"
10
 #include "../os/linux/AudioInputPulse.h"
11
 #else
11
 #else
12
@@ -54,7 +54,7 @@ AudioInput *AudioInput::Create(std::stri
13
 		return new AudioInputWave(deviceID);
14
 #endif
15
 	return new AudioInputWASAPI(deviceID);
16
-#elif defined(__linux__)
17
+#elif defined(__linux__) || defined(__FreeBSD__)
18
 	if(AudioInputPulse::IsAvailable()){
19
 		AudioInputPulse* aip=new AudioInputPulse(deviceID);
20
 		if(!aip->IsInitialized())
21
@@ -87,7 +87,7 @@ void AudioInput::EnumerateDevices(std::v
22
 	}
23
 #endif
24
 	AudioInputWASAPI::EnumerateDevices(devs);
25
-#elif defined(__linux__) && !defined(__ANDROID__)
26
+#elif (defined(__linux__) || defined(__FreeBSD__)) && !defined(__ANDROID__)
27
 	if(!AudioInputPulse::IsAvailable() || !AudioInputPulse::EnumerateDevices(devs))
28
 		AudioInputALSA::EnumerateDevices(devs);
29
 #endif
(-)./files/patch-Telegram_ThirdParty_libtgvoip_audio_AudioOutput.cpp (-2 / +20 lines)
Lines 1-6 Link Here
1
--- Telegram/ThirdParty/libtgvoip/audio/AudioOutput.cpp.orig	2017-07-06 17:16:18 UTC
1
--- Telegram/ThirdParty/libtgvoip/audio/AudioOutput.cpp.orig	2017-12-27 18:47:58 UTC
2
+++ Telegram/ThirdParty/libtgvoip/audio/AudioOutput.cpp
2
+++ Telegram/ThirdParty/libtgvoip/audio/AudioOutput.cpp
3
@@ -21,7 +21,7 @@
3
@@ -20,7 +20,7 @@
4
 #include "../os/windows/AudioOutputWave.h"
4
 #include "../os/windows/AudioOutputWave.h"
5
 #endif
5
 #endif
6
 #include "../os/windows/AudioOutputWASAPI.h"
6
 #include "../os/windows/AudioOutputWASAPI.h"
Lines 9-11 Link Here
9
 #include "../os/linux/AudioOutputALSA.h"
9
 #include "../os/linux/AudioOutputALSA.h"
10
 #include "../os/linux/AudioOutputPulse.h"
10
 #include "../os/linux/AudioOutputPulse.h"
11
 #else
11
 #else
12
@@ -52,7 +52,7 @@ AudioOutput *AudioOutput::Create(std::st
13
 		return new AudioOutputWave(deviceID);
14
 #endif
15
 	return new AudioOutputWASAPI(deviceID);
16
-#elif defined(__linux__)
17
+#elif defined(__linux__) || defined(__FreeBSD__)
18
 	if(AudioOutputPulse::IsAvailable()){
19
 		AudioOutputPulse* aop=new AudioOutputPulse(deviceID);
20
 		if(!aop->IsInitialized())
21
@@ -101,7 +101,7 @@ void AudioOutput::EnumerateDevices(std::
22
 	}
23
 #endif
24
 	AudioOutputWASAPI::EnumerateDevices(devs);
25
-#elif defined(__linux__) && !defined(__ANDROID__)
26
+#elif (defined(__linux__) || defined(__FreeBSD__)) && !defined(__ANDROID__)
27
 	if(!AudioOutputPulse::IsAvailable() || !AudioOutputPulse::EnumerateDevices(devs))
28
 		AudioOutputALSA::EnumerateDevices(devs);
29
 #endif
(-)./files/patch-Telegram_ThirdParty_libtgvoip_logging.cpp (+20 lines)
Line 0 Link Here
1
--- Telegram/ThirdParty/libtgvoip/logging.cpp.orig	2018-02-07 04:44:58 UTC
2
+++ Telegram/ThirdParty/libtgvoip/logging.cpp
3
@@ -13,7 +13,7 @@
4
 
5
 #ifdef __ANDROID__
6
 #include <sys/system_properties.h>
7
-#elif defined(__linux__)
8
+#elif defined(__linux__) || defined(__FreeBSD__)
9
 #include <sys/utsname.h>
10
 #endif
11
 
12
@@ -51,7 +51,7 @@ void tgvoip_log_file_write_header(){
13
 #else
14
 			char* systemVersion="Windows RT";
15
 #endif
16
-#elif defined(__linux__)
17
+#elif defined(__linux__) || defined(__FreeBSD__)
18
 #ifdef __ANDROID__
19
 		char systemVersion[128];
20
 		char sysRel[PROP_VALUE_MAX];
(-)./files/patch-Telegram_ThirdParty_libtgvoip_os_linux_AudioInputALSA.cpp (+20 lines)
Line 0 Link Here
1
--- Telegram/ThirdParty/libtgvoip/os/linux/AudioInputALSA.cpp.orig	2018-02-07 04:47:15 UTC
2
+++ Telegram/ThirdParty/libtgvoip/os/linux/AudioInputALSA.cpp
3
@@ -12,6 +12,10 @@
4
 #include "../../logging.h"
5
 #include "../../VoIPController.h"
6
 
7
+#ifndef typeof
8
+#define typeof __typeof__
9
+#endif
10
+
11
 using namespace tgvoip::audio;
12
 
13
 #define BUFFER_SIZE 960
14
@@ -177,4 +181,4 @@ void AudioInputALSA::EnumerateDevices(st
15
 	}
16
 
17
 	dlclose(lib);
18
-}
19
\ No newline at end of file
20
+}
(-)./files/patch-Telegram_ThirdParty_libtgvoip_os_linux_AudioInputPulse.cpp (+10 lines)
Line 0 Link Here
1
--- Telegram/ThirdParty/libtgvoip/os/linux/AudioInputPulse.cpp.orig	2018-02-07 04:48:22 UTC
2
+++ Telegram/ThirdParty/libtgvoip/os/linux/AudioInputPulse.cpp
3
@@ -8,6 +8,7 @@
4
 #include <assert.h>
5
 #include <dlfcn.h>
6
 #include <unistd.h>
7
+#include <libgen.h>
8
 #include "AudioInputPulse.h"
9
 #include "../../logging.h"
10
 #include "../../VoIPController.h"
(-)./files/patch-Telegram_ThirdParty_libtgvoip_os_linux_AudioOutputALSA.cpp (+20 lines)
Line 0 Link Here
1
--- Telegram/ThirdParty/libtgvoip/os/linux/AudioOutputALSA.cpp.orig	2018-02-07 04:46:53 UTC
2
+++ Telegram/ThirdParty/libtgvoip/os/linux/AudioOutputALSA.cpp
3
@@ -11,6 +11,10 @@
4
 #include "../../logging.h"
5
 #include "../../VoIPController.h"
6
 
7
+#ifndef typeof
8
+#define typeof __typeof__
9
+#endif
10
+
11
 #define BUFFER_SIZE 960
12
 #define CHECK_ERROR(res, msg) if(res<0){LOGE(msg ": %s", _snd_strerror(res)); failed=true; return;}
13
 #define CHECK_DL_ERROR(res, msg) if(!res){LOGE(msg ": %s", dlerror()); failed=true; return;}
14
@@ -180,4 +184,4 @@ void AudioOutputALSA::EnumerateDevices(s
15
 	}
16
 
17
 	dlclose(lib);
18
-}
19
\ No newline at end of file
20
+}
(-)./files/patch-Telegram_ThirdParty_libtgvoip_os_linux_AudioOutputPulse.cpp (+10 lines)
Line 0 Link Here
1
--- Telegram/ThirdParty/libtgvoip/os/linux/AudioOutputPulse.cpp.orig	2018-02-07 04:48:32 UTC
2
+++ Telegram/ThirdParty/libtgvoip/os/linux/AudioOutputPulse.cpp
3
@@ -8,6 +8,7 @@
4
 #include <assert.h>
5
 #include <dlfcn.h>
6
 #include <unistd.h>
7
+#include <libgen.h>
8
 #include "AudioOutputPulse.h"
9
 #include "../../logging.h"
10
 #include "../../VoIPController.h"
(-)./files/patch-Telegram_ThirdParty_libtgvoip_os_linux_PulseAudioLoader.h (+20 lines)
Line 0 Link Here
1
--- Telegram/ThirdParty/libtgvoip/os/linux/PulseAudioLoader.h.orig	2018-02-07 04:46:43 UTC
2
+++ Telegram/ThirdParty/libtgvoip/os/linux/PulseAudioLoader.h
3
@@ -9,6 +9,10 @@
4
 
5
 #include <pulse/pulseaudio.h>
6
 
7
+#ifndef typeof
8
+#define typeof __typeof__
9
+#endif
10
+
11
 #define DECLARE_DL_FUNCTION(name) static typeof(name)* _import_##name
12
 
13
 namespace tgvoip{
14
@@ -106,4 +110,4 @@ private:
15
 #define pa_operation_get_state PulseAudioLoader::_import_pa_operation_get_state
16
 #endif
17
 
18
-#endif // LIBTGVOIP_PULSEAUDIOLOADER_H
19
\ No newline at end of file
20
+#endif // LIBTGVOIP_PULSEAUDIOLOADER_H
(-)./files/patch-Telegram_ThirdParty_libtgvoip_os_posix_NetworkSocketPosix.cpp (-2 / +2 lines)
Lines 1-6 Link Here
1
--- Telegram/ThirdParty/libtgvoip/os/posix/NetworkSocketPosix.cpp.orig	2017-07-06 17:16:18 UTC
1
--- Telegram/ThirdParty/libtgvoip/os/posix/NetworkSocketPosix.cpp.orig	2017-12-27 18:47:58 UTC
2
+++ Telegram/ThirdParty/libtgvoip/os/posix/NetworkSocketPosix.cpp
2
+++ Telegram/ThirdParty/libtgvoip/os/posix/NetworkSocketPosix.cpp
3
@@ -45,6 +45,7 @@ void NetworkSocketPosix::SetMaxPriority(
3
@@ -46,6 +46,7 @@ void NetworkSocketPosix::SetMaxPriority(
4
 	if(res<0){
4
 	if(res<0){
5
 		LOGE("error setting darwin-specific net priority: %d / %s", errno, strerror(errno));
5
 		LOGE("error setting darwin-specific net priority: %d / %s", errno, strerror(errno));
6
 	}
6
 	}
(-)./files/patch-Telegram_ThirdParty_libtgvoip_threading.h (-1 / +1 lines)
Lines 1-4 Link Here
1
--- Telegram/ThirdParty/libtgvoip/threading.h.orig	2017-07-06 17:16:18 UTC
1
--- Telegram/ThirdParty/libtgvoip/threading.h.orig	2017-12-27 18:47:58 UTC
2
+++ Telegram/ThirdParty/libtgvoip/threading.h
2
+++ Telegram/ThirdParty/libtgvoip/threading.h
3
@@ -20,7 +20,7 @@ typedef pthread_cond_t tgvoip_lock_t;
3
@@ -20,7 +20,7 @@ typedef pthread_cond_t tgvoip_lock_t;
4
 #define start_thread(ref, entry, arg) pthread_create(&ref, NULL, entry, arg)
4
 #define start_thread(ref, entry, arg) pthread_create(&ref, NULL, entry, arg)
(-)./files/patch-Telegram_ThirdParty_libtgvoip_VoIPController.cpp (+11 lines)
Line 0 Link Here
1
--- Telegram/ThirdParty/libtgvoip/VoIPController.cpp.orig	2018-02-07 04:45:28 UTC
2
+++ Telegram/ThirdParty/libtgvoip/VoIPController.cpp
3
@@ -1954,7 +1954,7 @@ static void initMachTimestart() {
4
 #endif
5
 
6
 double VoIPController::GetCurrentTime(){
7
-#if defined(__linux__)
8
+#if defined(__linux__) || defined(__FreeBSD__)
9
 	struct timespec ts;
10
 	clock_gettime(CLOCK_MONOTONIC, &ts);
11
 	return ts.tv_sec+(double)ts.tv_nsec/1000000000.0;
(-)./files/patch-Telegram_ThirdParty_libtgvoip_webrtc__dsp_webrtc_base_stringutils.h (-1 / +1 lines)
Lines 1-4 Link Here
1
--- Telegram/ThirdParty/libtgvoip/webrtc_dsp/webrtc/base/stringutils.h.orig	2017-07-06 17:16:18 UTC
1
--- Telegram/ThirdParty/libtgvoip/webrtc_dsp/webrtc/base/stringutils.h.orig	2017-12-27 18:47:58 UTC
2
+++ Telegram/ThirdParty/libtgvoip/webrtc_dsp/webrtc/base/stringutils.h
2
+++ Telegram/ThirdParty/libtgvoip/webrtc_dsp/webrtc/base/stringutils.h
3
@@ -23,7 +23,7 @@
3
@@ -23,7 +23,7 @@
4
 #endif  // WEBRTC_WIN 
4
 #endif  // WEBRTC_WIN 
(-)./Makefile (-13 / +28 lines)
Lines 2-8 Link Here
2
2
3
PORTNAME=	telegram-desktop
3
PORTNAME=	telegram-desktop
4
DISTVERSIONPREFIX=	v
4
DISTVERSIONPREFIX=	v
5
DISTVERSION=	1.1.23
5
DISTVERSION=	1.2.17
6
CATEGORIES=	net-im
6
CATEGORIES=	net-im
7
7
8
MAINTAINER=	henry.hu.sh@gmail.com
8
MAINTAINER=	henry.hu.sh@gmail.com
Lines 12-25 Link Here
12
LICENSE_FILE=	${WRKSRC}/LICENSE
12
LICENSE_FILE=	${WRKSRC}/LICENSE
13
13
14
BUILD_DEPENDS=	dee>0:devel/dee \
14
BUILD_DEPENDS=	dee>0:devel/dee \
15
		gyp:devel/py-gyp@${PY_FLAVOR}
15
		gyp:devel/py-gyp@${PY_FLAVOR} \
16
LIB_DEPENDS=	libasound.so:audio/alsa-lib \
16
		range-v3>0:devel/range-v3 \
17
		libavformat.so:multimedia/ffmpeg \
17
		pulseaudio>0:audio/pulseaudio \
18
		alsa-lib>0:audio/alsa-lib
19
LIB_DEPENDS=	libavformat.so:multimedia/ffmpeg \
18
		libdbus-1.so:devel/dbus \
20
		libdbus-1.so:devel/dbus \
19
		libminizip.so:archivers/minizip \
21
		libminizip.so:archivers/minizip \
20
		libopenal.so:audio/openal-soft \
22
		libopenal.so:audio/openal-soft \
21
		libopus.so:audio/opus \
23
		libopus.so:audio/opus
22
		libpulse.so:audio/pulseaudio
23
24
24
USES=		cmake:noninja,outsource desktop-file-utils gmake pkgconfig python:2.7,build ssl
25
USES=		cmake:noninja,outsource desktop-file-utils gmake pkgconfig python:2.7,build ssl
25
USE_GITHUB=	yes
26
USE_GITHUB=	yes
Lines 27-49 Link Here
27
GH_PROJECT=	tdesktop
28
GH_PROJECT=	tdesktop
28
GH_TUPLE=	catchorg:Catch2:5ca44b68:catch/Telegram/ThirdParty/Catch \
29
GH_TUPLE=	catchorg:Catch2:5ca44b68:catch/Telegram/ThirdParty/Catch \
29
		mapbox:variant:550ac2f:variant/Telegram/ThirdParty/variant \
30
		mapbox:variant:550ac2f:variant/Telegram/ThirdParty/variant \
30
		Microsoft:GSL:c5851a8:gsl/Telegram/ThirdParty/GSL \
31
		Microsoft:GSL:9d65e74:gsl/Telegram/ThirdParty/GSL \
31
		telegramdesktop:libtgvoip:757a5d8e:libtgvoip/Telegram/ThirdParty/libtgvoip
32
		telegramdesktop:libtgvoip:6e0e102:libtgvoip/Telegram/ThirdParty/libtgvoip \
33
		telegramdesktop:crl:344cbde9:crl/Telegram/ThirdParty/crl
32
USE_GNOME=	glib20 gtk30
34
USE_GNOME=	glib20 gtk30
33
USE_QT5=	core gui imageformats network widgets buildtools_build qmake_build
35
USE_QT5=	core gui imageformats network widgets buildtools_build qmake_build dbus
34
USE_XORG=	x11 xcb
36
USE_XORG=	x11 xcb
35
37
36
CMAKE_SOURCE_PATH=	${WRKSRC}/out/Release
38
CMAKE_SOURCE_PATH=	${WRKSRC}/out/Release
37
39
38
GYP_DEFINES=	TDESKTOP_DISABLE_CRASH_REPORTS,TDESKTOP_DISABLE_AUTOUPDATE,TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME
40
GYP_DEFINES=	TDESKTOP_DISABLE_CRASH_REPORTS,TDESKTOP_DISABLE_AUTOUPDATE,TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME
39
41
42
# Telegram uses OpenAL for its audio, but libtgvoip (for voice calls) can use PulseAudio or ALSA.
43
# It dynamically loads PulseAudio, and if this fails, it loads ALSA.
44
# If both of them are not installed, then voice calls do not work, but other functionalities still work.
45
OPTIONS_MULTI=	AUDIO
46
OPTIONS_MULTI_AUDIO=	ALSA PULSEAUDIO
47
OPTIONS_DEFAULT=	ALSA
48
49
AUDIO_DESC=	Audio backend for voice calls
50
51
ALSA_LIB_DEPENDS=	libasound.so:audio/alsa-lib
52
PULSEAUDIO_LIB_DEPENDS=	libpulse.so:audio/pulseaudio
53
40
.include <bsd.port.pre.mk>
54
.include <bsd.port.pre.mk>
41
55
56
# This port needs C++17 libs/compiler.
57
# Currently, this is not supported by USES=compiler
58
# Using clang does not work: libc++ in base does not support C++17.
59
# Using gcc does not work: using both libc++ and libstdc++ causes crashes.
42
.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1100000
60
.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1100000
43
CC=		clang40
61
BROKEN=		Need C++17 support in compiler and runtime
44
CXX=		clang++40
45
BUILD_DEPENDS+=	clang++40:devel/llvm40
46
RUN_DEPENDS+=	clang++40:devel/llvm40
47
.endif
62
.endif
48
63
49
post-patch:
64
post-patch:

Return to bug 227571