aboutsummaryrefslogtreecommitdiff
path: root/net-im
diff options
context:
space:
mode:
authorKirill Ponomarev <krion@FreeBSD.org>2018-04-17 14:10:49 +0000
committerKirill Ponomarev <krion@FreeBSD.org>2018-04-17 14:10:49 +0000
commit4e2c600ca3c66118495219386b65344fc2dbbdec (patch)
tree6c9a563948d4f275b2eafc7254835e6d5c0327de /net-im
parent884fb2d5051b3ec7f865ff8387c32fea93f928a5 (diff)
downloadports-4e2c600ca3c66118495219386b65344fc2dbbdec.tar.gz
ports-4e2c600ca3c66118495219386b65344fc2dbbdec.zip
Notes
Diffstat (limited to 'net-im')
-rw-r--r--net-im/telegram-desktop/Makefile41
-rw-r--r--net-im/telegram-desktop/distinfo20
-rw-r--r--net-im/telegram-desktop/files/gyp-patches210
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_Resources_qrc_telegram__linux.qrc8
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles___other_packer.cpp4
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_base_build__config.h6
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_base_lambda.h14
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_boxes_notifications__box.cpp17
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_config.h6
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_core_launcher.cpp47
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_core_utils.h10
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_data_data__document.cpp (renamed from net-im/telegram-desktop/files/patch-Telegram_SourceFiles_structs.cpp)6
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_history_admin__log_history__admin__log__inner.cpp18
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_history_history__inner__widget.cpp20
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_history_view_history__view__list__widget.cpp11
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_layout.cpp6
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_logs.cpp50
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_main.cpp30
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_mainwindow.cpp19
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_linux_linux__libs.cpp14
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_linux_linux__libs.h12
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_linux_main__window__linux.cpp28
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__audio.h6
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__file__utilities.h6
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__launcher.h14
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__main__window.h6
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__notifications__manager.h6
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__specific.h6
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__window__title.h8
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_qt__functions.cpp2
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_qt__static__plugins.cpp4
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_settings.cpp11
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_settings_settings__notifications__widget.cpp14
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_ui_text_text.cpp4
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_ui_text_text__block.cpp13
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_ui_twidget.cpp4
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_ui_widgets_labels.cpp16
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_SourceFiles_window_main__window.h11
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_VoIPController.cpp11
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_audio_AudioInput.cpp22
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_audio_AudioOutput.cpp22
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_logging.cpp20
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_linux_AudioInputALSA.cpp20
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_linux_AudioInputPulse.cpp10
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_linux_AudioOutputALSA.cpp20
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_linux_AudioOutputPulse.cpp10
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_linux_PulseAudioLoader.h20
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_posix_NetworkSocketPosix.cpp4
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_threading.h2
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_webrtc__dsp_webrtc_base_stringutils.h2
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_gyp_PrecompiledHeader.cmake2
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_gyp_common.gypi4
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_gyp_settings__linux.gypi17
-rw-r--r--net-im/telegram-desktop/files/patch-Telegram_gyp_telegram__sources.txt4
-rw-r--r--net-im/telegram-desktop/files/patch-lib_xdg_tg.protocol2
55 files changed, 653 insertions, 267 deletions
diff --git a/net-im/telegram-desktop/Makefile b/net-im/telegram-desktop/Makefile
index d64987bcbfe8..39102ede0c39 100644
--- a/net-im/telegram-desktop/Makefile
+++ b/net-im/telegram-desktop/Makefile
@@ -2,7 +2,7 @@
PORTNAME= telegram-desktop
DISTVERSIONPREFIX= v
-DISTVERSION= 1.1.23
+DISTVERSION= 1.2.17
CATEGORIES= net-im
MAINTAINER= henry.hu.sh@gmail.com
@@ -12,14 +12,15 @@ LICENSE= GPLv3
LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= dee>0:devel/dee \
- gyp:devel/py-gyp@${PY_FLAVOR}
-LIB_DEPENDS= libasound.so:audio/alsa-lib \
- libavformat.so:multimedia/ffmpeg \
+ gyp:devel/py-gyp@${PY_FLAVOR} \
+ range-v3>0:devel/range-v3 \
+ pulseaudio>0:audio/pulseaudio \
+ alsa-lib>0:audio/alsa-lib
+LIB_DEPENDS= libavformat.so:multimedia/ffmpeg \
libdbus-1.so:devel/dbus \
libminizip.so:archivers/minizip \
libopenal.so:audio/openal-soft \
- libopus.so:audio/opus \
- libpulse.so:audio/pulseaudio
+ libopus.so:audio/opus
USES= cmake:noninja,outsource desktop-file-utils gmake pkgconfig python:2.7,build ssl
USE_GITHUB= yes
@@ -27,23 +28,37 @@ GH_ACCOUNT= telegramdesktop
GH_PROJECT= tdesktop
GH_TUPLE= catchorg:Catch2:5ca44b68:catch/Telegram/ThirdParty/Catch \
mapbox:variant:550ac2f:variant/Telegram/ThirdParty/variant \
- Microsoft:GSL:c5851a8:gsl/Telegram/ThirdParty/GSL \
- telegramdesktop:libtgvoip:757a5d8e:libtgvoip/Telegram/ThirdParty/libtgvoip
+ Microsoft:GSL:9d65e74:gsl/Telegram/ThirdParty/GSL \
+ telegramdesktop:libtgvoip:6e0e102:libtgvoip/Telegram/ThirdParty/libtgvoip \
+ telegramdesktop:crl:344cbde9:crl/Telegram/ThirdParty/crl
USE_GNOME= glib20 gtk30
-USE_QT5= core gui imageformats network widgets buildtools_build qmake_build
+USE_QT5= core gui imageformats network widgets buildtools_build qmake_build dbus
USE_XORG= x11 xcb
CMAKE_SOURCE_PATH= ${WRKSRC}/out/Release
GYP_DEFINES= TDESKTOP_DISABLE_CRASH_REPORTS,TDESKTOP_DISABLE_AUTOUPDATE,TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME
+# Telegram uses OpenAL for its audio, but libtgvoip (for voice calls) can use PulseAudio or ALSA.
+# It dynamically loads PulseAudio, and if this fails, it loads ALSA.
+# If both of them are not installed, then voice calls do not work, but other functionalities still work.
+OPTIONS_MULTI= AUDIO
+OPTIONS_MULTI_AUDIO= ALSA PULSEAUDIO
+OPTIONS_DEFAULT= ALSA
+
+AUDIO_DESC= Audio backend for voice calls
+
+ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib
+PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio
+
.include <bsd.port.pre.mk>
+# This port needs C++17 libs/compiler.
+# Currently, this is not supported by USES=compiler
+# Using clang does not work: libc++ in base does not support C++17.
+# Using gcc does not work: using both libc++ and libstdc++ causes crashes.
.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1100000
-CC= clang40
-CXX= clang++40
-BUILD_DEPENDS+= clang++40:devel/llvm40
-RUN_DEPENDS+= clang++40:devel/llvm40
+BROKEN= Need C++17 support in compiler and runtime
.endif
post-patch:
diff --git a/net-im/telegram-desktop/distinfo b/net-im/telegram-desktop/distinfo
index d28acf319b8b..a5dda2d15919 100644
--- a/net-im/telegram-desktop/distinfo
+++ b/net-im/telegram-desktop/distinfo
@@ -1,11 +1,13 @@
-TIMESTAMP = 1512711381
-SHA256 (telegramdesktop-tdesktop-v1.1.23_GH0.tar.gz) = 56b7fce84adf85a4af1c3174353169f32d0b0c052a4e7a284fc741fa96b04030
-SIZE (telegramdesktop-tdesktop-v1.1.23_GH0.tar.gz) = 16863984
-SHA256 (Microsoft-GSL-c5851a8_GH0.tar.gz) = 32fae541af0bc21cdf83922740db6a3a00fbb9cb9ace323fbc038b608ac36956
-SIZE (Microsoft-GSL-c5851a8_GH0.tar.gz) = 54462
-SHA256 (mapbox-variant-550ac2f_GH0.tar.gz) = 7ab3aa7c9fa672027f13721584df5f7ec09c0ecca499d374c6ac76e147ef7354
-SIZE (mapbox-variant-550ac2f_GH0.tar.gz) = 108686
+TIMESTAMP = 1523832839
+SHA256 (telegramdesktop-tdesktop-v1.2.17_GH0.tar.gz) = 775614e70372b2e18ef1b2940fa043599240975597e4c5e4431c6deb041a613d
+SIZE (telegramdesktop-tdesktop-v1.2.17_GH0.tar.gz) = 16916625
SHA256 (catchorg-Catch2-5ca44b68_GH0.tar.gz) = 8cdf2a345897bda1aaabffd4496dffe263768cef3e4254e74ae63545c8e12cc2
SIZE (catchorg-Catch2-5ca44b68_GH0.tar.gz) = 375264
-SHA256 (telegramdesktop-libtgvoip-757a5d8e_GH0.tar.gz) = a745c2c097f6a98bf9443d0cee9e375f279571a18dcb51bf06684eccf82eb9c6
-SIZE (telegramdesktop-libtgvoip-757a5d8e_GH0.tar.gz) = 408328
+SHA256 (mapbox-variant-550ac2f_GH0.tar.gz) = 7ab3aa7c9fa672027f13721584df5f7ec09c0ecca499d374c6ac76e147ef7354
+SIZE (mapbox-variant-550ac2f_GH0.tar.gz) = 108686
+SHA256 (Microsoft-GSL-9d65e74_GH0.tar.gz) = c2270ade74bd74831e2e854970c04db77f00e0dfdb0a3c3bce356da6019dd18d
+SIZE (Microsoft-GSL-9d65e74_GH0.tar.gz) = 57320
+SHA256 (telegramdesktop-libtgvoip-6e0e102_GH0.tar.gz) = 53f2d27f8bc76d454cd933fe0d598155d091967e9cb98b095cd44f2a70137220
+SIZE (telegramdesktop-libtgvoip-6e0e102_GH0.tar.gz) = 411964
+SHA256 (telegramdesktop-crl-344cbde9_GH0.tar.gz) = ec7d04bc36ed6dda88574e317e78d332b36cbd3378c3a8218ac5a3f37ee6d90f
+SIZE (telegramdesktop-crl-344cbde9_GH0.tar.gz) = 18308
diff --git a/net-im/telegram-desktop/files/gyp-patches b/net-im/telegram-desktop/files/gyp-patches
index 379607eebba0..db0dc263f314 100644
--- a/net-im/telegram-desktop/files/gyp-patches
+++ b/net-im/telegram-desktop/files/gyp-patches
@@ -1,6 +1,6 @@
---- Telegram/gyp/qt_rcc.gypi.orig 2017-09-05 17:38:38 UTC
+--- Telegram/gyp/qt_rcc.gypi.orig 2018-01-03 10:46:01 UTC
+++ Telegram/gyp/qt_rcc.gypi
-@@ -28,7 +28,7 @@
+@@ -15,7 +15,7 @@
'<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/qrc/qrc_<(RULE_INPUT_ROOT).cpp',
],
'action': [
@@ -9,9 +9,26 @@
'-name', '<(RULE_INPUT_ROOT)',
'-no-compress',
'<(RULE_INPUT_PATH)',
---- Telegram/gyp/qt.gypi.orig 2017-09-05 17:38:38 UTC
+--- Telegram/gyp/qt_moc.gypi.orig 2018-01-03 10:46:01 UTC
++++ Telegram/gyp/qt_moc.gypi
+@@ -12,12 +12,12 @@
+ '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/moc/moc_<(RULE_INPUT_ROOT).cpp',
+ ],
+ 'action': [
+- '<(qt_loc)/bin/moc<(exe_ext)',
++ '%%QT_BINDIR%%/moc',
+
+ # Silence "Note: No relevant classes found. No output generated."
+ '--no-notes',
+
+- '<!@(python -c "for s in \'<@(_defines)\'.split(\' \'): print(\'-D\' + s)")',
++ '<!@(%%PYTHON_CMD%% -c "for s in \'<@(_defines)\'.split(\' \'): print(\'-D\' + s)")',
+ # '<!@(python -c "for s in \'<@(_include_dirs)\'.split(\' \'): print(\'-I\' + s)")',
+ '<(RULE_INPUT_PATH)',
+ '-o', '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/moc/moc_<(RULE_INPUT_ROOT).cpp',
+--- Telegram/gyp/qt.gypi.orig 2018-01-03 10:46:01 UTC
+++ Telegram/gyp/qt.gypi
-@@ -27,25 +27,21 @@
+@@ -14,25 +14,21 @@
[ 'build_macold', {
'qt_version%': '5.3.2',
}, {
@@ -39,7 +56,7 @@
}]
]
},
-@@ -85,44 +81,24 @@
+@@ -72,44 +68,25 @@
],
}],
[ 'build_linux', {
@@ -56,7 +73,7 @@
- 'qgenericbearer',
- 'qnmbearer',
'<@(qt_libs)',
-- 'Qt5DBus',
+ 'Qt5DBus',
'Qt5Core',
- 'qtpcre',
- 'Xi',
@@ -90,7 +107,7 @@
],
},
'qt_libs_debug': [ '<@(qt_libs_debug)' ],
-@@ -140,11 +116,6 @@
+@@ -127,11 +104,6 @@
# '<!@(python <(DEPTH)/list_sources.py [sources] <(qt_moc_list_sources_arg))'
# where [sources] contains all your source files
'qt_moc_list_sources_arg': '--moc-prefix SHARED_INTERMEDIATE_DIR/<(_target_name)/moc/moc_',
@@ -98,17 +115,18 @@
- 'linux_path_xkbcommon%': '/usr/local',
- 'linux_lib_ssl%': '/usr/local/ssl/lib/libssl.a',
- 'linux_lib_crypto%': '/usr/local/ssl/lib/libcrypto.a',
-- 'linux_lib_icu%': '/usr/lib/libicutu.a /usr/lib/libicui18n.a /usr/lib/libicuuc.a /usr/lib/libicudata.a',
+- 'linux_lib_icu%': 'libicutu.a libicui18n.a libicuuc.a libicudata.a',
},
'configurations': {
-@@ -193,15 +164,17 @@
+@@ -180,18 +152,18 @@
},
'include_dirs': [
- '<(qt_loc)/include',
- '<(qt_loc)/include/QtCore',
- '<(qt_loc)/include/QtGui',
+- '<(qt_loc)/include/QtDBus',
- '<(qt_loc)/include/QtCore/<(qt_version)',
- '<(qt_loc)/include/QtGui/<(qt_version)',
- '<(qt_loc)/include/QtCore/<(qt_version)/QtCore',
@@ -116,33 +134,44 @@
+ '%%QT_INCDIR%%',
+ '%%QT_INCDIR%%/QtCore',
+ '%%QT_INCDIR%%/QtGui',
++ '%%QT_INCDIR%%/QtDBus',
+ '%%QT_INCDIR%%/QtCore/<(qt_version)',
+ '%%QT_INCDIR%%/QtGui/<(qt_version)',
+ '%%QT_INCDIR%%/QtCore/<(qt_version)/QtCore',
+ '%%QT_INCDIR%%/QtGui/<(qt_version)/QtGui',
],
'library_dirs': [
+- '<(qt_loc)/lib',
+- '<(qt_loc)/plugins',
+ '%%LOCALBASE%%/lib',
+ '%%QT_LIBDIR%%/',
- '<(qt_loc)/lib',
- '<(qt_loc)/plugins',
'<(qt_loc)/plugins/bearer',
-@@ -220,25 +193,20 @@
+ '<(qt_loc)/plugins/platforms',
+ '<(qt_loc)/plugins/imageformats',
+@@ -204,33 +176,20 @@
+ ],
+ 'conditions': [
+ [ 'build_linux', {
+- 'dependencies': [
+- '<(DEPTH)/linux_glibc_wraps.gyp:linux_glibc_wraps',
+- ],
+ 'library_dirs': [
'<(qt_loc)/plugins/platforminputcontexts',
],
'libraries': [
+- '<(PRODUCT_DIR)/obj.target/liblinux_glibc_wraps.a',
- '<(linux_path_xkbcommon)/lib/libxkbcommon.a',
'<@(qt_libs_release)',
- '<(linux_lib_ssl)',
- '<(linux_lib_crypto)',
- '<!@(python -c "for s in \'<(linux_lib_icu)\'.split(\' \'): print(s)")',
+- '-lxcb',
+ '-lcrypto',
- '-lxcb',
'-lX11',
- '-lX11-xcb',
- '-ldbus-1',
+- '-lX11-xcb',
+- '-ldbus-1',
- '-ldl',
- '-lgthread-2.0',
+- '-lgthread-2.0',
'-lglib-2.0',
'-lpthread',
],
@@ -153,35 +182,41 @@
'ldflags': [
- '-static-libstdc++',
'-pthread',
- '-g',
'-rdynamic',
-@@ -260,12 +228,12 @@
- '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/moc/moc_<(RULE_INPUT_ROOT).cpp',
- ],
- 'action': [
-- '<(qt_loc)/bin/moc<(exe_ext)',
-+ '%%QT_BINDIR%%/moc',
-
- # Silence "Note: No relevant classes found. No output generated."
- '--no-notes',
-
-- '<!@(python -c "for s in \'<@(_defines)\'.split(\' \'): print(\'-D\' + s)")',
-+ '<!@(%%PYTHON_CMD%% -c "for s in \'<@(_defines)\'.split(\' \'): print(\'-D\' + s)")',
- # '<!@(python -c "for s in \'<@(_include_dirs)\'.split(\' \'): print(\'-I\' + s)")',
- '<(RULE_INPUT_PATH)',
- '-o', '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/moc/moc_<(RULE_INPUT_ROOT).cpp',
---- Telegram/gyp/telegram_linux.gypi.orig 2017-09-05 17:38:38 UTC
+ ],
+--- Telegram/gyp/telegram_linux.gypi.orig 2018-01-03 10:46:01 UTC
+++ Telegram/gyp/telegram_linux.gypi
-@@ -33,7 +33,7 @@
+@@ -7,7 +7,7 @@
+ {
+ 'conditions': [[ 'build_linux', {
+ 'variables': {
+- 'not_need_gtk%': '<!(python -c "print(\'TDESKTOP_DISABLE_GTK_INTEGRATION\' in \'<(build_defines)\')")',
++ 'not_need_gtk%': '<!(%%PYTHON_CMD%% -c "print(\'TDESKTOP_DISABLE_GTK_INTEGRATION\' in \'<(build_defines)\')")',
+ 'pkgconfig_libs': [
+ # In order to work libxkbcommon must be linked statically,
+ # PKGCONFIG links it like "-L/usr/local/lib -lxkbcommon"
+@@ -20,10 +20,11 @@
'linux_path_va%': '/usr/local',
'linux_path_vdpau%': '/usr/local',
- 'linux_path_breakpad%': '<(libs_loc)/breakpad',
+ 'linux_path_breakpad%': '/usr/local',
- 'linux_path_opus_include%': '<(libs_loc)/opus/include',
+ 'linux_path_opus_include%': '%%LOCALBASE%%/include/opus',
+ 'linux_path_range%': '/usr/local',
},
'include_dirs': [
++ '/usr/include/openssl-1.0',
'/usr/local/include',
-@@ -52,48 +52,34 @@
+ '<(linux_path_ffmpeg)/include',
+ '<(linux_path_openal)/include',
+@@ -32,6 +33,7 @@
+ '<(linux_path_range)/include',
+ ],
+ 'library_dirs': [
++ '/usr/lib/openssl-1.0',
+ '/usr/local/lib',
+ '<(linux_path_ffmpeg)/lib',
+ '<(linux_path_openal)/lib',
+@@ -40,25 +42,15 @@
'<(linux_path_breakpad)/lib',
],
'libraries': [
@@ -216,37 +251,51 @@
# '<!(pkg-config 2> /dev/null --libs <@(pkgconfig_libs))',
],
'cflags_cc': [
-- '<!(pkg-config 2> /dev/null --cflags appindicator-0.1)',
-- '<!(pkg-config 2> /dev/null --cflags gtk+-2.0)',
-- '<!(pkg-config 2> /dev/null --cflags glib-2.0)',
-+# '<!(pkg-config 2> /dev/null --cflags appindicator-0.1)',
-+ '<!(pkg-config 2> /dev/null --cflags gtk+-3.0)',
- '<!(pkg-config 2> /dev/null --cflags dee-1.0)',
+@@ -67,7 +59,6 @@
+ 'ldflags': [
+ '-Wl,-wrap,aligned_alloc',
+ '-Wl,-wrap,secure_getenv',
+- '-Wl,-wrap,clock_gettime',
+ '-Wl,--no-as-needed,-lrt',
],
'configurations': {
- 'Release': {
- 'cflags': [
-- '-Ofast',
-- '-flto',
-+ %%CFLAGS%%
- '-fno-strict-aliasing',
+@@ -86,7 +77,7 @@
+ },
+ },
+ 'conditions': [
+- [ '"<!(uname -p)" == "x86_64"', {
++ [ '"<!(uname -m)" == "x86_64"', {
+ # 32 bit version can't be linked with debug info or LTO,
+ # virtual memory exhausted :(
+ 'cflags_c': [ '-g' ],
+@@ -94,9 +85,9 @@
+ 'ldflags': [ '-g' ],
+ 'configurations': {
+ 'Release': {
+- 'cflags_c': [ '-flto' ],
+- 'cflags_cc': [ '-flto' ],
+- 'ldflags': [ '-flto' ],
++ 'cflags_c': [ %%CFLAGS%% ],
++ 'cflags_cc': [ %%CXXFLAGS%% ],
++ 'ldflags': [ %%LDFLAGS%% ],
+ },
+ },
+ }, {
+@@ -105,10 +96,7 @@
],
+ }], ['not_need_gtk!="True"', {
'cflags_cc': [
-- '-Ofast',
-- '-flto',
-+ %%CXXFLAGS%%
- '-fno-strict-aliasing',
- ],
- 'ldflags': [
-- '-Ofast',
-- '-flto',
-+ %%LDFLAGS%%
+- '<!(pkg-config 2> /dev/null --cflags appindicator-0.1)',
+- '<!(pkg-config 2> /dev/null --cflags gtk+-2.0)',
+- '<!(pkg-config 2> /dev/null --cflags glib-2.0)',
+- '<!(pkg-config 2> /dev/null --cflags dee-1.0)',
++ '<!(pkg-config 2> /dev/null --cflags gtk+-3.0)',
],
- },
- },
---- Telegram/gyp/Telegram.gyp.orig 2017-09-05 17:38:38 UTC
+ }]
+ ],
+--- Telegram/gyp/Telegram.gyp.orig 2018-01-03 10:46:01 UTC
+++ Telegram/gyp/Telegram.gyp
-@@ -61,7 +61,7 @@
+@@ -49,7 +49,7 @@
'pt-BR',
],
'build_defines%': '',
@@ -255,12 +304,13 @@
},
'includes': [
'common_executable.gypi',
-@@ -80,28 +80,19 @@
+@@ -69,30 +69,20 @@
'codegen.gyp:codegen_numbers',
'codegen.gyp:codegen_style',
'tests/tests.gyp:tests',
- 'utils.gyp:Updater',
'../ThirdParty/libtgvoip/libtgvoip.gyp:libtgvoip',
+ 'crl.gyp:crl',
],
'defines': [
@@ -276,18 +326,19 @@
'<(SHARED_INTERMEDIATE_DIR)',
- '<(libs_loc)/breakpad/src',
- '<(libs_loc)/lzma/C',
-- '<(libs_loc)/libexif-0.6.20',
-- '<(libs_loc)/zlib-1.2.8',
+- '<(libs_loc)/zlib',
- '<(libs_loc)/ffmpeg',
- '<(libs_loc)/openal-soft/include',
- '<(libs_loc)/opus/include',
+- '<(libs_loc)/range-v3/include',
- '<(minizip_loc)',
+- '<(sp_media_key_tap_loc)',
+ '%%LOCALBASE%%/include/minizip',
- '<(sp_media_key_tap_loc)',
'<(emoji_suggestions_loc)',
'<(submodules_loc)/GSL/include',
-@@ -113,7 +104,7 @@
- '<!@(<(list_sources_command) <(qt_moc_list_sources_arg))',
+ '<(submodules_loc)/variant/include',
+@@ -105,7 +95,7 @@
+ 'telegram_sources.txt',
],
'sources!': [
- '<!@(<(list_sources_command) <(qt_moc_list_sources_arg) --exclude_for <(build_os))',
@@ -295,7 +346,7 @@
],
'conditions': [
[ '"<(official_build_target)" != ""', {
---- Telegram/ThirdParty/libtgvoip/libtgvoip.gyp.orig 2017-07-06 17:16:18 UTC
+--- Telegram/ThirdParty/libtgvoip/libtgvoip.gyp.orig 2018-02-06 06:51:56 UTC
+++ Telegram/ThirdParty/libtgvoip/libtgvoip.gyp
@@ -13,11 +13,12 @@
'variables': {
@@ -311,7 +362,16 @@
],
'direct_dependent_settings': {
'include_dirs': [
-@@ -371,12 +372,13 @@
+@@ -259,7 +260,7 @@
+ },
+ ],
+ [
+- '"<(OS)" != "linux"', {
++ '"<(OS)" != "freebsd"', {
+ 'sources/': [['exclude', '<(tgvoip_src_loc)/os/linux/']],
+ },
+ ],
+@@ -378,12 +379,13 @@
},
],
[
@@ -326,9 +386,9 @@
],
'direct_dependent_settings': {
'libraries': [
---- Telegram/gyp/codegen_rules.gypi.orig 2017-12-11 17:08:58 UTC
+--- Telegram/gyp/codegen_rules.gypi.orig 2018-02-06 06:53:18 UTC
+++ Telegram/gyp/codegen_rules.gypi
-@@ -28,7 +28,7 @@
+@@ -15,7 +15,7 @@
'<(SHARED_INTERMEDIATE_DIR)/update_dependent_styles.timestamp',
],
'action': [
@@ -337,7 +397,7 @@
'-I', '<(res_loc)', '-I', '<(src_loc)',
'-o', '<(SHARED_INTERMEDIATE_DIR)/update_dependent_styles.timestamp',
'<@(style_files)',
-@@ -39,13 +39,13 @@
+@@ -26,13 +26,13 @@
'inputs': [
'<(DEPTH)/update_dependent.py',
'<@(qrc_files)',
@@ -353,7 +413,7 @@
'-o', '<(SHARED_INTERMEDIATE_DIR)/update_dependent_qrc.timestamp',
'<@(qrc_files)',
],
-@@ -122,7 +122,7 @@
+@@ -109,7 +109,7 @@
'<(SHARED_INTERMEDIATE_DIR)/scheme.h',
],
'action': [
@@ -362,9 +422,9 @@
'-o', '<(SHARED_INTERMEDIATE_DIR)', '<(res_loc)/scheme.tl',
],
'message': 'codegen_scheme-ing scheme.tl..',
---- Telegram/gyp/tests/tests.gyp.orig 2017-12-11 17:12:35 UTC
+--- Telegram/gyp/tests/tests.gyp.orig 2018-02-06 06:53:50 UTC
+++ Telegram/gyp/tests/tests.gyp
-@@ -26,7 +26,7 @@
+@@ -13,7 +13,7 @@
'src_loc': '../../SourceFiles',
'submodules_loc': '../../ThirdParty',
'mac_target': '10.10',
diff --git a/net-im/telegram-desktop/files/patch-Telegram_Resources_qrc_telegram__linux.qrc b/net-im/telegram-desktop/files/patch-Telegram_Resources_qrc_telegram__linux.qrc
new file mode 100644
index 000000000000..fe51a7a9ec10
--- /dev/null
+++ b/net-im/telegram-desktop/files/patch-Telegram_Resources_qrc_telegram__linux.qrc
@@ -0,0 +1,8 @@
+--- Telegram/Resources/qrc/telegram_linux.qrc.orig 2018-01-03 10:46:01 UTC
++++ Telegram/Resources/qrc/telegram_linux.qrc
+@@ -1,5 +1,4 @@
+ <RCC>
+ <qresource prefix="/qt">
+- <file alias="etc/qt.conf">../etc/qt_linux.conf</file>
+ </qresource>
+ </RCC>
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles___other_packer.cpp b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles___other_packer.cpp
index 6edc49a306f8..d5216b269917 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles___other_packer.cpp
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles___other_packer.cpp
@@ -1,6 +1,6 @@
---- Telegram/SourceFiles/_other/packer.cpp.orig 2017-09-05 17:38:38 UTC
+--- Telegram/SourceFiles/_other/packer.cpp.orig 2018-02-06 05:52:28 UTC
+++ Telegram/SourceFiles/_other/packer.cpp
-@@ -246,7 +246,7 @@ int main(int argc, char *argv[])
+@@ -233,7 +233,7 @@ int main(int argc, char *argv[])
}
QByteArray inner = f.readAll();
stream << name << quint32(inner.size()) << inner;
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_base_build__config.h b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_base_build__config.h
index 6138f504dfca..e44dc4778250 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_base_build__config.h
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_base_build__config.h
@@ -1,11 +1,11 @@
---- Telegram/SourceFiles/base/build_config.h.orig 2017-09-05 17:38:38 UTC
+--- Telegram/SourceFiles/base/build_config.h.orig 2018-02-06 05:52:11 UTC
+++ Telegram/SourceFiles/base/build_config.h
-@@ -26,7 +26,7 @@ Copyright (c) 2014-2017 John Preston, ht
+@@ -13,7 +13,7 @@ https://github.com/telegramdesktop/tdesk
#if defined(__APPLE__)
#define OS_MAC 1
-#elif defined(__linux__) // __APPLE__
-+#elif defined(__linux__) || defined(__FreeBSD__)// __APPLE__
++#elif defined(__linux__) || defined(__FreeBSD__) // __APPLE__
#define OS_LINUX 1
#elif defined(_WIN32) // __APPLE__ || __linux__
#define OS_WIN 1
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_base_lambda.h b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_base_lambda.h
index 560cfdbc36d1..493450668339 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_base_lambda.h
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_base_lambda.h
@@ -1,6 +1,6 @@
---- Telegram/SourceFiles/base/lambda.h.orig 2017-09-05 17:38:38 UTC
+--- Telegram/SourceFiles/base/lambda.h.orig 2018-01-03 10:46:01 UTC
+++ Telegram/SourceFiles/base/lambda.h
-@@ -212,11 +212,14 @@ protected:
+@@ -226,11 +226,14 @@ protected:
template <typename Lambda, typename Return, typename ...Args>
struct vtable_once : public vtable_once_impl<Lambda, is_large<Lambda>, Return, Args...> {
@@ -17,7 +17,7 @@
template <typename Lambda, bool IsLarge, typename Return, typename ...Args> struct vtable_impl;
-@@ -262,12 +265,14 @@ struct vtable_impl<Lambda, false, Return
+@@ -276,12 +279,14 @@ struct vtable_impl<Lambda, false, Return
template <typename Lambda, typename Return, typename ...Args>
struct vtable : public vtable_impl<Lambda, is_large<Lambda>, Return, Args...> {
@@ -35,7 +35,7 @@
} // namespace lambda_internal
template <typename Return, typename ...Args>
-@@ -346,7 +351,7 @@ public:
+@@ -360,7 +365,7 @@ public:
// Copy / move construct / assign from an arbitrary type.
template <typename Lambda, typename = std::enable_if_t<std::is_convertible<decltype(std::declval<Lambda>()(std::declval<Args>()...)),Return>::value>>
lambda_once(Lambda other) {
@@ -44,7 +44,7 @@
lambda_internal::vtable_once<Lambda, Return, Args...>::construct_move_lambda_method(data_.storage, &other);
}
template <typename Lambda, typename = std::enable_if_t<std::is_convertible<decltype(std::declval<Lambda>()(std::declval<Args>()...)),Return>::value>>
-@@ -354,7 +359,7 @@ public:
+@@ -368,7 +373,7 @@ public:
if (data_.vtable) {
data_.vtable->destruct(data_.storage);
}
@@ -53,7 +53,7 @@
lambda_internal::vtable_once<Lambda, Return, Args...>::construct_move_lambda_method(data_.storage, &other);
return *this;
}
-@@ -424,7 +429,7 @@ public:
+@@ -443,7 +448,7 @@ public:
// Copy / move construct / assign from an arbitrary type.
template <typename Lambda, typename = std::enable_if_t<std::is_convertible<decltype(std::declval<Lambda>()(std::declval<Args>()...)),Return>::value>>
@@ -62,7 +62,7 @@
lambda_internal::vtable<Lambda, Return, Args...>::construct_move_lambda_method(this->data_.storage, &other);
}
template <typename Lambda, typename = std::enable_if_t<std::is_convertible<decltype(std::declval<Lambda>()(std::declval<Args>()...)),Return>::value>>
-@@ -432,7 +437,7 @@ public:
+@@ -451,7 +456,7 @@ public:
if (this->data_.vtable) {
this->data_.vtable->destruct(this->data_.storage);
}
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_boxes_notifications__box.cpp b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_boxes_notifications__box.cpp
new file mode 100644
index 000000000000..fd4229e950cc
--- /dev/null
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_boxes_notifications__box.cpp
@@ -0,0 +1,17 @@
+--- Telegram/SourceFiles/boxes/notifications_box.cpp.orig 2018-02-06 06:26:42 UTC
++++ Telegram/SourceFiles/boxes/notifications_box.cpp
+@@ -84,11 +84,11 @@ private:
+ _deleted = true;
+
+ // Ubuntu has a lag if deleteLater() called immediately.
+-#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
++#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64 || defined Q_OS_FREEBSD
+ QTimer::singleShot(1000, [this] { delete this; });
+-#else // Q_OS_LINUX32 || Q_OS_LINUX64
++#else // Q_OS_LINUX32 || Q_OS_LINUX64 || defined Q_OS_FREEBSD
+ deleteLater();
+-#endif // Q_OS_LINUX32 || Q_OS_LINUX64
++#endif // Q_OS_LINUX32 || Q_OS_LINUX64 || defined Q_OS_FREEBSD
+ }
+
+ NotificationsBox *_owner;
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_config.h b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_config.h
index 3b596bd1068c..84e3b918c15b 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_config.h
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_config.h
@@ -1,6 +1,6 @@
---- Telegram/SourceFiles/config.h.orig 2017-09-05 17:38:38 UTC
+--- Telegram/SourceFiles/config.h.orig 2018-04-08 17:34:33 UTC
+++ Telegram/SourceFiles/config.h
-@@ -270,7 +270,7 @@ inline const char *cApiDeviceModel() {
+@@ -240,7 +240,7 @@ inline const char *cApiDeviceModel() {
return "PC";
#elif defined Q_OS_MAC
return "Mac";
@@ -9,7 +9,7 @@
return "PC";
#endif
}
-@@ -281,6 +281,8 @@ inline const char *cApiSystemVersion() {
+@@ -251,6 +251,8 @@ inline const char *cApiSystemVersion() {
return "OS X";
#elif defined Q_OS_LINUX
return "Linux";
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_core_launcher.cpp b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_core_launcher.cpp
new file mode 100644
index 000000000000..5b448bbadc3c
--- /dev/null
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_core_launcher.cpp
@@ -0,0 +1,47 @@
+--- Telegram/SourceFiles/core/launcher.cpp.orig 2018-01-03 10:46:01 UTC
++++ Telegram/SourceFiles/core/launcher.cpp
+@@ -13,6 +13,8 @@ https://github.com/telegramdesktop/tdesk
+ #include "core/main_queue_processor.h"
+ #include "application.h"
+
++#include "FREEBSD_QT_PLUGINDIR.h"
++
+ namespace Core {
+
+ std::unique_ptr<Launcher> Launcher::Create(int argc, char *argv[]) {
+@@ -31,9 +33,10 @@ void Launcher::init() {
+
+ QCoreApplication::setApplicationName(qsl("TelegramDesktop"));
+
+-#ifndef OS_MAC_OLD
++#if !defined(Q_OS_MAC) && QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
++ // Retina display support is working fine, others are not.
+ QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling, true);
+-#endif // OS_MAC_OLD
++#endif // not defined Q_OS_MAC and QT_VERSION >= 5.6.0
+
+ initHook();
+ }
+@@ -51,6 +54,11 @@ int Launcher::exec() {
+ Logs::start(this); // must be started before Platform is started
+ Platform::start(); // must be started before QApplication is created
+
++ // I don't know why path is not in QT_PLUGIN_PATH by default
++ QCoreApplication::addLibraryPath(FREEBSD_QT_PLUGINDIR);
++ // Telegram doesn't start when extraordinary theme is set, see launchpad.net/bugs/1680943
++ unsetenv("QT_QPA_PLATFORMTHEME");
++
+ auto result = executeApplication();
+
+ DEBUG_LOG(("Telegram finished, result: %1").arg(result));
+@@ -136,6 +144,10 @@ void Launcher::prepareSettings() {
+ gUpdateURL = QUrl(qsl("http://tdesktop.com/linux32/tupdates/current"));
+ gPlatformString = qsl("Linux32bit");
+ break;
++ case dbipFreeBSD:
++ gUpdateURL = QUrl(qsl(""));
++ gPlatformString = qsl("FreeBSD");
++ break;
+ }
+
+ auto path = Platform::CurrentExecutablePath(_argc, _argv);
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_core_utils.h b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_core_utils.h
new file mode 100644
index 000000000000..2460632aea0d
--- /dev/null
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_core_utils.h
@@ -0,0 +1,10 @@
+--- Telegram/SourceFiles/core/utils.h.orig 2018-04-08 17:34:33 UTC
++++ Telegram/SourceFiles/core/utils.h
+@@ -451,6 +451,7 @@ enum DBIPlatform {
+ dbipLinux64 = 2,
+ dbipLinux32 = 3,
+ dbipMacOld = 4,
++ dbipFreeBSD = 5,
+ };
+
+ enum DBIPeerReportSpamStatus {
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_structs.cpp b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_data_data__document.cpp
index ed3c4bd68037..7e6512aee847 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_structs.cpp
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_data_data__document.cpp
@@ -1,6 +1,6 @@
---- Telegram/SourceFiles/structs.cpp.orig 2017-09-05 17:38:38 UTC
-+++ Telegram/SourceFiles/structs.cpp
-@@ -1280,7 +1280,7 @@ QString saveFileName(const QString &titl
+--- Telegram/SourceFiles/data/data_document.cpp.orig 2018-04-08 17:34:33 UTC
++++ Telegram/SourceFiles/data/data_document.cpp
+@@ -76,7 +76,7 @@ QString FileNameUnsafe(
name = name.replace(QRegularExpression(qsl("[\\\\\\/\\:\\*\\?\\\"\\<\\>\\|]")), qsl("_"));
#elif defined Q_OS_MAC
name = name.replace(QRegularExpression(qsl("[\\:]")), qsl("_"));
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_history_admin__log_history__admin__log__inner.cpp b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_history_admin__log_history__admin__log__inner.cpp
new file mode 100644
index 000000000000..5a0a5928505d
--- /dev/null
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_history_admin__log_history__admin__log__inner.cpp
@@ -0,0 +1,18 @@
+--- Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp.orig 2018-04-08 17:34:33 UTC
++++ Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp
+@@ -1388,13 +1388,13 @@ void InnerWidget::mouseActionFinish(cons
+ _mouseSelectType = TextSelectType::Letters;
+ //_widget->noSelectingScroll(); // TODO
+
+-#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
++#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64 || defined Q_OS_FREEBSD
+ if (_selectedItem && _selectedText.from != _selectedText.to) {
+ SetClipboardWithEntities(
+ _selectedItem->selectedText(_selectedText),
+ QClipboard::Selection);
+ }
+-#endif // Q_OS_LINUX32 || Q_OS_LINUX64
++#endif // Q_OS_LINUX32 || Q_OS_LINUX64 || Q_OS_FREEBSD
+ }
+
+ void InnerWidget::updateSelected() {
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_history_history__inner__widget.cpp b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_history_history__inner__widget.cpp
new file mode 100644
index 000000000000..05550bb9ad1d
--- /dev/null
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_history_history__inner__widget.cpp
@@ -0,0 +1,20 @@
+--- Telegram/SourceFiles/history/history_inner_widget.cpp.orig 2018-04-08 17:34:33 UTC
++++ Telegram/SourceFiles/history/history_inner_widget.cpp
+@@ -1336,7 +1336,7 @@ void HistoryInner::mouseActionFinish(
+ _widget->noSelectingScroll();
+ _widget->updateTopBarSelection();
+
+-#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
++#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64 || defined Q_OS_FREEBSD
+ if (!_selected.empty() && _selected.cbegin()->second != FullSelection) {
+ const auto [item, selection] = *_selected.cbegin();
+ if (const auto view = item->mainView()) {
+@@ -1345,7 +1345,7 @@ void HistoryInner::mouseActionFinish(
+ QClipboard::Selection);
+ }
+ }
+-#endif // Q_OS_LINUX32 || Q_OS_LINUX64
++#endif // Q_OS_LINUX32 || Q_OS_LINUX64 || Q_OS_FREEBSD
+ }
+
+ void HistoryInner::mouseReleaseEvent(QMouseEvent *e) {
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_history_view_history__view__list__widget.cpp b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_history_view_history__view__list__widget.cpp
new file mode 100644
index 000000000000..c6eea7c0faa3
--- /dev/null
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_history_view_history__view__list__widget.cpp
@@ -0,0 +1,11 @@
+--- Telegram/SourceFiles/history/view/history_view_list_widget.cpp.orig 2018-04-15 23:31:46 UTC
++++ Telegram/SourceFiles/history/view/history_view_list_widget.cpp
+@@ -2014,7 +2014,7 @@ void ListWidget::mouseActionFinish(
+ _mouseSelectType = TextSelectType::Letters;
+ //_widget->noSelectingScroll(); // #TODO select scroll
+
+-#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
++#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64 || defined Q_OS_FREEBSD
+ if (_selectedTextItem
+ && _selectedTextRange.from != _selectedTextRange.to) {
+ if (const auto view = viewForItem(_selectedTextItem)) {
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_layout.cpp b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_layout.cpp
index 22545c6e01a0..ebfeaa3174be 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_layout.cpp
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_layout.cpp
@@ -1,6 +1,6 @@
---- Telegram/SourceFiles/layout.cpp.orig 2017-09-05 17:38:38 UTC
+--- Telegram/SourceFiles/layout.cpp.orig 2018-04-08 17:34:33 UTC
+++ Telegram/SourceFiles/layout.cpp
-@@ -264,16 +264,16 @@ bool documentIsExecutableName(const QStr
+@@ -206,16 +206,16 @@ bool documentIsExecutableName(const QStr
*result = qsl("\
action app bin command csh osx workflow\
").split(' ');
@@ -16,7 +16,7 @@
msp mst paf pif ps1 reg rgs sct shb shs u3p vb vbe vbs vbscript ws wsf\
").split(' ');
-#endif // !Q_OS_MAC && !Q_OS_LINUX
-+#endif // !Q_OS_MAC && !Q_OS_LINUX && ! Q_OS_FREEBSD
++#endif // !Q_OS_MAC && !Q_OS_LINUX && !Q_OS_FREEBSD
return result.release();
})());
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_logs.cpp b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_logs.cpp
index 2155b99fee85..105c65d378d7 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_logs.cpp
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_logs.cpp
@@ -1,35 +1,39 @@
---- Telegram/SourceFiles/logs.cpp.orig 2017-09-05 17:38:38 UTC
+--- Telegram/SourceFiles/logs.cpp.orig 2018-02-06 05:51:11 UTC
+++ Telegram/SourceFiles/logs.cpp
-@@ -311,7 +311,7 @@ namespace Logs {
- QString initialWorkingDir = QDir(cWorkingDir()).absolutePath() + '/', moveOldDataFrom;
- if (cBetaVersion()) {
- cSetDebug(true);
+@@ -321,7 +321,7 @@ void start(not_null<Core::Launcher*> lau
+ if (cBetaVersion()) {
+ cSetDebug(true);
+ workingDirChosen = true;
-#if defined Q_OS_MAC || defined Q_OS_LINUX
+#if defined Q_OS_MAC || defined Q_OS_LINUX || defined Q_OS_FREEBSD
- } else {
+ } else {
#ifdef _DEBUG
- cForceWorkingDir(cExeDir());
-@@ -322,11 +322,11 @@ namespace Logs {
- #endif // else for _DEBUG
- workingDirChosen = true;
+ cForceWorkingDir(cExeDir());
+@@ -335,15 +335,15 @@ void start(not_null<Core::Launcher*> lau
+ #endif // !_DEBUG
+ workingDirChosen = true;
-#if defined Q_OS_LINUX && !defined _DEBUG // fix first version
+#if (defined Q_OS_LINUX || defined Q_OS_FREEBSD) && !defined _DEBUG // fix first version
- moveOldDataFrom = initialWorkingDir;
--#endif // Q_OS_LINUX && !_DEBUG
-+#endif // (Q_OS_LINUX || Q_OS_FREEBSD) && !_DEBUG
+ moveOldDataFrom = initialWorkingDir;
+ #endif // Q_OS_LINUX && !_DEBUG
-#elif defined Q_OS_WINRT // Q_OS_MAC || Q_OS_LINUX
+#elif defined Q_OS_WINRT // Q_OS_MAC || Q_OS_LINUX || Q_OS_FREEBSD
- } else {
- cForceWorkingDir(psAppDataPath());
+ } else {
+ cForceWorkingDir(psAppDataPath());
+ workingDirChosen = true;
+-#elif defined OS_WIN_STORE // Q_OS_MAC || Q_OS_LINUX || Q_OS_WINRT
++#elif defined OS_WIN_STORE // Q_OS_MAC || Q_OS_LINUX || Q_OS_WINRT || Q_OS_FREEBSD
+ #ifdef _DEBUG
+ cForceWorkingDir(cExeDir());
+ #else // _DEBUG
+@@ -357,7 +357,7 @@ void start(not_null<Core::Launcher*> lau
+ cForceWorkingDir(cWorkingDir());
workingDirChosen = true;
-@@ -502,7 +502,7 @@ namespace Logs {
- //OutputDebugString(reinterpret_cast<const wchar_t *>(msg.utf16()));
- #elif defined Q_OS_MAC
- //objc_outputDebugString(msg);
--#elif defined Q_OS_LINUX && defined _DEBUG
-+#elif (defined Q_OS_LINUX || defined Q_OS_FREEBSD) && defined _DEBUG
- //std::cout << msg.toUtf8().constData();
- #endif
+ }
+-#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WINRT || OS_WIN_STORE
++#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WINRT || OS_WIN_STORE || Q_OS_FREEBSD
}
+
+ LogsData = new LogsDataFields();
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_main.cpp b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_main.cpp
deleted file mode 100644
index 4835ff0b7fca..000000000000
--- a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_main.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
---- Telegram/SourceFiles/main.cpp.orig 2017-09-05 17:38:38 UTC
-+++ Telegram/SourceFiles/main.cpp
-@@ -22,10 +22,13 @@ Copyright (c) 2014-2017 John Preston, ht
- #include "platform/platform_specific.h"
- #include "storage/localstorage.h"
-
-+#include "FREEBSD_QT_PLUGINDIR.h"
-+
- int main(int argc, char *argv[]) {
--#ifndef Q_OS_MAC // Retina display support is working fine, others are not.
-+#if !defined(Q_OS_MAC) && QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
-+ // Retina display support is working fine, others are not.
- QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling, true);
--#endif // Q_OS_MAC
-+#endif // not defined Q_OS_MAC and QT_VERSION >= 5.6.0
- QCoreApplication::setApplicationName(qsl("TelegramDesktop"));
-
- InitFromCommandLine(argc, argv);
-@@ -39,6 +42,11 @@ int main(int argc, char *argv[]) {
- Logs::start(); // must be started before Platform is started
- Platform::start(); // must be started before QApplication is created
-
-+ // I don't know why path is not in QT_PLUGIN_PATH by default
-+ QCoreApplication::addLibraryPath(FREEBSD_QT_PLUGINDIR);
-+ // without this Telegram doesn't start on Ubuntu 17.04 due GTK errors
-+ setenv("QT_STYLE_OVERRIDE", "qwerty", false);
-+
- int result = 0;
- {
- Application app(argc, argv);
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_mainwindow.cpp b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_mainwindow.cpp
deleted file mode 100644
index 9a3fdcf3bc7e..000000000000
--- a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_mainwindow.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
---- Telegram/SourceFiles/mainwindow.cpp.orig 2017-09-05 17:38:38 UTC
-+++ Telegram/SourceFiles/mainwindow.cpp
-@@ -460,6 +460,7 @@ void MainWindow::ui_hideMediaPreview() {
- void MainWindow::showConnecting(const QString &text, const QString &reconnect) {
- if (_connecting) {
- _connecting->set(text, reconnect);
-+ _connecting->show();
- } else {
- _connecting.create(bodyWidget(), text, reconnect);
- _connecting->show();
-@@ -470,7 +471,7 @@ void MainWindow::showConnecting(const QS
-
- void MainWindow::hideConnecting() {
- if (_connecting) {
-- _connecting.destroyDelayed();
-+ _connecting->hide();
- }
- }
-
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_linux_linux__libs.cpp b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_linux_linux__libs.cpp
index 32152264bcd0..80fed3082b09 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_linux_linux__libs.cpp
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_linux_linux__libs.cpp
@@ -1,6 +1,6 @@
---- Telegram/SourceFiles/platform/linux/linux_libs.cpp.orig 2017-09-05 17:38:38 UTC
+--- Telegram/SourceFiles/platform/linux/linux_libs.cpp.orig 2018-02-06 05:57:25 UTC
+++ Telegram/SourceFiles/platform/linux/linux_libs.cpp
-@@ -133,6 +133,7 @@ bool setupGtkBase(QLibrary &lib_gtk) {
+@@ -121,6 +121,7 @@ bool setupGtkBase(QLibrary &lib_gtk) {
return true;
}
@@ -8,15 +8,15 @@
bool setupAppIndicator(QLibrary &lib_indicator) {
if (!load(lib_indicator, "app_indicator_new", app_indicator_new)) return false;
if (!load(lib_indicator, "app_indicator_set_status", app_indicator_set_status)) return false;
-@@ -142,6 +143,7 @@ bool setupAppIndicator(QLibrary &lib_ind
+@@ -130,6 +131,7 @@ bool setupAppIndicator(QLibrary &lib_ind
DEBUG_LOG(("Library appindicator functions loaded!"));
return true;
}
+#endif
+ #endif // !TDESKTOP_DISABLE_GTK_INTEGRATION
} // namespace
-
-@@ -201,10 +203,12 @@ f_g_type_check_instance_cast g_type_chec
+@@ -191,10 +193,12 @@ f_g_type_check_instance_cast g_type_chec
f_g_type_check_instance_is_a g_type_check_instance_is_a = nullptr;
f_g_signal_connect_data g_signal_connect_data = nullptr;
f_g_signal_handler_disconnect g_signal_handler_disconnect = nullptr;
@@ -29,7 +29,7 @@
f_gdk_init_check gdk_init_check = nullptr;
f_gdk_pixbuf_new_from_data gdk_pixbuf_new_from_data = nullptr;
f_gdk_pixbuf_new_from_file gdk_pixbuf_new_from_file = nullptr;
-@@ -242,6 +246,7 @@ void start() {
+@@ -234,6 +238,7 @@ void start() {
bool gtkLoaded = false;
bool indicatorLoaded = false;
QLibrary lib_gtk, lib_indicator;
@@ -37,7 +37,7 @@
if (loadLibrary(lib_indicator, "appindicator3", 1)) {
if (loadLibrary(lib_gtk, "gtk-3", 0)) {
gtkLoaded = setupGtkBase(lib_gtk);
-@@ -257,6 +262,7 @@ void start() {
+@@ -249,6 +254,7 @@ void start() {
}
}
}
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_linux_linux__libs.h b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_linux_linux__libs.h
index 53ce0217b9ea..da71f3ff3cac 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_linux_linux__libs.h
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_linux_linux__libs.h
@@ -1,7 +1,7 @@
---- Telegram/SourceFiles/platform/linux/linux_libs.h.orig 2017-09-05 17:38:38 UTC
+--- Telegram/SourceFiles/platform/linux/linux_libs.h.orig 2018-02-06 05:56:56 UTC
+++ Telegram/SourceFiles/platform/linux/linux_libs.h
-@@ -22,14 +22,16 @@ Copyright (c) 2014-2017 John Preston, ht
-
+@@ -10,14 +10,16 @@ https://github.com/telegramdesktop/tdesk
+ #ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
extern "C" {
#undef signals
+#ifdef HAVE_APPINDICATOR
@@ -16,9 +16,9 @@
-#include <unity/unity/unity.h>
+typedef void UnityLauncherEntry;
#endif // !TDESKTOP_DISABLE_UNITY_INTEGRATION
+ #endif // !TDESKTOP_DISABLE_GTK_INTEGRATION
- namespace Platform {
-@@ -284,6 +286,7 @@ inline gulong g_signal_connect_swapped_h
+@@ -274,6 +276,7 @@ inline gulong g_signal_connect_swapped_h
typedef void (*f_g_signal_handler_disconnect)(gpointer instance, gulong handler_id);
extern f_g_signal_handler_disconnect g_signal_handler_disconnect;
@@ -26,7 +26,7 @@
typedef AppIndicator* (*f_app_indicator_new)(const gchar *id, const gchar *icon_name, AppIndicatorCategory category);
extern f_app_indicator_new app_indicator_new;
-@@ -295,6 +298,7 @@ extern f_app_indicator_set_menu app_indi
+@@ -285,6 +288,7 @@ extern f_app_indicator_set_menu app_indi
typedef void (*f_app_indicator_set_icon_full)(AppIndicator *self, const gchar *icon_name, const gchar *icon_desc);
extern f_app_indicator_set_icon_full app_indicator_set_icon_full;
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_linux_main__window__linux.cpp b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_linux_main__window__linux.cpp
index d31a2a5ba2d1..e438a56bea90 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_linux_main__window__linux.cpp
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_linux_main__window__linux.cpp
@@ -1,18 +1,18 @@
---- Telegram/SourceFiles/platform/linux/main_window_linux.cpp.orig 2017-09-05 17:38:38 UTC
+--- Telegram/SourceFiles/platform/linux/main_window_linux.cpp.orig 2018-04-08 17:34:33 UTC
+++ Telegram/SourceFiles/platform/linux/main_window_linux.cpp
-@@ -36,7 +36,9 @@ namespace {
- bool noQtTrayIcon = false, tryAppIndicator = false;
+@@ -25,7 +25,9 @@ bool noQtTrayIcon = false, tryAppIndicat
bool useGtkBase = false, useAppIndicator = false, useStatusIcon = false, trayIconChecked = false, useUnityCount = false;
+ #ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
+#ifdef HAVE_APPINDICATOR
AppIndicator *_trayIndicator = 0;
+#endif
GtkStatusIcon *_trayIcon = 0;
GtkWidget *_trayMenu = 0;
GdkPixbuf *_trayPixbuf = 0;
-@@ -274,7 +276,9 @@ void MainWindow::workmodeUpdated(DBIWork
- if (mode == dbiwmWindowOnly) {
+@@ -279,7 +281,9 @@ void MainWindow::workmodeUpdated(DBIWork
if (noQtTrayIcon) {
+ #ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
if (useAppIndicator) {
+#ifdef HAVE_APPINDICATOR
Libs::app_indicator_set_status(_trayIndicator, APP_INDICATOR_STATUS_PASSIVE);
@@ -20,9 +20,9 @@
} else if (useStatusIcon) {
Libs::gtk_status_icon_set_visible(_trayIcon, false);
}
-@@ -288,7 +292,9 @@ void MainWindow::workmodeUpdated(DBIWork
- } else {
+@@ -295,7 +299,9 @@ void MainWindow::workmodeUpdated(DBIWork
if (noQtTrayIcon) {
+ #ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
if (useAppIndicator) {
+#ifdef HAVE_APPINDICATOR
Libs::app_indicator_set_status(_trayIndicator, APP_INDICATOR_STATUS_ACTIVE);
@@ -30,7 +30,7 @@
} else if (useStatusIcon) {
Libs::gtk_status_icon_set_visible(_trayIcon, true);
}
-@@ -305,7 +311,9 @@ void MainWindow::psUpdateIndicator() {
+@@ -314,7 +320,9 @@ void MainWindow::psUpdateIndicator() {
if (iconFile.exists()) {
QByteArray path = QFile::encodeName(iconFile.absoluteFilePath()), name = QFile::encodeName(iconFile.fileName());
name = name.mid(0, name.size() - 4);
@@ -40,7 +40,7 @@
} else {
useAppIndicator = false;
}
-@@ -392,11 +400,15 @@ void MainWindow::LibsLoaded() {
+@@ -407,11 +415,15 @@ void MainWindow::LibsLoaded() {
&& (Libs::g_object_ref_sink != nullptr)
&& (Libs::g_object_unref != nullptr);
@@ -51,20 +51,20 @@
&& (Libs::app_indicator_set_menu != nullptr)
&& (Libs::app_indicator_set_icon_full != nullptr);
+#else
-+ useAppIndicator = false;
++ useAppIndicator = false;
+#endif
if (tryAppIndicator && useGtkBase && useAppIndicator) {
noQtTrayIcon = true;
-@@ -439,6 +451,7 @@ void MainWindow::psCreateTrayIcon() {
- return;
+@@ -456,6 +468,7 @@ void MainWindow::psCreateTrayIcon() {
}
+ #ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
+#ifdef HAVE_APPINDICATOR
if (useAppIndicator) {
DEBUG_LOG(("Trying to create AppIndicator"));
_trayMenu = Libs::gtk_menu_new();
-@@ -469,6 +482,7 @@ void MainWindow::psCreateTrayIcon() {
+@@ -486,6 +499,7 @@ void MainWindow::psCreateTrayIcon() {
useAppIndicator = false;
}
}
@@ -72,7 +72,7 @@
if (useStatusIcon) {
if (Libs::gdk_init_check(0, 0)) {
if (!_trayMenu) _trayMenu = Libs::gtk_menu_new();
-@@ -585,10 +599,12 @@ MainWindow::~MainWindow() {
+@@ -604,10 +618,12 @@ MainWindow::~MainWindow() {
Libs::g_object_unref(_trayMenu);
_trayMenu = nullptr;
}
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__audio.h b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__audio.h
index 302480d688c1..b95620506be3 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__audio.h
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__audio.h
@@ -1,6 +1,6 @@
---- Telegram/SourceFiles/platform/platform_audio.h.orig 2017-09-05 17:38:38 UTC
+--- Telegram/SourceFiles/platform/platform_audio.h.orig 2018-02-06 05:55:32 UTC
+++ Telegram/SourceFiles/platform/platform_audio.h
-@@ -32,7 +32,7 @@ void DeInit();
+@@ -19,7 +19,7 @@ void DeInit();
// Platform dependent implementations.
@@ -9,7 +9,7 @@
namespace Platform {
namespace Audio {
-@@ -44,6 +44,6 @@ inline void DeInit() {
+@@ -31,6 +31,6 @@ inline void DeInit() {
} // namespace Audio
} // namespace Platform
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__file__utilities.h b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__file__utilities.h
index 98ebbb8aa247..413e1f9bb321 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__file__utilities.h
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__file__utilities.h
@@ -1,11 +1,11 @@
---- Telegram/SourceFiles/platform/platform_file_utilities.h.orig 2017-09-05 17:38:38 UTC
+--- Telegram/SourceFiles/platform/platform_file_utilities.h.orig 2018-02-06 05:55:41 UTC
+++ Telegram/SourceFiles/platform/platform_file_utilities.h
-@@ -51,8 +51,8 @@ bool Get(QStringList &files, QByteArray
+@@ -38,8 +38,8 @@ bool Get(QStringList &files, QByteArray
#ifdef Q_OS_MAC
#include "platform/mac/file_utilities_mac.h"
-#elif defined Q_OS_LINUX // Q_OS_MAC
-+#elif defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) // Q_OS_MAC
++#elif defined Q_OS_LINUX || defined Q_OS_FREEBSD // Q_OS_MAC
#include "platform/linux/file_utilities_linux.h"
-#elif defined Q_OS_WINRT || defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
+#elif defined Q_OS_WINRT || defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX || Q_OS_FREEBSD
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__launcher.h b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__launcher.h
new file mode 100644
index 000000000000..143df2bc67bc
--- /dev/null
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__launcher.h
@@ -0,0 +1,14 @@
+--- Telegram/SourceFiles/platform/platform_launcher.h.orig 2018-02-07 00:52:41 UTC
++++ Telegram/SourceFiles/platform/platform_launcher.h
+@@ -23,8 +23,8 @@ namespace Platform {
+
+ #ifdef Q_OS_MAC
+ #include "platform/mac/launcher_mac.h"
+-#elif defined Q_OS_LINUX // Q_OS_MAC
++#elif defined Q_OS_LINUX || defined Q_OS_FREEBSD // Q_OS_MAC
+ #include "platform/linux/launcher_linux.h"
+-#elif defined Q_OS_WINRT || defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
++#elif defined Q_OS_WINRT || defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX || Q_OS_FREEBSD
+ #include "platform/win/launcher_win.h"
+-#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WINRT || Q_OS_WIN
++#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WINRT || Q_OS_WIN || Q_OS_FREEBSD
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__main__window.h b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__main__window.h
index 34c08df18f21..860ee56a3ff6 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__main__window.h
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__main__window.h
@@ -1,11 +1,11 @@
---- Telegram/SourceFiles/platform/platform_main_window.h.orig 2017-09-05 17:38:38 UTC
+--- Telegram/SourceFiles/platform/platform_main_window.h.orig 2018-02-06 05:55:51 UTC
+++ Telegram/SourceFiles/platform/platform_main_window.h
-@@ -32,8 +32,8 @@ class MainWindow;
+@@ -19,8 +19,8 @@ class MainWindow;
#ifdef Q_OS_MAC
#include "platform/mac/main_window_mac.h"
-#elif defined Q_OS_LINUX // Q_OS_MAC
-+#elif defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) // Q_OS_MAC
++#elif defined Q_OS_LINUX || defined Q_OS_FREEBSD // Q_OS_MAC
#include "platform/linux/main_window_linux.h"
-#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
+#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX || Q_OS_FREEBSD
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__notifications__manager.h b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__notifications__manager.h
index 8f3699b92875..05bdce840258 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__notifications__manager.h
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__notifications__manager.h
@@ -1,11 +1,11 @@
---- Telegram/SourceFiles/platform/platform_notifications_manager.h.orig 2017-09-05 17:38:38 UTC
+--- Telegram/SourceFiles/platform/platform_notifications_manager.h.orig 2018-02-06 05:55:59 UTC
+++ Telegram/SourceFiles/platform/platform_notifications_manager.h
-@@ -39,8 +39,8 @@ void FlashBounce();
+@@ -26,8 +26,8 @@ void FlashBounce();
#ifdef Q_OS_MAC
#include "platform/mac/notifications_manager_mac.h"
-#elif defined Q_OS_LINUX // Q_OS_MAC
-+#elif defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) // Q_OS_MAC
++#elif defined Q_OS_LINUX || defined Q_OS_FREEBSD // Q_OS_MAC
#include "platform/linux/notifications_manager_linux.h"
-#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
+#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX || Q_OS_FREEBSD
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__specific.h b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__specific.h
index debe306c7aac..fee021f07df8 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__specific.h
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__specific.h
@@ -1,11 +1,11 @@
---- Telegram/SourceFiles/platform/platform_specific.h.orig 2017-09-05 17:38:38 UTC
+--- Telegram/SourceFiles/platform/platform_specific.h.orig 2018-02-06 05:56:11 UTC
+++ Telegram/SourceFiles/platform/platform_specific.h
-@@ -45,8 +45,8 @@ void finish();
+@@ -32,8 +32,8 @@ void finish();
#ifdef Q_OS_MAC
#include "platform/mac/specific_mac.h"
-#elif defined Q_OS_LINUX // Q_OS_MAC
-+#elif defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) // Q_OS_MAC
++#elif defined Q_OS_LINUX || defined Q_OS_FREEBSD // Q_OS_MAC
#include "platform/linux/specific_linux.h"
-#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
+#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX || Q_OS_FREEBSD
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__window__title.h b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__window__title.h
index 5216166bd822..4a05a9204c72 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__window__title.h
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_platform_platform__window__title.h
@@ -1,15 +1,15 @@
---- Telegram/SourceFiles/platform/platform_window_title.h.orig 2017-09-05 17:38:38 UTC
+--- Telegram/SourceFiles/platform/platform_window_title.h.orig 2018-02-06 05:56:19 UTC
+++ Telegram/SourceFiles/platform/platform_window_title.h
-@@ -38,7 +38,7 @@ void PreviewWindowFramePaint(QImage &pre
+@@ -25,7 +25,7 @@ void PreviewWindowFramePaint(QImage &pre
#include "platform/mac/window_title_mac.h"
#elif defined Q_OS_WIN // Q_OS_MAC
#include "platform/win/window_title_win.h"
-#elif defined Q_OS_WINRT || defined Q_OS_LINUX // Q_OS_MAC || Q_OS_WIN
-+#elif defined Q_OS_WINRT || defined Q_OS_LINUX || defined Q_OS_FREEBSD // Q_OS_MAC || Q_OS_WIN
++#elif defined Q_OS_WINRT || defined Q_OS_LINUX || defined Q_OS_FREEBSD // Q_OS_MAC || Q_OS_WIN
namespace Platform {
-@@ -56,4 +56,4 @@ inline void PreviewWindowFramePaint(QIma
+@@ -43,4 +43,4 @@ inline void PreviewWindowFramePaint(QIma
} // namespace Platform
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_qt__functions.cpp b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_qt__functions.cpp
index 8d76c04ea7ea..2d4268cd13f2 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_qt__functions.cpp
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_qt__functions.cpp
@@ -1,4 +1,4 @@
---- Telegram/SourceFiles/qt_functions.cpp.orig 2017-12-11 10:10:37 UTC
+--- Telegram/SourceFiles/qt_functions.cpp.orig 2018-02-06 05:16:48 UTC
+++ Telegram/SourceFiles/qt_functions.cpp
@@ -0,0 +1,94 @@
+/****************************************************************************
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_qt__static__plugins.cpp b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_qt__static__plugins.cpp
index 550a22dfa278..0078d3d6e606 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_qt__static__plugins.cpp
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_qt__static__plugins.cpp
@@ -1,6 +1,6 @@
---- Telegram/SourceFiles/qt_static_plugins.cpp.orig 2017-09-05 17:38:38 UTC
+--- Telegram/SourceFiles/qt_static_plugins.cpp.orig 2018-01-03 10:46:01 UTC
+++ Telegram/SourceFiles/qt_static_plugins.cpp
-@@ -27,14 +27,5 @@ Q_IMPORT_PLUGIN(QWindowsIntegrationPlugi
+@@ -14,14 +14,5 @@ Q_IMPORT_PLUGIN(QWindowsIntegrationPlugi
Q_IMPORT_PLUGIN(QWebpPlugin)
Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)
Q_IMPORT_PLUGIN(QGenericEnginePlugin)
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_settings.cpp b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_settings.cpp
new file mode 100644
index 000000000000..edda6d1a439f
--- /dev/null
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_settings.cpp
@@ -0,0 +1,11 @@
+--- Telegram/SourceFiles/settings.cpp.orig 2018-02-06 06:26:16 UTC
++++ Telegram/SourceFiles/settings.cpp
+@@ -83,6 +83,8 @@ DBIPlatform gPlatform = dbipMac;
+ DBIPlatform gPlatform = dbipLinux64;
+ #elif defined Q_OS_LINUX32
+ DBIPlatform gPlatform = dbipLinux32;
++#elif defined Q_OS_FREEBSD
++DBIPlatform gPlatform = dbipFreeBSD;
+ #else
+ #error Unknown platform
+ #endif
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_settings_settings__notifications__widget.cpp b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_settings_settings__notifications__widget.cpp
new file mode 100644
index 000000000000..e1d7229f3620
--- /dev/null
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_settings_settings__notifications__widget.cpp
@@ -0,0 +1,14 @@
+--- Telegram/SourceFiles/settings/settings_notifications_widget.cpp.orig 2018-02-06 06:27:16 UTC
++++ Telegram/SourceFiles/settings/settings_notifications_widget.cpp
+@@ -69,9 +69,9 @@ void NotificationsWidget::createNotifica
+ if (Platform::Notifications::Supported()) {
+ #ifdef Q_OS_WIN
+ nativeNotificationsLabel = lang(lng_settings_use_windows);
+-#elif defined Q_OS_LINUX64 || defined Q_OS_LINUX32 // Q_OS_WIN
++#elif defined Q_OS_LINUX64 || defined Q_OS_LINUX32 || defined Q_OS_FREEBSD // Q_OS_WIN
+ nativeNotificationsLabel = lang(lng_settings_use_native_notifications);
+-#endif // Q_OS_WIN || Q_OS_LINUX64 || Q_OS_LINUX32
++#endif // Q_OS_WIN || Q_OS_LINUX64 || Q_OS_LINUX32 || Q_OS_FREEBSD
+ }
+ if (!nativeNotificationsLabel.isEmpty()) {
+ createChildRow(_nativeNotifications, margin, nativeNotificationsLabel, [this](bool) { onNativeNotifications(); }, Global::NativeNotifications());
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_ui_text_text.cpp b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_ui_text_text.cpp
index 9fa8cbaf66c9..9d6df137c531 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_ui_text_text.cpp
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_ui_text_text.cpp
@@ -1,6 +1,6 @@
---- Telegram/SourceFiles/ui/text/text.cpp.orig 2017-09-05 17:38:38 UTC
+--- Telegram/SourceFiles/ui/text/text.cpp.orig 2018-04-08 17:34:33 UTC
+++ Telegram/SourceFiles/ui/text/text.cpp
-@@ -1689,11 +1689,11 @@ private:
+@@ -1748,11 +1748,11 @@ private:
if (item == -1)
return;
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_ui_text_text__block.cpp b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_ui_text_text__block.cpp
index 670103853f9f..e3f9d7940a6d 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_ui_text_text__block.cpp
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_ui_text_text__block.cpp
@@ -1,11 +1,12 @@
---- Telegram/SourceFiles/ui/text/text_block.cpp.orig 2017-09-05 17:38:38 UTC
+--- Telegram/SourceFiles/ui/text/text_block.cpp.orig 2018-04-08 17:34:33 UTC
+++ Telegram/SourceFiles/ui/text/text_block.cpp
-@@ -330,7 +330,7 @@ TextBlock::TextBlock(const style::font &
- SignalHandlers::setCrashAnnotationRef("CrashString", &part);
+@@ -332,6 +332,9 @@ TextBlock::TextBlock(const style::font &
QStackTextEngine engine(part, blockFont->f);
-- QTextLayout layout(&engine);
+ BlockParser parser(&engine, this, minResizeWidth, _from, part);
+ QTextLayout layout(part, blockFont->f);
- layout.beginLayout();
- layout.createLine();
++ layout.beginLayout();
++ layout.createLine();
+ CrashReports::ClearAnnotationRef("CrashString");
+ }
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_ui_twidget.cpp b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_ui_twidget.cpp
index 8b440118311e..ab0965f47a5b 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_ui_twidget.cpp
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_ui_twidget.cpp
@@ -1,6 +1,6 @@
---- Telegram/SourceFiles/ui/twidget.cpp.orig 2017-09-05 17:38:38 UTC
+--- Telegram/SourceFiles/ui/twidget.cpp.orig 2018-01-03 10:46:01 UTC
+++ Telegram/SourceFiles/ui/twidget.cpp
-@@ -191,9 +191,9 @@ void sendSynteticMouseEvent(QWidget *wid
+@@ -235,9 +235,9 @@ void sendSynteticMouseEvent(QWidget *wid
, button
, QGuiApplication::mouseButtons() | button
, QGuiApplication::keyboardModifiers()
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_ui_widgets_labels.cpp b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_ui_widgets_labels.cpp
new file mode 100644
index 000000000000..ec2eecd44ebc
--- /dev/null
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_ui_widgets_labels.cpp
@@ -0,0 +1,16 @@
+--- Telegram/SourceFiles/ui/widgets/labels.cpp.orig 2018-02-06 06:28:03 UTC
++++ Telegram/SourceFiles/ui/widgets/labels.cpp
+@@ -359,11 +359,11 @@ Text::StateResult FlatLabel::dragActionF
+ }
+ }
+
+-#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
++#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64 || defined Q_OS_FREEBSD
+ if (!_selection.empty()) {
+ QApplication::clipboard()->setText(_text.originalText(_selection, _contextExpandLinksMode), QClipboard::Selection);
+ }
+-#endif // Q_OS_LINUX32 || Q_OS_LINUX64
++#endif // Q_OS_LINUX32 || Q_OS_LINUX64 || Q_OS_FREEBSD
+
+ return state;
+ }
diff --git a/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_window_main__window.h b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_window_main__window.h
new file mode 100644
index 000000000000..b86a5f1ae1c9
--- /dev/null
+++ b/net-im/telegram-desktop/files/patch-Telegram_SourceFiles_window_main__window.h
@@ -0,0 +1,11 @@
+--- Telegram/SourceFiles/window/main_window.h.orig 2018-04-08 17:34:33 UTC
++++ Telegram/SourceFiles/window/main_window.h
+@@ -57,7 +57,7 @@ public:
+ }
+
+ void reActivateWindow() {
+-#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64
++#if defined Q_OS_LINUX32 || defined Q_OS_LINUX64 || defined Q_OS_FREEBSD
+ onReActivate();
+ QTimer::singleShot(200, this, SLOT(onReActivate()));
+ #endif // Q_OS_LINUX32 || Q_OS_LINUX64
diff --git a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_VoIPController.cpp b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_VoIPController.cpp
new file mode 100644
index 000000000000..8fa139136183
--- /dev/null
+++ b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_VoIPController.cpp
@@ -0,0 +1,11 @@
+--- Telegram/ThirdParty/libtgvoip/VoIPController.cpp.orig 2018-02-07 04:45:28 UTC
++++ Telegram/ThirdParty/libtgvoip/VoIPController.cpp
+@@ -1954,7 +1954,7 @@ static void initMachTimestart() {
+ #endif
+
+ double VoIPController::GetCurrentTime(){
+-#if defined(__linux__)
++#if defined(__linux__) || defined(__FreeBSD__)
+ struct timespec ts;
+ clock_gettime(CLOCK_MONOTONIC, &ts);
+ return ts.tv_sec+(double)ts.tv_nsec/1000000000.0;
diff --git a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_audio_AudioInput.cpp b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_audio_AudioInput.cpp
index 90ad3a66c0d5..e87740e5ab98 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_audio_AudioInput.cpp
+++ b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_audio_AudioInput.cpp
@@ -1,6 +1,6 @@
---- Telegram/ThirdParty/libtgvoip/audio/AudioInput.cpp.orig 2017-07-06 17:16:18 UTC
+--- Telegram/ThirdParty/libtgvoip/audio/AudioInput.cpp.orig 2017-12-27 18:47:58 UTC
+++ Telegram/ThirdParty/libtgvoip/audio/AudioInput.cpp
-@@ -20,7 +20,7 @@
+@@ -19,7 +19,7 @@
#include "../os/windows/AudioInputWave.h"
#endif
#include "../os/windows/AudioInputWASAPI.h"
@@ -9,3 +9,21 @@
#include "../os/linux/AudioInputALSA.h"
#include "../os/linux/AudioInputPulse.h"
#else
+@@ -54,7 +54,7 @@ AudioInput *AudioInput::Create(std::stri
+ return new AudioInputWave(deviceID);
+ #endif
+ return new AudioInputWASAPI(deviceID);
+-#elif defined(__linux__)
++#elif defined(__linux__) || defined(__FreeBSD__)
+ if(AudioInputPulse::IsAvailable()){
+ AudioInputPulse* aip=new AudioInputPulse(deviceID);
+ if(!aip->IsInitialized())
+@@ -87,7 +87,7 @@ void AudioInput::EnumerateDevices(std::v
+ }
+ #endif
+ AudioInputWASAPI::EnumerateDevices(devs);
+-#elif defined(__linux__) && !defined(__ANDROID__)
++#elif (defined(__linux__) || defined(__FreeBSD__)) && !defined(__ANDROID__)
+ if(!AudioInputPulse::IsAvailable() || !AudioInputPulse::EnumerateDevices(devs))
+ AudioInputALSA::EnumerateDevices(devs);
+ #endif
diff --git a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_audio_AudioOutput.cpp b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_audio_AudioOutput.cpp
index c2240c21deca..2cd3382b818f 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_audio_AudioOutput.cpp
+++ b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_audio_AudioOutput.cpp
@@ -1,6 +1,6 @@
---- Telegram/ThirdParty/libtgvoip/audio/AudioOutput.cpp.orig 2017-07-06 17:16:18 UTC
+--- Telegram/ThirdParty/libtgvoip/audio/AudioOutput.cpp.orig 2017-12-27 18:47:58 UTC
+++ Telegram/ThirdParty/libtgvoip/audio/AudioOutput.cpp
-@@ -21,7 +21,7 @@
+@@ -20,7 +20,7 @@
#include "../os/windows/AudioOutputWave.h"
#endif
#include "../os/windows/AudioOutputWASAPI.h"
@@ -9,3 +9,21 @@
#include "../os/linux/AudioOutputALSA.h"
#include "../os/linux/AudioOutputPulse.h"
#else
+@@ -52,7 +52,7 @@ AudioOutput *AudioOutput::Create(std::st
+ return new AudioOutputWave(deviceID);
+ #endif
+ return new AudioOutputWASAPI(deviceID);
+-#elif defined(__linux__)
++#elif defined(__linux__) || defined(__FreeBSD__)
+ if(AudioOutputPulse::IsAvailable()){
+ AudioOutputPulse* aop=new AudioOutputPulse(deviceID);
+ if(!aop->IsInitialized())
+@@ -101,7 +101,7 @@ void AudioOutput::EnumerateDevices(std::
+ }
+ #endif
+ AudioOutputWASAPI::EnumerateDevices(devs);
+-#elif defined(__linux__) && !defined(__ANDROID__)
++#elif (defined(__linux__) || defined(__FreeBSD__)) && !defined(__ANDROID__)
+ if(!AudioOutputPulse::IsAvailable() || !AudioOutputPulse::EnumerateDevices(devs))
+ AudioOutputALSA::EnumerateDevices(devs);
+ #endif
diff --git a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_logging.cpp b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_logging.cpp
new file mode 100644
index 000000000000..b3a030540688
--- /dev/null
+++ b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_logging.cpp
@@ -0,0 +1,20 @@
+--- Telegram/ThirdParty/libtgvoip/logging.cpp.orig 2018-02-07 04:44:58 UTC
++++ Telegram/ThirdParty/libtgvoip/logging.cpp
+@@ -13,7 +13,7 @@
+
+ #ifdef __ANDROID__
+ #include <sys/system_properties.h>
+-#elif defined(__linux__)
++#elif defined(__linux__) || defined(__FreeBSD__)
+ #include <sys/utsname.h>
+ #endif
+
+@@ -51,7 +51,7 @@ void tgvoip_log_file_write_header(){
+ #else
+ char* systemVersion="Windows RT";
+ #endif
+-#elif defined(__linux__)
++#elif defined(__linux__) || defined(__FreeBSD__)
+ #ifdef __ANDROID__
+ char systemVersion[128];
+ char sysRel[PROP_VALUE_MAX];
diff --git a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_linux_AudioInputALSA.cpp b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_linux_AudioInputALSA.cpp
new file mode 100644
index 000000000000..2d5dc520b666
--- /dev/null
+++ b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_linux_AudioInputALSA.cpp
@@ -0,0 +1,20 @@
+--- Telegram/ThirdParty/libtgvoip/os/linux/AudioInputALSA.cpp.orig 2018-02-07 04:47:15 UTC
++++ Telegram/ThirdParty/libtgvoip/os/linux/AudioInputALSA.cpp
+@@ -12,6 +12,10 @@
+ #include "../../logging.h"
+ #include "../../VoIPController.h"
+
++#ifndef typeof
++#define typeof __typeof__
++#endif
++
+ using namespace tgvoip::audio;
+
+ #define BUFFER_SIZE 960
+@@ -177,4 +181,4 @@ void AudioInputALSA::EnumerateDevices(st
+ }
+
+ dlclose(lib);
+-}
+\ No newline at end of file
++}
diff --git a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_linux_AudioInputPulse.cpp b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_linux_AudioInputPulse.cpp
new file mode 100644
index 000000000000..a33dc5cb023a
--- /dev/null
+++ b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_linux_AudioInputPulse.cpp
@@ -0,0 +1,10 @@
+--- Telegram/ThirdParty/libtgvoip/os/linux/AudioInputPulse.cpp.orig 2018-02-07 04:48:22 UTC
++++ Telegram/ThirdParty/libtgvoip/os/linux/AudioInputPulse.cpp
+@@ -8,6 +8,7 @@
+ #include <assert.h>
+ #include <dlfcn.h>
+ #include <unistd.h>
++#include <libgen.h>
+ #include "AudioInputPulse.h"
+ #include "../../logging.h"
+ #include "../../VoIPController.h"
diff --git a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_linux_AudioOutputALSA.cpp b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_linux_AudioOutputALSA.cpp
new file mode 100644
index 000000000000..8844950e63d6
--- /dev/null
+++ b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_linux_AudioOutputALSA.cpp
@@ -0,0 +1,20 @@
+--- Telegram/ThirdParty/libtgvoip/os/linux/AudioOutputALSA.cpp.orig 2018-02-07 04:46:53 UTC
++++ Telegram/ThirdParty/libtgvoip/os/linux/AudioOutputALSA.cpp
+@@ -11,6 +11,10 @@
+ #include "../../logging.h"
+ #include "../../VoIPController.h"
+
++#ifndef typeof
++#define typeof __typeof__
++#endif
++
+ #define BUFFER_SIZE 960
+ #define CHECK_ERROR(res, msg) if(res<0){LOGE(msg ": %s", _snd_strerror(res)); failed=true; return;}
+ #define CHECK_DL_ERROR(res, msg) if(!res){LOGE(msg ": %s", dlerror()); failed=true; return;}
+@@ -180,4 +184,4 @@ void AudioOutputALSA::EnumerateDevices(s
+ }
+
+ dlclose(lib);
+-}
+\ No newline at end of file
++}
diff --git a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_linux_AudioOutputPulse.cpp b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_linux_AudioOutputPulse.cpp
new file mode 100644
index 000000000000..9406c847bbbf
--- /dev/null
+++ b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_linux_AudioOutputPulse.cpp
@@ -0,0 +1,10 @@
+--- Telegram/ThirdParty/libtgvoip/os/linux/AudioOutputPulse.cpp.orig 2018-02-07 04:48:32 UTC
++++ Telegram/ThirdParty/libtgvoip/os/linux/AudioOutputPulse.cpp
+@@ -8,6 +8,7 @@
+ #include <assert.h>
+ #include <dlfcn.h>
+ #include <unistd.h>
++#include <libgen.h>
+ #include "AudioOutputPulse.h"
+ #include "../../logging.h"
+ #include "../../VoIPController.h"
diff --git a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_linux_PulseAudioLoader.h b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_linux_PulseAudioLoader.h
new file mode 100644
index 000000000000..58be8043dc96
--- /dev/null
+++ b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_linux_PulseAudioLoader.h
@@ -0,0 +1,20 @@
+--- Telegram/ThirdParty/libtgvoip/os/linux/PulseAudioLoader.h.orig 2018-02-07 04:46:43 UTC
++++ Telegram/ThirdParty/libtgvoip/os/linux/PulseAudioLoader.h
+@@ -9,6 +9,10 @@
+
+ #include <pulse/pulseaudio.h>
+
++#ifndef typeof
++#define typeof __typeof__
++#endif
++
+ #define DECLARE_DL_FUNCTION(name) static typeof(name)* _import_##name
+
+ namespace tgvoip{
+@@ -106,4 +110,4 @@ private:
+ #define pa_operation_get_state PulseAudioLoader::_import_pa_operation_get_state
+ #endif
+
+-#endif // LIBTGVOIP_PULSEAUDIOLOADER_H
+\ No newline at end of file
++#endif // LIBTGVOIP_PULSEAUDIOLOADER_H
diff --git a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_posix_NetworkSocketPosix.cpp b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_posix_NetworkSocketPosix.cpp
index 4fb1713ccabb..5b6082b601c7 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_posix_NetworkSocketPosix.cpp
+++ b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_os_posix_NetworkSocketPosix.cpp
@@ -1,6 +1,6 @@
---- Telegram/ThirdParty/libtgvoip/os/posix/NetworkSocketPosix.cpp.orig 2017-07-06 17:16:18 UTC
+--- Telegram/ThirdParty/libtgvoip/os/posix/NetworkSocketPosix.cpp.orig 2017-12-27 18:47:58 UTC
+++ Telegram/ThirdParty/libtgvoip/os/posix/NetworkSocketPosix.cpp
-@@ -45,6 +45,7 @@ void NetworkSocketPosix::SetMaxPriority(
+@@ -46,6 +46,7 @@ void NetworkSocketPosix::SetMaxPriority(
if(res<0){
LOGE("error setting darwin-specific net priority: %d / %s", errno, strerror(errno));
}
diff --git a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_threading.h b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_threading.h
index 3be3f1b7461f..c37d231be239 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_threading.h
+++ b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_threading.h
@@ -1,4 +1,4 @@
---- Telegram/ThirdParty/libtgvoip/threading.h.orig 2017-07-06 17:16:18 UTC
+--- Telegram/ThirdParty/libtgvoip/threading.h.orig 2017-12-27 18:47:58 UTC
+++ Telegram/ThirdParty/libtgvoip/threading.h
@@ -20,7 +20,7 @@ typedef pthread_cond_t tgvoip_lock_t;
#define start_thread(ref, entry, arg) pthread_create(&ref, NULL, entry, arg)
diff --git a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_webrtc__dsp_webrtc_base_stringutils.h b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_webrtc__dsp_webrtc_base_stringutils.h
index a04402d23a5b..307edd6e5a19 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_webrtc__dsp_webrtc_base_stringutils.h
+++ b/net-im/telegram-desktop/files/patch-Telegram_ThirdParty_libtgvoip_webrtc__dsp_webrtc_base_stringutils.h
@@ -1,4 +1,4 @@
---- Telegram/ThirdParty/libtgvoip/webrtc_dsp/webrtc/base/stringutils.h.orig 2017-07-06 17:16:18 UTC
+--- Telegram/ThirdParty/libtgvoip/webrtc_dsp/webrtc/base/stringutils.h.orig 2017-12-27 18:47:58 UTC
+++ Telegram/ThirdParty/libtgvoip/webrtc_dsp/webrtc/base/stringutils.h
@@ -23,7 +23,7 @@
#endif // WEBRTC_WIN
diff --git a/net-im/telegram-desktop/files/patch-Telegram_gyp_PrecompiledHeader.cmake b/net-im/telegram-desktop/files/patch-Telegram_gyp_PrecompiledHeader.cmake
index 7d458e9b6846..d211c25869b2 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_gyp_PrecompiledHeader.cmake
+++ b/net-im/telegram-desktop/files/patch-Telegram_gyp_PrecompiledHeader.cmake
@@ -1,4 +1,4 @@
---- Telegram/gyp/PrecompiledHeader.cmake.orig 2017-09-05 17:38:38 UTC
+--- Telegram/gyp/PrecompiledHeader.cmake.orig 2018-01-03 10:46:01 UTC
+++ Telegram/gyp/PrecompiledHeader.cmake
@@ -79,7 +79,7 @@ function(export_all_flags _filename _sou
endfunction()
diff --git a/net-im/telegram-desktop/files/patch-Telegram_gyp_common.gypi b/net-im/telegram-desktop/files/patch-Telegram_gyp_common.gypi
index 76bf82b970e7..a7a6d0d96da5 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_gyp_common.gypi
+++ b/net-im/telegram-desktop/files/patch-Telegram_gyp_common.gypi
@@ -1,6 +1,6 @@
---- Telegram/gyp/common.gypi.orig 2017-09-05 17:38:38 UTC
+--- Telegram/gyp/common.gypi.orig 2018-02-06 06:29:27 UTC
+++ Telegram/gyp/common.gypi
-@@ -42,7 +42,7 @@
+@@ -29,7 +29,7 @@
}, {
'build_mac': 0,
}],
diff --git a/net-im/telegram-desktop/files/patch-Telegram_gyp_settings__linux.gypi b/net-im/telegram-desktop/files/patch-Telegram_gyp_settings__linux.gypi
index a42d3b652c75..c129832a49b1 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_gyp_settings__linux.gypi
+++ b/net-im/telegram-desktop/files/patch-Telegram_gyp_settings__linux.gypi
@@ -1,14 +1,23 @@
---- Telegram/gyp/settings_linux.gypi.orig 2017-09-05 17:38:38 UTC
+--- Telegram/gyp/settings_linux.gypi.orig 2018-01-03 10:46:01 UTC
+++ Telegram/gyp/settings_linux.gypi
-@@ -25,7 +25,6 @@
+@@ -11,7 +11,6 @@
+ 'linux_common_flags': [
'-pipe',
- '-g',
'-Wall',
- '-Werror',
'-W',
'-fPIC',
'-Wno-unused-variable',
-@@ -61,7 +60,6 @@
+@@ -25,7 +24,7 @@
+ ],
+ },
+ 'conditions': [
+- [ '"<!(uname -m)" == "x86_64" or "<!(uname -m)" == "aarch64"', {
++ [ '"<!(uname -m)" == "amd64" or "<!(uname -m)" == "arm64"', {
+ 'defines': [
+ 'Q_OS_LINUX64',
+ ],
+@@ -47,7 +46,6 @@
],
'defines': [
'_REENTRANT',
diff --git a/net-im/telegram-desktop/files/patch-Telegram_gyp_telegram__sources.txt b/net-im/telegram-desktop/files/patch-Telegram_gyp_telegram__sources.txt
index bfaf5a316c99..c8207d48c0fb 100644
--- a/net-im/telegram-desktop/files/patch-Telegram_gyp_telegram__sources.txt
+++ b/net-im/telegram-desktop/files/patch-Telegram_gyp_telegram__sources.txt
@@ -1,6 +1,6 @@
---- Telegram/gyp/telegram_sources.txt.orig 2017-09-05 17:38:38 UTC
+--- Telegram/gyp/telegram_sources.txt.orig 2018-04-08 17:34:33 UTC
+++ Telegram/gyp/telegram_sources.txt
-@@ -598,14 +598,7 @@
+@@ -760,14 +760,7 @@
<(emoji_suggestions_loc)/emoji_suggestions.cpp
<(emoji_suggestions_loc)/emoji_suggestions.h
diff --git a/net-im/telegram-desktop/files/patch-lib_xdg_tg.protocol b/net-im/telegram-desktop/files/patch-lib_xdg_tg.protocol
index f2eff6d5b318..3507d46554cc 100644
--- a/net-im/telegram-desktop/files/patch-lib_xdg_tg.protocol
+++ b/net-im/telegram-desktop/files/patch-lib_xdg_tg.protocol
@@ -1,4 +1,4 @@
---- lib/xdg/tg.protocol.orig 2017-09-05 17:38:38 UTC
+--- lib/xdg/tg.protocol.orig 2018-02-06 05:50:37 UTC
+++ lib/xdg/tg.protocol
@@ -1,5 +1,5 @@
[Protocol]