[d1x/f36] Fix compilation on armv7hl
by jwrdegoede
Summary of changes:
a462521... Fix compilation on armv7hl (*)
(*) This commit already existed in another branch; no separate mail sent
2 years, 8 months
[d1x] Fix compilation on armv7hl
by jwrdegoede
commit a462521e24331c838d0be9aa3a5c84f53e9cc466
Author: Hans de Goede <hdegoede(a)redhat.com>
Date: Sat Mar 12 13:14:08 2022 +0100
Fix compilation on armv7hl
d1x-disable-Werror-useless-cast.patch | 62 +++++++++++++++++++++++++++++++++++
d1x.spec | 3 ++
2 files changed, 65 insertions(+)
---
diff --git a/d1x-disable-Werror-useless-cast.patch b/d1x-disable-Werror-useless-cast.patch
new file mode 100644
index 0000000..68a8dc8
--- /dev/null
+++ b/d1x-disable-Werror-useless-cast.patch
@@ -0,0 +1,62 @@
+diff -up dxx-rebirth-7258b7fd5966fc38e53f4d8192b0c810829ada02/SConstruct~ dxx-rebirth-7258b7fd5966fc38e53f4d8192b0c810829ada02/SConstruct
+--- dxx-rebirth-7258b7fd5966fc38e53f4d8192b0c810829ada02/SConstruct~ 2022-01-30 05:40:54.000000000 +0100
++++ dxx-rebirth-7258b7fd5966fc38e53f4d8192b0c810829ada02/SConstruct 2022-03-12 13:00:09.405774342 +0100
+@@ -2455,58 +2455,6 @@ $ x86_64-pc-linux-gnu-g++-5.4.0 -x c++ -
+ context.sconf.Define('DXX_PRI_size_type', f)
+ return
+ raise SCons.Errors.StopError("C++ compiler rejects all candidate format strings for std::size_t.")
+- implicit_tests.append(_implicit_test.RecordedTest('check_compiler_accepts_useless_cast', "assume compiler accepts -Wuseless-cast"))
+-
+- @_custom_test
+- def check_compiler_useless_cast(self,context):
+- Compile = self.Compile
+- flags = {'CXXFLAGS' : [get_Werror_string(context.env['CXXFLAGS']) + 'useless-cast']}
+- if Compile(context, text='''
+-/*
+- * SDL on Raspbian provokes a warning from -Wuseless-cast
+- *
+- * Reported-by: derhass <https://github.com/dxx-rebirth/dxx-rebirth/issues/257>
+- */
+-#include <SDL_endian.h>
+-
+-/*
+- * Recent gcc[1] create a useless cast when synthesizing constructor
+- * inheritance, then warn the user about the compiler-generated cast.
+- * Since the user did not write the cast in the source, the user
+- * cannot remove the cast to eliminate the warning.
+- *
+- * The only way to avoid the problem is to avoid using constructor
+- * inheritance in cases where the compiler would synthesize a useless
+- * cast.
+- *
+- * Reported-by: zicodxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/316>
+- * gcc Bugzilla: <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70844>
+- *
+- * [1] gcc-6.x, gcc-7.x (all currently released versions)
+- */
+-class base
+-{
+-public:
+- base(int &) {}
+-};
+-
+-class derived : public base
+-{
+-public:
+- using base::base;
+-};
+-
+-''', main='''
+- derived d(argc);
+- return SDL_Swap32(argc);
+-''', msg='whether compiler argument -Wuseless-cast works with SDL and with constructor inheritance', successflags=flags):
+- return
+- # <=clang-3.7 does not understand -Wuseless-cast
+- # This test does not influence the compile environment, but is
+- # run to distinguish in the output whether the failure is
+- # because the compiler does not accept -Wuseless-cast or because
+- # SDL's headers provoke a warning from -Wuseless-cast.
+- Compile(context, text='', main='', msg='whether compiler accepts -Wuseless-cast', testflags=flags, calling_function='compiler_accepts_useless_cast')
+
+ @_custom_test
+ def check_compiler_ptrdiff_cast_int(self,context):
diff --git a/d1x.spec b/d1x.spec
index 5f68aba..8516e4e 100644
--- a/d1x.spec
+++ b/d1x.spec
@@ -18,6 +18,8 @@ Source6: d2x-rebirth.appdata.xml
Patch0: d1x-gcc10.patch
Patch1: d1x-gcc12.patch
Patch2: d1x-window_icon_bitmap.patch
+# Fix compilation on armv7hl, can be dropped when we drop armv7hl support
+Patch3: d1x-disable-Werror-useless-cast.patch
URL: https://www.dxx-rebirth.com/
BuildRequires: gcc gcc-c++ libpng-devel
BuildRequires: SDL2-devel SDL2_mixer-devel SDL2_image-devel
@@ -69,6 +71,7 @@ robots-h.mvl files to the dir.
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
# Fixup encoding and CTRL+Z at the end of the orderfrm.txt files
iconv -f CP850 -t UTF-8 d1shar/ORDERFRM.TXT | head -n-3 > ORDERFRM.TXT
touch -r d1shar/ORDERFRM.TXT ORDERFRM.TXT
2 years, 8 months
[telegram-desktop/f36] One more ffmpeg 5.0 patch rebase.
by Vitaly Zaitsev
commit 06b36b0e77ae7c7ca7b1ea4b13cb0d91df42069f
Author: Vitaly Zaitsev <vitaly(a)easycoding.org>
Date: Fri Mar 11 23:00:51 2022 +0100
One more ffmpeg 5.0 patch rebase.
telegram-desktop-ffmpeg5.patch | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/telegram-desktop-ffmpeg5.patch b/telegram-desktop-ffmpeg5.patch
index c3d7eeb..4c9d978 100644
--- a/telegram-desktop-ffmpeg5.patch
+++ b/telegram-desktop-ffmpeg5.patch
@@ -6,15 +6,15 @@ Subject: [PATCH] Fix build against FFmpeg v5.0
It has been released on January 17th. This patch keeps source compatibility
with older versions.
---
- Telegram/ThirdParty/tgcalls/group/AudioStreamingPartInternal.cpp | 5 ++++-
- Telegram/ThirdParty/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp | 2 +-
- Telegram/ThirdParty/tgcalls/group/VideoStreamingPart.cpp | 5 ++++-
+ Telegram/ThirdParty/tgcalls/tgcalls/group/AudioStreamingPartInternal.cpp | 5 ++++-
+ Telegram/ThirdParty/tgcalls/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp | 2 +-
+ Telegram/ThirdParty/tgcalls/tgcalls/group/VideoStreamingPart.cpp | 5 ++++-
3 files changed, 9 insertions(+), 3 deletions(-)
-diff --git a/Telegram/ThirdParty/tgcalls/group/AudioStreamingPartInternal.cpp b/Telegram/ThirdParty/tgcalls/group/AudioStreamingPartInternal.cpp
+diff --git a/Telegram/ThirdParty/tgcalls/tgcalls/group/AudioStreamingPartInternal.cpp b/Telegram/ThirdParty/tgcalls/tgcalls/group/AudioStreamingPartInternal.cpp
index 27a71cb..5639036 100644
---- a/Telegram/ThirdParty/tgcalls/group/AudioStreamingPartInternal.cpp
-+++ b/Telegram/ThirdParty/tgcalls/group/AudioStreamingPartInternal.cpp
+--- a/Telegram/ThirdParty/tgcalls/tgcalls/group/AudioStreamingPartInternal.cpp
++++ b/Telegram/ThirdParty/tgcalls/tgcalls/group/AudioStreamingPartInternal.cpp
@@ -104,6 +104,9 @@ _avIoContext(std::move(fileData)) {
_frame = av_frame_alloc();
@@ -34,10 +34,10 @@ index 27a71cb..5639036 100644
if (inStream->metadata) {
AVDictionaryEntry *entry = av_dict_get(inStream->metadata, "TG_META", nullptr, 0);
-diff --git a/Telegram/ThirdParty/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp b/Telegram/ThirdParty/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp
+diff --git a/Telegram/ThirdParty/tgcalls/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp b/Telegram/ThirdParty/tgcalls/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp
index e79d430..63ef475 100644
---- a/Telegram/ThirdParty/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp
-+++ b/Telegram/ThirdParty/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp
+--- a/Telegram/ThirdParty/tgcalls/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp
++++ b/Telegram/ThirdParty/tgcalls/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp
@@ -32,7 +32,7 @@ class AudioStreamingPartPersistentDecoderState {
AudioStreamingPartPersistentDecoderState(AVCodecParameters const *codecParameters, AVRational timeBase) :
_codecParameters(codecParameters),
@@ -47,10 +47,10 @@ index e79d430..63ef475 100644
if (codec) {
_codecContext = avcodec_alloc_context3(codec);
int ret = avcodec_parameters_to_context(_codecContext, codecParameters);
-diff --git a/Telegram/ThirdParty/tgcalls/group/VideoStreamingPart.cpp b/Telegram/ThirdParty/tgcalls/group/VideoStreamingPart.cpp
+diff --git a/Telegram/ThirdParty/tgcalls/tgcalls/group/VideoStreamingPart.cpp b/Telegram/ThirdParty/tgcalls/tgcalls/group/VideoStreamingPart.cpp
index a67514a..10457eb 100644
---- a/Telegram/ThirdParty/tgcalls/group/VideoStreamingPart.cpp
-+++ b/Telegram/ThirdParty/tgcalls/group/VideoStreamingPart.cpp
+--- a/Telegram/ThirdParty/tgcalls/tgcalls/group/VideoStreamingPart.cpp
++++ b/Telegram/ThirdParty/tgcalls/tgcalls/group/VideoStreamingPart.cpp
@@ -280,6 +280,9 @@ class VideoStreamingPartInternal {
int ret = 0;
2 years, 8 months
[telegram-desktop/f36] Rebased ffmpeg 5.0 patch.
by Vitaly Zaitsev
commit 0731d2e015d76173365c8590295acfedd54627b1
Author: Vitaly Zaitsev <vitaly(a)easycoding.org>
Date: Fri Mar 11 22:54:55 2022 +0100
Rebased ffmpeg 5.0 patch.
telegram-desktop-ffmpeg5.patch | 79 ++++++++++++++++++++++--------------------
1 file changed, 42 insertions(+), 37 deletions(-)
---
diff --git a/telegram-desktop-ffmpeg5.patch b/telegram-desktop-ffmpeg5.patch
index 3b809fa..c3d7eeb 100644
--- a/telegram-desktop-ffmpeg5.patch
+++ b/telegram-desktop-ffmpeg5.patch
@@ -1,52 +1,57 @@
-From 9ffcae6397442091d2aa77d643fc6268ff048105 Mon Sep 17 00:00:00 2001
+From da288b3cf4f91937da5bb8de0570dfa64871f4d9 Mon Sep 17 00:00:00 2001
From: Nicholas Guriev <nicholas(a)guriev.su>
-Date: Tue, 8 Feb 2022 18:20:27 +0300
+Date: Mon, 7 Mar 2022 11:52:01 +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/ThirdParty/tgcalls/tgcalls/group/AudioStreamingPart.cpp | 7 +++++--
- Telegram/ThirdParty/tgcalls/tgcalls/group/VideoStreamingPart.cpp | 5 ++++-
- 2 files changed, 9 insertions(+), 3 deletions(-)
+ Telegram/ThirdParty/tgcalls/group/AudioStreamingPartInternal.cpp | 5 ++++-
+ Telegram/ThirdParty/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp | 2 +-
+ Telegram/ThirdParty/tgcalls/group/VideoStreamingPart.cpp | 5 ++++-
+ 3 files changed, 9 insertions(+), 3 deletions(-)
-diff --git a/Telegram/ThirdParty/tgcalls/tgcalls/group/AudioStreamingPart.cpp b/Telegram/ThirdParty/tgcalls/tgcalls/group/AudioStreamingPart.cpp
-index f71c8c7..94271b1 100644
---- a/Telegram/ThirdParty/tgcalls/tgcalls/group/AudioStreamingPart.cpp
-+++ b/Telegram/ThirdParty/tgcalls/tgcalls/group/AudioStreamingPart.cpp
-@@ -170,6 +170,9 @@ class AudioStreamingPartInternal {
+diff --git a/Telegram/ThirdParty/tgcalls/group/AudioStreamingPartInternal.cpp b/Telegram/ThirdParty/tgcalls/group/AudioStreamingPartInternal.cpp
+index 27a71cb..5639036 100644
+--- a/Telegram/ThirdParty/tgcalls/group/AudioStreamingPartInternal.cpp
++++ b/Telegram/ThirdParty/tgcalls/group/AudioStreamingPartInternal.cpp
+@@ -104,6 +104,9 @@ _avIoContext(std::move(fileData)) {
- _frame = av_frame_alloc();
+ _frame = av_frame_alloc();
+#if LIBAVFORMAT_VERSION_MAJOR >= 59
-+ const
++ const
+#endif
- AVInputFormat *inputFormat = av_find_input_format("ogg");
- if (!inputFormat) {
- _didReadToEnd = true;
-@@ -209,7 +212,7 @@ class AudioStreamingPartInternal {
- audioCodecParameters = inCodecpar;
- audioStream = inStream;
+ AVInputFormat *inputFormat = av_find_input_format(container.c_str());
+ if (!inputFormat) {
+ _didReadToEnd = true;
+@@ -144,7 +147,7 @@ _avIoContext(std::move(fileData)) {
+
+ _streamId = i;
-- _durationInMilliseconds = (int)((inStream->duration + inStream->first_dts) * 1000 / 48000);
-+ _durationInMilliseconds = (int)(inStream->duration * av_q2d(inStream->time_base) * 1000);
+- _durationInMilliseconds = (int)((inStream->duration + inStream->first_dts) * 1000 / 48000);
++ _durationInMilliseconds = (int)(inStream->duration * av_q2d(inStream->time_base) * 1000);
- if (inStream->metadata) {
- AVDictionaryEntry *entry = av_dict_get(inStream->metadata, "TG_META", nullptr, 0);
-@@ -255,7 +258,7 @@ class AudioStreamingPartInternal {
- }
-
- 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/Telegram/ThirdParty/tgcalls/tgcalls/group/VideoStreamingPart.cpp b/Telegram/ThirdParty/tgcalls/tgcalls/group/VideoStreamingPart.cpp
-index 591a523..a92151e 100644
---- a/Telegram/ThirdParty/tgcalls/tgcalls/group/VideoStreamingPart.cpp
-+++ b/Telegram/ThirdParty/tgcalls/tgcalls/group/VideoStreamingPart.cpp
-@@ -337,6 +337,9 @@ class VideoStreamingPartInternal {
+ if (inStream->metadata) {
+ AVDictionaryEntry *entry = av_dict_get(inStream->metadata, "TG_META", nullptr, 0);
+diff --git a/Telegram/ThirdParty/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp b/Telegram/ThirdParty/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp
+index e79d430..63ef475 100644
+--- a/Telegram/ThirdParty/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp
++++ b/Telegram/ThirdParty/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp
+@@ -32,7 +32,7 @@ class AudioStreamingPartPersistentDecoderState {
+ AudioStreamingPartPersistentDecoderState(AVCodecParameters const *codecParameters, AVRational timeBase) :
+ _codecParameters(codecParameters),
+ _timeBase(timeBase) {
+- AVCodec *codec = avcodec_find_decoder(codecParameters->codec_id);
++ const AVCodec *codec = avcodec_find_decoder(codecParameters->codec_id);
+ if (codec) {
+ _codecContext = avcodec_alloc_context3(codec);
+ int ret = avcodec_parameters_to_context(_codecContext, codecParameters);
+diff --git a/Telegram/ThirdParty/tgcalls/group/VideoStreamingPart.cpp b/Telegram/ThirdParty/tgcalls/group/VideoStreamingPart.cpp
+index a67514a..10457eb 100644
+--- a/Telegram/ThirdParty/tgcalls/group/VideoStreamingPart.cpp
++++ b/Telegram/ThirdParty/tgcalls/group/VideoStreamingPart.cpp
+@@ -280,6 +280,9 @@ class VideoStreamingPartInternal {
int ret = 0;
@@ -56,7 +61,7 @@ index 591a523..a92151e 100644
AVInputFormat *inputFormat = av_find_input_format(container.c_str());
if (!inputFormat) {
_didReadToEnd = true;
-@@ -380,7 +383,7 @@ class VideoStreamingPartInternal {
+@@ -323,7 +326,7 @@ class VideoStreamingPartInternal {
}
if (videoCodecParameters && videoStream) {
2 years, 8 months
[telegram-desktop/f36] Added ffmpeg 5.0 patch again.
by Vitaly Zaitsev
commit 7a711e8ded66656e02986271297a522e28a2304e
Author: Vitaly Zaitsev <vitaly(a)easycoding.org>
Date: Fri Mar 11 22:40:56 2022 +0100
Added ffmpeg 5.0 patch again.
telegram-desktop-ffmpeg5.patch | 67 ++++++++++++++++++++++++++++++++++++++++++
telegram-desktop.spec | 3 ++
2 files changed, 70 insertions(+)
---
diff --git a/telegram-desktop-ffmpeg5.patch b/telegram-desktop-ffmpeg5.patch
new file mode 100644
index 0000000..3b809fa
--- /dev/null
+++ b/telegram-desktop-ffmpeg5.patch
@@ -0,0 +1,67 @@
+From 9ffcae6397442091d2aa77d643fc6268ff048105 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <nicholas(a)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/ThirdParty/tgcalls/tgcalls/group/AudioStreamingPart.cpp | 7 +++++--
+ Telegram/ThirdParty/tgcalls/tgcalls/group/VideoStreamingPart.cpp | 5 ++++-
+ 2 files changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/Telegram/ThirdParty/tgcalls/tgcalls/group/AudioStreamingPart.cpp b/Telegram/ThirdParty/tgcalls/tgcalls/group/AudioStreamingPart.cpp
+index f71c8c7..94271b1 100644
+--- a/Telegram/ThirdParty/tgcalls/tgcalls/group/AudioStreamingPart.cpp
++++ b/Telegram/ThirdParty/tgcalls/tgcalls/group/AudioStreamingPart.cpp
+@@ -170,6 +170,9 @@ class AudioStreamingPartInternal {
+
+ _frame = av_frame_alloc();
+
++#if LIBAVFORMAT_VERSION_MAJOR >= 59
++ const
++#endif
+ AVInputFormat *inputFormat = av_find_input_format("ogg");
+ if (!inputFormat) {
+ _didReadToEnd = true;
+@@ -209,7 +212,7 @@ class AudioStreamingPartInternal {
+ audioCodecParameters = inCodecpar;
+ audioStream = inStream;
+
+- _durationInMilliseconds = (int)((inStream->duration + inStream->first_dts) * 1000 / 48000);
++ _durationInMilliseconds = (int)(inStream->duration * av_q2d(inStream->time_base) * 1000);
+
+ if (inStream->metadata) {
+ AVDictionaryEntry *entry = av_dict_get(inStream->metadata, "TG_META", nullptr, 0);
+@@ -255,7 +258,7 @@ class AudioStreamingPartInternal {
+ }
+
+ 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/Telegram/ThirdParty/tgcalls/tgcalls/group/VideoStreamingPart.cpp b/Telegram/ThirdParty/tgcalls/tgcalls/group/VideoStreamingPart.cpp
+index 591a523..a92151e 100644
+--- a/Telegram/ThirdParty/tgcalls/tgcalls/group/VideoStreamingPart.cpp
++++ b/Telegram/ThirdParty/tgcalls/tgcalls/group/VideoStreamingPart.cpp
+@@ -337,6 +337,9 @@ class VideoStreamingPartInternal {
+
+ int ret = 0;
+
++#if LIBAVFORMAT_VERSION_MAJOR >= 59
++ const
++#endif
+ AVInputFormat *inputFormat = av_find_input_format(container.c_str());
+ if (!inputFormat) {
+ _didReadToEnd = true;
+@@ -380,7 +383,7 @@ class VideoStreamingPartInternal {
+ }
+
+ 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);
diff --git a/telegram-desktop.spec b/telegram-desktop.spec
index 0f3b163..7b4b1aa 100644
--- a/telegram-desktop.spec
+++ b/telegram-desktop.spec
@@ -39,6 +39,9 @@ Source0: %{url}/releases/download/v%{version}/%{appname}-%{version}-full.tar.gz
# Downstream patches.
Patch0: %{name}-unbundled-kwayland-stuff.patch
+# https://github.com/TelegramMessenger/tgcalls/pull/14
+Patch100: %{name}-ffmpeg5.patch
+
# Telegram Desktop require more than 8 GB of RAM on linking stage.
# Disabling all low-memory architectures.
ExclusiveArch: x86_64 aarch64
2 years, 8 months