diff --git a/net-im/telegram-desktop/patches/gcc8fixes-2.7.1.patchset b/net-im/telegram-desktop/patches/gcc8fixes-2.7.1.patchset new file mode 100644 index 000000000..d9d9424c2 --- /dev/null +++ b/net-im/telegram-desktop/patches/gcc8fixes-2.7.1.patchset @@ -0,0 +1,182 @@ +From fc3cc9c17c70402f8498db2921d2b18f650fea4a Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Sun, 21 Mar 2021 13:08:14 +1000 +Subject: Workaround build issues on GCC8 + + +diff --git a/Telegram/SourceFiles/calls/calls_group_panel.cpp b/Telegram/SourceFiles/calls/calls_group_panel.cpp +index e659dc0..6b6cf46 100644 +--- a/Telegram/SourceFiles/calls/calls_group_panel.cpp ++++ b/Telegram/SourceFiles/calls/calls_group_panel.cpp +@@ -291,9 +291,9 @@ Panel::Panel(not_null call) + call->allowedToSpeakNotifications( + ) | rpl::start_with_next([=] { + if (isActive()) { +- Ui::ShowMultilineToast({ +- .parentOverride = widget(), ++ Ui::ShowMultilineToast(Ui::MultilineToastArgs{ + .text = { tr::lng_group_call_can_speak_here(tr::now) }, ++ .parentOverride = widget(), + }); + } else { + const auto real = _peer->groupCall(); +@@ -536,9 +536,9 @@ void Panel::initWithCall(GroupCall *call) { + _layerBg->showBox(std::move(next)); + }; + const auto showToast = [=](QString text) { +- Ui::ShowMultilineToast({ +- .parentOverride = widget(), ++ Ui::ShowMultilineToast(Ui::MultilineToastArgs{ + .text = { text }, ++ .parentOverride = widget(), + }); + }; + auto [shareLinkCallback, shareLinkLifetime] = ShareInviteLinkAction( +@@ -610,13 +610,13 @@ void Panel::setupJoinAsChangedToasts() { + return (state == State::Joined); + }) | rpl::take(1); + }) | rpl::flatten_latest() | rpl::start_with_next([=] { +- Ui::ShowMultilineToast({ +- .parentOverride = widget(), ++ Ui::ShowMultilineToast(Ui::MultilineToastArgs{ + .text = tr::lng_group_call_join_as_changed( + tr::now, + lt_name, + Ui::Text::Bold(_call->joinAs()->name), + Ui::Text::WithEntities), ++ .parentOverride = widget(), + }); + }, widget()->lifetime()); + } +@@ -630,13 +630,13 @@ void Panel::setupTitleChangedToasts() { + ? _peer->name + : _peer->groupCall()->title(); + }) | rpl::start_with_next([=](const QString &title) { +- Ui::ShowMultilineToast({ +- .parentOverride = widget(), ++ Ui::ShowMultilineToast(Ui::MultilineToastArgs{ + .text = tr::lng_group_call_title_changed( + tr::now, + lt_title, + Ui::Text::Bold(title), + Ui::Text::WithEntities), ++ .parentOverride = widget(), + }); + }, widget()->lifetime()); + } +@@ -660,9 +660,9 @@ void Panel::subscribeToChanges(not_null real) { + const auto skip = st::groupCallRecordingMarkSkip; + _recordingMark->resize(size + 2 * skip, size + 2 * skip); + _recordingMark->setClickedCallback([=] { +- Ui::ShowMultilineToast({ +- .parentOverride = widget(), ++ Ui::ShowMultilineToast(Ui::MultilineToastArgs{ + .text = { tr::lng_group_call_is_recorded(tr::now) }, ++ .parentOverride = widget(), + }); + }); + const auto animate = [=] { +@@ -699,8 +699,7 @@ void Panel::subscribeToChanges(not_null real) { + ) | rpl::distinct_until_changed( + ) | rpl::start_with_next([=](bool recorded) { + validateRecordingMark(recorded); +- Ui::ShowMultilineToast({ +- .parentOverride = widget(), ++ Ui::ShowMultilineToast(Ui::MultilineToastArgs{ + .text = (recorded + ? tr::lng_group_call_recording_started + : (_call && _call->recordingStoppedByMe()) +@@ -708,6 +707,7 @@ void Panel::subscribeToChanges(not_null real) { + : tr::lng_group_call_recording_stopped)( + tr::now, + Ui::Text::RichLangValue), ++ .parentOverride = widget(), + }); + }, widget()->lifetime()); + validateRecordingMark(real->recordStartDate() != 0); +@@ -760,9 +760,9 @@ void Panel::chooseJoinAs() { + _layerBg->showBox(std::move(next)); + }; + const auto showToast = [=](QString text) { +- Ui::ShowMultilineToast({ +- .parentOverride = widget(), ++ Ui::ShowMultilineToast(Ui::MultilineToastArgs{ + .text = { text }, ++ .parentOverride = widget(), + }); + }; + _joinAsProcess.start( +@@ -857,23 +857,23 @@ void Panel::addMembers() { + } + const auto result = call->inviteUsers(users); + if (const auto user = std::get_if>(&result)) { +- Ui::ShowMultilineToast({ +- .parentOverride = widget(), ++ Ui::ShowMultilineToast(Ui::MultilineToastArgs{ + .text = tr::lng_group_call_invite_done_user( + tr::now, + lt_user, + Ui::Text::Bold((*user)->firstName), + Ui::Text::WithEntities), ++ .parentOverride = widget(), + }); + } else if (const auto count = std::get_if(&result)) { + if (*count > 0) { +- Ui::ShowMultilineToast({ +- .parentOverride = widget(), ++ Ui::ShowMultilineToast(Ui::MultilineToastArgs{ + .text = tr::lng_group_call_invite_done_many( + tr::now, + lt_count, + *count, + Ui::Text::RichLangValue), ++ .parentOverride = widget(), + }); + } + } else { +diff --git a/Telegram/SourceFiles/calls/calls_group_settings.cpp b/Telegram/SourceFiles/calls/calls_group_settings.cpp +index 42491c7..041fab3 100644 +--- a/Telegram/SourceFiles/calls/calls_group_settings.cpp ++++ b/Telegram/SourceFiles/calls/calls_group_settings.cpp +@@ -535,9 +535,9 @@ void SettingsBox( + box->getDelegate()->show(std::move(next)); + }); + const auto showToast = crl::guard(box, [=](QString text) { +- Ui::ShowMultilineToast({ +- .parentOverride = box->getDelegate()->outerContainer(), ++ Ui::ShowMultilineToast(Ui::MultilineToastArgs{ + .text = { text }, ++ .parentOverride = box->getDelegate()->outerContainer(), + }); + }); + auto [shareLinkCallback, shareLinkLifetime] = ShareInviteLinkAction( +@@ -573,9 +573,9 @@ void SettingsBox( + } + QGuiApplication::clipboard()->setText(link); + if (weakBox) { +- Ui::ShowMultilineToast({ +- .parentOverride = box->getDelegate()->outerContainer(), ++ Ui::ShowMultilineToast(Ui::MultilineToastArgs{ + .text = { tr::lng_create_channel_link_copied(tr::now) }, ++ .parentOverride = box->getDelegate()->outerContainer(), + }); + } + return true; +diff --git a/Telegram/SourceFiles/ui/toasts/common_toasts.h b/Telegram/SourceFiles/ui/toasts/common_toasts.h +index ebf1efe..33b1db0 100644 +--- a/Telegram/SourceFiles/ui/toasts/common_toasts.h ++++ b/Telegram/SourceFiles/ui/toasts/common_toasts.h +@@ -12,9 +12,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL + namespace Ui { + + struct MultilineToastArgs { +- QWidget *parentOverride = nullptr; + TextWithEntities text; + crl::time duration = 0; ++ QWidget *parentOverride = nullptr; + }; + + void ShowMultilineToast(MultilineToastArgs &&args); +-- +2.30.2 + diff --git a/net-im/telegram-desktop/patches/libtgvoip-2.7.0.patchset b/net-im/telegram-desktop/patches/libtgvoip-2.7.1.patchset similarity index 98% rename from net-im/telegram-desktop/patches/libtgvoip-2.7.0.patchset rename to net-im/telegram-desktop/patches/libtgvoip-2.7.1.patchset index 8f95f5c0b..27bf89c91 100644 --- a/net-im/telegram-desktop/patches/libtgvoip-2.7.0.patchset +++ b/net-im/telegram-desktop/patches/libtgvoip-2.7.1.patchset @@ -1,6 +1,6 @@ -From 0d54874c16b406da080f6995be872999d783ffeb Mon Sep 17 00:00:00 2001 +From 2127b20c02768156a93701f9f8b4f63bc9970a26 Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> -Date: Fri, 26 Feb 2021 21:24:04 +1000 +Date: Sun, 21 Mar 2021 11:45:25 +1000 Subject: Add Haiku support @@ -883,10 +883,10 @@ index 0bc42eb..c87cde9 100644 typedef pid_t PlatformThreadId; typedef pthread_t PlatformThreadRef; diff --git a/Telegram/cmake/lib_tgvoip.cmake b/Telegram/cmake/lib_tgvoip.cmake -index 74d4f26..b1f82ab 100644 +index 7616728..f120a69 100644 --- a/Telegram/cmake/lib_tgvoip.cmake +++ b/Telegram/cmake/lib_tgvoip.cmake -@@ -120,6 +120,14 @@ if (NOT TGVOIP_FOUND) +@@ -123,6 +123,14 @@ if (NOT TGVOIP_FOUND) os/linux/AudioPulse.cpp os/linux/AudioPulse.h @@ -901,7 +901,7 @@ index 74d4f26..b1f82ab 100644 # POSIX os/posix/NetworkSocketPosix.cpp os/posix/NetworkSocketPosix.h -@@ -157,6 +165,37 @@ if (NOT TGVOIP_FOUND) +@@ -160,6 +168,37 @@ if (NOT TGVOIP_FOUND) TGVOIP_NO_OSX_PRIVATE_API ) endif() @@ -939,15 +939,6 @@ index 74d4f26..b1f82ab 100644 else() target_compile_options(lib_tgvoip_bundled PRIVATE -@@ -179,7 +218,7 @@ if (NOT TGVOIP_FOUND) - desktop-app::external_opus - ) - -- if (LINUX) -+ if (LINUX AND NOT HAIKU) - find_package(PkgConfig REQUIRED) - find_package(ALSA REQUIRED) - pkg_check_modules(PULSE REQUIRED libpulse) -- -2.30.0 +2.30.2 diff --git a/net-im/telegram-desktop/patches/telegram_desktop-2.7.0.patchset b/net-im/telegram-desktop/patches/telegram_desktop-2.7.1.patchset similarity index 92% rename from net-im/telegram-desktop/patches/telegram_desktop-2.7.0.patchset rename to net-im/telegram-desktop/patches/telegram_desktop-2.7.1.patchset index d2eb94f2c..367fcb92a 100644 --- a/net-im/telegram-desktop/patches/telegram_desktop-2.7.0.patchset +++ b/net-im/telegram-desktop/patches/telegram_desktop-2.7.1.patchset @@ -1,7 +1,7 @@ -From fec486f3e53656766d82b43a9d3e9c8de8c089aa Mon Sep 17 00:00:00 2001 +From 266ede233d6089b71460a589144d31ed3098e1c9 Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> -Date: Sat, 27 Feb 2021 19:35:13 +1000 -Subject: Add haiku support +Date: Sun, 21 Mar 2021 11:46:03 +1000 +Subject: Add Haiku support diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt @@ -367,10 +367,23 @@ index 0000000..3926290 +} // namespace Notifications +} // namespace Platform diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp -index f297918..9459434 100644 +index f6b53fa..e92f64a 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp -@@ -529,7 +529,7 @@ QString GetHomeDir() { +@@ -7,6 +7,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL + */ + #include "platform/linux/specific_linux.h" + ++#ifdef __HAIKU__ ++#define _SUPPORT_DEFS_H ++typedef int32 status_t; ++typedef uint32 type_code; ++#endif ++ + #include "base/openssl_help.h" + #include "base/platform/base_platform_info.h" + #include "base/platform/linux/base_linux_glibmm_helper.h" +@@ -595,7 +601,7 @@ QString GetHomeDir() { return home; } @@ -379,7 +392,7 @@ index f297918..9459434 100644 void HaikuAutostart(bool start) { const auto home = GetHomeDir(); if (home.isEmpty()) { -@@ -554,7 +554,7 @@ void HaikuAutostart(bool start) { +@@ -620,7 +626,7 @@ void HaikuAutostart(bool start) { file.remove(); } } @@ -388,7 +401,7 @@ index f297918..9459434 100644 } // namespace -@@ -571,8 +571,11 @@ QString psAppDataPath() { +@@ -637,8 +643,11 @@ QString psAppDataPath() { return oldPath; } } @@ -401,7 +414,7 @@ index f297918..9459434 100644 } void psDoCleanup() { -@@ -786,7 +789,7 @@ bool OpenSystemSettings(SystemSettingsType type) { +@@ -857,7 +866,7 @@ bool OpenSystemSettings(SystemSettingsType type) { } else if (DesktopEnvironment::IsMATE()) { add("mate-volume-control"); } @@ -410,7 +423,7 @@ index f297918..9459434 100644 add("Media"); #endif // __ HAIKU__ add("pavucontrol-qt"); -@@ -835,17 +838,17 @@ void finish() { +@@ -906,17 +915,17 @@ void finish() { } // namespace Platform void psNewVersion() { @@ -540,23 +553,49 @@ index 81f9a7b..38d81f9 100644 elseif (LINUX) set_source_files_properties(${not_linux_sources} PROPERTIES HEADER_FILE_ONLY TRUE) set_source_files_properties(${not_linux_sources} PROPERTIES SKIP_AUTOGEN TRUE) -diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp -index 9459434..f8d8516 100644 ---- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp -+++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp -@@ -7,6 +7,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL - */ - #include "platform/linux/specific_linux.h" - -+#ifdef __HAIKU__ -+#define _SUPPORT_DEFS_H -+typedef int32 status_t; -+typedef uint32 type_code; -+#endif -+ - #include "base/openssl_help.h" - #include "base/platform/base_platform_info.h" - #include "base/platform/linux/base_linux_glibmm_helper.h" -- 2.30.2 + +From 8b713808ca7d568b7a69adacec7b62a76b03813f Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Sun, 21 Mar 2021 13:06:10 +1000 +Subject: Remove snap for Haiku + + +diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp +index e92f64a..e74e05d 100644 +--- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp ++++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp +@@ -207,6 +207,7 @@ PortalAutostart::PortalAutostart(bool start, bool silent) { + } + } + ++#ifndef Q_OS_HAIKU + class SnapDefaultHandler : public QWindow { + public: + SnapDefaultHandler(const QString &protocol); +@@ -268,6 +269,7 @@ SnapDefaultHandler::SnapDefaultHandler(const QString &protocol) { + QString::fromStdString(e.what()))); + } + } ++#endif + + bool IsIBusPortalPresent() { + static const auto Result = [&] { +@@ -763,11 +765,12 @@ void InstallLauncher(bool force) { + + void RegisterCustomScheme(bool force) { + try { ++#ifndef Q_OS_HAIKU + if (InSnap()) { + SnapDefaultHandler(qsl("tg")); + return; + } +- ++#endif + if (cExeName().isEmpty()) { + return; + } +-- +2.30.2 diff --git a/net-im/telegram-desktop/telegram_desktop-2.7.0.recipe b/net-im/telegram-desktop/telegram_desktop-2.7.1.recipe similarity index 93% rename from net-im/telegram-desktop/telegram_desktop-2.7.0.recipe rename to net-im/telegram-desktop/telegram_desktop-2.7.1.recipe index 246cabae1..6d57dc2c9 100644 --- a/net-im/telegram-desktop/telegram_desktop-2.7.0.recipe +++ b/net-im/telegram-desktop/telegram_desktop-2.7.1.recipe @@ -3,9 +3,9 @@ DESCRIPTION="Unofficial build of the original Telegram client for Haiku." HOMEPAGE="https://www.telegram.org/" COPYRIGHT="2013-2021 Telegram" LICENSE="GNU GPL v3" -REVISION="3" +REVISION="1" SOURCE_URI="https://github.com/telegramdesktop/tdesktop/releases/download/v$portVersion/tdesktop-$portVersion-full.tar.gz" -CHECKSUM_SHA256="ee50aa82e0c0515c2082a37496ffb65c7f83bd117805ee5bf9147c1777770337" +CHECKSUM_SHA256="41bfbe1ee63da9a6af7cf7d11b1cdd13a6754b51b294ac5a9d56f5f11dfbdd05" SOURCE_FILENAME="tdesktop-$portVersion-full.tar.gz" SOURCE_DIR="tdesktop-$portVersion-full" srcGitRev_2="2b383fe05f8ae78ac99470b9a2b9ea22b3ee5a92" @@ -15,7 +15,9 @@ CHECKSUM_SHA256_2="613e7e357518739e1f7d035337f37c344b248283fd4d916ddc95df73c2ff8 PATCHES=" libtgvoip-$portVersion.patchset telegram_desktop-$portVersion.patchset + gcc8fixes-$portVersion.patchset " + ADDITIONAL_FILES="telegram_desktop.rdef.in" ARCHITECTURES="!x86_gcc2 x86_64" @@ -57,7 +59,6 @@ REQUIRES=" BUILD_REQUIRES=" haiku${secondaryArchSuffix}_devel - gcc${secondaryArchSuffix}_syslibs devel:libavcodec$secondaryArchSuffix devel:libavformat$secondaryArchSuffix devel:libavutil$secondaryArchSuffix @@ -78,7 +79,6 @@ BUILD_REQUIRES=" devel:libQt5Network$secondaryArchSuffix devel:libQt5Widgets$secondaryArchSuffix devel:librapidjson$secondaryArchSuffix - devel:libstdc++$secondaryArchSuffix devel:libswresample$secondaryArchSuffix devel:libswscale$secondaryArchSuffix devel:libtg_owt$secondaryArchSuffix @@ -89,8 +89,6 @@ BUILD_REQUIRES=" BUILD_PREREQUIRES=" cmd:cmake cmd:gcc$secondaryArchSuffix - cmd:clang >= 9 - cmd:clang++ >= 9 cmd:lrelease$secondaryArchSuffix >= 5 cmd:make cmd:pkg_config$secondaryArchSuffix @@ -101,8 +99,6 @@ BUILD_PREREQUIRES=" BUILD() { - export CC=/bin/clang - export CXX=/bin/clang++ export DISABLE_ASLR=1 # get API_ID and API_HASH from Debian @@ -127,8 +123,6 @@ BUILD() cmake .. \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_C_FLAGS="-Wno-unknown-warning-option" \ - -DCMAKE_CXX_FLAGS="-Wno-unknown-warning-option" \ -DTDESKTOP_API_TEST=OFF \ -DTDESKTOP_DISABLE_GTK_INTEGRATION=ON \ -DDESKTOP_APP_DISABLE_CRASH_REPORTS=ON \ @@ -140,10 +134,12 @@ BUILD() -DDESKTOP_APP_USE_PACKAGED_FONTS=OFF \ -DDESKTOP_APP_USE_HUNSPELL_ONLY=ON \ -DTDESKTOP_USE_PACKAGED_TGVOIP=OFF \ + -DLIBTGVOIP_DISABLE_ALSA=ON \ + -DLIBTGVOIP_DISABLE_PULSEAUDIO=ON \ -DTDESKTOP_API_ID=$TELEGRAM_API_ID \ - -DTDESKTOP_API_HASH=$TELEGRAM_API_HASH + -DTDESKTOP_API_HASH=$TELEGRAM_API_HASH - make + make $jobArgs } INSTALL()