1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-02 01:20:54 +00:00

net-im/telegram-desktop: update to 1.9.14

PR:		244651
Submitted by:	Henry Hu <henry.hu.sh@gmail.com> (maintainer)
This commit is contained in:
Tobias C. Berner 2020-03-15 08:12:54 +00:00
parent 3ae0b35129
commit 45ce89a38b
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=528475
44 changed files with 181 additions and 1308 deletions

View File

@ -1,8 +1,7 @@
# $FreeBSD$
PORTNAME= telegram-desktop
DISTVERSIONPREFIX= v
DISTVERSION= 1.8.15
DISTVERSION= 1.9.14
CATEGORIES= net-im
MAINTAINER= henry.hu.sh@gmail.com
@ -19,42 +18,44 @@ NOT_FOR_ARCHS_REASON= Only little endian is supported
BUILD_DEPENDS= alsa-lib>0:audio/alsa-lib \
dee>0:devel/dee \
gyp:devel/py-gyp@${PY_FLAVOR} \
pulseaudio>0:audio/pulseaudio \
range-v3>0:devel/range-v3
range-v3>0:devel/range-v3 \
microsoft-gsl>0:devel/microsoft-gsl \
tl-expected>0:devel/tl-expected
LIB_DEPENDS= libavformat.so:multimedia/ffmpeg \
libdbus-1.so:devel/dbus \
libminizip.so:archivers/minizip \
libopenal.so:audio/openal-soft \
libopus.so:audio/opus
libopus.so:audio/opus \
libdbusmenu-qt5.so:devel/libdbusmenu-qt \
libhunspell-1.7.so:textproc/hunspell \
libxxhash.so:devel/xxhash \
libenchant-2.so:textproc/enchant2
USES= cmake:noninja compiler:c++17-lang desktop-file-utils gmake \
gnome pkgconfig python:2.7,build qt:5 ssl xorg
USES= cmake compiler:c++17-lang desktop-file-utils \
gnome pkgconfig python:3.7,build qt:5 ssl xorg
MASTER_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/releases/download/v${DISTVERSION}/
DISTNAME= tdesktop-${DISTVERSION}-full
USE_GITHUB= yes
GH_ACCOUNT= telegramdesktop
GH_PROJECT= tdesktop
GH_TUPLE= catchorg:Catch2:5ca44b68:catch/Telegram/ThirdParty/Catch \
mapbox:variant:550ac2f:variant/Telegram/ThirdParty/variant \
Microsoft:GSL:d846fe5:gsl/Telegram/ThirdParty/GSL \
telegramdesktop:libtgvoip:d4a0f71:libtgvoip/Telegram/ThirdParty/libtgvoip \
telegramdesktop:crl:52baf11:crl/Telegram/ThirdParty/crl \
Cyan4973:xxHash:7cc9639:xxhash/Telegram/ThirdParty/xxHash \
john-preston:rlottie:589db02:rlottie/Telegram/ThirdParty/rlottie \
lz4:lz4:9a2a9f2:lz4/Telegram/ThirdParty/lz4
USE_GNOME= glib20
USE_QT= core dbus gui imageformats network widgets buildtools_build \
qmake_build
USE_XORG= x11 xcb
CMAKE_SOURCE_PATH= ${WRKSRC}/out/Release
CMAKE_ON= DESKTOP_APP_USE_PACKAGED DESKTOP_APP_DISABLE_CRASH_REPORTS \
TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION
CMAKE_OFF= DESKTOP_APP_USE_PACKAGED_RLOTTIE DESKTOP_APP_USE_PACKAGED_VARIANT \
DESKTOP_APP_USE_GLIBC_WRAPS TDESKTOP_USE_PACKAGED_TGVOIP
CMAKE_ARGS= -DDESKTOP_APP_SPECIAL_TARGET="" -DTDESKTOP_LAUNCHER_BASENAME="telegramdesktop" \
-DTDESKTOP_API_ID=${TELEGRAM_API_ID} -DTDESKTOP_API_HASH=${TELEGRAM_API_HASH} \
-Ddisable_autoupdate=1
# Telegram asks each custom build to have its own API ID and hash.
# Use the default ones for now. We may need to switch to the official ones,
# or create our own.
TELEGRAM_API_ID= 17349
TELEGRAM_API_HASH= 344583e45741c457fe1862106095a5eb
GYP_DEFINES= TDESKTOP_DISABLE_CRASH_REPORTS,TDESKTOP_DISABLE_AUTOUPDATE,TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME
TELEGRAM_API_ID= 601761
TELEGRAM_API_HASH= 20a3432aab43f24bb4460fceac5ba38d
# 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.
@ -70,56 +71,12 @@ GTK_DESC= Gtk integration (Use Gtk dialogs, etc.)
ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib
PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio
GTK_CMAKE_BOOL_OFF= TDESKTOP_DISABLE_GTK_INTEGRATION
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MGTK}
USE_GNOME+= gtk30
.else
GYP_DEFINES:= ${GYP_DEFINES},TDESKTOP_DISABLE_GTK_INTEGRATION
.endif
.include <bsd.port.pre.mk>
post-patch:
@cd ${WRKSRC} && \
(${SED} -e " \
s|%%QT_VERSION%%|${QT5_VERSION}| ; \
s|%%LOCALBASE%%|${LOCALBASE}| ; \
s|%%CFLAGS%%|${CFLAGS:C/(.*)/'\1',/}| ; \
s|%%CXXFLAGS%%|${CXXFLAGS:C/(.*)/'\1',/}| ; \
s|%%LDFLAGS%%|${LDFLAGS:C/(.*)/'\1',/}| ; \
s|%%QT_BINDIR%%|${QT_BINDIR}| ; \
s|%%QT_INCDIR%%|${QT_INCDIR}| ; \
s|%%QT_LIBDIR%%|${QT_LIBDIR}| ; \
s|%%QMAKESPEC%%|${QMAKESPEC}| ; \
s|%%PYTHON_CMD%%|${PYTHON_CMD}|" \
${FILESDIR}/gyp-patches | \
${PATCH} -z .bak -s)
@${ECHO} "#define FREEBSD_QT_PLUGINDIR \"${QT_PLUGINDIR}\"" > ${WRKSRC}/Telegram/SourceFiles/FREEBSD_QT_PLUGINDIR.h
@${REINPLACE_CMD} "/Icon=/s|telegram|${PORTNAME}|" ${WRKSRC}/lib/xdg/telegramdesktop.desktop
pre-configure:
@cd ${WRKSRC} && gyp \
-Dapi_id=${TELEGRAM_API_ID} \
-Dapi_hash=${TELEGRAM_API_HASH} \
-Dbuild_defines=${GYP_DEFINES} \
-Gconfig=Release \
--depth=Telegram/gyp --generator-output=../.. -Goutput_dir=out Telegram/gyp/Telegram.gyp --format=cmake
@TOT=`wc -l < ${WRKSRC}/out/Release/CMakeLists.txt` && NUM=`expr $$TOT - 2` && \
${REINPLACE_CMD} "$$NUM r ${FILESDIR}/CMakeLists.inj" ${WRKSRC}/out/Release/CMakeLists.txt
do-install:
${INSTALL_PROGRAM} ${BUILD_WRKSRC}/Telegram ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
${INSTALL_DATA} ${WRKSRC}/lib/xdg/telegramdesktop.desktop ${STAGEDIR}${PREFIX}/share/applications/${PORTNAME}.desktop
@${MKDIR} ${STAGEDIR}${PREFIX}/share/kservices5
${INSTALL_DATA} ${WRKSRC}/lib/xdg/tg.protocol ${STAGEDIR}${PREFIX}/share/kservices5
@${MKDIR} ${STAGEDIR}${PREFIX}/share/appdata
${INSTALL_DATA} ${WRKSRC}/lib/xdg/telegramdesktop.appdata.xml ${STAGEDIR}${PREFIX}/share/appdata/${PORTNAME}.appdata.xml
.for icon_size in 16 32 48 64 128 256 512
@${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/${icon_size}x${icon_size}/apps
${INSTALL_DATA} \
${WRKSRC}/Telegram/Resources/art/icon${icon_size}.png \
${STAGEDIR}${PREFIX}/share/icons/hicolor/${icon_size}x${icon_size}/apps/${PORTNAME}.png
.endfor
.include <bsd.port.post.mk>
.include <bsd.port.mk>

View File

@ -1,19 +1,3 @@
TIMESTAMP = 1571274501
SHA256 (telegramdesktop-tdesktop-v1.8.15_GH0.tar.gz) = 68bb6c3d007fe21847286815f22c2532a7cf9c247dc2781d749ebeb40f02ed99
SIZE (telegramdesktop-tdesktop-v1.8.15_GH0.tar.gz) = 14416530
SHA256 (catchorg-Catch2-5ca44b68_GH0.tar.gz) = 8cdf2a345897bda1aaabffd4496dffe263768cef3e4254e74ae63545c8e12cc2
SIZE (catchorg-Catch2-5ca44b68_GH0.tar.gz) = 375264
SHA256 (mapbox-variant-550ac2f_GH0.tar.gz) = 7ab3aa7c9fa672027f13721584df5f7ec09c0ecca499d374c6ac76e147ef7354
SIZE (mapbox-variant-550ac2f_GH0.tar.gz) = 108686
SHA256 (Microsoft-GSL-d846fe5_GH0.tar.gz) = 4c463f93ca3b1dcb0b8d73b54309c1d31145761c457f1a6fd53554a6d469b468
SIZE (Microsoft-GSL-d846fe5_GH0.tar.gz) = 58930
SHA256 (telegramdesktop-libtgvoip-d4a0f71_GH0.tar.gz) = bff049b414bdaafe488f3d46d894e910c06ff5233bf33001d59fe50b7de3702a
SIZE (telegramdesktop-libtgvoip-d4a0f71_GH0.tar.gz) = 1484804
SHA256 (telegramdesktop-crl-52baf11_GH0.tar.gz) = 04effcfcbcd1486619d93dba0a30ca16579bca5cc37273ed1908dd8b375e3e3b
SIZE (telegramdesktop-crl-52baf11_GH0.tar.gz) = 21842
SHA256 (Cyan4973-xxHash-7cc9639_GH0.tar.gz) = f40801820e885f92bbe3d2434efeb39aa18eeaf878341982e8525b538468e3ed
SIZE (Cyan4973-xxHash-7cc9639_GH0.tar.gz) = 37534
SHA256 (john-preston-rlottie-589db02_GH0.tar.gz) = 415a78d04836f5bf4e535b034a7d5cf540d55cce98b9be869c3178e1c251f361
SIZE (john-preston-rlottie-589db02_GH0.tar.gz) = 7887733
SHA256 (lz4-lz4-9a2a9f2_GH0.tar.gz) = 437827e1a1a0eec752777d29ef7ac78b195c805438448fe08154d9b5b181b8ea
SIZE (lz4-lz4-9a2a9f2_GH0.tar.gz) = 293999
TIMESTAMP = 1583109660
SHA256 (tdesktop-1.9.14-full.tar.gz) = 864d1d5e810e30368e60d4ea389c644387abbc803b3b5426268efa5016d15a4b
SIZE (tdesktop-1.9.14-full.tar.gz) = 25324084

View File

@ -1,19 +0,0 @@
# ------------- debian/CMakeLists.inj begin -------------
# The text will be putted into the appropriate CMakeLists by debian/rules script
# Avoid rpath compiler parameter
set_target_properties(Telegram PROPERTIES SKIP_BUILD_RPATH TRUE)
# This makes up for patch of gyp utility, supporting precompiled headers. If
# Telegram/Patches/gyp.diff file will be changed in future, please check these
# lines.
include(../../Telegram/gyp/PrecompiledHeader.cmake)
add_precompiled_header(Telegram ../../Telegram/SourceFiles/stdafx.h)
add_precompiled_header(lib_base ../../Telegram/SourceFiles/base/base_pch.h)
add_precompiled_header(lib_export ../../Telegram/SourceFiles/export/export_pch.h)
add_precompiled_header(lib_storage ../../Telegram/SourceFiles/storage/storage_pch.h)
add_precompiled_header(lib_mtproto ../../Telegram/SourceFiles/mtproto/mtp_pch.h)
add_precompiled_header(lib_ui ../../Telegram/SourceFiles/ui/ui_pch.h)
# vim: ft=cmake
# -------------- debian/CMakeLists.inj end --------------

View File

@ -1,558 +0,0 @@
--- Telegram/gyp/codegen/rules.gypi.orig 2019-10-07 15:58:21 UTC
+++ Telegram/gyp/codegen/rules.gypi
@@ -10,13 +10,13 @@
'inputs': [
'<(DEPTH)/update_dependent.py',
'<@(qrc_files)',
- '<!@(python <(DEPTH)/update_dependent.py --qrc_list <@(qrc_files))',
+ '<!@(%%PYTHON_CMD%% <(DEPTH)/update_dependent.py --qrc_list <@(qrc_files))',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/update_dependent_qrc.timestamp',
],
'action': [
- 'python', '<(DEPTH)/update_dependent.py', '--qrc',
+ '%%PYTHON_CMD%%', '<(DEPTH)/update_dependent.py', '--qrc',
'-o', '<(SHARED_INTERMEDIATE_DIR)/update_dependent_qrc.timestamp',
'<@(qrc_files)',
],
--- Telegram/gyp/codegen/styles_rule.gypi.orig 2019-10-07 15:58:21 UTC
+++ Telegram/gyp/codegen/styles_rule.gypi
@@ -16,7 +16,7 @@
'<(style_timestamp)',
],
'action': [
- 'python', '<(DEPTH)/update_dependent.py', '--styles',
+ '%%PYTHON_CMD%%', '<(DEPTH)/update_dependent.py', '--styles',
'-I', '<(res_loc)', '-I', '<(src_loc)',
'-o', '<(style_timestamp)',
'<@(style_files)',
--- Telegram/gyp/common/linux.gypi.orig 2019-10-07 15:58:21 UTC
+++ Telegram/gyp/common/linux.gypi
@@ -11,7 +11,6 @@
'linux_common_flags': [
'-pipe',
'-Wall',
- '-Werror',
'-W',
'-fPIC',
'-Wno-unused-variable',
@@ -26,16 +25,17 @@
'-Wno-error=class-memaccess',
'-Wno-error=parentheses',
],
- 'linux_path_ffmpeg%': '/usr/local',
- 'linux_path_openal%': '/usr/local',
- 'linux_path_va%': '/usr/local',
- 'linux_path_vdpau%': '/usr/local',
- 'linux_path_breakpad%': '/usr/local',
- 'linux_path_opus_include%': '<(libs_loc)/opus/include',
- 'linux_path_range%': '/usr/local',
+ 'linux_path_ffmpeg%': '%%LOCALBASE%%',
+ 'linux_path_openal%': '%%LOCALBASE%%',
+ 'linux_path_va%': '%%LOCALBASE%%',
+ 'linux_path_vdpau%': '%%LOCALBASE%%',
+ 'linux_path_breakpad%': '%%LOCALBASE%%',
+ 'linux_path_opus_include%': '%%LOCALBASE%%/opus/include',
+ 'linux_path_range%': '%%LOCALBASE%%',
},
'include_dirs': [
- '/usr/local/include',
+ '/usr/include/openssl-1.0',
+ '%%LOCALBASE%%/include',
'<(linux_path_ffmpeg)/include',
'<(linux_path_openal)/include',
'<(linux_path_breakpad)/include/breakpad',
@@ -43,7 +43,8 @@
'<(linux_path_range)/include',
],
'library_dirs': [
- '/usr/local/lib',
+ '/usr/lib/openssl-1.0',
+ '%%LOCALBASE%%/lib',
'<(linux_path_ffmpeg)/lib',
'<(linux_path_openal)/lib',
'<(linux_path_va)/lib',
@@ -51,7 +52,7 @@
'<(linux_path_breakpad)/lib',
],
'conditions': [
- [ '"<!(uname -m)" == "x86_64" or "<!(uname -m)" == "aarch64"', {
+ [ '"<!(uname -m)" == "amd64" or "<!(uname -m)" == "arm64"', {
'defines': [
'Q_OS_LINUX64',
],
@@ -86,7 +87,6 @@
],
'defines': [
'_REENTRANT',
- 'QT_STATICPLUGIN',
'QT_PLUGIN',
],
'cflags_c': [
@@ -99,9 +99,6 @@
'-Wno-register',
],
'make_global_settings': [
- ['AR', '/usr/bin/gcc-ar'],
- ['RANLIB', '/usr/bin/gcc-ranlib'],
- ['NM', '/usr/bin/gcc-nm'],
],
'configurations': {
'Debug': {
--- Telegram/gyp/lib_export.gyp.orig 2019-10-07 15:58:21 UTC
+++ Telegram/gyp/lib_export.gyp
@@ -44,7 +44,7 @@
'include_dirs': [
'<(src_loc)',
'<(SHARED_INTERMEDIATE_DIR)',
- '<(libs_loc)/range-v3/include',
+ '%%LOCALBASE%%',
'<(submodules_loc)/GSL/include',
'<(submodules_loc)/variant/include',
'<(submodules_loc)/crl/src',
--- Telegram/gyp/lib_scheme.gyp.orig 2019-10-07 15:58:21 UTC
+++ Telegram/gyp/lib_scheme.gyp
@@ -48,7 +48,7 @@
'<(SHARED_INTERMEDIATE_DIR)/scheme.h',
],
'action': [
- 'python', '<(src_loc)/codegen/scheme/codegen_scheme.py',
+ '%%PYTHON_CMD%%', '<(src_loc)/codegen/scheme/codegen_scheme.py',
'-o', '<(SHARED_INTERMEDIATE_DIR)',
'<(res_loc)/tl/mtproto.tl',
'<(res_loc)/tl/api.tl',
--- Telegram/gyp/lib_ui.gyp.orig 2019-10-07 15:58:21 UTC
+++ Telegram/gyp/lib_ui.gyp
@@ -39,7 +39,7 @@
'dependent_style_files': [
],
'style_timestamp': '<(SHARED_INTERMEDIATE_DIR)/update_dependent_styles_ui.timestamp',
- 'list_sources_command': 'python <(DEPTH)/list_sources.py --input <(DEPTH)/lib_ui/sources.txt --replace src_loc=<(src_loc)',
+ 'list_sources_command': '%%PYTHON_CMD%% <(DEPTH)/list_sources.py --input <(DEPTH)/lib_ui/sources.txt --replace src_loc=<(src_loc)',
'pch_source': '<(src_loc)/ui/ui_pch.cpp',
'pch_header': '<(src_loc)/ui/ui_pch.h',
},
@@ -56,7 +56,7 @@
'include_dirs': [
'<(src_loc)',
'<(SHARED_INTERMEDIATE_DIR)',
- '<(libs_loc)/range-v3/include',
+ '%%LOCALBASE%%/include',
'<(submodules_loc)/GSL/include',
'<(submodules_loc)/variant/include',
'<(submodules_loc)/crl/src',
@@ -68,7 +68,7 @@
'<(DEPTH)/lib_ui/sources.txt',
],
'sources!': [
- '<!@(<(list_sources_command) <(qt_moc_list_sources_arg) --exclude_for <(build_os))',
+ '<!@(<(list_sources_command) <(qt_moc_list_sources_arg) --exclude_for linux)',
],
}],
}
--- Telegram/gyp/modules/qt_moc.gypi.orig 2019-10-07 15:58:21 UTC
+++ Telegram/gyp/modules/qt_moc.gypi
@@ -15,12 +15,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/modules/qt_rcc.gypi.orig 2019-10-07 15:58:21 UTC
+++ Telegram/gyp/modules/qt_rcc.gypi
@@ -15,7 +15,7 @@
'<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/qrc/qrc_<(RULE_INPUT_ROOT).cpp',
],
'action': [
- '<(qt_loc)/bin/rcc<(exe_ext)',
+ '%%QT_BINDIR%%/rcc',
'-name', '<(RULE_INPUT_ROOT)',
'-no-compress',
'<(RULE_INPUT_PATH)',
--- Telegram/gyp/modules/qt.gypi.orig 2019-10-07 15:58:21 UTC
+++ Telegram/gyp/modules/qt.gypi
@@ -14,25 +14,21 @@
[ 'build_macold', {
'qt_version%': '5.3.2',
}, {
- 'qt_version%': '5.6.2',
+ 'qt_version%': '%%QT_VERSION%%',
}]
],
},
'qt_libs': [
- 'qwebp',
- 'Qt5PrintSupport',
- 'Qt5PlatformSupport',
'Qt5Network',
'Qt5Widgets',
'Qt5Gui',
- 'qtharfbuzzng',
],
'qt_version%': '<(qt_version)',
'conditions': [
[ 'build_macold', {
'linux_path_qt%': '/usr/local/macold/Qt-<(qt_version)',
}, {
- 'linux_path_qt%': '/usr/local/tdesktop/Qt-<(qt_version)',
+ 'linux_path_qt%': '%%LOCALBASE%%/lib/qt',
}]
]
},
@@ -72,44 +68,25 @@
],
}],
[ 'build_linux', {
- 'qt_lib_prefix': 'lib',
- 'qt_lib_debug_postfix': '.a',
- 'qt_lib_release_postfix': '.a',
+ 'qt_lib_prefix': '',
+ 'qt_lib_debug_postfix': '',
+ 'qt_lib_release_postfix': '',
'qt_libs': [
- 'qxcb',
- 'Qt5XcbQpa',
- 'qconnmanbearer',
- 'qgenericbearer',
- 'qnmbearer',
'<@(qt_libs)',
'Qt5DBus',
'Qt5Core',
- 'qtpcre',
- 'Xi',
- 'Xext',
- 'Xfixes',
- 'SM',
- 'ICE',
- 'fontconfig',
- 'expat',
- 'freetype',
- 'z',
- 'xcb-shm',
- 'xcb-xfixes',
- 'xcb-render',
- 'xcb-static',
],
}],
],
},
'qt_version%': '<(qt_version)',
'qt_loc_unix': '<(qt_loc_unix)',
- 'qt_version_loc': '<!(python -c "print(\'<(qt_version)\'.replace(\'.\', \'_\'))")',
+ 'qt_version_loc': '<!(%%PYTHON_CMD%% -c "print(\'<(qt_version)\'.replace(\'.\', \'_\'))")',
'qt_libs_debug': [
- '<!@(python -c "for s in \'<@(qt_libs)\'.split(\' \'): print(\'<(qt_lib_prefix)\' + s + \'<(qt_lib_debug_postfix)\')")',
+ '<!@(%%PYTHON_CMD%% -c "for s in \'<@(qt_libs)\'.split(\' \'): print(\'<(qt_lib_prefix)\' + s + \'<(qt_lib_debug_postfix)\')")',
],
'qt_libs_release': [
- '<!@(python -c "for s in \'<@(qt_libs)\'.split(\' \'): print(\'<(qt_lib_prefix)\' + s + \'<(qt_lib_release_postfix)\')")',
+ '<!@(%%PYTHON_CMD%% -c "for s in \'<@(qt_libs)\'.split(\' \'): print(\'<(qt_lib_prefix)\' + s + \'<(qt_lib_release_postfix)\')")',
],
},
'qt_libs_debug': [ '<@(qt_libs_debug)' ],
@@ -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_',
-
- '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%': 'libicutu.a libicui18n.a libicuuc.a libicudata.a',
},
'configurations': {
@@ -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',
- '<(qt_loc)/include/QtGui/<(qt_version)/QtGui',
+ '%%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)/plugins/bearer',
'<(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',
'-lX11',
- '-lX11-xcb',
- '-ldbus-1',
- '-ldl',
- '-lgthread-2.0',
'-lglib-2.0',
'-lpthread',
],
'include_dirs': [
- '<(qt_loc)/mkspecs/linux-g++',
+ '%%QMAKESPEC%%',
],
'ldflags': [
- '-static-libstdc++',
'-pthread',
'-rdynamic',
],
--- Telegram/gyp/telegram/linux.gypi.orig 2019-10-07 15:58:21 UTC
+++ Telegram/gyp/telegram/linux.gypi
@@ -10,7 +10,7 @@
'variables': {
'build_defines%': '',
},
- '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,12 +20,6 @@
],
},
'libraries': [
- '-lbreakpad_client',
- '-lcomposeplatforminputcontextplugin',
- '-libusplatforminputcontextplugin',
- '-lfcitxplatforminputcontextplugin',
- '-lhimeplatforminputcontextplugin',
- '-lnimfplatforminputcontextplugin',
'-llzma',
'-lopenal',
'-lavformat',
@@ -34,12 +28,8 @@
'-lswscale',
'-lavutil',
'-lopus',
- '-lva-x11',
- '-lva-drm',
- '-lva',
- '-lvdpau',
- '-ldrm',
'-lz',
+ '-lminizip',
# '<!(pkg-config 2> /dev/null --libs <@(pkgconfig_libs))',
],
'cflags_cc': [
@@ -49,22 +39,23 @@
'ldflags': [
'-Wl,-wrap,aligned_alloc',
'-Wl,-wrap,secure_getenv',
- '-Wl,-wrap,clock_gettime',
'-Wl,--no-as-needed,-lrt',
- '-Wl,-Bstatic',
],
'configurations': {
'Release': {
'cflags_c': [
'-Ofast',
'-fno-strict-aliasing',
+ %%CFLAGS%%
],
'cflags_cc': [
'-Ofast',
'-fno-strict-aliasing',
+ %%CXXFLAGS%%
],
'ldflags': [
'-Ofast',
+ %%LDFLAGS%%
],
},
},
@@ -75,9 +66,7 @@
],
}], ['not_need_gtk!="True"', {
'cflags_cc': [
- '<!(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)',
],
}], ['<!(pkg-config ayatana-appindicator3-0.1; echo $?) == 0', {
'cflags_cc': [ '<!(pkg-config --cflags ayatana-appindicator3-0.1)' ],
--- Telegram/gyp/telegram/telegram.gypi.orig 2019-10-07 15:58:21 UTC
+++ Telegram/gyp/telegram/telegram.gypi
@@ -11,7 +11,7 @@
'src_loc': '../SourceFiles',
'res_loc': '../Resources',
'submodules_loc': '../ThirdParty',
- 'minizip_loc': '<(submodules_loc)/minizip',
+ 'minizip_loc': '%%LOCALBASE%%/include/minizip',
'sp_media_key_tap_loc': '<(submodules_loc)/SPMediaKeyTap',
'emoji_suggestions_loc': '<(submodules_loc)/emoji_suggestions',
'style_files': [
@@ -47,7 +47,7 @@
'pt-BR',
],
'build_defines%': '',
- 'list_sources_command': 'python <(DEPTH)/list_sources.py --input <(DEPTH)/telegram/sources.txt --replace src_loc=<(src_loc)',
+ 'list_sources_command': '%%PYTHON_CMD%% <(DEPTH)/list_sources.py --input <(DEPTH)/telegram/sources.txt --replace src_loc=<(src_loc)',
'pch_source': '<(src_loc)/stdafx.cpp',
'pch_header': '<(src_loc)/stdafx.h',
},
@@ -91,19 +91,12 @@
'XXH_INLINE_ALL',
'TDESKTOP_API_ID=<(api_id)',
'TDESKTOP_API_HASH=<(api_hash)',
- '<!@(python -c "for s in \'<(build_defines)\'.split(\',\'): print(s)")',
+ '<!@(%%PYTHON_CMD%% -c "for s in \'<(build_defines)\'.split(\',\'): print(s)")',
],
'include_dirs': [
'<(src_loc)',
'<(SHARED_INTERMEDIATE_DIR)',
- '<(libs_loc)/breakpad/src',
- '<(libs_loc)/lzma/C',
- '<(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)',
'<(emoji_suggestions_loc)',
@@ -124,7 +117,7 @@
'<!@(<(list_sources_command) <(qt_moc_list_sources_arg))',
],
'sources!': [
- '<!@(<(list_sources_command) <(qt_moc_list_sources_arg) --exclude_for <(build_os))',
+ '<!@(<(list_sources_command) <(qt_moc_list_sources_arg) --exclude_for linux)',
],
'conditions': [
[ '"<(official_build_target)" != ""', {
@@ -139,7 +132,7 @@
'mac_hardened_runtime': 1,
'mac_bundle': '1',
'mac_bundle_resources': [
- '<!@(python -c "for s in \'<@(langpacks)\'.split(\' \'): print(\'<(res_loc)/langs/\' + s + \'.lproj/Localizable.strings\')")',
+ '<!@(%%PYTHON_CMD%% -c "for s in \'<@(langpacks)\'.split(\' \'): print(\'<(res_loc)/langs/\' + s + \'.lproj/Localizable.strings\')")',
'../../Telegram/Images.xcassets',
],
'xcode_settings': {
--- Telegram/gyp/tests/tests.gyp.orig 2019-10-07 15:58:21 UTC
+++ Telegram/gyp/tests/tests.gyp
@@ -12,7 +12,7 @@
'src_loc': '../../SourceFiles',
'submodules_loc': '../../ThirdParty',
'mac_target': '10.10',
- 'list_tests_command': 'python <(DEPTH)/tests/list_tests.py --input <(DEPTH)/tests/tests_list.txt',
+ 'list_tests_command': '%%PYTHON_CMD%% <(DEPTH)/tests/list_tests.py --input <(DEPTH)/tests/tests_list.txt',
},
'targets': [{
'target_name': 'tests',
--- Telegram/gyp/utils.gyp.orig 2019-10-07 15:58:21 UTC
+++ Telegram/gyp/utils.gyp
@@ -119,11 +119,11 @@
],
}, {
'include_dirs': [
- '/usr/local/include',
+ '%%LOCALBASE%%/include',
'<(libs_loc)/openssl/include'
],
'library_dirs': [
- '/usr/local/lib',
+ '%%LOCALBASE%%/lib',
],
}]
],
@@ -141,11 +141,11 @@
],
}, {
'include_dirs': [
- '/usr/local/include',
+ '%%LOCALBASE%%/include',
'<(libs_loc)/openssl/include'
],
'library_dirs': [
- '/usr/local/lib',
+ '%%LOCALBASE%%/lib',
],
}]
],
--- Telegram/ThirdParty/libtgvoip/libtgvoip.gyp.orig 2019-07-15 12:59:17 UTC
+++ Telegram/ThirdParty/libtgvoip/libtgvoip.gyp
@@ -14,11 +14,12 @@
'variables': {
'tgvoip_src_loc': '.',
'official_build_target%': '',
- 'linux_path_opus_include%': '<(DEPTH)/../../../Libraries/opus/include',
+ 'linux_path_opus_include%': '%%LOCALBASE%%/include/opus',
},
'include_dirs': [
'<(tgvoip_src_loc)/webrtc_dsp',
'<(linux_path_opus_include)',
+ '%%LOCALBASE%%/include/',
],
'direct_dependent_settings': {
'include_dirs': [
@@ -743,7 +744,7 @@
},
],
[
- '"<(OS)" != "linux"', {
+ '"<(OS)" != "freebsd"', {
'sources/': [['exclude', '<(tgvoip_src_loc)/os/linux/']],
},
],
@@ -895,13 +896,16 @@
},
],
[
- '"<(OS)" == "linux"', {
+ '"<(OS)" == "freebsd"', {
'defines': [
'WEBRTC_POSIX',
'WEBRTC_LINUX',
],
+ 'cflags_cc': [
+ '-std=gnu++11',
+ ],
'conditions': [
- [ '"<!(uname -m)" == "i686"', {
+ [ '"<!(uname -m)" == "i386"', {
'cflags_cc': [
'-msse2',
],

View File

@ -0,0 +1,10 @@
--- Telegram/CMakeLists.txt.orig 2020-02-18 08:28:06 UTC
+++ Telegram/CMakeLists.txt
@@ -4,6 +4,7 @@
# For license and copyright information please follow this link:
# https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
+link_directories(${OPUS_LIBDIR})
add_executable(Telegram WIN32 MACOSX_BUNDLE)
init_target(Telegram)

View File

@ -1,9 +0,0 @@
--- Telegram/Resources/qrc/linux.qrc.orig 2019-10-07 15:58:21 UTC
+++ Telegram/Resources/qrc/linux.qrc
@@ -1,6 +1,5 @@
<RCC>
<qresource prefix="/qt">
- <file alias="etc/qt.conf">../etc/qt_linux.conf</file>
</qresource>
<qresource prefix="/fc">
<file alias="fc-custom.conf">../fc-custom.conf</file>

View File

@ -1,11 +0,0 @@
--- Telegram/SourceFiles/base/build_config.h.orig 2019-02-01 12:51:46 UTC
+++ Telegram/SourceFiles/base/build_config.h
@@ -13,7 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/maste
#if defined(__APPLE__)
#define OS_MAC 1
-#elif defined(__linux__) // __APPLE__
+#elif defined(__linux__) || defined(__FreeBSD__) // __APPLE__
#define OS_LINUX 1
#elif defined(_WIN32) // __APPLE__ || __linux__
#define OS_WIN 1

View File

@ -1,40 +1,11 @@
--- Telegram/SourceFiles/core/launcher.cpp.orig 2019-10-07 15:58:21 UTC
--- Telegram/SourceFiles/core/launcher.cpp.orig 2020-02-18 08:28:06 UTC
+++ Telegram/SourceFiles/core/launcher.cpp
@@ -17,6 +17,8 @@ https://github.com/telegramdesktop/tdesktop/blob/maste
#include "base/concurrent_timer.h"
#include "facades.h"
@@ -248,7 +248,7 @@ void Launcher::init() {
+#include "FREEBSD_QT_PLUGINDIR.h"
+
namespace Core {
namespace {
QApplication::setApplicationName(qsl("TelegramDesktop"));
@@ -249,12 +251,13 @@ void Launcher::init() {
#define TDESKTOP_LAUNCHER_FILENAME_TO_STRING_HELPER(V) #V
#define TDESKTOP_LAUNCHER_FILENAME_TO_STRING(V) TDESKTOP_LAUNCHER_FILENAME_TO_STRING_HELPER(V)
QApplication::setDesktopFileName(qsl(TDESKTOP_LAUNCHER_FILENAME_TO_STRING(TDESKTOP_LAUNCHER_FILENAME)));
-#elif defined(Q_OS_LINUX) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
+#elif (defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
QApplication::setDesktopFileName(qsl("telegramdesktop.desktop"));
-#if defined(Q_OS_LINUX) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
+#if (defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)) && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
QApplication::setDesktopFileName(Platform::GetLauncherFilename());
#endif
-#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.
QApplication::setAttribute(Qt::AA_DisableHighDpiScaling, true);
-#endif // OS_MAC_OLD
+#endif // not defined Q_OS_MAC and QT_VERSION >= 5.6.0
initHook();
}
@@ -271,6 +274,11 @@ int Launcher::exec() {
// both are finished in Sandbox::closeApplication
Logs::start(this); // must be started before Platform is started
Platform::start(); // must be started before Sandbox 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();

View File

@ -1,6 +1,6 @@
--- Telegram/SourceFiles/core/update_checker.cpp.orig 2019-10-07 15:58:21 UTC
--- Telegram/SourceFiles/core/update_checker.cpp.orig 2020-02-18 08:28:06 UTC
+++ Telegram/SourceFiles/core/update_checker.cpp
@@ -1459,6 +1459,9 @@ int UpdateChecker::size() const {
@@ -1460,6 +1460,9 @@ int UpdateChecker::size() const {
//}
bool checkReadyUpdate() {
@ -10,7 +10,7 @@
QString readyFilePath = cWorkingDir() + qsl("tupdates/temp/ready"), readyPath = cWorkingDir() + qsl("tupdates/temp");
if (!QFile(readyFilePath).exists() || cExeName().isEmpty()) {
if (QDir(cWorkingDir() + qsl("tupdates/ready")).exists() || QDir(cWorkingDir() + qsl("tupdates/temp")).exists()) {
@@ -1511,6 +1514,9 @@ bool checkReadyUpdate() {
@@ -1512,6 +1515,9 @@ bool checkReadyUpdate() {
#elif defined Q_OS_LINUX // Q_OS_MAC
QString curUpdater = (cExeDir() + qsl("Updater"));
QFileInfo updater(cWorkingDir() + qsl("tupdates/temp/Updater"));

View File

@ -1,11 +0,0 @@
--- Telegram/SourceFiles/data/data_document.cpp.orig 2019-10-07 15:58:21 UTC
+++ Telegram/SourceFiles/data/data_document.cpp
@@ -140,7 +140,7 @@ QString FileNameUnsafe(
name = name.replace(QRegularExpression(qsl("[\\\\\\/\\:\\*\\?\\\"\\<\\>\\|]")), qsl("_"));
#elif defined Q_OS_MAC
name = name.replace(QRegularExpression(qsl("[\\:]")), qsl("_"));
-#elif defined Q_OS_LINUX
+#elif defined Q_OS_LINUX || defined Q_OS_FREEBSD
name = name.replace(QRegularExpression(qsl("[\\/]")), qsl("_"));
#endif
if (Global::AskDownloadPath() || savingAs) {

View File

@ -1,14 +0,0 @@
--- Telegram/SourceFiles/export/data/export_data_types.cpp.orig 2019-09-06 13:41:43 UTC
+++ Telegram/SourceFiles/export/data/export_data_types.cpp
@@ -362,9 +362,9 @@ QString CleanDocumentName(QString name) {
'|',
#elif defined Q_OS_MAC // Q_OS_WIN
':',
-#elif defined Q_OS_LINUX // Q_OS_WIN || Q_OS_MAC
+#elif defined Q_OS_LINUX || defined Q_OS_FREEBSD // Q_OS_WIN || Q_OS_MAC
'/',
-#endif // Q_OS_WIN || Q_OS_MAC || Q_OS_LINUX
+#endif // Q_OS_WIN || Q_OS_MAC || Q_OS_LINUX || Q_OS_FREEBSD
};
for (const auto ch : controls) {
name = std::move(name).replace(ch, '_');

View File

@ -1,6 +1,6 @@
--- Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp.orig 2019-10-07 15:58:21 UTC
--- Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp.orig 2020-02-18 08:28:06 UTC
+++ Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp
@@ -1438,13 +1438,13 @@ void InnerWidget::mouseActionFinish(const QPoint &scre
@@ -1451,13 +1451,13 @@ void InnerWidget::mouseActionFinish(const QPoint &scre
_mouseSelectType = TextSelectType::Letters;
//_widget->noSelectingScroll(); // TODO

View File

@ -1,6 +1,6 @@
--- Telegram/SourceFiles/history/history_inner_widget.cpp.orig 2019-10-07 15:58:21 UTC
--- Telegram/SourceFiles/history/history_inner_widget.cpp.orig 2020-02-18 08:28:06 UTC
+++ Telegram/SourceFiles/history/history_inner_widget.cpp
@@ -1401,7 +1401,7 @@ void HistoryInner::mouseActionFinish(
@@ -1403,7 +1403,7 @@ void HistoryInner::mouseActionFinish(
_widget->noSelectingScroll();
_widget->updateTopBarSelection();
@ -9,7 +9,7 @@
if (!_selected.empty() && _selected.cbegin()->second != FullSelection) {
const auto [item, selection] = *_selected.cbegin();
if (const auto view = item->mainView()) {
@@ -1410,7 +1410,7 @@ void HistoryInner::mouseActionFinish(
@@ -1412,7 +1412,7 @@ void HistoryInner::mouseActionFinish(
QClipboard::Selection);
}
}

View File

@ -1,6 +1,6 @@
--- Telegram/SourceFiles/history/view/history_view_list_widget.cpp.orig 2019-10-07 15:58:21 UTC
--- Telegram/SourceFiles/history/view/history_view_list_widget.cpp.orig 2020-02-18 08:28:06 UTC
+++ Telegram/SourceFiles/history/view/history_view_list_widget.cpp
@@ -2061,7 +2061,7 @@ void ListWidget::mouseActionFinish(
@@ -2066,7 +2066,7 @@ void ListWidget::mouseActionFinish(
_mouseSelectType = TextSelectType::Letters;
//_widget->noSelectingScroll(); // #TODO select scroll
@ -9,7 +9,7 @@
if (_selectedTextItem
&& _selectedTextRange.from != _selectedTextRange.to) {
if (const auto view = viewForItem(_selectedTextItem)) {
@@ -2070,7 +2070,7 @@ void ListWidget::mouseActionFinish(
@@ -2075,7 +2075,7 @@ void ListWidget::mouseActionFinish(
QClipboard::Selection);
}
}

View File

@ -1,6 +1,6 @@
--- Telegram/SourceFiles/logs.cpp.orig 2019-07-07 13:34:35 UTC
--- Telegram/SourceFiles/logs.cpp.orig 2020-02-18 08:28:06 UTC
+++ Telegram/SourceFiles/logs.cpp
@@ -338,7 +338,7 @@ void start(not_null<Core::Launcher*> launcher) {
@@ -342,7 +342,7 @@ void start(not_null<Core::Launcher*> launcher) {
if (cAlphaVersion()) {
workingDirChosen = true;
@ -9,7 +9,7 @@
} else {
if (!cWorkingDir().isEmpty()) {
// This value must come from TelegramForcePortable
@@ -353,16 +353,16 @@ void start(not_null<Core::Launcher*> launcher) {
@@ -357,16 +357,16 @@ void start(not_null<Core::Launcher*> launcher) {
}
workingDirChosen = true;
@ -30,7 +30,7 @@
#ifdef _DEBUG
cForceWorkingDir(cExeDir());
#else // _DEBUG
@@ -379,7 +379,7 @@ void start(not_null<Core::Launcher*> launcher) {
@@ -383,7 +383,7 @@ void start(not_null<Core::Launcher*> launcher) {
workingDirChosen = true;
}

View File

@ -1,52 +0,0 @@
--- Telegram/SourceFiles/platform/freebsd/info_freebsd.cpp.orig 2019-09-29 04:23:33 UTC
+++ Telegram/SourceFiles/platform/freebsd/info_freebsd.cpp
@@ -0,0 +1,49 @@
+/*
+This file is part of Telegram Desktop,
+the official desktop application for the Telegram messaging service.
+
+For license and copyright information please follow this link:
+https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
+*/
+#include "platform/freebsd/info_freebsd.h"
+
+namespace Platform {
+
+QString DeviceModelPretty() {
+ return "FreeBSD";
+}
+
+QString SystemVersionPretty() {
+ const auto result = getenv("XDG_CURRENT_DESKTOP");
+ const auto value = result ? QString::fromLatin1(result) : QString();
+ const auto list = value.split(':', QString::SkipEmptyParts);
+ return list.isEmpty() ? "FreeBSD" : "FreeBSD " + list[0];
+}
+
+QString SystemCountry() {
+ return QLocale::system().name().split('_').last();
+}
+
+QString SystemLanguage() {
+ const auto system = QLocale::system();
+ const auto languages = system.uiLanguages();
+ return languages.isEmpty()
+ ? system.name().split('_').first()
+ : languages.front();
+}
+
+QDate WhenSystemBecomesOutdated() {
+ return QDate();
+}
+
+int AutoUpdateVersion() {
+ return 2;
+}
+
+QString AutoUpdateKey() {
+ return "freebsd";
+}
+
+
+
+} // namespace Platform

View File

@ -1,59 +0,0 @@
--- Telegram/SourceFiles/platform/freebsd/info_freebsd.h.orig 2019-07-28 03:19:18 UTC
+++ Telegram/SourceFiles/platform/freebsd/info_freebsd.h
@@ -0,0 +1,56 @@
+/*
+This file is part of Telegram Desktop,
+the official desktop application for the Telegram messaging service.
+
+For license and copyright information please follow this link:
+https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
+*/
+#pragma once
+
+#include "platform/platform_info.h"
+
+namespace Platform {
+
+inline constexpr bool IsLinux() {
+ return true;
+}
+
+inline constexpr bool IsLinux32Bit() {
+#ifdef Q_OS_LINUX32
+ return true;
+#else // Q_OS_LINUX32
+ return false;
+#endif // Q_OS_LINUX32
+}
+
+inline constexpr bool IsLinux64Bit() {
+#ifdef Q_OS_LINUX64
+ return true;
+#else // Q_OS_LINUX64
+ return false;
+#endif // Q_OS_LINUX64
+}
+
+inline constexpr bool IsWindows() { return false; }
+inline constexpr bool IsWindowsStoreBuild() { return false; }
+inline bool IsWindowsXPOrGreater() { return false; }
+inline bool IsWindowsVistaOrGreater() { return false; }
+inline bool IsWindows7OrGreater() { return false; }
+inline bool IsWindows8OrGreater() { return false; }
+inline bool IsWindows8Point1OrGreater() { return false; }
+inline bool IsWindows10OrGreater() { return false; }
+inline constexpr bool IsMac() { return false; }
+inline constexpr bool IsMacOldBuild() { return false; }
+inline constexpr bool IsMacStoreBuild() { return false; }
+inline bool IsMac10_6OrGreater() { return false; }
+inline bool IsMac10_7OrGreater() { return false; }
+inline bool IsMac10_8OrGreater() { return false; }
+inline bool IsMac10_9OrGreater() { return false; }
+inline bool IsMac10_10OrGreater() { return false; }
+inline bool IsMac10_11OrGreater() { return false; }
+inline bool IsMac10_12OrGreater() { return false; }
+inline bool IsMac10_13OrGreater() { return false; }
+inline bool IsMac10_14OrGreater() { return false; }
+
+} // namespace Platform
+

View File

@ -1,47 +0,0 @@
--- Telegram/SourceFiles/platform/linux/linux_libs.cpp.orig 2019-09-27 17:04:25 UTC
+++ Telegram/SourceFiles/platform/linux/linux_libs.cpp
@@ -128,6 +128,7 @@ bool setupGtkBase(QLibrary &lib_gtk) {
return true;
}
+#ifdef HAVE_APPINDICATOR
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;
@@ -137,6 +138,7 @@ bool setupAppIndicator(QLibrary &lib_indicator) {
DEBUG_LOG(("Library appindicator functions loaded!"));
return true;
}
+#endif
#endif // !TDESKTOP_DISABLE_GTK_INTEGRATION
} // namespace
@@ -198,10 +200,12 @@ f_g_type_check_instance_cast g_type_check_instance_cas
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;
+#ifdef HAVE_APPINDICATOR
f_app_indicator_new app_indicator_new = nullptr;
f_app_indicator_set_status app_indicator_set_status = nullptr;
f_app_indicator_set_menu app_indicator_set_menu = nullptr;
f_app_indicator_set_icon_full app_indicator_set_icon_full = nullptr;
+#endif
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;
@@ -237,6 +241,7 @@ void start() {
bool indicatorLoaded = false;
bool isWayland = QGuiApplication::platformName().startsWith(qsl("wayland"), Qt::CaseInsensitive);
QLibrary lib_gtk, lib_indicator;
+#ifdef HAVE_APPINDICATOR
if (loadLibrary(lib_indicator, "ayatana-appindicator3", 1) || loadLibrary(lib_indicator, "appindicator3", 1)) {
if (loadLibrary(lib_gtk, "gtk-3", 0)) {
gtkLoaded = setupGtkBase(lib_gtk);
@@ -252,6 +257,7 @@ void start() {
}
}
}
+#endif
// If no appindicator, try at least load gtk.
if (!gtkLoaded && !indicatorLoaded) {

View File

@ -1,32 +0,0 @@
--- Telegram/SourceFiles/platform/linux/linux_libs.h.orig 2019-09-27 17:04:25 UTC
+++ Telegram/SourceFiles/platform/linux/linux_libs.h
@@ -13,11 +13,13 @@ https://github.com/telegramdesktop/tdesktop/blob/maste
extern "C" {
#undef signals
+#ifdef HAVE_APPINDICATOR
#ifdef TDESKTOP_USE_AYATANA_INDICATORS
#include <libayatana-appindicator/app-indicator.h>
#else
#include <libappindicator/app-indicator.h>
#endif
+#endif
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#define signals public
@@ -278,6 +280,7 @@ inline gulong g_signal_connect_swapped_helper(gpointer
typedef void (*f_g_signal_handler_disconnect)(gpointer instance, gulong handler_id);
extern f_g_signal_handler_disconnect g_signal_handler_disconnect;
+#ifdef HAVE_APPINDICATOR
typedef AppIndicator* (*f_app_indicator_new)(const gchar *id, const gchar *icon_name, AppIndicatorCategory category);
extern f_app_indicator_new app_indicator_new;
@@ -289,6 +292,7 @@ extern f_app_indicator_set_menu app_indicator_set_menu
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;
+#endif
typedef gboolean (*f_gdk_init_check)(gint *argc, gchar ***argv);
extern f_gdk_init_check gdk_init_check;

View File

@ -1,87 +0,0 @@
--- Telegram/SourceFiles/platform/linux/main_window_linux.cpp.orig 2019-10-07 15:58:21 UTC
+++ Telegram/SourceFiles/platform/linux/main_window_linux.cpp
@@ -30,7 +30,9 @@ bool noQtTrayIcon = false, tryAppIndicator = false;
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;
@@ -296,7 +298,9 @@ void MainWindow::workmodeUpdated(DBIWorkMode mode) {
if (noQtTrayIcon) {
#ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
if (useAppIndicator) {
+#ifdef HAVE_APPINDICATOR
Libs::app_indicator_set_status(_trayIndicator, APP_INDICATOR_STATUS_PASSIVE);
+#endif
} else if (useStatusIcon) {
Libs::gtk_status_icon_set_visible(_trayIcon, false);
}
@@ -312,7 +316,9 @@ void MainWindow::workmodeUpdated(DBIWorkMode mode) {
if (noQtTrayIcon) {
#ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
if (useAppIndicator) {
+#ifdef HAVE_APPINDICATOR
Libs::app_indicator_set_status(_trayIndicator, APP_INDICATOR_STATUS_ACTIVE);
+#endif
} else if (useStatusIcon) {
Libs::gtk_status_icon_set_visible(_trayIcon, true);
}
@@ -331,7 +337,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);
+#ifdef HAVE_APPINDICATOR
Libs::app_indicator_set_icon_full(_trayIndicator, path.constData(), name);
+#endif
} else {
useAppIndicator = false;
}
@@ -428,11 +436,15 @@ void MainWindow::LibsLoaded() {
&& (Libs::g_object_ref_sink != nullptr)
&& (Libs::g_object_unref != nullptr);
+#ifdef HAVE_APPINDICATOR
useAppIndicator = useGtkBase
&& (Libs::app_indicator_new != nullptr)
&& (Libs::app_indicator_set_status != nullptr)
&& (Libs::app_indicator_set_menu != nullptr)
&& (Libs::app_indicator_set_icon_full != nullptr);
+#else
+ useAppIndicator = false;
+#endif
if (tryAppIndicator && useGtkBase && useAppIndicator) {
noQtTrayIcon = true;
@@ -468,6 +480,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();
@@ -498,6 +511,7 @@ void MainWindow::psCreateTrayIcon() {
useAppIndicator = false;
}
}
+#endif
if (useStatusIcon) {
if (Libs::gdk_init_check(0, 0)) {
if (!_trayMenu) _trayMenu = Libs::gtk_menu_new();
@@ -632,10 +646,12 @@ MainWindow::~MainWindow() {
Libs::g_object_unref(_trayMenu);
_trayMenu = nullptr;
}
+#ifdef HAVE_APPINDICATOR
if (_trayIndicator) {
Libs::g_object_unref(_trayIndicator);
_trayIndicator = nullptr;
}
+#endif
#endif // !TDESKTOP_DISABLE_GTK_INTEGRATION
}

View File

@ -1,10 +0,0 @@
--- Telegram/SourceFiles/platform/platform_info.h.orig 2019-09-27 17:04:25 UTC
+++ Telegram/SourceFiles/platform/platform_info.h
@@ -51,4 +51,6 @@ namespace Platform {
#include "platform/linux/info_linux.h"
#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
#include "platform/win/info_win.h"
-#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WIN
+#elif defined Q_OS_FREEBSD // Q_OS_MAC || Q_OS_LINUX || Q_OS_WIN
+#include "platform/freebsd/info_freebsd.h"
+#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WIN || Q_OS_FREEBSD

View File

@ -1,99 +0,0 @@
--- Telegram/SourceFiles/qt_functions.cpp.orig 2019-09-07 21:39:10 UTC
+++ Telegram/SourceFiles/qt_functions.cpp
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file contains some parts of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <private/qtextengine_p.h>
+
+/* TODO: find a dynamic library with these symbols. */
+
+/* Debian maintainer: this function is taken from qfiledialog.cpp */
+/*
+ Makes a list of filters from ;;-separated text.
+ Used by the mac and windows implementations
+*/
+QStringList qt_make_filter_list(const QString &filter)
+{
+ QString f(filter);
+
+ if (f.isEmpty())
+ return QStringList();
+
+ QString sep(QLatin1String(";;"));
+ int i = f.indexOf(sep, 0);
+ if (i == -1) {
+ if (f.indexOf(QLatin1Char('\n'), 0) != -1) {
+ sep = QLatin1Char('\n');
+ i = f.indexOf(sep, 0);
+ }
+ }
+
+ return f.split(sep);
+}
+
+/* Debian maintainer: this constructor is taken from qtextengine.cpp for TextPainter::drawLine */
+QTextItemInt::QTextItemInt(const QGlyphLayout &g, QFont *font, const QChar *chars_, int numChars, QFontEngine *fe, const QTextCharFormat &format)
+ : flags(0), justified(false), underlineStyle(QTextCharFormat::NoUnderline), charFormat(format),
+ num_chars(numChars), chars(chars_), logClusters(0), f(font), glyphs(g), fontEngine(fe)
+{
+}
+
+/* Debian maintainer: this method is also taken from qtextengine.cpp */
+// Fix up flags and underlineStyle with given info
+void QTextItemInt::initWithScriptItem(const QScriptItem &si)
+{
+ // explicitly initialize flags so that initFontAttributes can be called
+ // multiple times on the same TextItem
+ flags = 0;
+ if (si.analysis.bidiLevel %2)
+ flags |= QTextItem::RightToLeft;
+ ascent = si.ascent;
+ descent = si.descent;
+
+ if (charFormat.hasProperty(QTextFormat::TextUnderlineStyle)) {
+ underlineStyle = charFormat.underlineStyle();
+ } else if (charFormat.boolProperty(QTextFormat::FontUnderline)
+ || f->d->underline) {
+ underlineStyle = QTextCharFormat::SingleUnderline;
+ }
+
+ // compat
+ if (underlineStyle == QTextCharFormat::SingleUnderline)
+ flags |= QTextItem::Underline;
+
+ if (f->d->overline || charFormat.fontOverline())
+ flags |= QTextItem::Overline;
+ if (f->d->strikeOut || charFormat.fontStrikeOut())
+ flags |= QTextItem::StrikeOut;
+}

View File

@ -1,20 +1,17 @@
--- Telegram/SourceFiles/qt_static_plugins.cpp.orig 2019-02-01 12:51:46 UTC
--- Telegram/SourceFiles/qt_static_plugins.cpp.orig 2020-02-18 08:28:06 UTC
+++ Telegram/SourceFiles/qt_static_plugins.cpp
@@ -14,15 +14,5 @@ Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
Q_IMPORT_PLUGIN(QWebpPlugin)
@@ -19,7 +19,7 @@ Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
#elif defined Q_OS_MAC // Q_OS_WIN
Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)
Q_IMPORT_PLUGIN(QGenericEnginePlugin)
-#elif defined Q_OS_LINUX // Q_OS_WIN | Q_OS_MAC
-Q_IMPORT_PLUGIN(QWebpPlugin)
-Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)
-Q_IMPORT_PLUGIN(QConnmanEnginePlugin)
-Q_IMPORT_PLUGIN(QGenericEnginePlugin)
-Q_IMPORT_PLUGIN(QNetworkManagerEnginePlugin)
-Q_IMPORT_PLUGIN(QComposePlatformInputContextPlugin)
-Q_IMPORT_PLUGIN(QIbusPlatformInputContextPlugin)
-Q_IMPORT_PLUGIN(QFcitxPlatformInputContextPlugin)
-Q_IMPORT_PLUGIN(QHimePlatformInputContextPlugin)
-Q_IMPORT_PLUGIN(NimfInputContextPlugin)
-#endif // Q_OS_WIN | Q_OS_MAC | Q_OS_LINUX
+#elif defined Q_OS_LINUX || defined Q_OS_FREEBSD // Q_OS_WIN | Q_OS_MAC
Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)
Q_IMPORT_PLUGIN(QGenericEnginePlugin)
Q_IMPORT_PLUGIN(QComposePlatformInputContextPlugin)
@@ -33,4 +33,4 @@ Q_IMPORT_PLUGIN(QHimePlatformInputContextPlugin)
Q_IMPORT_PLUGIN(NimfInputContextPlugin)
Q_IMPORT_PLUGIN(QXdgDesktopPortalThemePlugin)
#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION
-#endif // Q_OS_WIN | Q_OS_MAC | Q_OS_LINUX
+#endif // Q_OS_WIN | Q_OS_MAC | Q_OS_LINUX | Q_OS_FREEBSD

View File

@ -1,6 +1,6 @@
--- Telegram/SourceFiles/settings/settings_notifications.cpp.orig 2019-10-07 15:58:21 UTC
--- Telegram/SourceFiles/settings/settings_notifications.cpp.orig 2020-02-18 08:28:06 UTC
+++ Telegram/SourceFiles/settings/settings_notifications.cpp
@@ -496,11 +496,11 @@ void NotificationsCount::SampleWidget::destroyDelayed(
@@ -495,11 +495,11 @@ void NotificationsCount::SampleWidget::destroyDelayed(
_deleted = true;
// Ubuntu has a lag if deleteLater() called immediately.

View File

@ -1,11 +0,0 @@
--- Telegram/SourceFiles/storage/storage_encrypted_file_tests.cpp.orig 2019-02-01 12:51:46 UTC
+++ Telegram/SourceFiles/storage/storage_encrypted_file_tests.cpp
@@ -21,7 +21,7 @@ https://github.com/telegramdesktop/tdesktop/blob/maste
#include <thread>
#ifdef Q_OS_MAC
#include <mach-o/dyld.h>
-#elif defined Q_OS_LINUX // Q_OS_MAC
+#elif defined Q_OS_LINUX || defined Q_OS_FREEBSD // Q_OS_MAC
#include <unistd.h>
#endif // Q_OS_MAC || Q_OS_LINUX

View File

@ -1,14 +0,0 @@
--- Telegram/SourceFiles/ui/platform/ui_platform_utility.h.orig 2019-10-07 15:58:21 UTC
+++ Telegram/SourceFiles/ui/platform/ui_platform_utility.h
@@ -37,8 +37,8 @@ void DrainMainQueue(); // Needed only if UseMainQueueG
#ifdef Q_OS_MAC
#include "ui/platform/mac/ui_platform_utility_mac.h"
-#elif defined Q_OS_LINUX // Q_OS_MAC
+#elif defined Q_OS_LINUX || defined Q_OS_FREEBSD // Q_OS_MAC
#include "ui/platform/linux/ui_platform_utility_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 "ui/platform/win/ui_platform_utility_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

View File

@ -1,17 +0,0 @@
--- Telegram/SourceFiles/ui/text/text.cpp.orig 2019-10-07 15:58:21 UTC
+++ Telegram/SourceFiles/ui/text/text.cpp
@@ -1972,11 +1972,11 @@ class Renderer { (private)
if (item == -1)
return;
-#ifdef OS_MAC_OLD
+#if defined(OS_MAC_OLD) || QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
auto end = _e->findItem(line.from + line.length - 1);
-#else // OS_MAC_OLD
+#else
auto end = _e->findItem(line.from + line.length - 1, item);
-#endif // OS_MAC_OLD
+#endif
auto blockIndex = _lineStartBlock;
auto currentBlock = _t->_blocks[blockIndex].get();

View File

@ -1,6 +1,6 @@
--- Telegram/SourceFiles/window/main_window.cpp.orig 2019-10-07 15:58:21 UTC
--- Telegram/SourceFiles/window/main_window.cpp.orig 2020-02-18 08:28:06 UTC
+++ Telegram/SourceFiles/window/main_window.cpp
@@ -573,7 +573,7 @@ bool MainWindow::minimizeToTray() {
@@ -589,7 +589,7 @@ bool MainWindow::minimizeToTray() {
}
void MainWindow::reActivateWindow() {
@ -9,10 +9,10 @@
const auto reActivate = [=] {
if (const auto w = App::wnd()) {
if (auto f = QApplication::focusWidget()) {
@@ -588,7 +588,7 @@ void MainWindow::reActivateWindow() {
@@ -604,7 +604,7 @@ void MainWindow::reActivateWindow() {
};
crl::on_main(this, reActivate);
App::CallDelayed(200, this, reActivate);
base::call_delayed(200, this, reActivate);
-#endif // Q_OS_LINUX32 || Q_OS_LINUX64
+#endif // Q_OS_LINUX32 || Q_OS_LINUX64 || Q_OS_FREEBSD
}

View File

@ -1,6 +1,6 @@
--- Telegram/ThirdParty/libtgvoip/VoIPController.cpp.orig 2019-07-15 12:59:17 UTC
--- Telegram/ThirdParty/libtgvoip/VoIPController.cpp.orig 2020-02-12 13:11:18 UTC
+++ Telegram/ThirdParty/libtgvoip/VoIPController.cpp
@@ -3048,7 +3048,7 @@ static void initMachTimestart() {
@@ -3005,7 +3005,7 @@ static void initMachTimestart() {
#endif
double VoIPController::GetCurrentTime(){

View File

@ -1,12 +0,0 @@
--- Telegram/ThirdParty/libtgvoip/os/linux/AudioPulse.cpp.orig 2018-11-23 01:03:16 UTC
+++ Telegram/ThirdParty/libtgvoip/os/linux/AudioPulse.cpp
@@ -7,6 +7,9 @@
#include "AudioPulse.h"
#include <dlfcn.h>
#include "../../logging.h"
+#ifdef __FreeBSD__
+#include <libgen.h>
+#endif
#define DECLARE_DL_FUNCTION(name) typeof(name)* AudioPulse::_import_##name=NULL
#define CHECK_DL_ERROR(res, msg) if(!res){LOGE(msg ": %s", dlerror()); return false;}

View File

@ -1,20 +0,0 @@
--- Telegram/gyp/PrecompiledHeader.cmake.orig 2019-07-07 13:34:35 UTC
+++ Telegram/gyp/PrecompiledHeader.cmake
@@ -114,7 +114,7 @@ function(add_precompiled_header _target _input)
set(_compiler_FLAGS "@${_pch_c_flags_file}")
add_custom_command(
OUTPUT "${_output_c}"
- COMMAND "${CMAKE_C_COMPILER}" ${_compiler_FLAGS} -x c-header -o "${_output_c}" -c "${_pchfile}"
+ COMMAND "${CMAKE_C_COMPILER}" "$(C_DEFINES)" "$(C_INCLUDES)" "$(C_FLAGS)" -x c-header -o "${_output_c}" -c "${_pchfile}"
DEPENDS "${_pchfile}" "${_pch_c_flags_file}"
IMPLICIT_DEPENDS C "${_pch_header}"
COMMENT "Precompiling ${_name} for ${_target} (C)")
@@ -125,7 +125,7 @@ function(add_precompiled_header _target _input)
set(_compiler_FLAGS "@${_pch_cpp_flags_file}")
add_custom_command(
OUTPUT "${_output_cxx}"
- COMMAND "${CMAKE_CXX_COMPILER}" ${_compiler_FLAGS} -x c++-header -o "${_output_cxx}" -c "${_pchfile}"
+ COMMAND "${CMAKE_CXX_COMPILER}" "$(CXX_DEFINES)" "$(CXX_INCLUDES)" "$(CXX_FLAGS)" -x c++-header -o "${_output_cxx}" -c "${_pchfile}"
DEPENDS "${_pchfile}" "${_pch_cpp_flags_file}"
IMPLICIT_DEPENDS CXX "${_pch_header}"
COMMENT "Precompiling header ${_name} for ${_target} (C++)")

View File

@ -1,11 +0,0 @@
--- Telegram/gyp/common/common.gypi.orig 2019-10-07 15:58:21 UTC
+++ Telegram/gyp/common/common.gypi
@@ -29,7 +29,7 @@
}, {
'build_mac': 0,
}],
- [ 'build_os == "linux"', {
+ [ 'build_os == "freebsd"', {
'build_linux': 1,
}, {
'build_linux': 0,

View File

@ -1,29 +0,0 @@
--- Telegram/gyp/telegram/sources.txt.orig 2019-10-07 15:58:21 UTC
+++ Telegram/gyp/telegram/sources.txt
@@ -610,8 +610,8 @@
<(src_loc)/platform/linux/linux_libs.h
<(src_loc)/platform/linux/file_utilities_linux.cpp
<(src_loc)/platform/linux/file_utilities_linux.h
-<(src_loc)/platform/linux/info_linux.cpp
-<(src_loc)/platform/linux/info_linux.h
+<(src_loc)/platform/freebsd/info_freebsd.cpp
+<(src_loc)/platform/freebsd/info_freebsd.h
<(src_loc)/platform/linux/launcher_linux.cpp
<(src_loc)/platform/linux/launcher_linux.h
<(src_loc)/platform/linux/main_window_linux.cpp
@@ -863,14 +863,7 @@
<(src_loc)/settings.cpp
<(src_loc)/settings.h
-platforms: !win
-<(minizip_loc)/crypt.h
-<(minizip_loc)/ioapi.c
-<(minizip_loc)/ioapi.h
-<(minizip_loc)/zip.c
-<(minizip_loc)/zip.h
-<(minizip_loc)/unzip.c
-<(minizip_loc)/unzip.h
+<(src_loc)/qt_functions.cpp
platforms: win
<(res_loc)/winrc/Telegram.rc

View File

@ -1,6 +1,6 @@
--- Telegram/SourceFiles/base/bytes.h.orig 2019-07-07 13:34:35 UTC
+++ Telegram/SourceFiles/base/bytes.h
@@ -137,7 +137,7 @@ template <
--- Telegram/lib_base/base/bytes.h.orig 2020-01-29 09:41:30 UTC
+++ Telegram/lib_base/base/bytes.h
@@ -136,7 +136,7 @@ template <
vector concatenate(Args &&...args) {
const auto size = details::spansLength(args...);
auto result = vector(size);
@ -9,7 +9,7 @@
return result;
}
@@ -149,7 +149,7 @@ vector concatenate(SpanRange args) {
@@ -148,7 +148,7 @@ vector concatenate(SpanRange args) {
size += bytes::make_span(arg).size();
}
auto result = vector(size);

View File

@ -0,0 +1,13 @@
--- Telegram/lib_base/base/platform/base_platform_file_utilities.h.orig 2020-01-29 09:41:30 UTC
+++ Telegram/lib_base/base/platform/base_platform_file_utilities.h
@@ -22,8 +22,8 @@ void RemoveQuarantine(const QString &path);
#ifdef Q_OS_MAC
#include "base/platform/mac/base_file_utilities_mac.h"
-#elif defined Q_OS_LINUX // Q_OS_MAC
+#elif defined Q_OS_LINUX || defined Q_OS_FREEBSD // Q_OS_MAC
#include "base/platform/linux/base_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
#include "base/platform/win/base_file_utilities_win.h"
#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WINRT || Q_OS_WIN

View File

@ -0,0 +1,14 @@
--- Telegram/lib_base/base/platform/base_platform_info.h.orig 2020-01-29 09:41:30 UTC
+++ Telegram/lib_base/base/platform/base_platform_info.h
@@ -53,8 +53,8 @@ void Finish();
#ifdef Q_OS_MAC
#include "base/platform/mac/base_info_mac.h"
-#elif defined Q_OS_LINUX // Q_OS_MAC
+#elif defined Q_OS_LINUX || defined Q_OS_FREEBSD // Q_OS_MAC
#include "base/platform/linux/base_info_linux.h"
-#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
+#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINU || Q_OS_FREEBSD X
#include "base/platform/win/base_info_win.h"
-#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WIN
+#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WIN || Q_OS_FREEBSD X

View File

@ -0,0 +1,13 @@
--- Telegram/lib_base/base/zlib_help.h.orig 2020-01-29 09:41:30 UTC
+++ Telegram/lib_base/base/zlib_help.h
@@ -6,8 +6,8 @@
//
#pragma once
-#include "zip.h"
-#include "unzip.h"
+#include "minizip/zip.h"
+#include "minizip/unzip.h"
#include "logs.h"
#ifdef small

View File

@ -0,0 +1,11 @@
--- Telegram/lib_ui/ui/platform/ui_platform_utility.h.orig 2020-02-10 08:12:05 UTC
+++ Telegram/lib_ui/ui/platform/ui_platform_utility.h
@@ -37,7 +37,7 @@ void DrainMainQueue(); // Needed only if UseMainQueueG
#ifdef Q_OS_MAC
#include "ui/platform/mac/ui_utility_mac.h"
-#elif defined Q_OS_LINUX // Q_OS_MAC
+#elif defined Q_OS_LINUX || defined Q_OS_FREEBSD // Q_OS_MAC
#include "ui/platform/linux/ui_utility_linux.h"
#elif defined Q_OS_WINRT || defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
#include "ui/platform/win/ui_utility_win.h"

View File

@ -0,0 +1,11 @@
--- Telegram/lib_ui/ui/style/style_core_font.cpp.orig 2020-02-10 08:12:05 UTC
+++ Telegram/lib_ui/ui/style/style_core_font.cpp
@@ -22,7 +22,7 @@ void style_InitFontsResource() {
Q_INIT_RESOURCE(win);
#elif defined Q_OS_MAC // Q_OS_WIN
Q_INIT_RESOURCE(mac);
-#elif defined Q_OS_LINUX && !defined DESKTOP_APP_USE_PACKAGED // Q_OS_WIN || Q_OS_MAC
+#elif (defined Q_OS_LINUX || defined Q_OS_FREEBSD) && !defined DESKTOP_APP_USE_PACKAGED // Q_OS_WIN || Q_OS_MAC
Q_INIT_RESOURCE(linux);
#endif // Q_OS_WIN || Q_OS_MAC || (Q_OS_LINUX && !DESKTOP_APP_USE_PACKAGED)
}

View File

@ -1,6 +1,6 @@
--- Telegram/SourceFiles/ui/widgets/labels.cpp.orig 2019-10-07 15:58:21 UTC
+++ Telegram/SourceFiles/ui/widgets/labels.cpp
@@ -400,13 +400,13 @@ Text::StateResult FlatLabel::dragActionFinish(const QP
--- Telegram/lib_ui/ui/widgets/labels.cpp.orig 2020-02-10 08:12:05 UTC
+++ Telegram/lib_ui/ui/widgets/labels.cpp
@@ -454,13 +454,13 @@ Text::StateResult FlatLabel::dragActionFinish(const QP
}
}

View File

@ -0,0 +1,11 @@
--- cmake/external/opus/CMakeLists.txt.orig 2020-02-18 08:27:33 UTC
+++ cmake/external/opus/CMakeLists.txt
@@ -11,7 +11,7 @@ if (DESKTOP_APP_USE_PACKAGED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(OPUS opus)
- target_include_directories(external_opus INTERFACE ${OPUS_INCLUDE_DIRS})
+ target_include_directories(external_opus INTERFACE ${OPUS_INCLUDEDIR})
else()
target_include_directories(external_opus SYSTEM
INTERFACE

View File

@ -0,0 +1,13 @@
--- cmake/external/qt/CMakeLists.txt.orig 2020-02-18 08:27:33 UTC
+++ cmake/external/qt/CMakeLists.txt
@@ -10,8 +10,10 @@ add_library(desktop-app::external_qt ALIAS external_qt
if (LINUX)
if (NOT build_linux32)
target_compile_definitions(external_qt INTERFACE Q_OS_LINUX64)
+ target_compile_definitions(external_qt INTERFACE Q_OS_FREEBSD)
else()
target_compile_definitions(external_qt INTERFACE Q_OS_LINUX32)
+ target_compile_definitions(external_qt INTERFACE Q_OS_FREEBSD)
endif()
endif()

View File

@ -1,9 +0,0 @@
--- lib/xdg/tg.protocol.orig 2018-08-04 18:53:40 UTC
+++ lib/xdg/tg.protocol
@@ -1,5 +1,5 @@
[Protocol]
-exec=/usr/bin/telegram-desktop -- %u
+exec=telegram-desktop -- %u
protocol=tg
input=none
output=none

View File

@ -1,11 +1,10 @@
bin/telegram-desktop
share/appdata/telegram-desktop.appdata.xml
share/applications/telegram-desktop.desktop
share/kservices5/tg.protocol
share/icons/hicolor/128x128/apps/telegram-desktop.png
share/icons/hicolor/16x16/apps/telegram-desktop.png
share/icons/hicolor/256x256/apps/telegram-desktop.png
share/icons/hicolor/32x32/apps/telegram-desktop.png
share/icons/hicolor/48x48/apps/telegram-desktop.png
share/icons/hicolor/512x512/apps/telegram-desktop.png
share/icons/hicolor/64x64/apps/telegram-desktop.png
share/applications/telegramdesktop.desktop
share/icons/hicolor/128x128/apps/telegram.png
share/icons/hicolor/16x16/apps/telegram.png
share/icons/hicolor/256x256/apps/telegram.png
share/icons/hicolor/32x32/apps/telegram.png
share/icons/hicolor/48x48/apps/telegram.png
share/icons/hicolor/512x512/apps/telegram.png
share/icons/hicolor/64x64/apps/telegram.png
share/metainfo/telegramdesktop.appdata.xml