diff options
author | Esteve Varela Colominas <esteve.varela@gmail.com> | 2022-03-12 20:08:02 +0100 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2022-03-13 20:20:08 +0200 |
commit | 48b4072b8670dde327bc2c4fd813c6cf80c6968b (patch) | |
tree | 93c05c98d5a140129d105ed7c60df80e5f849c48 /net-im/telegram-desktop/files | |
parent | net-im/telegram-desktop: Drop old (diff) | |
download | gentoo-48b4072b8670dde327bc2c4fd813c6cf80c6968b.tar.gz gentoo-48b4072b8670dde327bc2c4fd813c6cf80c6968b.tar.bz2 gentoo-48b4072b8670dde327bc2c4fd813c6cf80c6968b.zip |
net-im/telegram-desktop: Bump to 3.6.0
Also add support for ffmpeg5
Signed-off-by: Esteve Varela Colominas <esteve.varela@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/24518
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'net-im/telegram-desktop/files')
-rw-r--r-- | net-im/telegram-desktop/files/tdesktop-3.6.0-jemalloc-only-telegram.patch | 41 | ||||
-rw-r--r-- | net-im/telegram-desktop/files/tdesktop-3.6.0-support-ffmpeg5.patch | 75 |
2 files changed, 116 insertions, 0 deletions
diff --git a/net-im/telegram-desktop/files/tdesktop-3.6.0-jemalloc-only-telegram.patch b/net-im/telegram-desktop/files/tdesktop-3.6.0-jemalloc-only-telegram.patch new file mode 100644 index 000000000000..6836e6935049 --- /dev/null +++ b/net-im/telegram-desktop/files/tdesktop-3.6.0-jemalloc-only-telegram.patch @@ -0,0 +1,41 @@ +Only link jemalloc for the Telegram binary + +Some combination of factors is making the different codegen tools hang when +jemalloc is linked for those, and they're ran under portage's sandbox. Since +this is only used during build-time, and jemalloc is merely necessary to +improve runtime memory use, it's unnecessary to use it for anything else. + +--- tdesktop-3.6.0-full.orig/Telegram/CMakeLists.txt ++++ tdesktop-3.6.0-full/Telegram/CMakeLists.txt +@@ -1376,6 +1376,14 @@ + desktop-app::external_kwayland + ) + endif() ++ ++ if (NOT DESKTOP_APP_DISABLE_JEMALLOC) ++ target_link_libraries(Telegram ++ INTERFACE ++ $<TARGET_OBJECTS:desktop-app::linux_jemalloc_helper> ++ $<LINK_ONLY:desktop-app::external_jemalloc> ++ ) ++ endif() + endif() + + if (build_macstore) +--- tdesktop-3.6.0-full.orig/cmake/options_linux.cmake ++++ tdesktop-3.6.0-full/cmake/options_linux.cmake +@@ -62,14 +62,6 @@ + target_link_options(common_options INTERFACE $<IF:$<CONFIG:Debug>,,-g -flto -fuse-linker-plugin>) + endif() + +-if (NOT DESKTOP_APP_DISABLE_JEMALLOC) +- target_link_libraries(common_options +- INTERFACE +- $<TARGET_OBJECTS:desktop-app::linux_jemalloc_helper> +- $<LINK_ONLY:desktop-app::external_jemalloc> +- ) +-endif() +- + target_link_libraries(common_options + INTERFACE + ${CMAKE_DL_LIBS} diff --git a/net-im/telegram-desktop/files/tdesktop-3.6.0-support-ffmpeg5.patch b/net-im/telegram-desktop/files/tdesktop-3.6.0-support-ffmpeg5.patch new file mode 100644 index 000000000000..32959acd5482 --- /dev/null +++ b/net-im/telegram-desktop/files/tdesktop-3.6.0-support-ffmpeg5.patch @@ -0,0 +1,75 @@ +Support FFmpeg 5 + +I'm not comfortable changing the _durationInMilliseconds formula on older +versions of ffmpeg. Doing that only for newer versions also reduces the amount +of testing this patch needs (of which it'll get very minimal amounts, this is a +job better left for upstream when they get to it). + +Also it doesn't compile under ffmpeg 4 if the variables are constants :/ + +--- tdesktop-3.6.0-full.orig/Telegram/ThirdParty/tgcalls/tgcalls/group/AudioStreamingPartInternal.cpp ++++ tdesktop-3.6.0-full/Telegram/ThirdParty/tgcalls/tgcalls/group/AudioStreamingPartInternal.cpp +@@ -104,7 +104,11 @@ + + _frame = av_frame_alloc(); + ++#if LIBAVFORMAT_VERSION_MAJOR >= 59 ++ const AVInputFormat *inputFormat = av_find_input_format(container.c_str()); ++#else + AVInputFormat *inputFormat = av_find_input_format(container.c_str()); ++#endif + if (!inputFormat) { + _didReadToEnd = true; + return; +@@ -144,7 +148,11 @@ + + _streamId = i; + ++#if LIBAVFORMAT_VERSION_MAJOR >= 59 ++ _durationInMilliseconds = inStream->duration * 1000 / 48000; ++#else + _durationInMilliseconds = (int)((inStream->duration + inStream->first_dts) * 1000 / 48000); ++#endif + + if (inStream->metadata) { + AVDictionaryEntry *entry = av_dict_get(inStream->metadata, "TG_META", nullptr, 0); +--- tdesktop-3.6.0-full.orig/Telegram/ThirdParty/tgcalls/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp ++++ tdesktop-3.6.0-full/Telegram/ThirdParty/tgcalls/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp +@@ -32,7 +32,11 @@ + AudioStreamingPartPersistentDecoderState(AVCodecParameters const *codecParameters, AVRational timeBase) : + _codecParameters(codecParameters), + _timeBase(timeBase) { ++#ifdef LIBAVCODEC_VERSION_MAJOR >= 59 ++ const AVCodec *codec = avcodec_find_decoder(codecParameters->codec_id); ++#else + AVCodec *codec = avcodec_find_decoder(codecParameters->codec_id); ++#endif + if (codec) { + _codecContext = avcodec_alloc_context3(codec); + int ret = avcodec_parameters_to_context(_codecContext, codecParameters); +--- tdesktop-3.6.0-full.orig/Telegram/ThirdParty/tgcalls/tgcalls/group/VideoStreamingPart.cpp ++++ tdesktop-3.6.0-full/Telegram/ThirdParty/tgcalls/tgcalls/group/VideoStreamingPart.cpp +@@ -280,7 +280,11 @@ + + int ret = 0; + ++#if LIBAVFORMAT_VERSION_MAJOR >= 59 ++ const AVInputFormat *inputFormat = av_find_input_format(container.c_str()); ++#else + AVInputFormat *inputFormat = av_find_input_format(container.c_str()); ++#endif + if (!inputFormat) { + _didReadToEnd = true; + return; +@@ -323,7 +327,11 @@ + } + + if (videoCodecParameters && videoStream) { ++#if LIBAVCODEC_VERSION_MAJOR >= 59 ++ const AVCodec *codec = avcodec_find_decoder(videoCodecParameters->codec_id); ++#else + AVCodec *codec = avcodec_find_decoder(videoCodecParameters->codec_id); ++#endif + if (codec) { + _codecContext = avcodec_alloc_context3(codec); + ret = avcodec_parameters_to_context(_codecContext, videoCodecParameters); |