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

(-)./Makefile (-6 / +7 lines)
Lines 1-9 Link Here
1
# $FreeBSD: head/net-im/telegram-desktop/Makefile 507372 2019-07-26 20:46:53Z gerald $
1
# $FreeBSD: head/net-im/telegram-desktop/Makefile 484686 2018-11-11 11:45:19Z makc $
2
2
3
PORTNAME=	telegram-desktop
3
PORTNAME=	telegram-desktop
4
DISTVERSIONPREFIX=	v
4
DISTVERSIONPREFIX=	v
5
DISTVERSION=	1.6.7
5
DISTVERSION=	1.7.14
6
PORTREVISION=	2
7
CATEGORIES=	net-im
6
CATEGORIES=	net-im
8
7
9
MAINTAINER=	henry.hu.sh@gmail.com
8
MAINTAINER=	henry.hu.sh@gmail.com
Lines 34-42 Link Here
34
GH_TUPLE=	catchorg:Catch2:5ca44b68:catch/Telegram/ThirdParty/Catch \
33
GH_TUPLE=	catchorg:Catch2:5ca44b68:catch/Telegram/ThirdParty/Catch \
35
		mapbox:variant:550ac2f:variant/Telegram/ThirdParty/variant \
34
		mapbox:variant:550ac2f:variant/Telegram/ThirdParty/variant \
36
		Microsoft:GSL:d846fe5:gsl/Telegram/ThirdParty/GSL \
35
		Microsoft:GSL:d846fe5:gsl/Telegram/ThirdParty/GSL \
37
		telegramdesktop:libtgvoip:e701050:libtgvoip/Telegram/ThirdParty/libtgvoip \
36
		telegramdesktop:libtgvoip:0e92a22:libtgvoip/Telegram/ThirdParty/libtgvoip \
38
		telegramdesktop:crl:84072fb:crl/Telegram/ThirdParty/crl \
37
		telegramdesktop:crl:9ea8700:crl/Telegram/ThirdParty/crl \
39
		Cyan4973:xxHash:7cc9639:xxhash/Telegram/ThirdParty/xxHash
38
		Cyan4973:xxHash:7cc9639:xxhash/Telegram/ThirdParty/xxHash \
39
		john-preston:rlottie:302b7f9:rlottie/Telegram/ThirdParty/rlottie \
40
		lz4:lz4:9a2a9f2:lz4/Telegram/ThirdParty/lz4
40
USE_GNOME=	glib20
41
USE_GNOME=	glib20
41
USE_QT=		core gui imageformats network widgets buildtools_build qmake_build dbus
42
USE_QT=		core gui imageformats network widgets buildtools_build qmake_build dbus
42
USE_XORG=	x11 xcb
43
USE_XORG=	x11 xcb
(-)./distinfo (-7 / +11 lines)
Lines 1-15 Link Here
1
TIMESTAMP = 1555805465
1
TIMESTAMP = 1564285102
2
SHA256 (telegramdesktop-tdesktop-v1.6.7_GH0.tar.gz) = 77f4cf6507d1ebc26eaef472aa4817cc57a77c5e3065f6b2afa294530f0633a1
2
SHA256 (telegramdesktop-tdesktop-v1.7.14_GH0.tar.gz) = a52ab6efb4dc7579f05543df3fc3814baa09c0644e00ca30e37a9c6f99a5d164
3
SIZE (telegramdesktop-tdesktop-v1.6.7_GH0.tar.gz) = 14323106
3
SIZE (telegramdesktop-tdesktop-v1.7.14_GH0.tar.gz) = 14296012
4
SHA256 (catchorg-Catch2-5ca44b68_GH0.tar.gz) = 8cdf2a345897bda1aaabffd4496dffe263768cef3e4254e74ae63545c8e12cc2
4
SHA256 (catchorg-Catch2-5ca44b68_GH0.tar.gz) = 8cdf2a345897bda1aaabffd4496dffe263768cef3e4254e74ae63545c8e12cc2
5
SIZE (catchorg-Catch2-5ca44b68_GH0.tar.gz) = 375264
5
SIZE (catchorg-Catch2-5ca44b68_GH0.tar.gz) = 375264
6
SHA256 (mapbox-variant-550ac2f_GH0.tar.gz) = 7ab3aa7c9fa672027f13721584df5f7ec09c0ecca499d374c6ac76e147ef7354
6
SHA256 (mapbox-variant-550ac2f_GH0.tar.gz) = 7ab3aa7c9fa672027f13721584df5f7ec09c0ecca499d374c6ac76e147ef7354
7
SIZE (mapbox-variant-550ac2f_GH0.tar.gz) = 108686
7
SIZE (mapbox-variant-550ac2f_GH0.tar.gz) = 108686
8
SHA256 (Microsoft-GSL-d846fe5_GH0.tar.gz) = 4c463f93ca3b1dcb0b8d73b54309c1d31145761c457f1a6fd53554a6d469b468
8
SHA256 (Microsoft-GSL-d846fe5_GH0.tar.gz) = 4c463f93ca3b1dcb0b8d73b54309c1d31145761c457f1a6fd53554a6d469b468
9
SIZE (Microsoft-GSL-d846fe5_GH0.tar.gz) = 58930
9
SIZE (Microsoft-GSL-d846fe5_GH0.tar.gz) = 58930
10
SHA256 (telegramdesktop-libtgvoip-e701050_GH0.tar.gz) = 16cb5f4588f4a35877aacc5f39bb93e9c0ac5fca1ddfc4dabda841131c29d3d5
10
SHA256 (telegramdesktop-libtgvoip-0e92a22_GH0.tar.gz) = 179c780bf199ff41984756d1b0b96287edf0fa1490f76a31eb9cbdc572ecce6f
11
SIZE (telegramdesktop-libtgvoip-e701050_GH0.tar.gz) = 1484741
11
SIZE (telegramdesktop-libtgvoip-0e92a22_GH0.tar.gz) = 1484785
12
SHA256 (telegramdesktop-crl-84072fb_GH0.tar.gz) = 0d1c5a08b94c90ef213fadfdfb1f4587a23c01474195931c67bc98fb7fd01936
12
SHA256 (telegramdesktop-crl-9ea8700_GH0.tar.gz) = 68011a83a139d68bed4fd13b946c1aea6f7bea8bffc702a4795f2c0e23f9efd4
13
SIZE (telegramdesktop-crl-84072fb_GH0.tar.gz) = 21681
13
SIZE (telegramdesktop-crl-9ea8700_GH0.tar.gz) = 21873
14
SHA256 (Cyan4973-xxHash-7cc9639_GH0.tar.gz) = f40801820e885f92bbe3d2434efeb39aa18eeaf878341982e8525b538468e3ed
14
SHA256 (Cyan4973-xxHash-7cc9639_GH0.tar.gz) = f40801820e885f92bbe3d2434efeb39aa18eeaf878341982e8525b538468e3ed
15
SIZE (Cyan4973-xxHash-7cc9639_GH0.tar.gz) = 37534
15
SIZE (Cyan4973-xxHash-7cc9639_GH0.tar.gz) = 37534
16
SHA256 (john-preston-rlottie-302b7f9_GH0.tar.gz) = ade35b77c10c2a733ecccbca261222c36755bbd0f0d03f2e2772bd7cc0ad3d2b
17
SIZE (john-preston-rlottie-302b7f9_GH0.tar.gz) = 7896441
18
SHA256 (lz4-lz4-9a2a9f2_GH0.tar.gz) = 437827e1a1a0eec752777d29ef7ac78b195c805438448fe08154d9b5b181b8ea
19
SIZE (lz4-lz4-9a2a9f2_GH0.tar.gz) = 293999
(-)./files/gyp-patches (-14 / +14 lines)
Lines 1-4 Link Here
1
--- Telegram/gyp/codegen_rules.gypi.orig	2019-04-13 06:46:58 UTC
1
--- Telegram/gyp/codegen_rules.gypi.orig	2019-07-07 13:34:35 UTC
2
+++ Telegram/gyp/codegen_rules.gypi
2
+++ Telegram/gyp/codegen_rules.gypi
3
@@ -15,7 +15,7 @@
3
@@ -15,7 +15,7 @@
4
       '<(SHARED_INTERMEDIATE_DIR)/update_dependent_styles.timestamp',
4
       '<(SHARED_INTERMEDIATE_DIR)/update_dependent_styles.timestamp',
Lines 25-31 Link Here
25
       '-o', '<(SHARED_INTERMEDIATE_DIR)/update_dependent_qrc.timestamp',
25
       '-o', '<(SHARED_INTERMEDIATE_DIR)/update_dependent_qrc.timestamp',
26
       '<@(qrc_files)',
26
       '<@(qrc_files)',
27
     ],
27
     ],
28
--- Telegram/gyp/lib_export.gyp.orig	2019-04-13 06:46:58 UTC
28
--- Telegram/gyp/lib_export.gyp.orig	2019-07-07 13:34:35 UTC
29
+++ Telegram/gyp/lib_export.gyp
29
+++ Telegram/gyp/lib_export.gyp
30
@@ -46,7 +46,7 @@
30
@@ -46,7 +46,7 @@
31
     'include_dirs': [
31
     'include_dirs': [
Lines 36-42 Link Here
36
       '<(submodules_loc)/GSL/include',
36
       '<(submodules_loc)/GSL/include',
37
       '<(submodules_loc)/variant/include',
37
       '<(submodules_loc)/variant/include',
38
       '<(submodules_loc)/crl/src',
38
       '<(submodules_loc)/crl/src',
39
--- Telegram/gyp/lib_scheme.gyp.orig	2019-04-13 06:46:58 UTC
39
--- Telegram/gyp/lib_scheme.gyp.orig	2019-07-07 13:34:35 UTC
40
+++ Telegram/gyp/lib_scheme.gyp
40
+++ Telegram/gyp/lib_scheme.gyp
41
@@ -48,7 +48,7 @@
41
@@ -48,7 +48,7 @@
42
         '<(SHARED_INTERMEDIATE_DIR)/scheme.h',
42
         '<(SHARED_INTERMEDIATE_DIR)/scheme.h',
Lines 47-55 Link Here
47
         '-o', '<(SHARED_INTERMEDIATE_DIR)', '<(res_loc)/scheme.tl',
47
         '-o', '<(SHARED_INTERMEDIATE_DIR)', '<(res_loc)/scheme.tl',
48
       ],
48
       ],
49
       'message': 'codegen_scheme-ing scheme.tl..',
49
       'message': 'codegen_scheme-ing scheme.tl..',
50
--- Telegram/gyp/qt_moc.gypi.orig	2019-04-13 06:46:58 UTC
50
--- Telegram/gyp/qt_moc.gypi.orig	2019-07-07 13:34:35 UTC
51
+++ Telegram/gyp/qt_moc.gypi
51
+++ Telegram/gyp/qt_moc.gypi
52
@@ -12,12 +12,12 @@
52
@@ -15,12 +15,12 @@
53
       '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/moc/moc_<(RULE_INPUT_ROOT).cpp',
53
       '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/moc/moc_<(RULE_INPUT_ROOT).cpp',
54
     ],
54
     ],
55
     'action': [
55
     'action': [
Lines 64-70 Link Here
64
       # '<!@(python -c "for s in \'<@(_include_dirs)\'.split(\' \'): print(\'-I\' + s)")',
64
       # '<!@(python -c "for s in \'<@(_include_dirs)\'.split(\' \'): print(\'-I\' + s)")',
65
       '<(RULE_INPUT_PATH)',
65
       '<(RULE_INPUT_PATH)',
66
       '-o', '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/moc/moc_<(RULE_INPUT_ROOT).cpp',
66
       '-o', '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/moc/moc_<(RULE_INPUT_ROOT).cpp',
67
--- Telegram/gyp/qt_rcc.gypi.orig	2019-04-13 06:46:58 UTC
67
--- Telegram/gyp/qt_rcc.gypi.orig	2019-07-07 13:34:35 UTC
68
+++ Telegram/gyp/qt_rcc.gypi
68
+++ Telegram/gyp/qt_rcc.gypi
69
@@ -15,7 +15,7 @@
69
@@ -15,7 +15,7 @@
70
       '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/qrc/qrc_<(RULE_INPUT_ROOT).cpp',
70
       '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/qrc/qrc_<(RULE_INPUT_ROOT).cpp',
Lines 75-81 Link Here
75
       '-name', '<(RULE_INPUT_ROOT)',
75
       '-name', '<(RULE_INPUT_ROOT)',
76
       '-no-compress',
76
       '-no-compress',
77
       '<(RULE_INPUT_PATH)',
77
       '<(RULE_INPUT_PATH)',
78
--- Telegram/gyp/qt.gypi.orig	2019-04-13 06:46:58 UTC
78
--- Telegram/gyp/qt.gypi.orig	2019-07-07 13:34:35 UTC
79
+++ Telegram/gyp/qt.gypi
79
+++ Telegram/gyp/qt.gypi
80
@@ -14,25 +14,21 @@
80
@@ -14,25 +14,21 @@
81
               [ 'build_macold', {
81
               [ 'build_macold', {
Lines 233-239 Link Here
233
         '-pthread',
233
         '-pthread',
234
         '-rdynamic',
234
         '-rdynamic',
235
       ],
235
       ],
236
--- Telegram/gyp/telegram_linux.gypi.orig	2019-04-13 06:46:58 UTC
236
--- Telegram/gyp/telegram_linux.gypi.orig	2019-07-07 13:34:35 UTC
237
+++ Telegram/gyp/telegram_linux.gypi
237
+++ Telegram/gyp/telegram_linux.gypi
238
@@ -10,7 +10,7 @@
238
@@ -10,7 +10,7 @@
239
       'variables': {
239
       'variables': {
Lines 339-345 Link Here
339
         ],
339
         ],
340
       }], ['<!(pkg-config ayatana-appindicator3-0.1; echo $?) == 0', {
340
       }], ['<!(pkg-config ayatana-appindicator3-0.1; echo $?) == 0', {
341
         'cflags_cc': [ '<!(pkg-config --cflags ayatana-appindicator3-0.1)' ],
341
         'cflags_cc': [ '<!(pkg-config --cflags ayatana-appindicator3-0.1)' ],
342
--- Telegram/gyp/Telegram.gyp.orig	2019-04-13 06:46:58 UTC
342
--- Telegram/gyp/Telegram.gyp.orig	2019-07-07 13:34:35 UTC
343
+++ Telegram/gyp/Telegram.gyp
343
+++ Telegram/gyp/Telegram.gyp
344
@@ -51,7 +51,7 @@
344
@@ -51,7 +51,7 @@
345
         'pt-BR',
345
         'pt-BR',
Lines 358-364 Link Here
358
       '../ThirdParty/libtgvoip/libtgvoip.gyp:libtgvoip',
358
       '../ThirdParty/libtgvoip/libtgvoip.gyp:libtgvoip',
359
       'crl.gyp:crl',
359
       'crl.gyp:crl',
360
       'lib_base.gyp:lib_base',
360
       'lib_base.gyp:lib_base',
361
@@ -84,27 +83,18 @@
361
@@ -86,27 +85,18 @@
362
     ],
362
     ],
363
 
363
 
364
     'defines': [
364
     'defines': [
Lines 388-394 Link Here
388
       '<(emoji_suggestions_loc)',
388
       '<(emoji_suggestions_loc)',
389
       '<(submodules_loc)/GSL/include',
389
       '<(submodules_loc)/GSL/include',
390
       '<(submodules_loc)/variant/include',
390
       '<(submodules_loc)/variant/include',
391
@@ -123,7 +113,7 @@
391
@@ -125,7 +115,7 @@
392
       '<(res_loc)/export_html/images/back@2x.png',
392
       '<(res_loc)/export_html/images/back@2x.png',
393
     ],
393
     ],
394
     'sources!': [
394
     'sources!': [
Lines 397-403 Link Here
397
     ],
397
     ],
398
     'conditions': [
398
     'conditions': [
399
       [ '"<(official_build_target)" != ""', {
399
       [ '"<(official_build_target)" != ""', {
400
--- Telegram/gyp/tests/tests.gyp.orig	2019-04-13 06:46:58 UTC
400
--- Telegram/gyp/tests/tests.gyp.orig	2019-07-07 13:34:35 UTC
401
+++ Telegram/gyp/tests/tests.gyp
401
+++ Telegram/gyp/tests/tests.gyp
402
@@ -13,7 +13,7 @@
402
@@ -13,7 +13,7 @@
403
     'src_loc': '../../SourceFiles',
403
     'src_loc': '../../SourceFiles',
Lines 408-414 Link Here
408
   },
408
   },
409
   'targets': [{
409
   'targets': [{
410
     'target_name': 'tests',
410
     'target_name': 'tests',
411
--- Telegram/ThirdParty/libtgvoip/libtgvoip.gyp.orig	2019-04-03 18:20:00 UTC
411
--- Telegram/ThirdParty/libtgvoip/libtgvoip.gyp.orig	2019-06-24 11:42:33 UTC
412
+++ Telegram/ThirdParty/libtgvoip/libtgvoip.gyp
412
+++ Telegram/ThirdParty/libtgvoip/libtgvoip.gyp
413
@@ -14,11 +14,12 @@
413
@@ -14,11 +14,12 @@
414
         'variables': {
414
         'variables': {
Lines 433-439 Link Here
433
               'sources/': [['exclude', '<(tgvoip_src_loc)/os/linux/']],
433
               'sources/': [['exclude', '<(tgvoip_src_loc)/os/linux/']],
434
             },
434
             },
435
           ],
435
           ],
436
@@ -891,13 +892,16 @@
436
@@ -895,13 +896,16 @@
437
             },
437
             },
438
           ],
438
           ],
439
           [
439
           [
(-)./files/patch-Telegram_SourceFiles___other_packer.cpp (-2 / +2 lines)
Lines 1-6 Link Here
1
--- Telegram/SourceFiles/_other/packer.cpp.orig	2018-08-04 18:53:40 UTC
1
--- Telegram/SourceFiles/_other/packer.cpp.orig	2019-07-07 13:34:35 UTC
2
+++ Telegram/SourceFiles/_other/packer.cpp
2
+++ Telegram/SourceFiles/_other/packer.cpp
3
@@ -233,7 +233,7 @@ int main(int argc, char *argv[])
3
@@ -254,7 +254,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_bytes.h (-3 / +3 lines)
Lines 1-6 Link Here
1
--- Telegram/SourceFiles/base/bytes.h.orig	2018-09-28 13:08:38 UTC
1
--- Telegram/SourceFiles/base/bytes.h.orig	2019-07-07 13:34:35 UTC
2
+++ Telegram/SourceFiles/base/bytes.h
2
+++ Telegram/SourceFiles/base/bytes.h
3
@@ -135,7 +135,7 @@ template <
3
@@ -137,7 +137,7 @@ template <
4
 vector concatenate(Args &&...args) {
4
 vector concatenate(Args &&...args) {
5
 	const auto size = details::spansLength(args...);
5
 	const auto size = details::spansLength(args...);
6
 	auto result = vector(size);
6
 	auto result = vector(size);
Lines 9-15 Link Here
9
 	return result;
9
 	return result;
10
 }
10
 }
11
 
11
 
12
@@ -147,7 +147,7 @@ vector concatenate(SpanRange args) {
12
@@ -149,7 +149,7 @@ vector concatenate(SpanRange args) {
13
 		size += bytes::make_span(arg).size();
13
 		size += bytes::make_span(arg).size();
14
 	}
14
 	}
15
 	auto result = vector(size);
15
 	auto result = vector(size);
(-)./files/patch-Telegram_SourceFiles_core_launcher.cpp (-20 / +14 lines)
Lines 1-6 Link Here
1
--- Telegram/SourceFiles/core/launcher.cpp.orig	2019-02-01 12:51:46 UTC
1
--- Telegram/SourceFiles/core/launcher.cpp.orig	2019-07-07 13:34:35 UTC
2
+++ Telegram/SourceFiles/core/launcher.cpp
2
+++ Telegram/SourceFiles/core/launcher.cpp
3
@@ -15,6 +15,8 @@ https://github.com/telegramdesktop/tdesktop/blob/maste
3
@@ -16,6 +16,8 @@ https://github.com/telegramdesktop/tdesktop/blob/maste
4
 #include "core/sandbox.h"
4
 #include "core/sandbox.h"
5
 #include "base/concurrent_timer.h"
5
 #include "base/concurrent_timer.h"
6
 
6
 
Lines 9-18 Link Here
9
 namespace Core {
9
 namespace Core {
10
 namespace {
10
 namespace {
11
 
11
 
12
@@ -208,9 +210,10 @@ void Launcher::init() {
12
@@ -246,12 +248,13 @@ void Launcher::init() {
13
 
13
 #define TDESKTOP_LAUNCHER_FILENAME_TO_STRING_HELPER(V) #V
14
 	QApplication::setApplicationName(qsl("TelegramDesktop"));
14
 #define TDESKTOP_LAUNCHER_FILENAME_TO_STRING(V) TDESKTOP_LAUNCHER_FILENAME_TO_STRING_HELPER(V)
15
 
15
 	QApplication::setDesktopFileName(qsl(TDESKTOP_LAUNCHER_FILENAME_TO_STRING(TDESKTOP_LAUNCHER_FILENAME)));
16
-#elif defined(Q_OS_LINUX) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
17
+#elif (defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
18
 	QApplication::setDesktopFileName(qsl("telegramdesktop.desktop"));
19
 #endif
16
-#ifndef OS_MAC_OLD
20
-#ifndef OS_MAC_OLD
17
+#if !defined(Q_OS_MAC) && QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
21
+#if !defined(Q_OS_MAC) && QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
18
+	// Retina display support is working fine, others are not.
22
+	// Retina display support is working fine, others are not.
Lines 22-46 Link Here
22
 
26
 
23
 	initHook();
27
 	initHook();
24
 }
28
 }
25
@@ -228,6 +231,11 @@ int Launcher::exec() {
29
@@ -268,6 +271,11 @@ int Launcher::exec() {
30
 	// both are finished in Sandbox::closeApplication
26
 	Logs::start(this); // must be started before Platform is started
31
 	Logs::start(this); // must be started before Platform is started
27
 	Platform::start(); // must be started before Sandbox is created
32
 	Platform::start(); // must be started before Sandbox is created
28
 
33
+
29
+	// I don't know why path is not in QT_PLUGIN_PATH by default
34
+	// I don't know why path is not in QT_PLUGIN_PATH by default
30
+	QCoreApplication::addLibraryPath(FREEBSD_QT_PLUGINDIR);
35
+	QCoreApplication::addLibraryPath(FREEBSD_QT_PLUGINDIR);
31
+	// Telegram doesn't start when extraordinary theme is set, see launchpad.net/bugs/1680943
36
+	// Telegram doesn't start when extraordinary theme is set, see launchpad.net/bugs/1680943
32
+	unsetenv("QT_QPA_PLATFORMTHEME");
37
+	unsetenv("QT_QPA_PLATFORMTHEME");
33
+
34
 	auto result = executeApplication();
35
 
38
 
36
 	DEBUG_LOG(("Telegram finished, result: %1").arg(result));
39
 	auto result = executeApplication();
37
@@ -329,6 +337,9 @@ void Launcher::prepareSettings() {
38
 	break;
39
 	case dbipLinux32:
40
 		gPlatformString = qsl("Linux32bit");
41
+	break;
42
+	case dbipFreeBSD:
43
+		gPlatformString = qsl("FreeBSD");
44
 	break;
45
 	}
46
 
40
 
(-)./files/patch-Telegram_SourceFiles_core_update__checker.cpp (-3 / +3 lines)
Lines 1-6 Link Here
1
--- Telegram/SourceFiles/core/update_checker.cpp.orig	2019-04-13 06:46:58 UTC
1
--- Telegram/SourceFiles/core/update_checker.cpp.orig	2019-07-07 13:34:35 UTC
2
+++ Telegram/SourceFiles/core/update_checker.cpp
2
+++ Telegram/SourceFiles/core/update_checker.cpp
3
@@ -1456,6 +1456,9 @@ int UpdateChecker::size() const {
3
@@ -1461,6 +1461,9 @@ int UpdateChecker::size() const {
4
 //}
4
 //}
5
 
5
 
6
 bool checkReadyUpdate() {
6
 bool checkReadyUpdate() {
Lines 10-16 Link Here
10
 	QString readyFilePath = cWorkingDir() + qsl("tupdates/temp/ready"), readyPath = cWorkingDir() + qsl("tupdates/temp");
10
 	QString readyFilePath = cWorkingDir() + qsl("tupdates/temp/ready"), readyPath = cWorkingDir() + qsl("tupdates/temp");
11
 	if (!QFile(readyFilePath).exists() || cExeName().isEmpty()) {
11
 	if (!QFile(readyFilePath).exists() || cExeName().isEmpty()) {
12
 		if (QDir(cWorkingDir() + qsl("tupdates/ready")).exists() || QDir(cWorkingDir() + qsl("tupdates/temp")).exists()) {
12
 		if (QDir(cWorkingDir() + qsl("tupdates/ready")).exists() || QDir(cWorkingDir() + qsl("tupdates/temp")).exists()) {
13
@@ -1508,6 +1511,9 @@ bool checkReadyUpdate() {
13
@@ -1513,6 +1516,9 @@ bool checkReadyUpdate() {
14
 #elif defined Q_OS_LINUX // Q_OS_MAC
14
 #elif defined Q_OS_LINUX // Q_OS_MAC
15
 	QString curUpdater = (cExeDir() + qsl("Updater"));
15
 	QString curUpdater = (cExeDir() + qsl("Updater"));
16
 	QFileInfo updater(cWorkingDir() + qsl("tupdates/temp/Updater"));
16
 	QFileInfo updater(cWorkingDir() + qsl("tupdates/temp/Updater"));
(-)./files/patch-Telegram_SourceFiles_core_utils.h (-10 lines)
Lines 1-10 Link Here
1
--- Telegram/SourceFiles/core/utils.h.orig	2019-04-13 06:46:58 UTC
2
+++ Telegram/SourceFiles/core/utils.h
3
@@ -347,6 +347,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 (-2 / +2 lines)
Lines 1-6 Link Here
1
--- Telegram/SourceFiles/data/data_document.cpp.orig	2019-04-13 06:46:58 UTC
1
--- Telegram/SourceFiles/data/data_document.cpp.orig	2019-07-07 13:34:35 UTC
2
+++ Telegram/SourceFiles/data/data_document.cpp
2
+++ Telegram/SourceFiles/data/data_document.cpp
3
@@ -133,7 +133,7 @@ QString FileNameUnsafe(
3
@@ -138,7 +138,7 @@ QString FileNameUnsafe(
4
 	name = name.replace(QRegularExpression(qsl("[\\\\\\/\\:\\*\\?\\\"\\<\\>\\|]")), qsl("_"));
4
 	name = name.replace(QRegularExpression(qsl("[\\\\\\/\\:\\*\\?\\\"\\<\\>\\|]")), qsl("_"));
5
 #elif defined Q_OS_MAC
5
 #elif defined Q_OS_MAC
6
 	name = name.replace(QRegularExpression(qsl("[\\:]")), qsl("_"));
6
 	name = name.replace(QRegularExpression(qsl("[\\:]")), qsl("_"));
(-)./files/patch-Telegram_SourceFiles_export_data_export__data__types.cpp (-2 / +2 lines)
Lines 1-6 Link Here
1
--- Telegram/SourceFiles/export/data/export_data_types.cpp.orig	2019-04-13 06:46:58 UTC
1
--- Telegram/SourceFiles/export/data/export_data_types.cpp.orig	2019-07-07 13:34:35 UTC
2
+++ Telegram/SourceFiles/export/data/export_data_types.cpp
2
+++ Telegram/SourceFiles/export/data/export_data_types.cpp
3
@@ -353,9 +353,9 @@ QString CleanDocumentName(QString name) {
3
@@ -360,9 +360,9 @@ QString CleanDocumentName(QString name) {
4
 		'|',
4
 		'|',
5
 #elif defined Q_OS_MAC // Q_OS_WIN
5
 #elif defined Q_OS_MAC // Q_OS_WIN
6
 		':',
6
 		':',
(-)./files/patch-Telegram_SourceFiles_history_admin__log_history__admin__log__inner.cpp (-2 / +2 lines)
Lines 1-6 Link Here
1
--- Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp.orig	2019-04-13 06:46:58 UTC
1
--- Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp.orig	2019-07-07 13:34:35 UTC
2
+++ Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp
2
+++ Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp
3
@@ -1392,13 +1392,13 @@ void InnerWidget::mouseActionFinish(const QPoint &scre
3
@@ -1411,13 +1411,13 @@ void InnerWidget::mouseActionFinish(const QPoint &scre
4
 	_mouseSelectType = TextSelectType::Letters;
4
 	_mouseSelectType = TextSelectType::Letters;
5
 	//_widget->noSelectingScroll(); // TODO
5
 	//_widget->noSelectingScroll(); // TODO
6
 
6
 
(-)./files/patch-Telegram_SourceFiles_history_history__inner__widget.cpp (-3 / +3 lines)
Lines 1-6 Link Here
1
--- Telegram/SourceFiles/history/history_inner_widget.cpp.orig	2019-04-13 06:46:58 UTC
1
--- Telegram/SourceFiles/history/history_inner_widget.cpp.orig	2019-07-07 13:34:35 UTC
2
+++ Telegram/SourceFiles/history/history_inner_widget.cpp
2
+++ Telegram/SourceFiles/history/history_inner_widget.cpp
3
@@ -1376,7 +1376,7 @@ void HistoryInner::mouseActionFinish(
3
@@ -1382,7 +1382,7 @@ void HistoryInner::mouseActionFinish(
4
 	_widget->noSelectingScroll();
4
 	_widget->noSelectingScroll();
5
 	_widget->updateTopBarSelection();
5
 	_widget->updateTopBarSelection();
6
 
6
 
Lines 9-15 Link Here
9
 	if (!_selected.empty() && _selected.cbegin()->second != FullSelection) {
9
 	if (!_selected.empty() && _selected.cbegin()->second != FullSelection) {
10
 		const auto [item, selection] = *_selected.cbegin();
10
 		const auto [item, selection] = *_selected.cbegin();
11
 		if (const auto view = item->mainView()) {
11
 		if (const auto view = item->mainView()) {
12
@@ -1385,7 +1385,7 @@ void HistoryInner::mouseActionFinish(
12
@@ -1391,7 +1391,7 @@ void HistoryInner::mouseActionFinish(
13
 				QClipboard::Selection);
13
 				QClipboard::Selection);
14
 		}
14
 		}
15
 	}
15
 	}
(-)./files/patch-Telegram_SourceFiles_history_view_history__view__list__widget.cpp (-3 / +3 lines)
Lines 1-6 Link Here
1
--- Telegram/SourceFiles/history/view/history_view_list_widget.cpp.orig	2019-04-13 06:46:58 UTC
1
--- Telegram/SourceFiles/history/view/history_view_list_widget.cpp.orig	2019-07-07 13:34:35 UTC
2
+++ Telegram/SourceFiles/history/view/history_view_list_widget.cpp
2
+++ Telegram/SourceFiles/history/view/history_view_list_widget.cpp
3
@@ -2031,7 +2031,7 @@ void ListWidget::mouseActionFinish(
3
@@ -2042,7 +2042,7 @@ void ListWidget::mouseActionFinish(
4
 	_mouseSelectType = TextSelectType::Letters;
4
 	_mouseSelectType = TextSelectType::Letters;
5
 	//_widget->noSelectingScroll(); // #TODO select scroll
5
 	//_widget->noSelectingScroll(); // #TODO select scroll
6
 
6
 
Lines 9-15 Link Here
9
 	if (_selectedTextItem
9
 	if (_selectedTextItem
10
 		&& _selectedTextRange.from != _selectedTextRange.to) {
10
 		&& _selectedTextRange.from != _selectedTextRange.to) {
11
 		if (const auto view = viewForItem(_selectedTextItem)) {
11
 		if (const auto view = viewForItem(_selectedTextItem)) {
12
@@ -2040,7 +2040,7 @@ void ListWidget::mouseActionFinish(
12
@@ -2051,7 +2051,7 @@ void ListWidget::mouseActionFinish(
13
 				QClipboard::Selection);
13
 				QClipboard::Selection);
14
 }
14
 }
15
 	}
15
 	}
(-)./files/patch-Telegram_SourceFiles_logs.cpp (-4 / +4 lines)
Lines 1-6 Link Here
1
--- Telegram/SourceFiles/logs.cpp.orig	2019-02-01 12:51:46 UTC
1
--- Telegram/SourceFiles/logs.cpp.orig	2019-07-07 13:34:35 UTC
2
+++ Telegram/SourceFiles/logs.cpp
2
+++ Telegram/SourceFiles/logs.cpp
3
@@ -333,7 +333,7 @@ void start(not_null<Core::Launcher*> launcher) {
3
@@ -338,7 +338,7 @@ void start(not_null<Core::Launcher*> launcher) {
4
 	if (cAlphaVersion()) {
4
 	if (cAlphaVersion()) {
5
 		workingDirChosen = true;
5
 		workingDirChosen = true;
6
 
6
 
Lines 9-15 Link Here
9
 	} else {
9
 	} else {
10
 		if (!cWorkingDir().isEmpty()) {
10
 		if (!cWorkingDir().isEmpty()) {
11
 			// This value must come from TelegramForcePortable
11
 			// This value must come from TelegramForcePortable
12
@@ -348,16 +348,16 @@ void start(not_null<Core::Launcher*> launcher) {
12
@@ -353,16 +353,16 @@ void start(not_null<Core::Launcher*> launcher) {
13
 		}
13
 		}
14
 		workingDirChosen = true;
14
 		workingDirChosen = true;
15
 
15
 
Lines 30-36 Link Here
30
 #ifdef _DEBUG
30
 #ifdef _DEBUG
31
 		cForceWorkingDir(cExeDir());
31
 		cForceWorkingDir(cExeDir());
32
 #else // _DEBUG
32
 #else // _DEBUG
33
@@ -374,7 +374,7 @@ void start(not_null<Core::Launcher*> launcher) {
33
@@ -379,7 +379,7 @@ void start(not_null<Core::Launcher*> launcher) {
34
 			workingDirChosen = true;
34
 			workingDirChosen = true;
35
 		}
35
 		}
36
 
36
 
(-)./files/patch-Telegram_SourceFiles_platform_freebsd_info__freebsd.cpp (+38 lines)
Line 0 Link Here
1
--- Telegram/SourceFiles/platform/freebsd/info_freebsd.cpp.orig	2019-07-28 03:19:18 UTC
2
+++ Telegram/SourceFiles/platform/freebsd/info_freebsd.cpp
3
@@ -0,0 +1,35 @@
4
+/*
5
+This file is part of Telegram Desktop,
6
+the official desktop application for the Telegram messaging service.
7
+
8
+For license and copyright information please follow this link:
9
+https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
10
+*/
11
+#include "platform/freebsd/info_freebsd.h"
12
+
13
+namespace Platform {
14
+
15
+QString DeviceModelPretty() {
16
+    return "FreeBSD";
17
+}
18
+
19
+QString SystemVersionPretty() {
20
+	const auto result = getenv("XDG_CURRENT_DESKTOP");
21
+	const auto value = result ? QString::fromLatin1(result) : QString();
22
+	const auto list = value.split(':', QString::SkipEmptyParts);
23
+	return list.isEmpty() ? "FreeBSD" : "FreeBSD " + list[0];
24
+}
25
+
26
+QString SystemCountry() {
27
+	return QString();
28
+}
29
+
30
+QString SystemLanguage() {
31
+	return QString();
32
+}
33
+
34
+QDate WhenSystemBecomesOutdated() {
35
+	return QDate();
36
+}
37
+
38
+} // namespace Platform
(-)./files/patch-Telegram_SourceFiles_platform_freebsd_info__freebsd.h (+59 lines)
Line 0 Link Here
1
--- Telegram/SourceFiles/platform/freebsd/info_freebsd.h.orig	2019-07-28 03:19:18 UTC
2
+++ Telegram/SourceFiles/platform/freebsd/info_freebsd.h
3
@@ -0,0 +1,56 @@
4
+/*
5
+This file is part of Telegram Desktop,
6
+the official desktop application for the Telegram messaging service.
7
+
8
+For license and copyright information please follow this link:
9
+https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
10
+*/
11
+#pragma once
12
+
13
+#include "platform/platform_info.h"
14
+
15
+namespace Platform {
16
+
17
+inline constexpr bool IsLinux() {
18
+	return true;
19
+}
20
+
21
+inline constexpr bool IsLinux32Bit() {
22
+#ifdef Q_OS_LINUX32
23
+	return true;
24
+#else // Q_OS_LINUX32
25
+	return false;
26
+#endif // Q_OS_LINUX32
27
+}
28
+
29
+inline constexpr bool IsLinux64Bit() {
30
+#ifdef Q_OS_LINUX64
31
+	return true;
32
+#else // Q_OS_LINUX64
33
+	return false;
34
+#endif // Q_OS_LINUX64
35
+}
36
+
37
+inline constexpr bool IsWindows() { return false; }
38
+inline constexpr bool IsWindowsStoreBuild() { return false; }
39
+inline bool IsWindowsXPOrGreater() { return false; }
40
+inline bool IsWindowsVistaOrGreater() { return false; }
41
+inline bool IsWindows7OrGreater() { return false; }
42
+inline bool IsWindows8OrGreater() { return false; }
43
+inline bool IsWindows8Point1OrGreater() { return false; }
44
+inline bool IsWindows10OrGreater() { return false; }
45
+inline constexpr bool IsMac() { return false; }
46
+inline constexpr bool IsMacOldBuild() { return false; }
47
+inline constexpr bool IsMacStoreBuild() { return false; }
48
+inline bool IsMac10_6OrGreater() { return false; }
49
+inline bool IsMac10_7OrGreater() { return false; }
50
+inline bool IsMac10_8OrGreater() { return false; }
51
+inline bool IsMac10_9OrGreater() { return false; }
52
+inline bool IsMac10_10OrGreater() { return false; }
53
+inline bool IsMac10_11OrGreater() { return false; }
54
+inline bool IsMac10_12OrGreater() { return false; }
55
+inline bool IsMac10_13OrGreater() { return false; }
56
+inline bool IsMac10_14OrGreater() { return false; }
57
+
58
+} // namespace Platform
59
+
(-)./files/patch-Telegram_SourceFiles_platform_linux_main__window__linux.cpp (-8 / +8 lines)
Lines 1-4 Link Here
1
--- Telegram/SourceFiles/platform/linux/main_window_linux.cpp.orig	2019-04-13 06:46:58 UTC
1
--- Telegram/SourceFiles/platform/linux/main_window_linux.cpp.orig	2019-07-07 13:34:35 UTC
2
+++ Telegram/SourceFiles/platform/linux/main_window_linux.cpp
2
+++ Telegram/SourceFiles/platform/linux/main_window_linux.cpp
3
@@ -25,7 +25,9 @@ bool noQtTrayIcon = false, tryAppIndicator = false;
3
@@ -25,7 +25,9 @@ bool noQtTrayIcon = false, tryAppIndicator = false;
4
 bool useGtkBase = false, useAppIndicator = false, useStatusIcon = false, trayIconChecked = false, useUnityCount = false;
4
 bool useGtkBase = false, useAppIndicator = false, useStatusIcon = false, trayIconChecked = false, useUnityCount = false;
Lines 10-16 Link Here
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
@@ -290,7 +292,9 @@ void MainWindow::workmodeUpdated(DBIWorkMode mode) {
13
@@ -291,7 +293,9 @@ void MainWindow::workmodeUpdated(DBIWorkMode mode) {
14
 		if (noQtTrayIcon) {
14
 		if (noQtTrayIcon) {
15
 #ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
15
 #ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
16
 			if (useAppIndicator) {
16
 			if (useAppIndicator) {
Lines 20-26 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
@@ -306,7 +310,9 @@ void MainWindow::workmodeUpdated(DBIWorkMode mode) {
23
@@ -307,7 +311,9 @@ void MainWindow::workmodeUpdated(DBIWorkMode mode) {
24
 		if (noQtTrayIcon) {
24
 		if (noQtTrayIcon) {
25
 #ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
25
 #ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
26
 			if (useAppIndicator) {
26
 			if (useAppIndicator) {
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
@@ -325,7 +331,9 @@ void MainWindow::psUpdateIndicator() {
33
@@ -326,7 +332,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
@@ -422,11 +430,15 @@ void MainWindow::LibsLoaded() {
43
@@ -423,11 +431,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 56-62 Link Here
56
 
56
 
57
 	if (tryAppIndicator && useGtkBase && useAppIndicator) {
57
 	if (tryAppIndicator && useGtkBase && useAppIndicator) {
58
 		noQtTrayIcon = true;
58
 		noQtTrayIcon = true;
59
@@ -462,6 +474,7 @@ void MainWindow::psCreateTrayIcon() {
59
@@ -463,6 +475,7 @@ void MainWindow::psCreateTrayIcon() {
60
 	}
60
 	}
61
 
61
 
62
 #ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
62
 #ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
Lines 64-70 Link Here
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
@@ -492,6 +505,7 @@ void MainWindow::psCreateTrayIcon() {
67
@@ -493,6 +506,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
@@ -616,10 +630,12 @@ MainWindow::~MainWindow() {
75
@@ -617,10 +631,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__info.h (+10 lines)
Line 0 Link Here
1
--- Telegram/SourceFiles/platform/platform_info.h.orig	2019-07-07 13:34:35 UTC
2
+++ Telegram/SourceFiles/platform/platform_info.h
3
@@ -49,4 +49,6 @@ namespace Platform {
4
 #include "platform/linux/info_linux.h"
5
 #elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
6
 #include "platform/win/info_win.h"
7
-#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WIN
8
+#elif defined Q_OS_FREEBSD // Q_OS_MAC || Q_OS_LINUX || Q_OS_WIN
9
+#include "platform/freebsd/info_freebsd.h"
10
+#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WIN || Q_OS_FREEBSD
(-)./files/patch-Telegram_SourceFiles_settings.cpp (-11 lines)
Lines 1-11 Link Here
1
--- Telegram/SourceFiles/settings.cpp.orig	2018-12-24 08:16:05 UTC
2
+++ Telegram/SourceFiles/settings.cpp
3
@@ -77,6 +77,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_settings_settings__notifications.cpp (-2 / +2 lines)
Lines 1-6 Link Here
1
--- Telegram/SourceFiles/settings/settings_notifications.cpp.orig	2019-04-13 06:46:58 UTC
1
--- Telegram/SourceFiles/settings/settings_notifications.cpp.orig	2019-07-07 13:34:35 UTC
2
+++ Telegram/SourceFiles/settings/settings_notifications.cpp
2
+++ Telegram/SourceFiles/settings/settings_notifications.cpp
3
@@ -479,11 +479,11 @@ void NotificationsCount::SampleWidget::destroyDelayed(
3
@@ -480,11 +480,11 @@ void NotificationsCount::SampleWidget::destroyDelayed(
4
 	_deleted = true;
4
 	_deleted = true;
5
 
5
 
6
 	// Ubuntu has a lag if deleteLater() called immediately.
6
 	// Ubuntu has a lag if deleteLater() called immediately.
(-)./files/patch-Telegram_SourceFiles_ui_text_text.cpp (-2 / +2 lines)
Lines 1-6 Link Here
1
--- Telegram/SourceFiles/ui/text/text.cpp.orig	2019-04-13 06:46:58 UTC
1
--- Telegram/SourceFiles/ui/text/text.cpp.orig	2019-07-07 13:34:35 UTC
2
+++ Telegram/SourceFiles/ui/text/text.cpp
2
+++ Telegram/SourceFiles/ui/text/text.cpp
3
@@ -1762,11 +1762,11 @@ class TextPainter { (private)
3
@@ -2016,11 +2016,11 @@ class Renderer { (private)
4
 		if (item == -1)
4
 		if (item == -1)
5
 			return;
5
 			return;
6
 
6
 
(-)./files/patch-Telegram_SourceFiles_ui_text_text__block.cpp (-2 / +2 lines)
Lines 1-6 Link Here
1
--- Telegram/SourceFiles/ui/text/text_block.cpp.orig	2019-02-01 12:51:46 UTC
1
--- Telegram/SourceFiles/ui/text/text_block.cpp.orig	2019-07-07 13:34:35 UTC
2
+++ Telegram/SourceFiles/ui/text/text_block.cpp
2
+++ Telegram/SourceFiles/ui/text/text_block.cpp
3
@@ -332,6 +332,9 @@ TextBlock::TextBlock(const style::font &font, const QS
3
@@ -335,6 +335,9 @@ TextBlock::TextBlock(const style::font &font, const QS
4
 
4
 
5
 		QStackTextEngine engine(part, blockFont->f);
5
 		QStackTextEngine engine(part, blockFont->f);
6
 		BlockParser parser(&engine, this, minResizeWidth, _from, part);
6
 		BlockParser parser(&engine, this, minResizeWidth, _from, part);
(-)./files/patch-Telegram_SourceFiles_ui_twidget.cpp (-2 / +2 lines)
Lines 1-6 Link Here
1
--- Telegram/SourceFiles/ui/twidget.cpp.orig	2019-04-13 06:46:58 UTC
1
--- Telegram/SourceFiles/ui/twidget.cpp.orig	2019-07-07 13:34:35 UTC
2
+++ Telegram/SourceFiles/ui/twidget.cpp
2
+++ Telegram/SourceFiles/ui/twidget.cpp
3
@@ -249,9 +249,9 @@ void sendSynteticMouseEvent(QWidget *widget, QEvent::T
3
@@ -270,9 +270,9 @@ void sendSynteticMouseEvent(QWidget *widget, QEvent::T
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 (-2 / +2 lines)
Lines 1-6 Link Here
1
--- Telegram/SourceFiles/ui/widgets/labels.cpp.orig	2019-04-13 06:46:58 UTC
1
--- Telegram/SourceFiles/ui/widgets/labels.cpp.orig	2019-07-07 13:34:35 UTC
2
+++ Telegram/SourceFiles/ui/widgets/labels.cpp
2
+++ Telegram/SourceFiles/ui/widgets/labels.cpp
3
@@ -361,11 +361,11 @@ Text::StateResult FlatLabel::dragActionFinish(const QP
3
@@ -391,11 +391,11 @@ Ui::Text::StateResult FlatLabel::dragActionFinish(cons
4
 		}
4
 		}
5
 	}
5
 	}
6
 
6
 
(-)./files/patch-Telegram_SourceFiles_window_main__window.cpp (-3 / +3 lines)
Lines 1-6 Link Here
1
--- Telegram/SourceFiles/window/main_window.cpp.orig	2019-04-13 06:46:58 UTC
1
--- Telegram/SourceFiles/window/main_window.cpp.orig	2019-07-07 13:34:35 UTC
2
+++ Telegram/SourceFiles/window/main_window.cpp
2
+++ Telegram/SourceFiles/window/main_window.cpp
3
@@ -521,7 +521,7 @@ bool MainWindow::minimizeToTray() {
3
@@ -565,7 +565,7 @@ bool MainWindow::minimizeToTray() {
4
 }
4
 }
5
 
5
 
6
 void MainWindow::reActivateWindow() {
6
 void MainWindow::reActivateWindow() {
Lines 9-15 Link Here
9
 	const auto reActivate = [=] {
9
 	const auto reActivate = [=] {
10
 		if (const auto w = App::wnd()) {
10
 		if (const auto w = App::wnd()) {
11
 			if (auto f = QApplication::focusWidget()) {
11
 			if (auto f = QApplication::focusWidget()) {
12
@@ -536,7 +536,7 @@ void MainWindow::reActivateWindow() {
12
@@ -580,7 +580,7 @@ void MainWindow::reActivateWindow() {
13
 	};
13
 	};
14
 	crl::on_main(this, reActivate);
14
 	crl::on_main(this, reActivate);
15
 	App::CallDelayed(200, this, reActivate);
15
 	App::CallDelayed(200, this, reActivate);
(-)./files/patch-Telegram_ThirdParty_libtgvoip_VoIPController.cpp (-1 / +12 lines)
Lines 1-5 Link Here
1
--- Telegram/ThirdParty/libtgvoip/VoIPController.cpp.orig	2019-04-03 18:20:00 UTC
1
--- Telegram/ThirdParty/libtgvoip/VoIPController.cpp.orig	2019-06-24 11:42:33 UTC
2
+++ Telegram/ThirdParty/libtgvoip/VoIPController.cpp
2
+++ Telegram/ThirdParty/libtgvoip/VoIPController.cpp
3
@@ -2389,8 +2389,8 @@ simpleAudioBlock random_id:long random_bytes:string ra
4
 					stm->decoder=NULL;
5
 				}else if(stm->type==STREAM_TYPE_VIDEO){
6
 					if(!stm->packetReassembler){
7
-						stm->packetReassembler=make_shared<PacketReassembler>();
8
-						stm->packetReassembler->SetCallback(bind(&VoIPController::ProcessIncomingVideoFrame, this, placeholders::_1, placeholders::_2, placeholders::_3));
9
+						//stm->packetReassembler=make_shared<PacketReassembler>();
10
+						//stm->packetReassembler->SetCallback(bind(&VoIPController::ProcessIncomingVideoFrame, this, placeholders::_1, placeholders::_2, placeholders::_3));
11
 					}
12
 				}else{
13
 					LOGW("Unknown incoming stream type: %d", stm->type);
3
@@ -3048,7 +3048,7 @@ static void initMachTimestart() {
14
@@ -3048,7 +3048,7 @@ static void initMachTimestart() {
4
 #endif
15
 #endif
5
 
16
 
(-)./files/patch-Telegram_gyp_PrecompiledHeader.cmake (-17 / +1 lines)
Lines 1-14 Link Here
1
--- Telegram/gyp/PrecompiledHeader.cmake.orig	2019-02-01 12:51:46 UTC
1
--- Telegram/gyp/PrecompiledHeader.cmake.orig	2019-07-07 13:34:35 UTC
2
+++ Telegram/gyp/PrecompiledHeader.cmake
2
+++ Telegram/gyp/PrecompiledHeader.cmake
3
@@ -81,7 +81,7 @@ function(export_all_flags _filename _source_name_for_f
4
 endfunction()
5
 
6
 function(add_precompiled_header _target _input)
7
-  if(CMAKE_COMPILER_IS_GNUCXX)
8
+  if(CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
9
     get_filename_component(_name ${_input} NAME)
10
     set(_pch_header "${CMAKE_CURRENT_SOURCE_DIR}/${_input}")
11
     set(_pch_binary_dir "${CMAKE_CURRENT_BINARY_DIR}/${_target}_pch")
12
@@ -114,7 +114,7 @@ function(add_precompiled_header _target _input)
3
@@ -114,7 +114,7 @@ function(add_precompiled_header _target _input)
13
       set(_compiler_FLAGS "@${_pch_c_flags_file}")
4
       set(_compiler_FLAGS "@${_pch_c_flags_file}")
14
       add_custom_command(
5
       add_custom_command(
Lines 27-36 Link Here
27
         DEPENDS "${_pchfile}" "${_pch_cpp_flags_file}"
18
         DEPENDS "${_pchfile}" "${_pch_cpp_flags_file}"
28
         IMPLICIT_DEPENDS CXX "${_pch_header}"
19
         IMPLICIT_DEPENDS CXX "${_pch_header}"
29
         COMMENT "Precompiling header ${_name} for ${_target} (C++)")
20
         COMMENT "Precompiling header ${_name} for ${_target} (C++)")
30
@@ -163,5 +163,5 @@ function(add_precompiled_header _target _input)
31
           OBJECT_DEPENDS "${_object_depends}")
32
       endif()
33
     endforeach()
34
-  endif(CMAKE_COMPILER_IS_GNUCXX)
35
+  endif(CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
36
 endfunction()
(-)./files/patch-Telegram_gyp_settings__linux.gypi (-4 / +4 lines)
Lines 1-4 Link Here
1
--- Telegram/gyp/settings_linux.gypi.orig	2019-04-13 06:46:58 UTC
1
--- Telegram/gyp/settings_linux.gypi.orig	2019-07-07 13:34:35 UTC
2
+++ Telegram/gyp/settings_linux.gypi
2
+++ Telegram/gyp/settings_linux.gypi
3
@@ -11,7 +11,6 @@
3
@@ -11,7 +11,6 @@
4
         'linux_common_flags': [
4
         'linux_common_flags': [
Lines 8-14 Link Here
8
           '-W',
8
           '-W',
9
           '-fPIC',
9
           '-fPIC',
10
           '-Wno-unused-variable',
10
           '-Wno-unused-variable',
11
@@ -26,7 +25,7 @@
11
@@ -28,7 +27,7 @@
12
         ],
12
         ],
13
       },
13
       },
14
       'conditions': [
14
       'conditions': [
Lines 17-23 Link Here
17
           'defines': [
17
           'defines': [
18
             'Q_OS_LINUX64',
18
             'Q_OS_LINUX64',
19
           ],
19
           ],
20
@@ -61,7 +60,6 @@
20
@@ -63,7 +62,6 @@
21
       ],
21
       ],
22
       'defines': [
22
       'defines': [
23
         '_REENTRANT',
23
         '_REENTRANT',
Lines 25-31 Link Here
25
         'QT_PLUGIN',
25
         'QT_PLUGIN',
26
       ],
26
       ],
27
       'cflags_c': [
27
       'cflags_c': [
28
@@ -74,9 +72,6 @@
28
@@ -76,9 +74,6 @@
29
         '-Wno-register',
29
         '-Wno-register',
30
       ],
30
       ],
31
       'make_global_settings': [
31
       'make_global_settings': [
(-)./files/patch-Telegram_gyp_telegram__sources.txt (-2 / +13 lines)
Lines 1-6 Link Here
1
--- Telegram/gyp/telegram_sources.txt.orig	2019-04-13 06:46:58 UTC
1
--- Telegram/gyp/telegram_sources.txt.orig	2019-07-07 13:34:35 UTC
2
+++ Telegram/gyp/telegram_sources.txt
2
+++ Telegram/gyp/telegram_sources.txt
3
@@ -857,14 +857,7 @@
3
@@ -577,8 +577,8 @@
4
 <(src_loc)/platform/linux/linux_libs.h
5
 <(src_loc)/platform/linux/file_utilities_linux.cpp
6
 <(src_loc)/platform/linux/file_utilities_linux.h
7
-<(src_loc)/platform/linux/info_linux.cpp
8
-<(src_loc)/platform/linux/info_linux.h
9
+<(src_loc)/platform/freebsd/info_freebsd.cpp
10
+<(src_loc)/platform/freebsd/info_freebsd.h
11
 <(src_loc)/platform/linux/launcher_linux.cpp
12
 <(src_loc)/platform/linux/launcher_linux.h
13
 <(src_loc)/platform/linux/main_window_linux.cpp
14
@@ -894,14 +894,7 @@
4
 <(emoji_suggestions_loc)/emoji_suggestions.cpp
15
 <(emoji_suggestions_loc)/emoji_suggestions.cpp
5
 <(emoji_suggestions_loc)/emoji_suggestions.h
16
 <(emoji_suggestions_loc)/emoji_suggestions.h
6
 
17
 
(-)./files/patch-issue6219 (+172 lines)
Line 0 Link Here
1
From 0710dde4d5526454318b2748331e887c01ecfdce Mon Sep 17 00:00:00 2001
2
From: John Preston <johnprestonmail@gmail.com>
3
Date: Tue, 9 Jul 2019 13:43:57 +0200
4
Subject: [PATCH] Use private Qt color API only in official build.
5
6
Fixes #6219.
7
---
8
 .../SourceFiles/ffmpeg/ffmpeg_utility.cpp     | 100 ++++++++++++------
9
 Telegram/gyp/lib_ffmpeg.gyp                   |   6 +-
10
 2 files changed, 71 insertions(+), 35 deletions(-)
11
12
diff --git a/Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp b/Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp
13
index 5d0e50926..3775f7503 100644
14
--- Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp
15
+++ Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp
16
@@ -11,7 +11,10 @@ For license and copyright information please follow this link:
17
 #include "logs.h"
18
 
19
 #include <QImage>
20
+
21
+#ifdef TDESKTOP_OFFICIAL_TARGET
22
 #include <private/qdrawhelper_p.h>
23
+#endif // TDESKTOP_OFFICIAL_TARGET
24
 
25
 extern "C" {
26
 #include <libavutil/opt.h>
27
@@ -44,6 +47,58 @@ void AlignedImageBufferCleanupHandler(void* data) {
28
 		&& !(image.bytesPerLine() % kAlignImageBy);
29
 }
30
 
31
+void UnPremultiplyLine(uchar *dst, const uchar *src, int intsCount) {
32
+#ifdef TDESKTOP_OFFICIAL_TARGET
33
+	const auto layout = &qPixelLayouts[QImage::Format_ARGB32];
34
+	const auto convert = layout->convertFromARGB32PM;
35
+#else // TDESKTOP_OFFICIAL_TARGET
36
+	const auto layout = nullptr;
37
+	const auto convert = [](
38
+			uint *dst,
39
+			const uint *src,
40
+			int count,
41
+			std::nullptr_t,
42
+			std::nullptr_t) {
43
+		for (auto i = 0; i != count; ++i) {
44
+			dst[i] = qUnpremultiply(src[i]);
45
+		}
46
+	};
47
+#endif // TDESKTOP_OFFICIAL_TARGET
48
+
49
+	convert(
50
+		reinterpret_cast<uint*>(dst),
51
+		reinterpret_cast<const uint*>(src),
52
+		intsCount,
53
+		layout,
54
+		nullptr);
55
+}
56
+
57
+void PremultiplyLine(uchar *dst, const uchar *src, int intsCount) {
58
+#ifdef TDESKTOP_OFFICIAL_TARGET
59
+	const auto layout = &qPixelLayouts[QImage::Format_ARGB32];
60
+	const auto convert = layout->convertToARGB32PM;
61
+#else // TDESKTOP_OFFICIAL_TARGET
62
+	const auto layout = nullptr;
63
+	const auto convert = [](
64
+			uint *dst,
65
+			const uint *src,
66
+			int count,
67
+			std::nullptr_t,
68
+			std::nullptr_t) {
69
+		for (auto i = 0; i != count; ++i) {
70
+			dst[i] = qPremultiply(src[i]);
71
+		}
72
+	};
73
+#endif // TDESKTOP_OFFICIAL_TARGET
74
+
75
+	convert(
76
+		reinterpret_cast<uint*>(dst),
77
+		reinterpret_cast<const uint*>(src),
78
+		intsCount,
79
+		layout,
80
+		nullptr);
81
+}
82
+
83
 } // namespace
84
 
85
 IOPointer MakeIOPointer(
86
@@ -360,58 +415,35 @@ void UnPremultiply(QImage &to, const QImage &from) {
87
 	if (!GoodStorageForFrame(to, from.size())) {
88
 		to = CreateFrameStorage(from.size());
89
 	}
90
-
91
-	const auto layout = &qPixelLayouts[QImage::Format_ARGB32];
92
-	const auto convert = layout->convertFromARGB32PM;
93
 	const auto fromPerLine = from.bytesPerLine();
94
 	const auto toPerLine = to.bytesPerLine();
95
 	const auto width = from.width();
96
+	const auto height = from.height();
97
+	auto fromBytes = from.bits();
98
+	auto toBytes = to.bits();
99
 	if (fromPerLine != width * 4 || toPerLine != width * 4) {
100
-		auto fromBytes = from.bits();
101
-		auto toBytes = to.bits();
102
-		for (auto i = 0; i != to.height(); ++i) {
103
-			convert(
104
-				reinterpret_cast<uint*>(toBytes),
105
-				reinterpret_cast<const uint*>(fromBytes),
106
-				width,
107
-				layout,
108
-				nullptr);
109
+		for (auto i = 0; i != height; ++i) {
110
+			UnPremultiplyLine(toBytes, fromBytes, width);
111
 			fromBytes += fromPerLine;
112
 			toBytes += toPerLine;
113
 		}
114
 	} else {
115
-		convert(
116
-			reinterpret_cast<uint*>(to.bits()),
117
-			reinterpret_cast<const uint*>(from.bits()),
118
-			from.width() * from.height(),
119
-			layout,
120
-			nullptr);
121
+		UnPremultiplyLine(toBytes, fromBytes, width * height);
122
 	}
123
 }
124
 
125
 void PremultiplyInplace(QImage &image) {
126
-	const auto layout = &qPixelLayouts[QImage::Format_ARGB32];
127
-	const auto convert = layout->convertToARGB32PM;
128
 	const auto perLine = image.bytesPerLine();
129
 	const auto width = image.width();
130
+	const auto height = image.height();
131
+	auto bytes = image.bits();
132
 	if (perLine != width * 4) {
133
-		auto bytes = image.bits();
134
-		for (auto i = 0; i != image.height(); ++i) {
135
-			convert(
136
-				reinterpret_cast<uint*>(bytes),
137
-				reinterpret_cast<const uint*>(bytes),
138
-				width,
139
-				layout,
140
-				nullptr);
141
+		for (auto i = 0; i != height; ++i) {
142
+			PremultiplyLine(bytes, bytes, width);
143
 			bytes += perLine;
144
 		}
145
 	} else {
146
-		convert(
147
-			reinterpret_cast<uint*>(image.bits()),
148
-			reinterpret_cast<const uint*>(image.bits()),
149
-			image.width() * image.height(),
150
-			layout,
151
-			nullptr);
152
+		PremultiplyLine(bytes, bytes, width * height);
153
 	}
154
 }
155
 
156
diff --git a/Telegram/gyp/lib_ffmpeg.gyp b/Telegram/gyp/lib_ffmpeg.gyp
157
index 9971d76ae..b9ada5362 100644
158
--- Telegram/gyp/lib_ffmpeg.gyp
159
+++ Telegram/gyp/lib_ffmpeg.gyp
160
@@ -46,7 +46,11 @@
161
       '<(src_loc)/ffmpeg/ffmpeg_utility.cpp',
162
       '<(src_loc)/ffmpeg/ffmpeg_utility.h',
163
     ],
164
-    'conditions': [[ 'build_macold', {
165
+    'conditions': [[ '"<(official_build_target)" != ""', {
166
+      'defines': [
167
+        'TDESKTOP_OFFICIAL_TARGET=<(official_build_target)',
168
+      ],
169
+    }], [ 'build_macold', {
170
       'xcode_settings': {
171
         'OTHER_CPLUSPLUSFLAGS': [ '-nostdinc++' ],
172
       },

Return to bug 239502