mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-23 04:00:05 +02:00
Telegram: bump version, add Tracker add-on
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
From 01c0b3d70db3839658e8ac708d3732e7745a8368 Mon Sep 17 00:00:00 2001
|
||||
From 08824027b015a014c40d7573b70c62e99b636c79 Mon Sep 17 00:00:00 2001
|
||||
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
||||
Date: Sun, 1 Oct 2023 11:17:20 +1000
|
||||
Date: Sun, 29 Oct 2023 22:21:07 +1000
|
||||
Subject: Add Haiku support
|
||||
|
||||
|
||||
@@ -928,5 +928,5 @@ index 886cd99..705a6a2 100644
|
||||
add_library(lib_tgvoip_bundled_options INTERFACE)
|
||||
target_compile_options(lib_tgvoip_bundled_options
|
||||
--
|
||||
2.37.3
|
||||
2.42.0
|
||||
|
||||
@@ -1,14 +1,124 @@
|
||||
From da33d89b0b732e9a4f0816ed82795a5b6a84dc0a Mon Sep 17 00:00:00 2001
|
||||
From 1c037eefb43624e8d192d3096777a0f9d0319471 Mon Sep 17 00:00:00 2001
|
||||
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
||||
Date: Sun, 1 Oct 2023 11:46:07 +1000
|
||||
Date: Mon, 30 Oct 2023 20:41:28 +1000
|
||||
Subject: Add Haiku support
|
||||
|
||||
|
||||
diff --git a/SendToAddon/Makefile b/SendToAddon/Makefile
|
||||
new file mode 100644
|
||||
index 0000000..5098366
|
||||
--- /dev/null
|
||||
+++ b/SendToAddon/Makefile
|
||||
@@ -0,0 +1,12 @@
|
||||
+NAME = Send\ to\ Telegram
|
||||
+TYPE = SHARED
|
||||
+APP_MIME_SIG = application/x-vnd.Telegram-SendTo
|
||||
+SRCS = SendToTelegram.cpp
|
||||
+LIBS = be
|
||||
+OPTIMIZE := FULL
|
||||
+WARNINGS = NONE
|
||||
+RDEFS = resource.rdef
|
||||
+
|
||||
+DEVEL_DIRECTORY := \
|
||||
+ $(shell findpaths -r "makefile_engine" B_FIND_PATH_DEVELOP_DIRECTORY)
|
||||
+include $(DEVEL_DIRECTORY)/etc/makefile-engine
|
||||
diff --git a/SendToAddon/SendToTelegram.cpp b/SendToAddon/SendToTelegram.cpp
|
||||
new file mode 100644
|
||||
index 0000000..c68a21d
|
||||
--- /dev/null
|
||||
+++ b/SendToAddon/SendToTelegram.cpp
|
||||
@@ -0,0 +1,44 @@
|
||||
+#include <limits.h>
|
||||
+
|
||||
+#include <StorageKit.h>
|
||||
+#include <SupportKit.h>
|
||||
+#include <AppKit.h>
|
||||
+
|
||||
+#include <add-ons/tracker/TrackerAddOn.h>
|
||||
+
|
||||
+const char* kTelegramSignature = "application/x-vnd.Telegram";
|
||||
+
|
||||
+void
|
||||
+process_refs(entry_ref base_ref, BMessage* message, void* reserved)
|
||||
+{
|
||||
+ char **argv = new char*[ARG_MAX];
|
||||
+
|
||||
+ int argc = 0;
|
||||
+ argv[argc++] = strdup("-sendpath");
|
||||
+ argv[argc] = NULL;
|
||||
+
|
||||
+ BEntry entry;
|
||||
+ entry_ref ref;
|
||||
+
|
||||
+ int32 i;
|
||||
+
|
||||
+ for (i = 0; message->FindRef("refs", i, &ref) == B_OK; i++) {
|
||||
+ if (entry.SetTo(&ref, true) != B_OK)
|
||||
+ continue;
|
||||
+ if (entry.IsDirectory())
|
||||
+ continue;
|
||||
+
|
||||
+ BPath path;
|
||||
+ entry.GetPath(&path);
|
||||
+ argv[argc++] = strdup(path.Path());
|
||||
+ argv[argc] = NULL;
|
||||
+ }
|
||||
+
|
||||
+ if (argc > 1)
|
||||
+ be_roster->Launch(kTelegramSignature, argc, argv);
|
||||
+
|
||||
+ for(i = 0; argv[i] != NULL; i++)
|
||||
+ free(argv[i]);
|
||||
+
|
||||
+ delete[] argv;
|
||||
+}
|
||||
diff --git a/SendToAddon/resource.rdef b/SendToAddon/resource.rdef
|
||||
new file mode 100644
|
||||
index 0000000..e5f8b64
|
||||
--- /dev/null
|
||||
+++ b/SendToAddon/resource.rdef
|
||||
@@ -0,0 +1,36 @@
|
||||
+resource app_signature "application/x-vnd.Telegram-SendTo";
|
||||
+
|
||||
+resource app_version {
|
||||
+ major = 1,
|
||||
+ middle = 0,
|
||||
+ minor = 0,
|
||||
+ variety = 0,
|
||||
+ internal = 1,
|
||||
+
|
||||
+ short_info = "Send to Telegram",
|
||||
+ long_info = "Send selected files to Telegram"
|
||||
+};
|
||||
+
|
||||
+resource file_types message {
|
||||
+ "types" = "application/octet-stream"
|
||||
+};
|
||||
+
|
||||
+resource vector_icon {
|
||||
+ $"6E6369660604005A0500020106023F2D01ABB6552BBE233F33AF499EC5487829"
|
||||
+ $"0092B8EBFF1E5AA005F102000602BA6C443B6D6F3A833D398D6D4BD8904DC08F"
|
||||
+ $"00888A85FFB0B2AE05C4070207375FB843CE80445764584E54CF55C9897460D3"
|
||||
+ $"F9CA8775646E6873666B69656B6A6A5F6E3E773F773C77406FC039D28E346D02"
|
||||
+ $"04B454C190B454C991B454B98FC2D2B312BAD1B312CAD3B312D150C190D150B9"
|
||||
+ $"8FD150C991C2D2D00ECAD3D00EBAD1D00E0A08BD13B904D0EEBB14BF76C965BC"
|
||||
+ $"40C6D5B582CA40B954C275BCD4C187BAF4BE820A03BB01BE6FD12FBB02BD2EB9"
|
||||
+ $"250A03BBFEC63ABF76C93BD09BBB160A03D0C0BB40B971C27CB5A4CA110A03BA"
|
||||
+ $"F4BE68BCDFC17AD0D9BB1D090A000100023EE9780000000000003EA3FE41B2B1"
|
||||
+ $"4532B50A010101023F28320000000000003F1EC9C24BDB36864D0A020101023E"
|
||||
+ $"EFE40000000000003EE67BB99B69420C9F0A030102023F5FC20000000000003F"
|
||||
+ $"3403C2809BBB8D630A010102123F5FC20000000000003F3403C2809BBB8D6301"
|
||||
+ $"178522040A030103023F5FC20000000000003F3403C2809BBB8D630A04010402"
|
||||
+ $"3F5FC20000000000003F3403C2809BBB8D630A030105023F5FC2000000000000"
|
||||
+ $"3F3403C2809BBB8D630A050106023F5FC20000000000003F3403C2809BBB8D63"
|
||||
+};
|
||||
+
|
||||
+resource("BEOS:default_shortcut") "S";
|
||||
diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt
|
||||
index d555578..b1770d1 100644
|
||||
index 95ac565..612cffe 100644
|
||||
--- a/Telegram/CMakeLists.txt
|
||||
+++ b/Telegram/CMakeLists.txt
|
||||
@@ -90,6 +90,15 @@ PRIVATE
|
||||
@@ -91,6 +91,15 @@ PRIVATE
|
||||
desktop-app::external_xxhash
|
||||
)
|
||||
|
||||
@@ -24,7 +134,7 @@ index d555578..b1770d1 100644
|
||||
target_precompile_headers(Telegram PRIVATE $<$<COMPILE_LANGUAGE:CXX,OBJCXX>:${src_loc}/stdafx.h>)
|
||||
nice_target_sources(Telegram ${src_loc}
|
||||
PRIVATE
|
||||
@@ -1450,6 +1459,17 @@ if (NOT build_winstore)
|
||||
@@ -1476,6 +1485,17 @@ if (NOT build_winstore)
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -42,7 +152,7 @@ index d555578..b1770d1 100644
|
||||
if (DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION)
|
||||
remove_target_sources(Telegram ${src_loc}
|
||||
platform/linux/linux_wayland_integration.cpp
|
||||
@@ -1608,7 +1628,7 @@ if (build_macstore)
|
||||
@@ -1635,7 +1655,7 @@ if (build_macstore)
|
||||
else()
|
||||
set(bundle_identifier "com.tdesktop.Telegram$<$<CONFIG:Debug>:Debug>")
|
||||
set(bundle_entitlements "Telegram.entitlements")
|
||||
@@ -122,13 +232,13 @@ index beb06a6..38a4538 100644
|
||||
QString commands;
|
||||
const QStringList &lst(cSendPaths());
|
||||
for (QStringList::const_iterator i = lst.cbegin(), e = lst.cend(); i != e; ++i) {
|
||||
diff --git a/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp b/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp
|
||||
index 4f111a6..73330b7 100644
|
||||
--- a/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp
|
||||
+++ b/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp
|
||||
@@ -9,10 +9,35 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
|
||||
#include "platform/linux/linux_xdp_open_with_dialog.h"
|
||||
diff --git a/Telegram/SourceFiles/platform/linux/linux_xdp_open_with_dialog.cpp b/Telegram/SourceFiles/platform/linux/linux_xdp_open_with_dialog.cpp
|
||||
index e75bcb4..1a78dc6 100644
|
||||
--- a/Telegram/SourceFiles/platform/linux/linux_xdp_open_with_dialog.cpp
|
||||
+++ b/Telegram/SourceFiles/platform/linux/linux_xdp_open_with_dialog.cpp
|
||||
@@ -16,6 +16,15 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include <glibmm.h>
|
||||
#include <giomm.h>
|
||||
|
||||
+#ifdef Q_OS_HAIKU
|
||||
+#include <base/haiku_types.h>
|
||||
@@ -141,8 +251,11 @@ index 4f111a6..73330b7 100644
|
||||
+
|
||||
namespace Platform {
|
||||
namespace File {
|
||||
namespace internal {
|
||||
@@ -28,6 +37,22 @@ using base::Platform::XdgActivationToken;
|
||||
} // namespace
|
||||
|
||||
bool UnsafeShowOpenWith(const QString &filepath) {
|
||||
bool ShowXDPOpenWithDialog(const QString &filepath) {
|
||||
+#ifdef Q_OS_HAIKU
|
||||
+ BMessenger trackerMessenger("application/x-vnd.Be-TRAK");
|
||||
+ if (trackerMessenger.IsValid()) {
|
||||
@@ -158,12 +271,21 @@ index 4f111a6..73330b7 100644
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+#else
|
||||
try {
|
||||
const auto connection = Gio::DBus::Connection::get_sync(
|
||||
Gio::DBus::BusType::SESSION);
|
||||
@@ -135,7 +160,7 @@ bool ShowXDPOpenWithDialog(const QString &filepath) {
|
||||
return true;
|
||||
} catch (...) {
|
||||
}
|
||||
-
|
||||
+#endif
|
||||
return internal::ShowXDPOpenWithDialog(filepath);
|
||||
return false;
|
||||
}
|
||||
|
||||
diff --git a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp
|
||||
index 7fec6ec..bd1c804 100644
|
||||
index f4c400f..cad2787 100644
|
||||
--- a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp
|
||||
+++ b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp
|
||||
@@ -36,6 +36,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
@@ -191,7 +313,7 @@ index 7fec6ec..bd1c804 100644
|
||||
updateUnityCounter();
|
||||
}
|
||||
diff --git a/Telegram/SourceFiles/platform/linux/main_window_linux.h b/Telegram/SourceFiles/platform/linux/main_window_linux.h
|
||||
index 467f690..f1160f2 100644
|
||||
index 311ed3a..21c1ad3 100644
|
||||
--- a/Telegram/SourceFiles/platform/linux/main_window_linux.h
|
||||
+++ b/Telegram/SourceFiles/platform/linux/main_window_linux.h
|
||||
@@ -21,6 +21,9 @@ namespace Platform {
|
||||
@@ -809,7 +931,7 @@ index fcf1179..37c857e 100644
|
||||
#include <QtGui/QWindow>
|
||||
|
||||
diff --git a/Telegram/lib_base/base/platform/linux/base_power_save_blocker_linux.cpp b/Telegram/lib_base/base/platform/linux/base_power_save_blocker_linux.cpp
|
||||
index 37c8c41..67ac88c 100644
|
||||
index 549f942..668e2dd 100644
|
||||
--- a/Telegram/lib_base/base/platform/linux/base_power_save_blocker_linux.cpp
|
||||
+++ b/Telegram/lib_base/base/platform/linux/base_power_save_blocker_linux.cpp
|
||||
@@ -16,6 +16,10 @@
|
||||
@@ -938,10 +1060,10 @@ index bb6d91a..3c4a188 100644
|
||||
|
||||
#include "webrtc/webrtc_create_adm.h"
|
||||
diff --git a/cmake/external/CMakeLists.txt b/cmake/external/CMakeLists.txt
|
||||
index 2f9165b..57aa33d 100644
|
||||
index d9af92a..cd4ba1d 100644
|
||||
--- a/cmake/external/CMakeLists.txt
|
||||
+++ b/cmake/external/CMakeLists.txt
|
||||
@@ -17,7 +17,7 @@ if (add_cld3_library)
|
||||
@@ -18,7 +18,7 @@ if (add_cld3_library)
|
||||
add_checked_subdirectory(cld3)
|
||||
endif()
|
||||
add_checked_subdirectory(crash_reports)
|
||||
@@ -951,5 +1073,5 @@ index 2f9165b..57aa33d 100644
|
||||
endif()
|
||||
add_checked_subdirectory(expected)
|
||||
--
|
||||
2.37.3
|
||||
2.42.0
|
||||
|
||||
@@ -5,7 +5,7 @@ COPYRIGHT="2013-2023 Telegram"
|
||||
LICENSE="GNU GPL v3"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://github.com/telegramdesktop/tdesktop/releases/download/v$portVersion/tdesktop-$portVersion-full.tar.gz"
|
||||
CHECKSUM_SHA256="3f7aa12bf421a7fb6e9db9669f63bb6e1351cec2e7567551cef4ff2d936f2a27"
|
||||
CHECKSUM_SHA256="be7ca37fda49b790250dc9cbdf0ce801243a0ad3d54279a195573d517196bfd9"
|
||||
SOURCE_FILENAME="tdesktop-$portVersion-full.tar.gz"
|
||||
SOURCE_DIR="tdesktop-$portVersion-full"
|
||||
srcGitRev_2="2b383fe05f8ae78ac99470b9a2b9ea22b3ee5a92"
|
||||
@@ -73,9 +73,9 @@ BUILD_REQUIRES="
|
||||
qt6_tools${secondaryArchSuffix}_devel
|
||||
devel:libabsl_strings$secondaryArchSuffix >= 2301.0.0
|
||||
devel:libavcodec$secondaryArchSuffix >= 59
|
||||
devel:libboost_filesystem$secondaryArchSuffix >= 1.70.0
|
||||
devel:libboost_system$secondaryArchSuffix >= 1.70.0
|
||||
devel:libboost_program_options$secondaryArchSuffix >= 1.70.0
|
||||
devel:libboost_filesystem$secondaryArchSuffix >= 1.83.0
|
||||
devel:libboost_system$secondaryArchSuffix >= 1.83.0
|
||||
devel:libboost_program_options$secondaryArchSuffix >= 1.83.0
|
||||
devel:libcrypto$secondaryArchSuffix
|
||||
devel:libfmt$secondaryArchSuffix
|
||||
devel:libgirepository_1.0$secondaryArchSuffix
|
||||
@@ -106,12 +106,15 @@ BUILD_REQUIRES="
|
||||
devel:libz$secondaryArchSuffix
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
makefile_engine
|
||||
cmd:cmake
|
||||
cmd:gawk
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:g_ir_scanner
|
||||
cmd:make
|
||||
cmd:ninja
|
||||
cmd:pkg_config$secondaryArchSuffix
|
||||
cmd:python3.9
|
||||
cmd:python3.10
|
||||
cmd:sed
|
||||
cmd:yasm
|
||||
"
|
||||
@@ -168,6 +171,9 @@ BUILD()
|
||||
-DLZ4_INCLUDE_DIRS=/system/$relativeIncludeDir
|
||||
|
||||
ninja -C build $jobArgs
|
||||
|
||||
cd SendToAddon
|
||||
make $jobArgs
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
@@ -176,6 +182,10 @@ INSTALL()
|
||||
cp build/bin/Telegram $appsDir
|
||||
strip $appsDir/Telegram
|
||||
|
||||
pushd SendToAddon
|
||||
make install INSTALL_DIR=$addOnsDir/Tracker
|
||||
popd
|
||||
|
||||
local APP_SIGNATURE="application/x-vnd.telegram"
|
||||
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
|
||||
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
|
||||
Reference in New Issue
Block a user