summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Bernardini <ponce@slackbuilds.org>2017-10-12 08:44:40 +0200
committerDavid Spencer <idlemoor@slackbuilds.org>2017-10-14 14:49:06 +0100
commit75f00708f488e25feac184469c0bd8f5c553a67c (patch)
treeece6b8ae7acdcc873df15a9913bb775d0309b971
parent485412b1c535330a0b0b16d60d7edf0e66883254 (diff)
downloadslackbuilds-75f00708f488e25feac184469c0bd8f5c553a67c.tar.gz
multimedia/ffmpeg: Patched to build against openjpeg-2.3.0.
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
-rw-r--r--multimedia/ffmpeg/ffmpeg-3.2.4-openjpeg2.3.patch102
-rw-r--r--multimedia/ffmpeg/ffmpeg.SlackBuild3
2 files changed, 105 insertions, 0 deletions
diff --git a/multimedia/ffmpeg/ffmpeg-3.2.4-openjpeg2.3.patch b/multimedia/ffmpeg/ffmpeg-3.2.4-openjpeg2.3.patch
new file mode 100644
index 0000000000..65e17d4449
--- /dev/null
+++ b/multimedia/ffmpeg/ffmpeg-3.2.4-openjpeg2.3.patch
@@ -0,0 +1,102 @@
+diff -Naur ffmpeg-3.2.4.orig/configure ffmpeg-3.2.4/configure
+--- ffmpeg-3.2.4.orig/configure 2017-02-10 14:25:25.000000000 +0100
++++ ffmpeg-3.2.4/configure 2017-10-12 08:36:03.395867915 +0200
+@@ -1831,6 +1831,8 @@
+ machine_ioctl_meteor_h
+ malloc_h
+ opencv2_core_core_c_h
++ openjpeg_2_3_openjpeg_h
++ openjpeg_2_2_openjpeg_h
+ openjpeg_2_1_openjpeg_h
+ openjpeg_2_0_openjpeg_h
+ openjpeg_1_5_openjpeg_h
+@@ -5721,7 +5723,11 @@
+ require opencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
+ require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader; }
+ enabled libopenh264 && require_pkg_config openh264 wels/codec_api.h WelsGetCodecVersion
+-enabled libopenjpeg && { { check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
++enabled libopenjpeg && { { check_lib2 openjpeg-2.3/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
++ check_lib2 openjpeg-2.3/openjpeg.h opj_version -lopenjp2 ||
++ { check_lib2 openjpeg-2.2/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
++ check_lib2 openjpeg-2.2/openjpeg.h opj_version -lopenjp2 ||
++ { check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
+ check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2 ||
+ { check_lib2 openjpeg-2.0/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
+ { check_lib2 openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
+diff -Naur ffmpeg-3.2.4.orig/libavcodec/libopenjpegdec.c ffmpeg-3.2.4/libavcodec/libopenjpegdec.c
+--- ffmpeg-3.2.4.orig/libavcodec/libopenjpegdec.c 2017-02-10 14:25:26.000000000 +0100
++++ ffmpeg-3.2.4/libavcodec/libopenjpegdec.c 2017-10-12 08:38:20.676315554 +0200
+@@ -34,7 +34,11 @@
+ #include "internal.h"
+ #include "thread.h"
+
+-#if HAVE_OPENJPEG_2_1_OPENJPEG_H
++#if HAVE_OPENJPEG_2_3_OPENJPEG_H
++# include <openjpeg-2.3/openjpeg.h>
++#elif HAVE_OPENJPEG_2_2_OPENJPEG_H
++# include <openjpeg-2.2/openjpeg.h>
++#elif HAVE_OPENJPEG_2_1_OPENJPEG_H
+ # include <openjpeg-2.1/openjpeg.h>
+ #elif HAVE_OPENJPEG_2_0_OPENJPEG_H
+ # include <openjpeg-2.0/openjpeg.h>
+@@ -44,7 +48,7 @@
+ # include <openjpeg.h>
+ #endif
+
+-#if HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H
++#if HAVE_OPENJPEG_2_3_OPENJPEG_H || HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H
+ # define OPENJPEG_MAJOR_VERSION 2
+ # define OPJ(x) OPJ_##x
+ #else
+@@ -429,7 +433,7 @@
+ opj_stream_set_read_function(stream, stream_read);
+ opj_stream_set_skip_function(stream, stream_skip);
+ opj_stream_set_seek_function(stream, stream_seek);
+-#if HAVE_OPENJPEG_2_1_OPENJPEG_H
++#if HAVE_OPENJPEG_2_3_OPENJPEG_H || HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H
+ opj_stream_set_user_data(stream, &reader, NULL);
+ #elif HAVE_OPENJPEG_2_0_OPENJPEG_H
+ opj_stream_set_user_data(stream, &reader);
+diff -Naur ffmpeg-3.2.4.orig/libavcodec/libopenjpegenc.c ffmpeg-3.2.4/libavcodec/libopenjpegenc.c
+--- ffmpeg-3.2.4.orig/libavcodec/libopenjpegenc.c 2017-02-10 14:25:26.000000000 +0100
++++ ffmpeg-3.2.4/libavcodec/libopenjpegenc.c 2017-10-12 08:40:43.411456456 +0200
+@@ -32,7 +32,11 @@
+ #include "avcodec.h"
+ #include "internal.h"
+
+-#if HAVE_OPENJPEG_2_1_OPENJPEG_H
++#if HAVE_OPENJPEG_2_3_OPENJPEG_H
++# include <openjpeg-2.3/openjpeg.h>
++#elif HAVE_OPENJPEG_2_2_OPENJPEG_H
++# include <openjpeg-2.2/openjpeg.h>
++#elif HAVE_OPENJPEG_2_1_OPENJPEG_H
+ # include <openjpeg-2.1/openjpeg.h>
+ #elif HAVE_OPENJPEG_2_0_OPENJPEG_H
+ # include <openjpeg-2.0/openjpeg.h>
+@@ -42,7 +46,7 @@
+ # include <openjpeg.h>
+ #endif
+
+-#if HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H
++#if HAVE_OPENJPEG_2_3_OPENJPEG_H || HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H
+ # define OPENJPEG_MAJOR_VERSION 2
+ # define OPJ(x) OPJ_##x
+ #else
+@@ -306,7 +310,7 @@
+
+ opj_set_default_encoder_parameters(&ctx->enc_params);
+
+-#if HAVE_OPENJPEG_2_1_OPENJPEG_H
++#if HAVE_OPENJPEG_2_3_OPENJPEG_H || HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H
+ switch (ctx->cinema_mode) {
+ case OPJ_CINEMA2K_24:
+ ctx->enc_params.rsiz = OPJ_PROFILE_CINEMA_2K;
+@@ -771,7 +775,7 @@
+ opj_stream_set_write_function(stream, stream_write);
+ opj_stream_set_skip_function(stream, stream_skip);
+ opj_stream_set_seek_function(stream, stream_seek);
+-#if HAVE_OPENJPEG_2_1_OPENJPEG_H
++#if HAVE_OPENJPEG_2_3_OPENJPEG_H || HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H
+ opj_stream_set_user_data(stream, &writer, NULL);
+ #elif HAVE_OPENJPEG_2_0_OPENJPEG_H
+ opj_stream_set_user_data(stream, &writer);
diff --git a/multimedia/ffmpeg/ffmpeg.SlackBuild b/multimedia/ffmpeg/ffmpeg.SlackBuild
index f64d5dfb1a..6e740b34fe 100644
--- a/multimedia/ffmpeg/ffmpeg.SlackBuild
+++ b/multimedia/ffmpeg/ffmpeg.SlackBuild
@@ -154,6 +154,9 @@ 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 for openjpeg-2.3.0
+patch -p1 < $CWD/ffmpeg-3.2.4-openjpeg2.3.patch
+
# Fix linking with flite:
sed -i "s| -lflite\"| -lflite -lm -lasound\"|" \
./configure