diff options
author | Zach van Rijn <me@zv.io> | 2022-05-28 16:00:47 +0000 |
---|---|---|
committer | Zach van Rijn <me@zv.io> | 2022-06-12 23:51:58 +0000 |
commit | ae987f4bcffec80ac1e4d385e200659e6bce530e (patch) | |
tree | b7597d86c58c0e6d0a09ef28fdb30c1f01a80e71 | |
parent | 4c38c65698d7028d28b83e2375c871b080b57e70 (diff) | |
download | packages-ae987f4bcffec80ac1e4d385e200659e6bce530e.tar.gz packages-ae987f4bcffec80ac1e4d385e200659e6bce530e.tar.bz2 packages-ae987f4bcffec80ac1e4d385e200659e6bce530e.tar.xz packages-ae987f4bcffec80ac1e4d385e200659e6bce530e.zip |
user/telegram: add necessary patches. add official API key. fixes #732.
-rw-r--r-- | user/telegram/APKBUILD | 22 | ||||
-rw-r--r-- | user/telegram/add-missing-header.patch | 11 | ||||
-rw-r--r-- | user/telegram/fix-boolean-vs-nullptr.patch | 26 |
3 files changed, 49 insertions, 10 deletions
diff --git a/user/telegram/APKBUILD b/user/telegram/APKBUILD index 46cc4a9c1..e59e12b9c 100644 --- a/user/telegram/APKBUILD +++ b/user/telegram/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: A. Wilcox <awilfox@adelielinux.org> pkgname=telegram pkgver=2.0.1 -pkgrel=0 +pkgrel=1 pkgdesc="Telegram messaging app" url="https://telegram.org/" arch="all" @@ -15,18 +15,18 @@ makedepends="cmake enchant-dev ffmpeg-dev hunspell-dev libdbusmenu-qt-dev subpackages="" source="https://github.com/telegramdesktop/tdesktop/releases/download/v$pkgver/tdesktop-$pkgver-full.tar.gz endian.patch + add-missing-header.patch + fix-boolean-vs-nullptr.patch " builddir="$srcdir/tdesktop-$pkgver-full" build() { - [ -f "$HOME/telegram_credentials.sh" ] || die "You need to have a Telegram API ID." - - . $HOME/telegram_credentials.sh - if [ "$CBUILD" != "$CHOST" ]; then CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux" fi - # Can't use packaged rlottie, API mismatch. + # API ID/HASH come from Telegram's official Snap package. + # https://github.com/telegramdesktop/tdesktop/commit/9536a3c98e25fe8d6f08dc99764f4ec94319e4d5 + # First introduced here ^ and still in production use as of now. cmake \ -DCMAKE_INSTALL_PREFIX=/usr \ -DBUILD_SHARED_LIBS=True \ @@ -37,10 +37,10 @@ build() { -DDESKTOP_APP_USE_GLIBC_WRAPS=OFF \ -DDESKTOP_APP_USE_PACKAGED_EXPECTED=OFF \ -DDESKTOP_APP_USE_PACKAGED_GSL=OFF \ - -DDESKTOP_APP_USE_PACKAGED_RLOTTIE=OFF \ + -DDESKTOP_APP_USE_PACKAGED_RLOTTIE=OFF `# API mismatch` \ -DDESKTOP_APP_USE_PACKAGED_VARIANT=OFF \ - -DTDESKTOP_API_ID="${TELEGRAM_API_ID}" \ - -DTDESKTOP_API_HASH="${TELEGRAM_API_HASH}" \ + -DTDESKTOP_API_ID=611335 \ + -DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c \ -DTDESKTOP_DISABLE_GTK_INTEGRATION=ON \ -DTDESKTOP_LAUNCHER_BASENAME=telegramdesktop \ -DTDESKTOP_USE_PACKAGED_TGVOIP=OFF \ @@ -60,4 +60,6 @@ package() { } sha512sums="99cd7c5ca1e9dd75ecd98d272522b0e4aab2d46525e3d0c306503b7a00c9d25c1646e9d7462182682a58947c7435864af805a3b6f85906d8b21e5675cc8383cb tdesktop-2.0.1-full.tar.gz -c478bd59187493d60172d805ca19e9e09fa2c81b87d5dbbd5f3cd9aae0f207b463d127e06f2053f7b7b6ac00b3191d59e36ec6c5453a1da4d6535d1caad27242 endian.patch" +c478bd59187493d60172d805ca19e9e09fa2c81b87d5dbbd5f3cd9aae0f207b463d127e06f2053f7b7b6ac00b3191d59e36ec6c5453a1da4d6535d1caad27242 endian.patch +fae66dc209067a0e85b3ce781fa8e71316a9cabdc11dbc06d3ce65756a751c91b8fd78c66af0acf467c13d4d66be5c84d422965f57729a9d3a3b31ee5a4a3716 add-missing-header.patch +959897893f934179fd19a1397b83528ba328a6eb685ccdd31386660626990778a5951146d2a831c725d418cbb5a9fdb2ae219c645961dea358d8666e147f473f fix-boolean-vs-nullptr.patch" diff --git a/user/telegram/add-missing-header.patch b/user/telegram/add-missing-header.patch new file mode 100644 index 000000000..e142bb230 --- /dev/null +++ b/user/telegram/add-missing-header.patch @@ -0,0 +1,11 @@ +diff -ur a/Telegram/lib_base/base/basic_types.h b/Telegram/lib_base/base/basic_types.h +--- a/Telegram/lib_base/base/basic_types.h 2022-05-28 15:00:40.593938379 +0000 ++++ b/Telegram/lib_base/base/basic_types.h 2022-05-28 15:06:07.765546500 +0000 +@@ -13,6 +13,7 @@ + + #include <QtGlobal> + #include <QtCore/QByteArray> ++#include <QPainterPath> + + #include <string> + #include <exception> diff --git a/user/telegram/fix-boolean-vs-nullptr.patch b/user/telegram/fix-boolean-vs-nullptr.patch new file mode 100644 index 000000000..5b73dc980 --- /dev/null +++ b/user/telegram/fix-boolean-vs-nullptr.patch @@ -0,0 +1,26 @@ +diff -ur a/Telegram/SourceFiles/core/utils.cpp b/Telegram/SourceFiles/core/utils.cpp +--- a/Telegram/SourceFiles/core/utils.cpp 2022-05-28 15:18:57.852282454 +0000 ++++ b/Telegram/SourceFiles/core/utils.cpp 2022-05-28 15:26:07.391514703 +0000 +@@ -156,7 +156,7 @@ + if (!sslSupported) { + LOG(("Error: current Qt build doesn't support SSL requests.")); + } +- if (!CRYPTO_get_locking_callback()) { ++ if (nullptr == CRYPTO_get_locking_callback()) { + // Qt didn't initialize OpenSSL, so we will. + auto numLocks = CRYPTO_num_locks(); + if (numLocks) { +@@ -166,11 +166,11 @@ + LOG(("MTP Error: Could not init OpenSSL threads, CRYPTO_num_locks() returned zero!")); + } + } +- if (!CRYPTO_get_dynlock_create_callback()) { ++ if (nullptr == CRYPTO_get_dynlock_create_callback()) { + CRYPTO_set_dynlock_create_callback(_sslCreateFunction); + CRYPTO_set_dynlock_lock_callback(_sslLockFunction); + CRYPTO_set_dynlock_destroy_callback(_sslDestroyFunction); +- } else if (!CRYPTO_get_dynlock_lock_callback()) { ++ } else if (nullptr == CRYPTO_get_dynlock_lock_callback()) { + LOG(("MTP Error: dynlock_create callback is set without dynlock_lock callback!")); + } + |