summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Willy Sudiarto Raharjo <willysr@slackbuilds.org>2020-08-16 18:36:18 +0700
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2020-08-16 18:36:18 +0700
commitdcd422594be1b754e4711ac0e0bef2b751fe4567 (patch)
tree5c357ca94ecfa4dd3d61c8292bb4d68da7588bce
parent039623ea867a44e41cbf62cada3efca35cd703b8 (diff)
downloadslackbuilds-libopenshot-current.tar.gz
slackbuilds-libopenshot-current.tar.xz
libraries/libopenshot: Fix build on -current with gcc 10.libopenshot-current
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--libraries/libopenshot/512.patch51
-rw-r--r--libraries/libopenshot/libopenshot.SlackBuild1
2 files changed, 52 insertions, 0 deletions
diff --git a/libraries/libopenshot/512.patch b/libraries/libopenshot/512.patch
new file mode 100644
index 0000000000..3adac26b1c
--- /dev/null
+++ b/libraries/libopenshot/512.patch
@@ -0,0 +1,51 @@
+From 13290364e7bea54164ab83d973951f2898ad9e23 Mon Sep 17 00:00:00 2001
+From: Stefan Strogin <steils@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/libraries/libopenshot/libopenshot.SlackBuild b/libraries/libopenshot/libopenshot.SlackBuild
index 21480212eb..d2d6bebdcf 100644
--- a/libraries/libopenshot/libopenshot.SlackBuild
+++ b/libraries/libopenshot/libopenshot.SlackBuild
@@ -70,6 +70,7 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+patch -p1 < $CWD/512.patch
mkdir -p build
cd build
cmake \