summaryrefslogtreecommitdiff
path: root/net-im/telegram-desktop
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-02-29 18:01:47 +0000
committerV3n3RiX <venerix@redcorelinux.org>2020-02-29 18:01:47 +0000
commitceeeb463cc1eef97fd62eaee8bf2196ba04bc384 (patch)
tree9f47ee47c31a0f13f9496879cd88a1042550aa81 /net-im/telegram-desktop
parent53cba99042fa967e2a93da9f8db806fe2d035543 (diff)
gentoo (leap year) resync : 29.02.2020
Diffstat (limited to 'net-im/telegram-desktop')
-rw-r--r--net-im/telegram-desktop/Manifest13
-rw-r--r--net-im/telegram-desktop/files/1.9.19-crash.patch47
-rw-r--r--net-im/telegram-desktop/metadata.xml4
-rw-r--r--net-im/telegram-desktop/telegram-desktop-1.9.14.ebuild (renamed from net-im/telegram-desktop/telegram-desktop-1.9.13-r1.ebuild)0
-rw-r--r--net-im/telegram-desktop/telegram-desktop-1.9.15.ebuild134
-rw-r--r--net-im/telegram-desktop/telegram-desktop-1.9.16.ebuild134
-rw-r--r--net-im/telegram-desktop/telegram-desktop-1.9.19.ebuild143
7 files changed, 472 insertions, 3 deletions
diff --git a/net-im/telegram-desktop/Manifest b/net-im/telegram-desktop/Manifest
index c02d6913b6bb..5f413f9ca13e 100644
--- a/net-im/telegram-desktop/Manifest
+++ b/net-im/telegram-desktop/Manifest
@@ -1,4 +1,11 @@
AUX 0002-PPC-big-endian.patch 791 BLAKE2B f24d1f799eb23f4aa0ed3324996027014c790ef3ed249ef1b48748529b7e7af622d7db34fbe0cae06539913b5e20512f490e7a609b952273aa990baef20de374 SHA512 26aab35d254bdeb89aff05fa5ec84c405e2c939f300f923c0e7adb452e50442d140104fe74f6bd39ab533493314118de3bfed7f3a931c2c5442da6fccdb6e390
-DIST tdesktop-1.9.13-full.tar.gz 25324119 BLAKE2B 70029ea0dd68fd4be3ba540831111b79d223e059f70551a970847190b00f2aaebc13319236b2c681b2a55ee99408d20e6feea3fc3ab2fb9c97d4740fd4c6a644 SHA512 995face8a2ffb54f9f31aaa8d5a26421f4915e73360945553b6fa4e4b02431ca83ec1e72d6d2ce77f5b9daa39892859c88f7ea53c3ddbeec2cb37f27451878d2
-EBUILD telegram-desktop-1.9.13-r1.ebuild 3535 BLAKE2B 1cbaf77fe520be3d0bfc3624a725d9a09b4b92c771ba298e1d9c2fe7f7f1ae92b19381146a897f933964fa5ae08d00c9420402fc88067924597332bade4d344d SHA512 37902c4892ad492a3ca31979a32658cb9ada5e1a3be26e30846969cca11c5c6f38865cbe7a211e8f7a1c2c91679c96bee2f9b43c92a13d74660e80285bd4d95e
-MISC metadata.xml 251 BLAKE2B e9e9d48943645d8b737bc1f7ab0efb05db0f8eddad759c9bb40d07dc008fbfb8f5cca2020de71a9ff6945f5d66292ac02355773545010cd49c77fe6dd5ab7b40 SHA512 1b6a6955118c1a74cc89a77d6de9be8f4ff9c7137c186753462670a5b93457dfd034ad5d1f4d2507ac95cc149c2a042fa5324220b58702a56b09d91de40151c9
+AUX 1.9.19-crash.patch 1997 BLAKE2B 2ab31df9a8b9069844bd97c5178faf61556851027f92b8d895a2ad24d919922cbda597ac11e0337d092c527752de4343b3362ec8588eafcf42065ab8680c05fb SHA512 32590c5cdb99ed05cdb2e3664fe9ae1470bb4b2fcc7fd776d0739492629dbed76d28284face1d8b04add9a05f0cc3f512aff4a3b549eb94caaa7d49cfaeb1d41
+DIST tdesktop-1.9.14-full.tar.gz 25324084 BLAKE2B 45c071aa573541b6e483d2ae712b7f3b672c1294e8e7e624d9292f7176482f4d68069c35541019dc27fdb1c66134c29fb4d3667f1197e7085e4f8a80c8ca603c SHA512 56efa64048d23b280782b51319c0071c6cef833cb7e2584e52c6e45488577755beb85185ec9187029c425cc8d4c9c1887142687c744697e7731a15abe2846056
+DIST tdesktop-1.9.15-full.tar.gz 25327647 BLAKE2B 5d689f656a66d55b3e62d52d48106270fc16675a01ff8a2b865c122191c7ee4781c2e698d0652c765a10985148ade0ce5dd47f4938538f24348cd5b42fe0160c SHA512 457b568226e34cc23e379d34a9ad21d0d6c26fb69647cd17bf74aef48ad9ce35eae6697795af8c349f43e376b44bcab49e1939733b1cc20ec16ddf1c29a32c4e
+DIST tdesktop-1.9.16-full.tar.gz 25328085 BLAKE2B 1d429964e67641a1cfa0f826820ed54eb7e37d9946fdd3292d5d67276609d736dcfb2b4c422f6b64364705eb68e78f6ac6bfa52096ca39d948a9e01bc152404b SHA512 89cdf12456d9bcaa4e332286d2d5c4da6cf715bd0e798e51e458adb7bf5c89044899beb9ac7b11a808b81e37958473a473e3774519420baf7a6bc34eb7938733
+DIST tdesktop-1.9.19-full.tar.gz 25840478 BLAKE2B 1a730e74df71af0c8fcc579fb1b2546fe279d64dd60786a32e015dbc0046a5d4a933bfdc128f7bb2b624705e6788ec6d597ceeb328f91dc173d1c5a0e739a29c SHA512 29070c6e1d813943d5062dc1703f383a18323b5698fbc4e6f2c89b33366da9da5d1ec84dc29950288e7e7d112024de2924244ec9c800d59d4b210e6288c7291d
+EBUILD telegram-desktop-1.9.14.ebuild 3535 BLAKE2B 1cbaf77fe520be3d0bfc3624a725d9a09b4b92c771ba298e1d9c2fe7f7f1ae92b19381146a897f933964fa5ae08d00c9420402fc88067924597332bade4d344d SHA512 37902c4892ad492a3ca31979a32658cb9ada5e1a3be26e30846969cca11c5c6f38865cbe7a211e8f7a1c2c91679c96bee2f9b43c92a13d74660e80285bd4d95e
+EBUILD telegram-desktop-1.9.15.ebuild 3500 BLAKE2B 0360ce198161fb1d96aedd01439422c2417953457c78dc3c849136c1a859c696ab7e196fd983a8814e01c81eff8369f48d8af36c5c8928a0d9b7cb80fc6ae58b SHA512 f5de4da17c3b2f32f8da6ecd0a2f4052c8ad79dee05109d2bae495141e3efa1a9e8a033c6e856eb83691e06991aaebd6a217cb26949dce845392eb8eb6d7c7be
+EBUILD telegram-desktop-1.9.16.ebuild 3500 BLAKE2B 0360ce198161fb1d96aedd01439422c2417953457c78dc3c849136c1a859c696ab7e196fd983a8814e01c81eff8369f48d8af36c5c8928a0d9b7cb80fc6ae58b SHA512 f5de4da17c3b2f32f8da6ecd0a2f4052c8ad79dee05109d2bae495141e3efa1a9e8a033c6e856eb83691e06991aaebd6a217cb26949dce845392eb8eb6d7c7be
+EBUILD telegram-desktop-1.9.19.ebuild 3778 BLAKE2B 230296103a44d51af90e99dbf4bd37d370b8f4a1967454791159b623fcc0e1b41fed0d134c9a5ab25f036d8908e4f2202a45c5a9b5b00947a7855b7aa2f210ee SHA512 ec2b8e0ad38ecddd96e7952ba06549a2ddc9f83782d3cf47f8e467e246b7b9a6833f400c901f86668375fc3601bbb2aba123c46793ad42febb25127dde4f67ab
+MISC metadata.xml 429 BLAKE2B fd7c38c1636548f8fbd5b20f3c64681fd2e379dd6c1b9f25f159b15d4a287fd8cefaf11aa655784176990130f39ec7fcc6eb246a89c06c48e9480a1232c195a8 SHA512 b2ef15fa658070bca96cd00cb2dfb7d43befe9f1c06c0a6f2a3d29e85e8a90e626e782235379e500332ca9ca81cccc761793140c8d34791c57b2942aa0c76a88
diff --git a/net-im/telegram-desktop/files/1.9.19-crash.patch b/net-im/telegram-desktop/files/1.9.19-crash.patch
new file mode 100644
index 000000000000..ff88aec74eb6
--- /dev/null
+++ b/net-im/telegram-desktop/files/1.9.19-crash.patch
@@ -0,0 +1,47 @@
+From 844e9b60ddf01712082e7ff87cfe74bb20d97297 Mon Sep 17 00:00:00 2001
+From: John Preston <johnprestonmail@gmail.com>
+Date: Tue, 25 Feb 2020 16:12:04 +0400
+Subject: [PATCH] Fix crash in SearchController.
+
+Data::Histories cancels request in Main::Session::api(), so the
+request must be sent using this global api(), not custom MTP::Sender.
+---
+ Telegram/SourceFiles/data/data_search_controller.cpp | 5 ++---
+ Telegram/SourceFiles/data/data_search_controller.h | 1 -
+ 2 files changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/Telegram/SourceFiles/data/data_search_controller.cpp b/Telegram/SourceFiles/data/data_search_controller.cpp
+index 08541b13da..90fbd36762 100644
+--- a/Telegram/SourceFiles/data/data_search_controller.cpp
++++ b/Telegram/SourceFiles/data/data_search_controller.cpp
+@@ -194,8 +194,7 @@ SearchController::CacheEntry::CacheEntry(const Query &query)
+ }
+
+ SearchController::SearchController(not_null<Main::Session*> session)
+-: _session(session)
+-, _api(session->api().instance()) {
++: _session(session) {
+ }
+
+ bool SearchController::hasInCache(const Query &query) const {
+@@ -372,7 +371,7 @@ void SearchController::requestMore(
+ const auto type = ::Data::Histories::RequestType::History;
+ const auto history = _session->data().history(listData->peer);
+ auto requestId = histories.sendRequest(history, type, [=](Fn<void()> finish) {
+- return _api.request(
++ return _session->api().request(
+ std::move(*prepared)
+ ).done([=](const MTPmessages_Messages &result) {
+ listData->requests.remove(key);
+diff --git a/Telegram/SourceFiles/data/data_search_controller.h b/Telegram/SourceFiles/data/data_search_controller.h
+index a439bb38ed..f9341ac4d4 100644
+--- a/Telegram/SourceFiles/data/data_search_controller.h
++++ b/Telegram/SourceFiles/data/data_search_controller.h
+@@ -130,7 +130,6 @@ class SearchController final {
+ Data *listData);
+
+ const not_null<Main::Session*> _session;
+- MTP::Sender _api;
+ Cache _cache;
+ Cache::iterator _current = _cache.end();
+
diff --git a/net-im/telegram-desktop/metadata.xml b/net-im/telegram-desktop/metadata.xml
index efcd58fe0b9b..5eb4b12ceaa6 100644
--- a/net-im/telegram-desktop/metadata.xml
+++ b/net-im/telegram-desktop/metadata.xml
@@ -5,4 +5,8 @@
<email>gyakovlev@gentoo.org</email>
<name>Georgy Yakovlev</name>
</maintainer>
+ <use>
+ <flag name="enchant">Enable the app-text/aspell spell-checking backend</flag>
+ <flag name="hunspell">Enable the app-text/hunspell spell-checking backend</flag>
+ </use>
</pkgmetadata>
diff --git a/net-im/telegram-desktop/telegram-desktop-1.9.13-r1.ebuild b/net-im/telegram-desktop/telegram-desktop-1.9.14.ebuild
index 620b15ce23a9..620b15ce23a9 100644
--- a/net-im/telegram-desktop/telegram-desktop-1.9.13-r1.ebuild
+++ b/net-im/telegram-desktop/telegram-desktop-1.9.14.ebuild
diff --git a/net-im/telegram-desktop/telegram-desktop-1.9.15.ebuild b/net-im/telegram-desktop/telegram-desktop-1.9.15.ebuild
new file mode 100644
index 000000000000..3ca08c210812
--- /dev/null
+++ b/net-im/telegram-desktop/telegram-desktop-1.9.15.ebuild
@@ -0,0 +1,134 @@
+# Copyright 2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6,7} )
+
+inherit cmake desktop flag-o-matic python-any-r1 xdg-utils
+
+MY_P="tdesktop-${PV}-full"
+
+DESCRIPTION="Official desktop client for Telegram"
+HOMEPAGE="https://desktop.telegram.org"
+SRC_URI="https://github.com/telegramdesktop/tdesktop/releases/download/v${PV}/${MY_P}.tar.gz"
+
+LICENSE="GPL-3-with-openssl-exception"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64"
+IUSE="+alsa +dbus libressl pulseaudio +spell"
+
+RDEPEND="
+ !net-im/telegram-desktop-bin
+ app-arch/lz4:=
+ app-arch/xz-utils
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:0= )
+ >=dev-cpp/ms-gsl-2.1.0
+ dev-cpp/range-v3
+ dev-libs/xxhash
+ dev-qt/qtcore:5
+ dev-qt/qtimageformats:5
+ dev-qt/qtnetwork:5
+ dev-qt/qtsvg:5
+ media-libs/fontconfig:=
+ >=media-libs/libtgvoip-2.4.4_p20200212[alsa?,pulseaudio?]
+ media-libs/openal[alsa?,pulseaudio?]
+ media-libs/opus:=
+ media-video/ffmpeg:=[opus]
+ sys-libs/zlib[minizip]
+ virtual/libiconv
+ x11-libs/libva:=[X,drm]
+ x11-libs/libX11
+ || (
+ dev-qt/qtgui:5[jpeg,png,X(-)]
+ dev-qt/qtgui:5[jpeg,png,xcb(-)]
+ )
+ || (
+ dev-qt/qtwidgets:5[png,X(-)]
+ dev-qt/qtwidgets:5[png,xcb(-)]
+ )
+ dbus? (
+ dev-qt/qtdbus:5
+ dev-libs/libdbusmenu-qt[qt5(+)]
+ )
+ pulseaudio? ( media-sound/pulseaudio )
+ spell? ( app-text/enchant:= )
+"
+
+DEPEND="
+ ${PYTHON_DEPS}
+ ${RDEPEND}
+"
+
+BDEPEND="
+ >=dev-util/cmake-3.16
+ virtual/pkgconfig
+"
+
+REQUIRED_USE="|| ( alsa pulseaudio )"
+
+S="${WORKDIR}/${MY_P}"
+
+src_configure() {
+ local mycxxflags=(
+ -Wno-deprecated-declarations
+ -Wno-error=deprecated-declarations
+ -Wno-switch
+ )
+
+ append-cxxflags "${mycxxflags[@]}"
+
+ # TODO: unbundle header-only libs, ofc telegram uses git versions...
+ # it fals with tl-expected-1.0.0, so we use bundled for now to avoid git rev snapshots
+ # EXPECTED VARIANT
+ local mycmakeargs=(
+ -DDESKTOP_APP_DISABLE_CRASH_REPORTS=ON
+ -DDESKTOP_APP_USE_GLIBC_WRAPS=OFF
+ -DDESKTOP_APP_USE_PACKAGED=ON
+ -DDESKTOP_APP_USE_PACKAGED_EXPECTED=OFF
+ -DDESKTOP_APP_USE_PACKAGED_RLOTTIE=OFF
+ -DDESKTOP_APP_USE_PACKAGED_VARIANT=OFF
+ -DTDESKTOP_DISABLE_DESKTOP_FILE_GENERATION=ON
+ -DTDESKTOP_LAUNCHER_BASENAME="${PN}"
+ -DDESKTOP_APP_DISABLE_DBUS_INTEGRATION="$(usex dbus OFF ON)"
+ -DDESKTOP_APP_DISABLE_SPELLCHECK="$(usex spell OFF ON)"
+ )
+
+ if [[ -n ${MY_TDESKTOP_API_ID} && -n ${MY_TDESKTOP_API_HASH} ]]; then
+ einfo "Found custom API credentials"
+ mycmakeargs+=(
+ -DTDESKTOP_API_ID="${MY_TDESKTOP_API_ID}"
+ -DTDESKTOP_API_HASH="${MY_TDESKTOP_API_HASH}"
+ )
+ else
+ # https://github.com/telegramdesktop/tdesktop/blob/dev/snap/snapcraft.yaml
+ # Building with snapcraft API credentials by default
+ # Custom API credentials can be obtained here:
+ # https://github.com/telegramdesktop/tdesktop/blob/dev/docs/api_credentials.md
+ # After getting credentials you can export variables:
+ # export MY_TDESKTOP_API_ID="17349""
+ # export MY_TDESKTOP_API_HASH="344583e45741c457fe1862106095a5eb"
+ # and restart the build"
+ # you can set above variables (without export) in /etc/portage/env/net-im/telegram-desktop
+ # portage will use custom variable every build automatically
+ mycmakeargs+=(
+ -DTDESKTOP_API_ID="611335"
+ -DTDESKTOP_API_HASH="d524b414d21f4d37f08684c1df41ac9c"
+ )
+ fi
+
+ cmake_src_configure
+}
+
+pkg_postinst() {
+ xdg_desktop_database_update
+ xdg_icon_cache_update
+ xdg_mimeinfo_database_update
+}
+
+pkg_postrm() {
+ xdg_desktop_database_update
+ xdg_icon_cache_update
+ xdg_mimeinfo_database_update
+}
diff --git a/net-im/telegram-desktop/telegram-desktop-1.9.16.ebuild b/net-im/telegram-desktop/telegram-desktop-1.9.16.ebuild
new file mode 100644
index 000000000000..3ca08c210812
--- /dev/null
+++ b/net-im/telegram-desktop/telegram-desktop-1.9.16.ebuild
@@ -0,0 +1,134 @@
+# Copyright 2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6,7} )
+
+inherit cmake desktop flag-o-matic python-any-r1 xdg-utils
+
+MY_P="tdesktop-${PV}-full"
+
+DESCRIPTION="Official desktop client for Telegram"
+HOMEPAGE="https://desktop.telegram.org"
+SRC_URI="https://github.com/telegramdesktop/tdesktop/releases/download/v${PV}/${MY_P}.tar.gz"
+
+LICENSE="GPL-3-with-openssl-exception"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64"
+IUSE="+alsa +dbus libressl pulseaudio +spell"
+
+RDEPEND="
+ !net-im/telegram-desktop-bin
+ app-arch/lz4:=
+ app-arch/xz-utils
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:0= )
+ >=dev-cpp/ms-gsl-2.1.0
+ dev-cpp/range-v3
+ dev-libs/xxhash
+ dev-qt/qtcore:5
+ dev-qt/qtimageformats:5
+ dev-qt/qtnetwork:5
+ dev-qt/qtsvg:5
+ media-libs/fontconfig:=
+ >=media-libs/libtgvoip-2.4.4_p20200212[alsa?,pulseaudio?]
+ media-libs/openal[alsa?,pulseaudio?]
+ media-libs/opus:=
+ media-video/ffmpeg:=[opus]
+ sys-libs/zlib[minizip]
+ virtual/libiconv
+ x11-libs/libva:=[X,drm]
+ x11-libs/libX11
+ || (
+ dev-qt/qtgui:5[jpeg,png,X(-)]
+ dev-qt/qtgui:5[jpeg,png,xcb(-)]
+ )
+ || (
+ dev-qt/qtwidgets:5[png,X(-)]
+ dev-qt/qtwidgets:5[png,xcb(-)]
+ )
+ dbus? (
+ dev-qt/qtdbus:5
+ dev-libs/libdbusmenu-qt[qt5(+)]
+ )
+ pulseaudio? ( media-sound/pulseaudio )
+ spell? ( app-text/enchant:= )
+"
+
+DEPEND="
+ ${PYTHON_DEPS}
+ ${RDEPEND}
+"
+
+BDEPEND="
+ >=dev-util/cmake-3.16
+ virtual/pkgconfig
+"
+
+REQUIRED_USE="|| ( alsa pulseaudio )"
+
+S="${WORKDIR}/${MY_P}"
+
+src_configure() {
+ local mycxxflags=(
+ -Wno-deprecated-declarations
+ -Wno-error=deprecated-declarations
+ -Wno-switch
+ )
+
+ append-cxxflags "${mycxxflags[@]}"
+
+ # TODO: unbundle header-only libs, ofc telegram uses git versions...
+ # it fals with tl-expected-1.0.0, so we use bundled for now to avoid git rev snapshots
+ # EXPECTED VARIANT
+ local mycmakeargs=(
+ -DDESKTOP_APP_DISABLE_CRASH_REPORTS=ON
+ -DDESKTOP_APP_USE_GLIBC_WRAPS=OFF
+ -DDESKTOP_APP_USE_PACKAGED=ON
+ -DDESKTOP_APP_USE_PACKAGED_EXPECTED=OFF
+ -DDESKTOP_APP_USE_PACKAGED_RLOTTIE=OFF
+ -DDESKTOP_APP_USE_PACKAGED_VARIANT=OFF
+ -DTDESKTOP_DISABLE_DESKTOP_FILE_GENERATION=ON
+ -DTDESKTOP_LAUNCHER_BASENAME="${PN}"
+ -DDESKTOP_APP_DISABLE_DBUS_INTEGRATION="$(usex dbus OFF ON)"
+ -DDESKTOP_APP_DISABLE_SPELLCHECK="$(usex spell OFF ON)"
+ )
+
+ if [[ -n ${MY_TDESKTOP_API_ID} && -n ${MY_TDESKTOP_API_HASH} ]]; then
+ einfo "Found custom API credentials"
+ mycmakeargs+=(
+ -DTDESKTOP_API_ID="${MY_TDESKTOP_API_ID}"
+ -DTDESKTOP_API_HASH="${MY_TDESKTOP_API_HASH}"
+ )
+ else
+ # https://github.com/telegramdesktop/tdesktop/blob/dev/snap/snapcraft.yaml
+ # Building with snapcraft API credentials by default
+ # Custom API credentials can be obtained here:
+ # https://github.com/telegramdesktop/tdesktop/blob/dev/docs/api_credentials.md
+ # After getting credentials you can export variables:
+ # export MY_TDESKTOP_API_ID="17349""
+ # export MY_TDESKTOP_API_HASH="344583e45741c457fe1862106095a5eb"
+ # and restart the build"
+ # you can set above variables (without export) in /etc/portage/env/net-im/telegram-desktop
+ # portage will use custom variable every build automatically
+ mycmakeargs+=(
+ -DTDESKTOP_API_ID="611335"
+ -DTDESKTOP_API_HASH="d524b414d21f4d37f08684c1df41ac9c"
+ )
+ fi
+
+ cmake_src_configure
+}
+
+pkg_postinst() {
+ xdg_desktop_database_update
+ xdg_icon_cache_update
+ xdg_mimeinfo_database_update
+}
+
+pkg_postrm() {
+ xdg_desktop_database_update
+ xdg_icon_cache_update
+ xdg_mimeinfo_database_update
+}
diff --git a/net-im/telegram-desktop/telegram-desktop-1.9.19.ebuild b/net-im/telegram-desktop/telegram-desktop-1.9.19.ebuild
new file mode 100644
index 000000000000..a038d5820eca
--- /dev/null
+++ b/net-im/telegram-desktop/telegram-desktop-1.9.19.ebuild
@@ -0,0 +1,143 @@
+# Copyright 2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6,7} )
+
+inherit cmake desktop flag-o-matic python-any-r1 xdg-utils
+
+MY_P="tdesktop-${PV}-full"
+
+DESCRIPTION="Official desktop client for Telegram"
+HOMEPAGE="https://desktop.telegram.org"
+SRC_URI="https://github.com/telegramdesktop/tdesktop/releases/download/v${PV}/${MY_P}.tar.gz"
+
+LICENSE="GPL-3-with-openssl-exception"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64"
+IUSE="+alsa +dbus enchant +hunspell libressl pulseaudio +spell"
+
+RDEPEND="
+ !net-im/telegram-desktop-bin
+ app-arch/lz4:=
+ app-arch/xz-utils
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:0= )
+ >=dev-cpp/ms-gsl-2.1.0
+ dev-cpp/range-v3
+ dev-libs/xxhash
+ dev-qt/qtcore:5
+ dev-qt/qtimageformats:5
+ dev-qt/qtnetwork:5
+ dev-qt/qtsvg:5
+ dev-qt/qtwayland:5
+ media-libs/fontconfig:=
+ >=media-libs/libtgvoip-2.4.4_p20200212[alsa?,pulseaudio?]
+ media-libs/openal[alsa?,pulseaudio?]
+ media-libs/opus:=
+ media-video/ffmpeg:=[opus]
+ sys-libs/zlib[minizip]
+ virtual/libiconv
+ x11-libs/libva:=[X,drm]
+ x11-libs/libX11
+ || (
+ dev-qt/qtgui:5[jpeg,png,X(-)]
+ dev-qt/qtgui:5[jpeg,png,xcb(-)]
+ )
+ || (
+ dev-qt/qtwidgets:5[png,X(-)]
+ dev-qt/qtwidgets:5[png,xcb(-)]
+ )
+ dbus? (
+ dev-qt/qtdbus:5
+ dev-libs/libdbusmenu-qt[qt5(+)]
+ )
+ enchant? ( app-text/enchant:= )
+ hunspell? ( >=app-text/hunspell-1.7:= )
+ pulseaudio? ( media-sound/pulseaudio )
+"
+
+DEPEND="
+ ${PYTHON_DEPS}
+ ${RDEPEND}
+"
+
+BDEPEND="
+ >=dev-util/cmake-3.16
+ virtual/pkgconfig
+"
+
+REQUIRED_USE="|| ( alsa pulseaudio )
+ spell? (
+ ^^ ( enchant hunspell )
+ )
+"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=( "${FILESDIR}/${PV}-crash.patch" )
+
+src_configure() {
+ local mycxxflags=(
+ -Wno-deprecated-declarations
+ -Wno-error=deprecated-declarations
+ -Wno-switch
+ )
+
+ append-cxxflags "${mycxxflags[@]}"
+
+ # TODO: unbundle header-only libs, ofc telegram uses git versions...
+ # it fals with tl-expected-1.0.0, so we use bundled for now to avoid git rev snapshots
+ # EXPECTED VARIANT
+ local mycmakeargs=(
+ -DDESKTOP_APP_DISABLE_CRASH_REPORTS=ON
+ -DDESKTOP_APP_USE_GLIBC_WRAPS=OFF
+ -DDESKTOP_APP_USE_PACKAGED=ON
+ -DDESKTOP_APP_USE_PACKAGED_EXPECTED=OFF
+ -DDESKTOP_APP_USE_PACKAGED_RLOTTIE=OFF
+ -DDESKTOP_APP_USE_PACKAGED_VARIANT=OFF
+ -DTDESKTOP_DISABLE_DESKTOP_FILE_GENERATION=ON
+ -DTDESKTOP_LAUNCHER_BASENAME="${PN}"
+ -DDESKTOP_APP_DISABLE_DBUS_INTEGRATION="$(usex dbus OFF ON)"
+ -DDESKTOP_APP_DISABLE_SPELLCHECK="$(usex spell OFF ON)" # enables hunspell
+ -DDESKTOP_APP_USE_ENCHANT="$(usex enchant ON OFF)" # enables enchant and disables hunspell
+ )
+
+ if [[ -n ${MY_TDESKTOP_API_ID} && -n ${MY_TDESKTOP_API_HASH} ]]; then
+ einfo "Found custom API credentials"
+ mycmakeargs+=(
+ -DTDESKTOP_API_ID="${MY_TDESKTOP_API_ID}"
+ -DTDESKTOP_API_HASH="${MY_TDESKTOP_API_HASH}"
+ )
+ else
+ # https://github.com/telegramdesktop/tdesktop/blob/dev/snap/snapcraft.yaml
+ # Building with snapcraft API credentials by default
+ # Custom API credentials can be obtained here:
+ # https://github.com/telegramdesktop/tdesktop/blob/dev/docs/api_credentials.md
+ # After getting credentials you can export variables:
+ # export MY_TDESKTOP_API_ID="17349""
+ # export MY_TDESKTOP_API_HASH="344583e45741c457fe1862106095a5eb"
+ # and restart the build"
+ # you can set above variables (without export) in /etc/portage/env/net-im/telegram-desktop
+ # portage will use custom variable every build automatically
+ mycmakeargs+=(
+ -DTDESKTOP_API_ID="611335"
+ -DTDESKTOP_API_HASH="d524b414d21f4d37f08684c1df41ac9c"
+ )
+ fi
+
+ cmake_src_configure
+}
+
+pkg_postinst() {
+ xdg_desktop_database_update
+ xdg_icon_cache_update
+ xdg_mimeinfo_database_update
+}
+
+pkg_postrm() {
+ xdg_desktop_database_update
+ xdg_icon_cache_update
+ xdg_mimeinfo_database_update
+}