summarylogtreecommitdiffstats
diff options
context:
space:
mode:
author3JlOy_PYCCKUI2022-02-20 01:41:40 +0300
committer3JlOy_PYCCKUI2022-02-20 01:41:40 +0300
commit3357073c5b33bbec677f67e554b8ef796e4edc32 (patch)
tree92a1867ccff110e9362792d084d11079b10d7f0e
parent7e2a8142582df6c73a91d64fef22360d7e23faf8 (diff)
downloadaur-3357073c5b33bbec677f67e554b8ef796e4edc32.tar.gz
atempt to fix build with ffmpeg 5 (added 2 patches, but still failing, trying to get working)
one of patches no more compatible because of update kotatogram settings, soon patch will be fixed
-rw-r--r--.SRCINFO9
-rw-r--r--PKGBUILD20
-rw-r--r--fix_ffmpeg5_build_24044.patch85
-rw-r--r--fix_tgcalls_ffmpeg5.patch44
4 files changed, 150 insertions, 8 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 270286dd5f0a..64ec182e09d6 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = kotatogram-dev-git
pkgdesc = Kotatogram – experimental Telegram Desktop fork - Dev branch
- pkgver = k1.4.8.r174.g98f2683e5
- pkgrel = 3
+ pkgver = k1.4.8.r521.gd35d97355
+ pkgrel = 1
url = https://kotatogram.github.io
arch = x86_64
license = GPL3
@@ -19,6 +19,7 @@ pkgbase = kotatogram-dev-git
makedepends = unzip
makedepends = yasm
makedepends = libtg_owt
+ makedepends = meson
depends = hunspell
depends = ffmpeg
depends = hicolor-icon-theme
@@ -98,6 +99,8 @@ pkgbase = kotatogram-dev-git
source = kotatogram-desktop-dispatch::git+https://github.com/apple/swift-corelibs-libdispatch.git
source = 0001-Add-an-option-to-hide-messages-from-blocked-users-in.patch
source = block-sponsored_messages.patch
+ source = fix_ffmpeg5_build_24044.patch
+ source = fix_tgcalls_ffmpeg5.patch
b2sums = SKIP
b2sums = SKIP
b2sums = SKIP
@@ -133,5 +136,7 @@ pkgbase = kotatogram-dev-git
b2sums = SKIP
b2sums = 462900e97b9d7a9d40bc02d3dc7dacd3060cc19af02135065628e38e83835a2fb438581ca78001aaffc27d8b0473a78d39509c35f50e4ebb25607fe9c6bae264
b2sums = 96a703e3c7e4a2e2229c386daa24af0ca0228d130a35a6ba25e5da4885297d5d0b33fe37f26f71955cac01e3250dc4f811ebb6ff0fe58f3f7e5d5380a970347f
+ b2sums = 850eb9a923f12a58d6844f41fb6648c9873fa94f13d76f629dbd5c8e5ee4729a4bdb982dff8be846ad5e62d90cbecc99cc41d8c108e42e70b74d8304e1d3cef9
+ b2sums = c8f9125281606c020c346ac0e021adc75c1ce64454daa4c0a8126b209f3235ede129602de5c831745ed1424457d890cf3e6ee20c886716128bb580f39f3e58a1
pkgname = kotatogram-dev-git
diff --git a/PKGBUILD b/PKGBUILD
index 872249026b83..6b20547b275f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,8 +6,8 @@
pkgname=kotatogram-dev-git
_pkgname=kotatogram-desktop
-pkgver=k1.4.8.r174.g98f2683e5
-pkgrel=3
+pkgver=k1.4.8.r521.gd35d97355
+pkgrel=1
pkgdesc='Kotatogram – experimental Telegram Desktop fork - Dev branch'
arch=('x86_64')
url="https://kotatogram.github.io"
@@ -19,7 +19,7 @@ depends=('hunspell' 'ffmpeg' 'hicolor-icon-theme' 'lz4' 'minizip' 'openal' 'ttf-
'libxdamage' 'libxext' 'libxfixes' 'zlib' 'wayland' 'glibc' 'libsigc++' 'glib2' 'xcb-util-keysyms' 'libxcb' 'gcc-libs')
makedepends=('cmake' 'git' 'ninja' 'python' 'range-v3' 'tl-expected' 'microsoft-gsl'
'extra-cmake-modules' 'wayland-protocols' 'plasma-wayland-protocols' 'webkit2gtk' 'unzip'
- 'yasm' 'libtg_owt')
+ 'yasm' 'libtg_owt' 'meson')
optdepends=('webkit2gtk: embedded browser features'
'xdg-desktop-portal: desktop integration')
conflicts=('kotatogram-desktop-bin' 'kotatogram-desktop-dynamic-bin' 'kotatogram-desktop')
@@ -58,7 +58,10 @@ source=("${_pkgname}::git+https://github.com/kotatogram/${_pkgname}.git#branch=d
"${_pkgname}-dispatch::git+https://github.com/apple/swift-corelibs-libdispatch.git"
"0001-Add-an-option-to-hide-messages-from-blocked-users-in.patch"
- "block-sponsored_messages.patch")
+ "block-sponsored_messages.patch"
+ "fix_ffmpeg5_build_24044.patch"
+ "fix_tgcalls_ffmpeg5.patch"
+ )
b2sums=('SKIP'
@@ -95,7 +98,9 @@ b2sums=('SKIP'
'SKIP'
'SKIP'
'462900e97b9d7a9d40bc02d3dc7dacd3060cc19af02135065628e38e83835a2fb438581ca78001aaffc27d8b0473a78d39509c35f50e4ebb25607fe9c6bae264'
- '96a703e3c7e4a2e2229c386daa24af0ca0228d130a35a6ba25e5da4885297d5d0b33fe37f26f71955cac01e3250dc4f811ebb6ff0fe58f3f7e5d5380a970347f')
+ '96a703e3c7e4a2e2229c386daa24af0ca0228d130a35a6ba25e5da4885297d5d0b33fe37f26f71955cac01e3250dc4f811ebb6ff0fe58f3f7e5d5380a970347f'
+ '850eb9a923f12a58d6844f41fb6648c9873fa94f13d76f629dbd5c8e5ee4729a4bdb982dff8be846ad5e62d90cbecc99cc41d8c108e42e70b74d8304e1d3cef9'
+ 'c8f9125281606c020c346ac0e021adc75c1ce64454daa4c0a8126b209f3235ede129602de5c831745ed1424457d890cf3e6ee20c886716128bb580f39f3e58a1')
pkgver() {
cd "${srcdir}/${_pkgname}"
@@ -143,8 +148,11 @@ prepare() {
git submodule update --init
#patches
- patch -p1 < "${srcdir}/0001-Add-an-option-to-hide-messages-from-blocked-users-in.patch"
+ #patch -p1 < "${srcdir}/0001-Add-an-option-to-hide-messages-from-blocked-users-in.patch"
patch -p1 < "${srcdir}/block-sponsored_messages.patch"
+ patch -p1 < "${srcdir}/fix_ffmpeg5_build_24044.patch"
+ cd "${srcdir}/${_pkgname}/Telegram/ThirdParty/tgcalls/"
+ patch -p1 < "${srcdir}/fix_tgcalls_ffmpeg5.patch"
}
build() {
diff --git a/fix_ffmpeg5_build_24044.patch b/fix_ffmpeg5_build_24044.patch
new file mode 100644
index 000000000000..389d5f778fff
--- /dev/null
+++ b/fix_ffmpeg5_build_24044.patch
@@ -0,0 +1,85 @@
+From 75e40907af063d25cdb9e42ed5c8a033920ab5c8 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <nicholas@guriev.su>
+Date: Tue, 8 Feb 2022 18:20:27 +0300
+Subject: [PATCH] Fix build against FFmpeg v5.0
+
+It has been released on January 17th. This patch keeps source compatibility
+with older versions.
+---
+ Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp | 2 +-
+ Telegram/SourceFiles/ffmpeg/ffmpeg_utility.h | 2 +-
+ Telegram/SourceFiles/media/audio/media_audio_capture.cpp | 2 +-
+ Telegram/SourceFiles/media/audio/media_audio_ffmpeg_loader.h | 4 ++++
+ Telegram/SourceFiles/media/streaming/media_streaming_file.cpp | 4 ++--
+ 5 files changed, 9 insertions(+), 5 deletions(-)
+
+diff --git a/Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp b/Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp
+index 866926a9ef13..a01b9fe6152f 100644
+--- a/Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp
++++ b/Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp
+@@ -154,7 +154,7 @@ void FormatDeleter::operator()(AVFormatContext *value) {
+ }
+ }
+
+-AVCodec *FindDecoder(not_null<AVCodecContext*> context) {
++const AVCodec *FindDecoder(not_null<AVCodecContext*> context) {
+ // Force libvpx-vp9, because we need alpha channel support.
+ return (context->codec_id == AV_CODEC_ID_VP9)
+ ? avcodec_find_decoder_by_name("libvpx-vp9")
+diff --git a/Telegram/SourceFiles/ffmpeg/ffmpeg_utility.h b/Telegram/SourceFiles/ffmpeg/ffmpeg_utility.h
+index 401d65dc6b45..6f502dcaa88b 100644
+--- a/Telegram/SourceFiles/ffmpeg/ffmpeg_utility.h
++++ b/Telegram/SourceFiles/ffmpeg/ffmpeg_utility.h
+@@ -158,7 +158,7 @@ using SwscalePointer = std::unique_ptr<SwsContext, SwscaleDeleter>;
+ void LogError(QLatin1String method);
+ void LogError(QLatin1String method, FFmpeg::AvErrorWrap error);
+
+-[[nodiscard]] AVCodec *FindDecoder(not_null<AVCodecContext*> context);
++[[nodiscard]] const AVCodec *FindDecoder(not_null<AVCodecContext*> context);
+ [[nodiscard]] crl::time PtsToTime(int64_t pts, AVRational timeBase);
+ // Used for full duration conversion.
+ [[nodiscard]] crl::time PtsToTimeCeil(int64_t pts, AVRational timeBase);
+diff --git a/Telegram/SourceFiles/media/audio/media_audio_capture.cpp b/Telegram/SourceFiles/media/audio/media_audio_capture.cpp
+index 6ce2456681b3..04c361a37d9e 100644
+--- a/Telegram/SourceFiles/media/audio/media_audio_capture.cpp
++++ b/Telegram/SourceFiles/media/audio/media_audio_capture.cpp
+@@ -147,7 +147,7 @@ struct Instance::Inner::Private {
+ AVIOContext *ioContext = nullptr;
+ AVFormatContext *fmtContext = nullptr;
+ AVStream *stream = nullptr;
+- AVCodec *codec = nullptr;
++ const AVCodec *codec = nullptr;
+ AVCodecContext *codecContext = nullptr;
+ bool opened = false;
+ bool processing = false;
+diff --git a/Telegram/SourceFiles/media/audio/media_audio_ffmpeg_loader.h b/Telegram/SourceFiles/media/audio/media_audio_ffmpeg_loader.h
+index 83de13bad267..58c97fe49bb0 100644
+--- a/Telegram/SourceFiles/media/audio/media_audio_ffmpeg_loader.h
++++ b/Telegram/SourceFiles/media/audio/media_audio_ffmpeg_loader.h
+@@ -60,7 +60,11 @@ class AbstractFFMpegLoader : public AudioPlayerLoader {
+ uchar *ioBuffer = nullptr;
+ AVIOContext *ioContext = nullptr;
+ AVFormatContext *fmtContext = nullptr;
++#if LIBAVFORMAT_VERSION_MAJOR >= 59
++ const AVCodec *codec = nullptr;
++#else
+ AVCodec *codec = nullptr;
++#endif
+ int32 streamId = 0;
+
+ bool _opened = false;
+diff --git a/Telegram/SourceFiles/media/streaming/media_streaming_file.cpp b/Telegram/SourceFiles/media/streaming/media_streaming_file.cpp
+index 874cf5cd2417..3d2658c880d9 100644
+--- a/Telegram/SourceFiles/media/streaming/media_streaming_file.cpp
++++ b/Telegram/SourceFiles/media/streaming/media_streaming_file.cpp
+@@ -23,8 +23,8 @@ constexpr auto kMaxQueuedPackets = 1024;
+ not_null<AVStream*> stream,
+ Mode mode) {
+ return (mode == Mode::Video || mode == Mode::Inspection)
+- && stream->codec
+- && (stream->codec->codec_id == AV_CODEC_ID_VP9)
++ && stream->codecpar
++ && (stream->codecpar->codec_id == AV_CODEC_ID_VP9)
+ && format->iformat
+ && format->iformat->name
+ && QString::fromLatin1(
diff --git a/fix_tgcalls_ffmpeg5.patch b/fix_tgcalls_ffmpeg5.patch
new file mode 100644
index 000000000000..4e0cb53b0292
--- /dev/null
+++ b/fix_tgcalls_ffmpeg5.patch
@@ -0,0 +1,44 @@
+diff --git a/tgcalls/group/AudioStreamingPart.cpp b/tgcalls/group/AudioStreamingPart.cpp
+index f71c8c7..27d8c89 100644
+--- a/tgcalls/group/AudioStreamingPart.cpp
++++ b/tgcalls/group/AudioStreamingPart.cpp
+@@ -170,7 +170,7 @@ public:
+
+ _frame = av_frame_alloc();
+
+- AVInputFormat *inputFormat = av_find_input_format("ogg");
++ const AVInputFormat *inputFormat = av_find_input_format("ogg");
+ if (!inputFormat) {
+ _didReadToEnd = true;
+ return;
+@@ -255,7 +255,7 @@ public:
+ }
+
+ if (audioCodecParameters && audioStream) {
+- AVCodec *codec = avcodec_find_decoder(audioCodecParameters->codec_id);
++ const AVCodec *codec = avcodec_find_decoder(audioCodecParameters->codec_id);
+ if (codec) {
+ _codecContext = avcodec_alloc_context3(codec);
+ ret = avcodec_parameters_to_context(_codecContext, audioCodecParameters);
+diff --git a/tgcalls/group/VideoStreamingPart.cpp b/tgcalls/group/VideoStreamingPart.cpp
+index 591a523..c2b1998 100644
+--- a/tgcalls/group/VideoStreamingPart.cpp
++++ b/tgcalls/group/VideoStreamingPart.cpp
+@@ -337,7 +337,7 @@ public:
+
+ int ret = 0;
+
+- AVInputFormat *inputFormat = av_find_input_format(container.c_str());
++ const AVInputFormat *inputFormat = av_find_input_format(container.c_str());
+ if (!inputFormat) {
+ _didReadToEnd = true;
+ return;
+@@ -380,7 +380,7 @@ public:
+ }
+
+ if (videoCodecParameters && videoStream) {
+- AVCodec *codec = avcodec_find_decoder(videoCodecParameters->codec_id);
++ const AVCodec *codec = avcodec_find_decoder(videoCodecParameters->codec_id);
+ if (codec) {
+ _codecContext = avcodec_alloc_context3(codec);
+ ret = avcodec_parameters_to_context(_codecContext, videoCodecParameters);