commit 4a61f1c37ecb5e08d64232b808aa7298d2eb6476
Author: Leigh Scott <leigh123linux(a)gmail.com>
Date: Tue Jun 2 19:09:37 2020 +0100
Fix gcc-10 -fno-common issue
gcc10_fix.patch | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
libopenshot.spec | 10 +++++++---
sources | 1 -
3 files changed, 58 insertions(+), 4 deletions(-)
---
diff --git a/gcc10_fix.patch b/gcc10_fix.patch
new file mode 100644
index 0000000..3adac26
--- /dev/null
+++ b/gcc10_fix.patch
@@ -0,0 +1,51 @@
+From 13290364e7bea54164ab83d973951f2898ad9e23 Mon Sep 17 00:00:00 2001
+From: Stefan Strogin <steils(a)gentoo.org>
+Date: Sat, 16 May 2020 02:33:37 +0300
+Subject: [PATCH] FFmpegUtilities: replace variable definition with statement
+ expression
+
+It is needed to avoid multiple definitions of AV_GET_CODEC_CONTEXT,
+which is considered as an error with '-fno-common' which is default
+since gcc-10.
+
+Fixes: #511
+---
+ include/FFmpegUtilities.h | 18 ++++++++----------
+ 1 file changed, 8 insertions(+), 10 deletions(-)
+
+diff --git a/include/FFmpegUtilities.h b/include/FFmpegUtilities.h
+index 62d64df1..b4ec951f 100644
+--- a/include/FFmpegUtilities.h
++++ b/include/FFmpegUtilities.h
+@@ -163,11 +163,10 @@
+ #define AV_FREE_CONTEXT(av_context) avcodec_free_context(&av_context)
+ #define AV_GET_CODEC_TYPE(av_stream) av_stream->codecpar->codec_type
+ #define AV_FIND_DECODER_CODEC_ID(av_stream) av_stream->codecpar->codec_id
+- auto AV_GET_CODEC_CONTEXT = [](AVStream* av_stream, AVCodec* av_codec) { \
+- AVCodecContext *context = avcodec_alloc_context3(av_codec); \
+- avcodec_parameters_to_context(context, av_stream->codecpar); \
+- return context; \
+- };
++ #define AV_GET_CODEC_CONTEXT(av_stream, av_codec) \
++ ({ AVCodecContext *context = avcodec_alloc_context3(av_codec); \
++ avcodec_parameters_to_context(context, av_stream->codecpar); \
++ context; })
+ #define AV_GET_CODEC_PAR_CONTEXT(av_stream, av_codec) av_codec;
+ #define AV_GET_CODEC_FROM_STREAM(av_stream,codec_in)
+ #define AV_GET_CODEC_ATTRIBUTES(av_stream, av_context) av_stream->codecpar
+@@ -199,11 +198,10 @@
+ #define AV_FREE_CONTEXT(av_context) avcodec_free_context(&av_context)
+ #define AV_GET_CODEC_TYPE(av_stream) av_stream->codecpar->codec_type
+ #define AV_FIND_DECODER_CODEC_ID(av_stream) av_stream->codecpar->codec_id
+- auto AV_GET_CODEC_CONTEXT = [](AVStream* av_stream, AVCodec* av_codec) { \
+- AVCodecContext *context = avcodec_alloc_context3(av_codec); \
+- avcodec_parameters_to_context(context, av_stream->codecpar); \
+- return context; \
+- };
++ #define AV_GET_CODEC_CONTEXT(av_stream, av_codec) \
++ ({ AVCodecContext *context = avcodec_alloc_context3(av_codec); \
++ avcodec_parameters_to_context(context, av_stream->codecpar); \
++ context; })
+ #define AV_GET_CODEC_PAR_CONTEXT(av_stream, av_codec) av_codec;
+ #define AV_GET_CODEC_FROM_STREAM(av_stream,codec_in)
+ #define AV_GET_CODEC_ATTRIBUTES(av_stream, av_context) av_stream->codecpar
diff --git a/libopenshot.spec b/libopenshot.spec
index 0c2f2db..34a6322 100644
--- a/libopenshot.spec
+++ b/libopenshot.spec
@@ -1,13 +1,14 @@
-%define _legacy_common_support 1
+%global github_url
https://github.com/OpenShot/libopenshot
Name: libopenshot
Version: 0.2.5
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: Library for creating and editing videos
License: LGPLv3+
URL:
http://www.openshot.org/
-Source0:
https://github.com/OpenShot/%{name}/archive/v%{version}/%{name}-%{version...
+Source0: %{github_url}/archive/v%{version}/%{name}-%{version}.tar.gz
+Patch0:
%{github_url}/commit/13290364e7bea54164ab83d973951f2898ad9e23.patch#/gcc10_fix.patch
# libopenshot is completely broken on ppc64le, see rfbz #5528
ExcludeArch: ppc64le
@@ -103,6 +104,9 @@ make os_test
%{ruby_vendorarchdir}/*
%changelog
+* Tue Jun 02 2020 Leigh Scott <leigh123linux(a)gmail.com> - 0.2.5-4
+- Fix gcc-10 -fno-common issue
+
* Sat May 30 2020 Leigh Scott <leigh123linux(a)gmail.com> - 0.2.5-3
- Rebuild for python-3.9
diff --git a/sources b/sources
index 04fd197..2dad97d 100644
--- a/sources
+++ b/sources
@@ -1,2 +1 @@
-SHA512 (libopenshot-0.2.4.tar.gz) =
6824ad22e81814b6427a4cb6489e5b893be264b5afa6e54287cd649f244f86b938c1b1d56280c1f49af65fa118d056d204bd39bc5b2ccdc10376d2df2f33a352
SHA512 (libopenshot-0.2.5.tar.gz) =
b7cdf72897e6edaa8cc00e17dbe30f5b22a6b5d69aab64ddafb184458b41ef0332db1f3e2c6f039492bf7adb521d9758834d0bf6c24e6421a55970d8cf8caba7