From 4dcbaf6863cf61198bbb2ca60a2b7e15b26337ac Mon Sep 17 00:00:00 2001 From: Sergei Reznikov Date: Wed, 13 Sep 2017 02:14:12 +0300 Subject: [PATCH] Telegram: more fixes, almost builds now --- .../tdesktop/patches/tdesktop-1.1.23.patchset | 1201 ++++++++++------- net-im/tdesktop/patches/telegram.diff | 128 -- net-im/tdesktop/tdesktop-1.1.23.recipe | 33 +- 3 files changed, 705 insertions(+), 657 deletions(-) delete mode 100644 net-im/tdesktop/patches/telegram.diff diff --git a/net-im/tdesktop/patches/tdesktop-1.1.23.patchset b/net-im/tdesktop/patches/tdesktop-1.1.23.patchset index 9c3bd12ad..28ac46cc2 100644 --- a/net-im/tdesktop/patches/tdesktop-1.1.23.patchset +++ b/net-im/tdesktop/patches/tdesktop-1.1.23.patchset @@ -1,9 +1,22 @@ -From bdb1098d693f85cb87e049dd3878cf2cb401dc80 Mon Sep 17 00:00:00 2001 +From 08ee2efc5ae576a53e040d7e3ab779e59c840bcf Mon Sep 17 00:00:00 2001 From: Sergei Reznikov Date: Sat, 9 Sep 2017 02:14:52 +0300 Subject: Haiku fixes +diff --git a/Telegram/SourceFiles/autoupdater.cpp b/Telegram/SourceFiles/autoupdater.cpp +index a6aa4c2..45ba0ed 100644 +--- a/Telegram/SourceFiles/autoupdater.cpp ++++ b/Telegram/SourceFiles/autoupdater.cpp +@@ -534,7 +534,7 @@ bool checkReadyUpdate() { + #elif defined Q_OS_MAC // Q_OS_WIN + QString curUpdater = (cExeDir() + cExeName() + qsl("/Contents/Frameworks/Updater")); + QFileInfo updater(cWorkingDir() + qsl("tupdates/temp/Telegram.app/Contents/Frameworks/Updater")); +-#elif defined Q_OS_LINUX // Q_OS_MAC ++#elif defined Q_OS_LINUX || defined Q_OS_HAIKU // Q_OS_MAC + QString curUpdater = (cExeDir() + qsl("Updater")); + QFileInfo updater(cWorkingDir() + qsl("tupdates/temp/Updater")); + #endif // Q_OS_LINUX diff --git a/Telegram/SourceFiles/base/build_config.h b/Telegram/SourceFiles/base/build_config.h index 1731630..3a93c27 100644 --- a/Telegram/SourceFiles/base/build_config.h @@ -52,7 +65,7 @@ index 88a83a2..6551667 100644 #include "base/flat_map.h" #include diff --git a/Telegram/SourceFiles/base/flat_set_tests.cpp b/Telegram/SourceFiles/base/flat_set_tests.cpp -index 675b0bd..ecef629 100644 +index 675b0bd..735ab1b 100644 --- a/Telegram/SourceFiles/base/flat_set_tests.cpp +++ b/Telegram/SourceFiles/base/flat_set_tests.cpp @@ -18,7 +18,7 @@ to link the code of portions of this program with the OpenSSL library. @@ -60,7 +73,7 @@ index 675b0bd..ecef629 100644 Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ -#include "catch.hpp" -+#include "../ThirdParty/variant/test/include/catch.hpp" ++#include "../../ThirdParty/variant/test/include/catch.hpp" #include "base/flat_set.h" @@ -143,483 +156,62 @@ index a8bf969..7559354 100644 #endif // !TDESKTOP_DISABLE_UNITY_INTEGRATION namespace Platform { -diff --git a/Telegram/SourceFiles/qt_static_plugins.cpp b/Telegram/SourceFiles/qt_static_plugins.cpp -index b975c7a..f2f876b 100644 ---- a/Telegram/SourceFiles/qt_static_plugins.cpp -+++ b/Telegram/SourceFiles/qt_static_plugins.cpp -@@ -28,13 +28,4 @@ Q_IMPORT_PLUGIN(QWebpPlugin) - 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) - #endif // Q_OS_WIN | Q_OS_MAC | Q_OS_LINUX -diff --git a/Telegram/SourceFiles/ui/effects/panel_animation.h b/Telegram/SourceFiles/ui/effects/panel_animation.h -index 2e35ece..2a879a0 100644 ---- a/Telegram/SourceFiles/ui/effects/panel_animation.h -+++ b/Telegram/SourceFiles/ui/effects/panel_animation.h -@@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org - */ - #pragma once +diff --git a/Telegram/SourceFiles/platform/platform_file_utilities.h b/Telegram/SourceFiles/platform/platform_file_utilities.h +index 593ab28..c08f759 100644 +--- a/Telegram/SourceFiles/platform/platform_file_utilities.h ++++ b/Telegram/SourceFiles/platform/platform_file_utilities.h +@@ -51,8 +51,8 @@ bool Get(QStringList &files, QByteArray &remoteContent, const QString &caption, --#include "styles/style_widgets.h" -+//#include "styles/style_widgets.h" + #ifdef Q_OS_MAC + #include "platform/mac/file_utilities_mac.h" +-#elif defined Q_OS_LINUX // Q_OS_MAC +-#include "platform/linux/file_utilities_linux.h" ++//#elif defined Q_OS_LINUX // 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 + #include "platform/win/file_utilities_win.h" + #endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WINRT || Q_OS_WIN +diff --git a/Telegram/SourceFiles/platform/platform_main_window.h b/Telegram/SourceFiles/platform/platform_main_window.h +index b7b5334..66af0cd 100644 +--- a/Telegram/SourceFiles/platform/platform_main_window.h ++++ b/Telegram/SourceFiles/platform/platform_main_window.h +@@ -34,6 +34,8 @@ class MainWindow; + #include "platform/mac/main_window_mac.h" + #elif defined Q_OS_LINUX // 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_HAIKU // Q_OS_MAC || Q_OS_LINUX ++#include "platform/haiku/main_window_haiku.h" ++#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX || Q_OS_HAIKU + #include "platform/win/main_window_win.h" + #endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WIN +diff --git a/Telegram/SourceFiles/platform/platform_specific.h b/Telegram/SourceFiles/platform/platform_specific.h +index 359b047..dca0c7e 100644 +--- a/Telegram/SourceFiles/platform/platform_specific.h ++++ b/Telegram/SourceFiles/platform/platform_specific.h +@@ -47,6 +47,8 @@ void finish(); + #include "platform/mac/specific_mac.h" + #elif defined Q_OS_LINUX // Q_OS_MAC + #include "platform/linux/specific_linux.h" +-#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX ++#elif defined Q_OS_HAIKU // Q_OS_MAC || Q_OS_LINUX ++#include "platform/haiku/specific_haiku.h" ++#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX || Q_OS_HAIKU + #include "platform/win/specific_win.h" + #endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WIN +diff --git a/Telegram/SourceFiles/platform/platform_window_title.h b/Telegram/SourceFiles/platform/platform_window_title.h +index 1d0d892..285568c 100644 +--- a/Telegram/SourceFiles/platform/platform_window_title.h ++++ b/Telegram/SourceFiles/platform/platform_window_title.h +@@ -38,7 +38,7 @@ void PreviewWindowFramePaint(QImage &preview, const style::palette &palette, QRe + #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_HAIKU // Q_OS_MAC || Q_OS_WIN - namespace Ui { + namespace Platform { -diff --git a/Telegram/SourceFiles/ui/emoji_config.h b/Telegram/SourceFiles/ui/emoji_config.h -index d580ba7..3d844a4 100644 ---- a/Telegram/SourceFiles/ui/emoji_config.h -+++ b/Telegram/SourceFiles/ui/emoji_config.h -@@ -21,7 +21,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org - #pragma once - - #include "ui/text/text.h" --#include "emoji.h" -+//#include "emoji.h" - - namespace Ui { - namespace Emoji { -diff --git a/Telegram/SourceFiles/ui/text/text.cpp b/Telegram/SourceFiles/ui/text/text.cpp -index d18a8ea..2c58287 100644 ---- a/Telegram/SourceFiles/ui/text/text.cpp -+++ b/Telegram/SourceFiles/ui/text/text.cpp -@@ -1689,11 +1689,11 @@ 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(); -diff --git a/Telegram/SourceFiles/ui/text/text.h b/Telegram/SourceFiles/ui/text/text.h -index f5bcd66..272dbc8 100644 ---- a/Telegram/SourceFiles/ui/text/text.h -+++ b/Telegram/SourceFiles/ui/text/text.h -@@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org - */ - #pragma once - --#include "private/qfontengine_p.h" -+//#include "private/qfontengine_p.h" - - #include "core/click_handler.h" - #include "ui/text/text_entity.h" -diff --git a/Telegram/SourceFiles/ui/text/text_block.cpp b/Telegram/SourceFiles/ui/text/text_block.cpp -index f89644e..35230cf 100644 ---- a/Telegram/SourceFiles/ui/text/text_block.cpp -+++ b/Telegram/SourceFiles/ui/text/text_block.cpp -@@ -330,7 +330,7 @@ TextBlock::TextBlock(const style::font &font, const QString &str, QFixed minResi - SignalHandlers::setCrashAnnotationRef("CrashString", &part); - - QStackTextEngine engine(part, blockFont->f); -- QTextLayout layout(&engine); -+ QTextLayout layout(part, blockFont->f); - layout.beginLayout(); - layout.createLine(); - -diff --git a/Telegram/SourceFiles/ui/twidget.cpp b/Telegram/SourceFiles/ui/twidget.cpp -index e9848ef..dcee47e 100644 ---- a/Telegram/SourceFiles/ui/twidget.cpp -+++ b/Telegram/SourceFiles/ui/twidget.cpp -@@ -191,9 +191,9 @@ void sendSynteticMouseEvent(QWidget *widget, QEvent::Type type, Qt::MouseButton - , button - , QGuiApplication::mouseButtons() | button - , QGuiApplication::keyboardModifiers() --#ifndef OS_MAC_OLD -+#if !defined(OS_MAC_OLD) && QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) - , Qt::MouseEventSynthesizedByApplication --#endif // OS_MAC_OLD -+#endif - ); - ev.setTimestamp(getms()); - QGuiApplication::sendEvent(windowHandle, &ev); -diff --git a/Telegram/SourceFiles/ui/widgets/shadow.h b/Telegram/SourceFiles/ui/widgets/shadow.h -index fcce8cc..f844881 100644 ---- a/Telegram/SourceFiles/ui/widgets/shadow.h -+++ b/Telegram/SourceFiles/ui/widgets/shadow.h -@@ -17,7 +17,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org - */ - #pragma once - --#include "styles/style_widgets.h" -+//#include "styles/style_widgets.h" - - namespace Ui { - -diff --git a/Telegram/ThirdParty/minizip/ioapi.c b/Telegram/ThirdParty/minizip/ioapi.c -index 7f5c191..649255c 100644 ---- a/Telegram/ThirdParty/minizip/ioapi.c -+++ b/Telegram/ThirdParty/minizip/ioapi.c -@@ -14,7 +14,7 @@ - #define _CRT_SECURE_NO_WARNINGS - #endif - --#if defined(__APPLE__) || defined(IOAPI_NO_64) -+#if defined(__APPLE__) || defined(IOAPI_NO_64) || defined(__HAIKU__) - // In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions - #define FOPEN_FUNC(filename, mode) fopen(filename, mode) - #define FTELLO_FUNC(stream) ftello(stream) -diff --git a/Telegram/gyp/PrecompiledHeader.cmake b/Telegram/gyp/PrecompiledHeader.cmake -index 5d6830e..c3f08d3 100644 ---- a/Telegram/gyp/PrecompiledHeader.cmake -+++ b/Telegram/gyp/PrecompiledHeader.cmake -@@ -112,7 +112,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)") -@@ -123,7 +123,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 ${_name} for ${_target} (C++)") -diff --git a/Telegram/gyp/Telegram.gyp b/Telegram/gyp/Telegram.gyp -index 0d1f38a..91ffc3c 100644 ---- a/Telegram/gyp/Telegram.gyp -+++ b/Telegram/gyp/Telegram.gyp -@@ -80,12 +80,10 @@ - 'codegen.gyp:codegen_numbers', - 'codegen.gyp:codegen_style', - 'tests/tests.gyp:tests', -- 'utils.gyp:Updater', - '../ThirdParty/libtgvoip/libtgvoip.gyp:libtgvoip', - ], - - 'defines': [ -- 'AL_LIBTYPE_STATIC', - 'AL_ALEXT_PROTOTYPES', - 'TGVOIP_USE_CXX11_LIB', - ' /dev/null --libs <@(pkgconfig_libs))', - ], - 'cflags_cc': [ -- ' /dev/null --cflags appindicator-0.1)', -- ' /dev/null --cflags gtk+-2.0)', -- ' /dev/null --cflags glib-2.0)', -- ' /dev/null --cflags dee-1.0)', -+# ' /dev/null --cflags appindicator-0.1)', -+# ' /dev/null --cflags gtk+-2.0)', -+# ' /dev/null --cflags glib-2.0)', -+# ' /dev/null --cflags dee-1.0)', - ], - 'configurations': { - 'Release': { -diff --git a/Telegram/gyp/telegram_sources.txt b/Telegram/gyp/telegram_sources.txt -index ef66965..81852d1 100644 ---- a/Telegram/gyp/telegram_sources.txt -+++ b/Telegram/gyp/telegram_sources.txt -@@ -598,14 +598,7 @@ - <(emoji_suggestions_loc)/emoji_suggestions.cpp - <(emoji_suggestions_loc)/emoji_suggestions.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: mac - <(sp_media_key_tap_loc)/SPMediaKeyTap.m --- -2.13.1 - - -From 65a214d83477e921c76a85c789792ffae03c7c82 Mon Sep 17 00:00:00 2001 -From: Sergei Reznikov -Date: Sat, 9 Sep 2017 04:49:22 +0300 -Subject: missing file - - diff --git a/Telegram/SourceFiles/qt_functions.cpp b/Telegram/SourceFiles/qt_functions.cpp new file mode 100644 index 0000000..4a722b8 @@ -720,45 +312,636 @@ index 0000000..4a722b8 + if (f->d->strikeOut || charFormat.fontStrikeOut()) + flags |= QTextItem::StrikeOut; +} +diff --git a/Telegram/SourceFiles/qt_static_plugins.cpp b/Telegram/SourceFiles/qt_static_plugins.cpp +index b975c7a..f2f876b 100644 +--- a/Telegram/SourceFiles/qt_static_plugins.cpp ++++ b/Telegram/SourceFiles/qt_static_plugins.cpp +@@ -28,13 +28,4 @@ Q_IMPORT_PLUGIN(QWebpPlugin) + 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) + #endif // Q_OS_WIN | Q_OS_MAC | Q_OS_LINUX +diff --git a/Telegram/SourceFiles/ui/text/text.cpp b/Telegram/SourceFiles/ui/text/text.cpp +index d18a8ea..2c58287 100644 +--- a/Telegram/SourceFiles/ui/text/text.cpp ++++ b/Telegram/SourceFiles/ui/text/text.cpp +@@ -1689,11 +1689,11 @@ 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(); +diff --git a/Telegram/SourceFiles/ui/text/text_block.cpp b/Telegram/SourceFiles/ui/text/text_block.cpp +index f89644e..35230cf 100644 +--- a/Telegram/SourceFiles/ui/text/text_block.cpp ++++ b/Telegram/SourceFiles/ui/text/text_block.cpp +@@ -330,7 +330,7 @@ TextBlock::TextBlock(const style::font &font, const QString &str, QFixed minResi + SignalHandlers::setCrashAnnotationRef("CrashString", &part); + + QStackTextEngine engine(part, blockFont->f); +- QTextLayout layout(&engine); ++ QTextLayout layout(part, blockFont->f); + layout.beginLayout(); + layout.createLine(); + +diff --git a/Telegram/SourceFiles/ui/twidget.cpp b/Telegram/SourceFiles/ui/twidget.cpp +index e9848ef..dcee47e 100644 +--- a/Telegram/SourceFiles/ui/twidget.cpp ++++ b/Telegram/SourceFiles/ui/twidget.cpp +@@ -191,9 +191,9 @@ void sendSynteticMouseEvent(QWidget *widget, QEvent::Type type, Qt::MouseButton + , button + , QGuiApplication::mouseButtons() | button + , QGuiApplication::keyboardModifiers() +-#ifndef OS_MAC_OLD ++#if !defined(OS_MAC_OLD) && QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) + , Qt::MouseEventSynthesizedByApplication +-#endif // OS_MAC_OLD ++#endif + ); + ev.setTimestamp(getms()); + QGuiApplication::sendEvent(windowHandle, &ev); +diff --git a/Telegram/ThirdParty/minizip/ioapi.c b/Telegram/ThirdParty/minizip/ioapi.c +index 7f5c191..649255c 100644 +--- a/Telegram/ThirdParty/minizip/ioapi.c ++++ b/Telegram/ThirdParty/minizip/ioapi.c +@@ -14,7 +14,7 @@ + #define _CRT_SECURE_NO_WARNINGS + #endif + +-#if defined(__APPLE__) || defined(IOAPI_NO_64) ++#if defined(__APPLE__) || defined(IOAPI_NO_64) || defined(__HAIKU__) + // In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions + #define FOPEN_FUNC(filename, mode) fopen(filename, mode) + #define FTELLO_FUNC(stream) ftello(stream) +diff --git a/Telegram/gyp/PrecompiledHeader.cmake b/Telegram/gyp/PrecompiledHeader.cmake +index 5d6830e..c3f08d3 100644 +--- a/Telegram/gyp/PrecompiledHeader.cmake ++++ b/Telegram/gyp/PrecompiledHeader.cmake +@@ -112,7 +112,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)") +@@ -123,7 +123,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 ${_name} for ${_target} (C++)") diff --git a/Telegram/gyp/Telegram.gyp b/Telegram/gyp/Telegram.gyp -index 91ffc3c..d4fe27a 100644 +index 0d1f38a..e716483 100644 --- a/Telegram/gyp/Telegram.gyp +++ b/Telegram/gyp/Telegram.gyp -@@ -25,7 +25,7 @@ - 'target_name': 'Telegram', - 'variables': { - 'variables': { -- 'libs_loc': '../../../Libraries', -+ 'libs_loc': '../../../LibrariesHERE', - }, - 'libs_loc': '<(libs_loc)', - 'src_loc': '../SourceFiles', -diff --git a/Telegram/gyp/telegram_linux.gypi b/Telegram/gyp/telegram_linux.gypi -index 3064f26..8e2feb2 100644 ---- a/Telegram/gyp/telegram_linux.gypi -+++ b/Telegram/gyp/telegram_linux.gypi -@@ -33,7 +33,7 @@ - 'linux_path_va%': '/usr/local', - 'linux_path_vdpau%': '/usr/local', - 'linux_path_breakpad%': '<(libs_loc)/breakpad', -- 'linux_path_opus_include%': '/boot/system/develop/headers/opus', -+ 'linux_path_opus_include%': '/system/develop/headers/opus', - }, +@@ -69,6 +69,7 @@ + 'telegram_win.gypi', + 'telegram_mac.gypi', + 'telegram_linux.gypi', ++ 'telegram_haiku.gypi', + 'qt.gypi', + 'qt_rcc.gypi', + 'codegen_rules.gypi', +@@ -80,12 +81,10 @@ + 'codegen.gyp:codegen_numbers', + 'codegen.gyp:codegen_style', + 'tests/tests.gyp:tests', +- 'utils.gyp:Updater', +- '../ThirdParty/libtgvoip/libtgvoip.gyp:libtgvoip', ++# '../ThirdParty/libtgvoip/libtgvoip.gyp:libtgvoip', + ], + + 'defines': [ +- 'AL_LIBTYPE_STATIC', + 'AL_ALEXT_PROTOTYPES', + 'TGVOIP_USE_CXX11_LIB', + ' /dev/null --libs <@(pkgconfig_libs))', ++ ], ++ 'configurations': { ++ 'Release': { ++ 'cflags': [ ++ '-Ofast', ++ '-flto', ++ '-fno-strict-aliasing', ++ ], ++ 'cflags_cc': [ ++ '-Ofast', ++ '-flto', ++ '-fno-strict-aliasing', ++ ], ++ 'ldflags': [ ++ '-Ofast', ++ '-flto', ++ ], ++ }, ++ }, ++ 'cmake_precompiled_header': '<(src_loc)/stdafx.h', ++ 'cmake_precompiled_header_script': 'PrecompiledHeader.cmake', ++ }]], ++} +diff --git a/Telegram/gyp/telegram_qrc.gypi b/Telegram/gyp/telegram_qrc.gypi +index 4bf4033..8fdd119 100644 +--- a/Telegram/gyp/telegram_qrc.gypi ++++ b/Telegram/gyp/telegram_qrc.gypi +@@ -34,6 +34,13 @@ + ], + } + }], ++ [ 'build_haiku', { ++ 'variables': { ++ 'qrc_files': [ ++ '<(res_loc)/qrc/telegram_haiku.qrc', ++ ], ++ } ++ }], + [ 'build_mac', { + 'variables': { + 'qrc_files': [ +diff --git a/Telegram/gyp/telegram_sources.txt b/Telegram/gyp/telegram_sources.txt +index ef66965..58f2789 100644 +--- a/Telegram/gyp/telegram_sources.txt ++++ b/Telegram/gyp/telegram_sources.txt +@@ -302,6 +302,10 @@ + <(src_loc)/mtproto/type_utils.h + <(src_loc)/overview/overview_layout.cpp + <(src_loc)/overview/overview_layout.h ++<(src_loc)/platform/haiku/main_window_haiku.cpp ++<(src_loc)/platform/haiku/main_window_haiku.h ++<(src_loc)/platform/haiku/specific_haiku.cpp ++<(src_loc)/platform/haiku/specific_haiku.h + <(src_loc)/platform/linux/linux_desktop_environment.cpp + <(src_loc)/platform/linux/linux_desktop_environment.h + <(src_loc)/platform/linux/linux_gdk_helper.cpp +@@ -599,13 +603,7 @@ + <(emoji_suggestions_loc)/emoji_suggestions.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: mac + <(sp_media_key_tap_loc)/SPMediaKeyTap.m diff --git a/Telegram/gyp/utils.gyp b/Telegram/gyp/utils.gyp -index 209c737..fe09416 100644 +index 209c737..63b3ec5 100644 --- a/Telegram/gyp/utils.gyp +++ b/Telegram/gyp/utils.gyp -@@ -24,7 +24,7 @@ - 'targets': [{ - 'target_name': 'Updater', - 'variables': { -- 'libs_loc': '../../../Libraries', -+ 'libs_loc': '../../../LibrariesHERE2', - 'src_loc': '../SourceFiles', - 'res_loc': '../Resources', - }, +@@ -91,6 +91,13 @@ + 'lzma', + ], + }], ++ [ 'build_haiku', { ++ 'libraries': [ ++ 'ssl', ++ 'crypto', ++ 'lzma', ++ ], ++ }], + [ 'build_mac', { + 'include_dirs': [ + '<(libs_loc)/openssl-xcode/include' -- 2.13.1 diff --git a/net-im/tdesktop/patches/telegram.diff b/net-im/tdesktop/patches/telegram.diff deleted file mode 100644 index 52b73d0d8..000000000 --- a/net-im/tdesktop/patches/telegram.diff +++ /dev/null @@ -1,128 +0,0 @@ -diff --git a/Telegram/SourceFiles/base/build_config.h b/Telegram/SourceFiles/base/build_config.h -index 17316303..3a93c274 100644 ---- a/Telegram/SourceFiles/base/build_config.h -+++ b/Telegram/SourceFiles/base/build_config.h -@@ -30,13 +30,15 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org - #define OS_LINUX 1 - #elif defined(_WIN32) // __APPLE__ || __linux__ - #define OS_WIN 1 -+#elif defined(__HAIKU__) // __APPLE__ || __linux__ -+#define OS_HAIKU 1 - #else // __APPLE__ || __linux__ || _WIN32 - #error Please add support for your platform in base/build_config.h - #endif // else for __APPLE__ || __linux__ || _WIN32 - - // For access to standard POSIXish features, use OS_POSIX instead of a - // more specific macro. --#if defined(OS_MAC) || defined(OS_LINUX) -+#if defined(OS_MAC) || defined(OS_LINUX) || defined(OS_HAIKU) - #define OS_POSIX 1 - #endif // OS_MAC || OS_LINUX - -diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h -index 633c4e4a..0d09e7d2 100644 ---- a/Telegram/SourceFiles/config.h -+++ b/Telegram/SourceFiles/config.h -@@ -272,6 +272,8 @@ inline const char *cApiDeviceModel() { - return "Mac"; - #elif defined Q_OS_LINUX - return "PC"; -+#elif defined Q_OS_HAIKU -+ return "PC"; - #endif - } - inline const char *cApiSystemVersion() { -@@ -281,6 +283,8 @@ inline const char *cApiSystemVersion() { - return "OS X"; - #elif defined Q_OS_LINUX - return "Linux"; -+#elif defined Q_OS_Haiku -+ return "Haiku"; - #endif - } - -diff --git a/Telegram/SourceFiles/ui/effects/panel_animation.h b/Telegram/SourceFiles/ui/effects/panel_animation.h -index 2e35ece1..2a879a0d 100644 ---- a/Telegram/SourceFiles/ui/effects/panel_animation.h -+++ b/Telegram/SourceFiles/ui/effects/panel_animation.h -@@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org - */ - #pragma once - --#include "styles/style_widgets.h" -+//#include "styles/style_widgets.h" - - namespace Ui { - -diff --git a/Telegram/SourceFiles/ui/emoji_config.h b/Telegram/SourceFiles/ui/emoji_config.h -index d580ba7a..3d844a43 100644 ---- a/Telegram/SourceFiles/ui/emoji_config.h -+++ b/Telegram/SourceFiles/ui/emoji_config.h -@@ -21,7 +21,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org - #pragma once - - #include "ui/text/text.h" --#include "emoji.h" -+//#include "emoji.h" - - namespace Ui { - namespace Emoji { -diff --git a/Telegram/SourceFiles/ui/text/text.h b/Telegram/SourceFiles/ui/text/text.h -index f5bcd66d..272dbc80 100644 ---- a/Telegram/SourceFiles/ui/text/text.h -+++ b/Telegram/SourceFiles/ui/text/text.h -@@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org - */ - #pragma once - --#include "private/qfontengine_p.h" -+//#include "private/qfontengine_p.h" - - #include "core/click_handler.h" - #include "ui/text/text_entity.h" -diff --git a/Telegram/SourceFiles/ui/widgets/shadow.h b/Telegram/SourceFiles/ui/widgets/shadow.h -index fcce8cc1..f844881f 100644 ---- a/Telegram/SourceFiles/ui/widgets/shadow.h -+++ b/Telegram/SourceFiles/ui/widgets/shadow.h -@@ -17,7 +17,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org - */ - #pragma once - --#include "styles/style_widgets.h" -+//#include "styles/style_widgets.h" - - namespace Ui { - -diff --git a/Telegram/ThirdParty/minizip/ioapi.c b/Telegram/ThirdParty/minizip/ioapi.c -index 7f5c191b..649255c5 100644 ---- a/Telegram/ThirdParty/minizip/ioapi.c -+++ b/Telegram/ThirdParty/minizip/ioapi.c -@@ -14,7 +14,7 @@ - #define _CRT_SECURE_NO_WARNINGS - #endif - --#if defined(__APPLE__) || defined(IOAPI_NO_64) -+#if defined(__APPLE__) || defined(IOAPI_NO_64) || defined(__HAIKU__) - // In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions - #define FOPEN_FUNC(filename, mode) fopen(filename, mode) - #define FTELLO_FUNC(stream) ftello(stream) - -diff --git a/Telegram/gyp/telegram_linux.gypi b/Telegram/gyp/telegram_linux.gypi -index 2c464928..d97715c9 100644 ---- a/Telegram/gyp/telegram_linux.gypi -+++ b/Telegram/gyp/telegram_linux.gypi -@@ -74,10 +74,10 @@ - # ' /dev/null --libs <@(pkgconfig_libs))', - ], - 'cflags_cc': [ -- ' /dev/null --cflags appindicator-0.1)', -- ' /dev/null --cflags gtk+-2.0)', -- ' /dev/null --cflags glib-2.0)', -- ' /dev/null --cflags dee-1.0)', -+# ' /dev/null --cflags appindicator-0.1)', -+# ' /dev/null --cflags gtk+-2.0)', -+# ' /dev/null --cflags glib-2.0)', -+# ' /dev/null --cflags dee-1.0)', - ], - 'configurations': { - 'Release': { diff --git a/net-im/tdesktop/tdesktop-1.1.23.recipe b/net-im/tdesktop/tdesktop-1.1.23.recipe index 728486721..2758c1b22 100644 --- a/net-im/tdesktop/tdesktop-1.1.23.recipe +++ b/net-im/tdesktop/tdesktop-1.1.23.recipe @@ -11,28 +11,31 @@ SOURCE_URI_2="https://github.com/telegramdesktop/libtgvoip/archive/$COMMIT_2.zip CHECKSUM_SHA256_2="afd82dde02fb43c0e66e462a3da1d9e84ae76aa3e71d37e696c261aa151d3cdd" COMMIT_3="550ac2f159ca883d360c196149b466955c77a573" SOURCE_URI_3="https://github.com/mapbox/variant/archive/$COMMIT_3.zip" -CHECKSUM_SHA256_3="ab8f86c9234cbd976d71923e080ca70f698dd29a388e05a43f112117ceea418b" +CHECKSUM_SHA256_3="3676117c49db1ef1ff2818f6f70713c3a4469f0da8ecb5c98c157499322501fc" COMMIT_4="c5851a8161938798c5594a66420cb814fea92711" SOURCE_URI_4="https://github.com/Microsoft/GSL/archive/$COMMIT_4.zip" CHECKSUM_SHA256_4="2fe4befdd1cd69de435797c8c50cd7ce749d140982f2260eead90f31721d2c95" COMMIT_5="5ca44b68721833ae3731802ed99af67c6f38a53a" SOURCE_URI_5="https://github.com/philsquared/Catch/archive/$COMMIT_5.zip" +CHECKSUM_SHA256_5="3774ee51ab7a14045b151c4f8927b85349436525f1fefe033f6e5772752f9cd9" ADDITIONAL_FILES="tdesktop.rdef.in" PATCHES="tdesktop-$portVersion.patchset" ARCHITECTURES="!x86_gcc2 ?x86_64" -SECONDARY_ARCHITECTURES="x86" +SECONDARY_ARCHITECTURES="?x86" PROVIDES=" - telegram$secondaryArchSuffix = $portVersion + tdesktop$secondaryArchSuffix = $portVersion app:Telegram$secondaryArchSuffix " REQUIRES=" haiku$secondaryArchSuffix + lib:libavcodec$secondaryArchSuffix lib:libcrypto$secondaryArchSuffix lib:libglib_2.0$secondaryArchSuffix lib:libgthread_2.0$secondaryArchSuffix + lib:liblzma$secondaryArchSuffix lib:libopus$secondaryArchSuffix lib:libQt5Core$secondaryArchSuffix lib:libQt5Gui$secondaryArchSuffix @@ -48,9 +51,11 @@ REQUIRES=" " BUILD_REQUIRES=" haiku${secondaryArchSuffix}_devel + devel:libavcodec$secondaryArchSuffix devel:libcrypto$secondaryArchSuffix devel:libglib_2.0$secondaryArchSuffix devel:libgthread_2.0$secondaryArchSuffix + devel:liblzma$secondaryArchSuffix devel:libopus$secondaryArchSuffix devel:libQt5Core$secondaryArchSuffix devel:libQt5Gui$secondaryArchSuffix @@ -62,7 +67,6 @@ BUILD_REQUIRES=" devel:libQt5WebKitWidgets$secondaryArchSuffix devel:libQt5Widgets$secondaryArchSuffix devel:libQt5Xml$secondaryArchSuffix - devel:libxcb$secondaryArchSuffix devel:libz$secondaryArchSuffix " BUILD_PREREQUIRES=" @@ -76,23 +80,12 @@ BUILD_PREREQUIRES=" BUILD() { # link submodules - ln -sfn $sourceDir2 Telegram/ThirdParty/libtgvoip - ln -sfn $sourceDir3 Telegram/ThirdParty/variant - ln -sfn $sourceDir4 Telegram/ThirdParty/GSL - ln -sfn $sourceDir5 Telegram/ThirdParty/Catch + ln -sfn $sourceDir2/libtgvoip-$COMMIT_2 Telegram/ThirdParty/libtgvoip + ln -sfn $sourceDir3/variant-$COMMIT_3 Telegram/ThirdParty/variant + ln -sfn $sourceDir4/GSL-$COMMIT_4 Telegram/ThirdParty/GSL + ln -sfn $sourceDir5/Catch-$COMMIT_5 Telegram/ThirdParty/Catch -# ln -sfn $sourceDir2/libtgvoip-$COMMIT_2 Telegram/ThirdParty/libtgvoip -# ln -sfn $sourceDir3/variant-$COMMIT_3 Telegram/ThirdParty/variant -# ln -sfn $sourceDir4/GSL-$COMMIT_4 Telegram/ThirdParty/GSL -# ln -sfn $sourceDir5/Catch-$COMMIT_5 Telegram/ThirdParty/Catch - -# ln -sfn ../../../../sources-2/libtgvoip-757a5d8ec31aadcf387ac3cb135256152c18de1c Telegram/ThirdParty/libtgvoip -# ln -sfn ../../../../sources-3/variant-550ac2f159ca883d360c196149b466955c77a573 Telegram/ThirdParty/variant -# ln -sfn ../../../../sources-4/GSL-c5851a8161938798c5594a66420cb814fea92711 Telegram/ThirdParty/GSL -# ln -sfn ../../../../sources-5/Catch-5ca44b68721833ae3731802ed99af67c6f38a53a Telegram/ThirdParty/Catch - - cd Telegram ; gyp/refresh.sh - cd ../out/Release + Telegram/gyp/refresh.sh ; cd out/Release make $jobArgs }