Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net-im/tdlib-purple: add replacement for telegram-purple.
Deprecate the latter.
- Loading branch information
Mikhail Teterin
authored and
Mikhail Teterin
committed
Dec 18, 2023
1 parent
7e5dafe
commit e07c60d
Showing
10 changed files
with
141 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
PORTNAME= tdlib-purple | ||
DISTVERSIONPREFIX= v | ||
DISTVERSION= 0.8.1 | ||
CATEGORIES= net-im | ||
|
||
PATCH_SITES= https://github.com/ars3niy/tdlib-purple/commit/ | ||
PATCHFILES+= 8c87b899ddbec32.patch:-p1 # https://github.com/ars3niy/tdlib-purple/pull/154 | ||
|
||
MAINTAINER= mi@aldan.algebra.com | ||
COMMENT= Telegram plugin for libpurple, using tdlib | ||
WWW= https://github.com/ars3niy/tdlib-purple | ||
|
||
LICENSE= GPLv2 | ||
LICENSE_FILE= ${WRKSRC}/LICENSE | ||
|
||
LIB_DEPENDS= libfmt.so:textproc/fmtlib \ | ||
libtdapi.so:net-im/tdlib \ | ||
librlottie.so:graphics/rlottie \ | ||
libwebp.so:graphics/webp \ | ||
libpng.so:graphics/png | ||
TEST_LIB_DEPENDS=libgtest.so:devel/googletest | ||
|
||
USES= cmake localbase | ||
|
||
USE_GITHUB= yeah | ||
GH_ACCOUNT= ars3niy | ||
|
||
OPTIONS_DEFINE= NLS TEST | ||
OPTIONS_DEFAULT=NLS | ||
OPTIONS_SUB= yes | ||
TEST_DESC= Do not enable, tests are broken | ||
|
||
CMAKE_ON+= NoVoip # tgvoip is yet to be ported | ||
CMAKE_ON+= NoBundledLottie # Using graphics/rlottie | ||
NLS_CMAKE_OFF+= -DNoTranslations=1 | ||
|
||
EXTRACT_AFTER_ARGS=--exclude rlottie --exclude fmt | ||
|
||
.include <bsd.port.options.mk> | ||
|
||
.if ${PORT_OPTIONS:MTEST} | ||
WARNING+= "Tests are stale at this time and are likely to fail to compile" | ||
TEST_TARGET= tests | ||
.endif | ||
|
||
.include <bsd.port.mk> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
TIMESTAMP = 1702875649 | ||
SHA256 (ars3niy-tdlib-purple-v0.8.1_GH0.tar.gz) = 8eb8b10c714368d7435d34ccda66a918e59c4cb4d2f49b6e16a246a78abd1a62 | ||
SIZE (ars3niy-tdlib-purple-v0.8.1_GH0.tar.gz) = 776564 | ||
SHA256 (8c87b899ddbec32.patch) = b6861f1129a8e17564c2f4abfc264fc95801ad22d00326c3c05d3003fd1b3832 | ||
SIZE (8c87b899ddbec32.patch) = 11742 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- CMakeLists.txt 2021-12-17 04:50:38.000000000 -0500 | ||
+++ CMakeLists.txt 2023-12-18 00:14:18.331831000 -0500 | ||
@@ -69,4 +69,5 @@ | ||
secret-chat.cpp | ||
) | ||
+target_link_libraries(telegram-tdlib PRIVATE z) | ||
|
||
# libpurple uses the deprecated glib-type `GParameter` and the deprecated glib-macro `G_CONST_RETURN`, which | ||
@@ -94,7 +95,5 @@ | ||
|
||
set(BUILD_SHARED_LIBS OFF) | ||
-add_subdirectory(fmt) | ||
-target_compile_options(fmt PRIVATE -fPIC) | ||
-target_link_libraries(telegram-tdlib PRIVATE fmt::fmt) | ||
+target_link_libraries(telegram-tdlib PRIVATE fmt) | ||
|
||
if (NOT NoLottie) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- format.cpp 2021-12-17 04:50:38.000000000 -0500 | ||
+++ format.cpp 2023-12-18 01:10:41.084981000 -0500 | ||
@@ -1,4 +1,4 @@ | ||
#include "format.h" | ||
-#include <fmt/format.h> | ||
+#include <fmt/args.h> | ||
|
||
std::string formatMessage(const char *fmt, std::initializer_list<std::string> args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- test/CMakeLists.txt 2021-12-17 04:50:38.000000000 -0500 | ||
+++ test/CMakeLists.txt 2023-12-18 01:08:45.228855000 -0500 | ||
@@ -41,5 +41,5 @@ | ||
set_property(TARGET tests PROPERTY CXX_STANDARD 14) | ||
target_include_directories(tests PRIVATE ${CMAKE_SOURCE_DIR}) | ||
-target_link_libraries(tests PRIVATE gtest fmt::fmt Td::TdStatic ${GLIB_LIBRARIES}) | ||
+target_link_libraries(tests PRIVATE gtest fmt Td::TdStatic ${GLIB_LIBRARIES}) | ||
|
||
if (DEFINED GTEST_PATH) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
The new libpurple plugin for accessing Telegram. | ||
|
||
This is meant as a successor for telegram-purple. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
lib/purple-2/libtelegram-tdlib.so | ||
share/pixmaps/pidgin/protocols/16/telegram.png | ||
share/pixmaps/pidgin/protocols/22/telegram.png | ||
share/pixmaps/pidgin/protocols/48/telegram.png | ||
share/metainfo/tdlib-purple.metainfo.xml | ||
%%NLS%%share/locale/cs/LC_MESSAGES/tdlib-purple.mo | ||
%%NLS%%share/locale/de/LC_MESSAGES/tdlib-purple.mo | ||
%%NLS%%share/locale/pl/LC_MESSAGES/tdlib-purple.mo | ||
%%NLS%%share/locale/sq/LC_MESSAGES/tdlib-purple.mo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- tgl/generate.c 2020-04-27 07:49:17.000000000 -0400 | ||
+++ tgl/generate.c 2022-05-22 17:18:25.245975000 -0400 | ||
@@ -328,5 +328,4 @@ | ||
struct tl_tree_type *t1; | ||
struct tl_tree_array *t2; | ||
- int y; | ||
int L = strlen (cur_name); | ||
char *fail = fun == 1 ? "return 0;" : fun == -1 ? "return;" : "return -1;"; | ||
@@ -353,9 +352,9 @@ | ||
|
||
sprintf (cur_name + L, "->params[0]"); | ||
- y = gen_uni_skip (t2->multiplicity, cur_name, vars, 0, fun); | ||
+ gen_uni_skip (t2->multiplicity, cur_name, vars, 0, fun); | ||
cur_name[L] = 0; | ||
|
||
sprintf (cur_name + L, "->params[1]"); | ||
- y += gen_uni_skip (t2->args[0]->type, cur_name, vars, 0, fun); | ||
+ gen_uni_skip (t2->args[0]->type, cur_name, vars, 0, fun); | ||
cur_name[L] = 0; | ||
return 0; | ||
--- telegram-purple.c 2021-04-04 11:44:49.000000000 -0400 | ||
+++ telegram-purple.c 2022-05-22 17:21:25.278082000 -0400 | ||
@@ -801,4 +801,7 @@ | ||
NULL, // add_buddy_with_invite | ||
- NULL // add_buddies_with_invite | ||
+ NULL, // add_buddies_with_invite | ||
+ NULL, // get_cb_alias | ||
+ NULL, // chat_can_receive_file | ||
+ NULL, // chat_send_file | ||
}; | ||
|
||
--- tgp-msg.c 2021-04-04 11:44:49.000000000 -0400 | ||
+++ tgp-msg.c 2022-05-22 17:26:06.344212000 -0400 | ||
@@ -389,5 +389,5 @@ | ||
debug ("sending img='%s'", tmp); | ||
tgl_do_send_document (TLS, to, tmp, NULL, 0, | ||
- TGL_SEND_MSG_FLAG_DOCUMENT_AUTO | (tgl_get_peer_type (to) == TGL_PEER_CHANNEL) ? TGLMF_POST_AS_CHANNEL : 0, | ||
+ TGL_SEND_MSG_FLAG_DOCUMENT_AUTO | ((tgl_get_peer_type (to) == TGL_PEER_CHANNEL) ? TGLMF_POST_AS_CHANNEL : 0), | ||
send_inline_picture_done, NULL); | ||
} else { |