Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/mlt/files/, media-libs/mlt/
Date: Sat, 05 Aug 2017 11:54:47
Message-Id: 1501934069.dbada02dc1801b0eeb09a1c37c4c4840a6ec04cc.asturm@gentoo
1 commit: dbada02dc1801b0eeb09a1c37c4c4840a6ec04cc
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sat Aug 5 10:31:01 2017 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sat Aug 5 11:54:29 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dbada02d
7
8 media-libs/mlt: Unbundle libebur128
9
10 Package-Manager: Portage-2.3.6, Repoman-2.3.1
11
12 .../mlt/files/mlt-6.4.1-libebur128-unbundle.patch | 137 +++++++++++++
13 media-libs/mlt/mlt-6.4.1-r3.ebuild | 215 +++++++++++++++++++++
14 2 files changed, 352 insertions(+)
15
16 diff --git a/media-libs/mlt/files/mlt-6.4.1-libebur128-unbundle.patch b/media-libs/mlt/files/mlt-6.4.1-libebur128-unbundle.patch
17 new file mode 100644
18 index 00000000000..e9aaa25cf32
19 --- /dev/null
20 +++ b/media-libs/mlt/files/mlt-6.4.1-libebur128-unbundle.patch
21 @@ -0,0 +1,137 @@
22 +From fad1df2bc8efc2881867e510443547fddf5d620b Mon Sep 17 00:00:00 2001
23 +From: Brian Matherly <code@×××××××××××××.com>
24 +Date: Sun, 19 Feb 2017 23:35:17 -0600
25 +Subject: [PATCH 1/2] Use external libebur128 if detected.
26 +
27 +---
28 + src/modules/plus/Makefile | 7 +++++--
29 + src/modules/plus/configure | 11 +++++++++++
30 + 2 files changed, 16 insertions(+), 2 deletions(-)
31 +
32 +diff --git a/src/modules/plus/Makefile b/src/modules/plus/Makefile
33 +index 90067a56..351e7b76 100644
34 +--- a/src/modules/plus/Makefile
35 ++++ b/src/modules/plus/Makefile
36 +@@ -22,14 +22,17 @@ OBJS = consumer_blipflash.o \
37 + filter_sepia.o \
38 + producer_blipflash.o \
39 + producer_count.o \
40 +- transition_affine.o \
41 +- ebur128/ebur128.o
42 ++ transition_affine.o
43 +
44 + ifdef USE_FFTW
45 + OBJS += filter_dance.o \
46 + filter_fft.o
47 + endif
48 +
49 ++ifdef USE_INTERNAL_LIBEBUR128
50 ++ OBJS += ebur128/ebur128.o
51 ++endif
52 ++
53 + SRCS := $(OBJS:.o=.c)
54 +
55 + all: $(TARGET)
56 +diff --git a/src/modules/plus/configure b/src/modules/plus/configure
57 +index fbd49807..e38464b4 100755
58 +--- a/src/modules/plus/configure
59 ++++ b/src/modules/plus/configure
60 +@@ -16,5 +16,16 @@ then
61 + echo "- fftw not found: disable fft and dance filters"
62 + fi
63 +
64 ++ pkg-config libebur128
65 ++ if [ $? -eq 0 ]
66 ++ then
67 ++ echo "CFLAGS += $(pkg-config --cflags libebur128)" >> config.mak
68 ++ echo "LDFLAGS += $(pkg-config --libs libebur128)" >> config.mak
69 ++ else
70 ++ echo "- libebur128 not found: using internal libebur128"
71 ++ echo "USE_INTERNAL_LIBEBUR128=1" >> config.mak
72 ++ echo "CFLAGS += -DUSE_INTERNAL_LIBEBUR128" >> config.mak
73 ++ fi
74 ++
75 + exit 0
76 + fi
77 +
78 +From 9951883b895eb920b7f67ea67a0753d8dea21a9e Mon Sep 17 00:00:00 2001
79 +From: Brian Matherly <code@×××××××××××××.com>
80 +Date: Mon, 20 Feb 2017 08:15:52 -0600
81 +Subject: [PATCH 2/2] Fix include directives for ebur128 filters.
82 +
83 +---
84 + src/modules/plus/Makefile | 2 +-
85 + src/modules/plus/configure | 2 ++
86 + src/modules/plus/filter_dynamic_loudness.c | 2 +-
87 + src/modules/plus/filter_loudness.c | 2 +-
88 + src/modules/plus/filter_loudness_meter.c | 2 +-
89 + 5 files changed, 6 insertions(+), 4 deletions(-)
90 +
91 +diff --git a/src/modules/plus/Makefile b/src/modules/plus/Makefile
92 +index 351e7b76..366bca19 100644
93 +--- a/src/modules/plus/Makefile
94 ++++ b/src/modules/plus/Makefile
95 +@@ -1,4 +1,4 @@
96 +-CFLAGS += -I../.. -Iebur128/queue
97 ++CFLAGS += -I../..
98 +
99 + LDFLAGS += -L../../framework -lmlt -lm -lpthread
100 +
101 +diff --git a/src/modules/plus/configure b/src/modules/plus/configure
102 +index e38464b4..59662ca0 100755
103 +--- a/src/modules/plus/configure
104 ++++ b/src/modules/plus/configure
105 +@@ -19,12 +19,14 @@ then
106 + pkg-config libebur128
107 + if [ $? -eq 0 ]
108 + then
109 ++ echo "- libebur128 found: using external libebur128"
110 + echo "CFLAGS += $(pkg-config --cflags libebur128)" >> config.mak
111 + echo "LDFLAGS += $(pkg-config --libs libebur128)" >> config.mak
112 + else
113 + echo "- libebur128 not found: using internal libebur128"
114 + echo "USE_INTERNAL_LIBEBUR128=1" >> config.mak
115 + echo "CFLAGS += -DUSE_INTERNAL_LIBEBUR128" >> config.mak
116 ++ echo "CFLAGS += -Iebur128 -Iebur128/queue" >> config.mak
117 + fi
118 +
119 + exit 0
120 +diff --git a/src/modules/plus/filter_dynamic_loudness.c b/src/modules/plus/filter_dynamic_loudness.c
121 +index 07551f14..99c83051 100644
122 +--- a/src/modules/plus/filter_dynamic_loudness.c
123 ++++ b/src/modules/plus/filter_dynamic_loudness.c
124 +@@ -22,7 +22,7 @@
125 + #include <stdlib.h>
126 + #include <string.h>
127 + #include <math.h>
128 +-#include "ebur128/ebur128.h"
129 ++#include <ebur128.h>
130 +
131 + typedef struct
132 + {
133 +diff --git a/src/modules/plus/filter_loudness.c b/src/modules/plus/filter_loudness.c
134 +index 8b74b5c9..0614fecc 100644
135 +--- a/src/modules/plus/filter_loudness.c
136 ++++ b/src/modules/plus/filter_loudness.c
137 +@@ -22,7 +22,7 @@
138 + #include <stdlib.h>
139 + #include <string.h>
140 + #include <math.h>
141 +-#include "ebur128/ebur128.h"
142 ++#include <ebur128.h>
143 +
144 + #define MAX_RESULT_SIZE 512
145 +
146 +diff --git a/src/modules/plus/filter_loudness_meter.c b/src/modules/plus/filter_loudness_meter.c
147 +index 9926f945..6c81d19f 100644
148 +--- a/src/modules/plus/filter_loudness_meter.c
149 ++++ b/src/modules/plus/filter_loudness_meter.c
150 +@@ -22,7 +22,7 @@
151 + #include <stdlib.h>
152 + #include <string.h>
153 + #include <math.h>
154 +-#include "ebur128/ebur128.h"
155 ++#include <ebur128.h>
156 +
157 + typedef struct
158 + {
159
160 diff --git a/media-libs/mlt/mlt-6.4.1-r3.ebuild b/media-libs/mlt/mlt-6.4.1-r3.ebuild
161 new file mode 100644
162 index 00000000000..0e847602b09
163 --- /dev/null
164 +++ b/media-libs/mlt/mlt-6.4.1-r3.ebuild
165 @@ -0,0 +1,215 @@
166 +# Copyright 1999-2017 Gentoo Foundation
167 +# Distributed under the terms of the GNU General Public License v2
168 +
169 +EAPI=6
170 +PYTHON_COMPAT=( python2_7 )
171 +# this ebuild currently only supports installing ruby bindings for a single ruby version
172 +# so USE_RUBY must contain only a single value (the latest stable) as the ebuild calls
173 +# /usr/bin/${USE_RUBY} directly
174 +USE_RUBY="ruby22"
175 +inherit eutils flag-o-matic multilib python-single-r1 ruby-single toolchain-funcs
176 +
177 +DESCRIPTION="Open source multimedia framework for television broadcasting"
178 +HOMEPAGE="https://www.mltframework.org/"
179 +SRC_URI="https://github.com/mltframework/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
180 +
181 +LICENSE="GPL-3"
182 +SLOT="0"
183 +KEYWORDS="~amd64 ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
184 +IUSE="compressed-lumas debug ffmpeg fftw frei0r gtk jack kdenlive libav libsamplerate melt opencv opengl
185 +cpu_flags_x86_mmx qt5 rtaudio sdl cpu_flags_x86_sse cpu_flags_x86_sse2 xine xml lua python ruby vdpau"
186 +# java perl php tcl vidstab
187 +IUSE="${IUSE} kernel_linux"
188 +
189 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
190 +
191 +#rtaudio will use OSS on non linux OSes
192 +COMMON_DEPEND="
193 + >=media-libs/libebur128-1.2.2
194 + ffmpeg? (
195 + libav? ( media-video/libav:0=[vdpau?] )
196 + !libav? ( media-video/ffmpeg:0=[vdpau?] )
197 + )
198 + xml? ( >=dev-libs/libxml2-2.5 )
199 + sdl? ( >=media-libs/libsdl-1.2.10[X,opengl,video]
200 + >=media-libs/sdl-image-1.2.4 )
201 + libsamplerate? ( >=media-libs/libsamplerate-0.1.2 )
202 + jack? ( >=media-sound/jack-audio-connection-kit-0.121.3
203 + media-libs/ladspa-sdk
204 + >=dev-libs/libxml2-2.5 )
205 + fftw? ( sci-libs/fftw:3.0= )
206 + frei0r? ( media-plugins/frei0r-plugins )
207 + gtk? ( x11-libs/gtk+:2
208 + media-libs/libexif
209 + x11-libs/pango )
210 + opencv? ( >=media-libs/opencv-3.1.0:= )
211 + opengl? ( media-video/movit )
212 + rtaudio? (
213 + media-libs/rtaudio
214 + kernel_linux? ( media-libs/alsa-lib )
215 + )
216 + xine? ( >=media-libs/xine-lib-1.1.2_pre20060328-r7 )
217 + qt5? (
218 + dev-qt/qtcore:5
219 + dev-qt/qtgui:5
220 + dev-qt/qtsvg:5
221 + dev-qt/qtwidgets:5
222 + dev-qt/qtxml:5
223 + media-libs/libexif
224 + x11-libs/libX11
225 + opengl? ( dev-qt/qtopengl:5 )
226 + )
227 + lua? ( >=dev-lang/lua-5.1.4-r4:= )
228 + python? ( ${PYTHON_DEPS} )
229 + ruby? ( ${RUBY_DEPS} )"
230 +# sox? ( media-sound/sox )
231 +# java? ( >=virtual/jre-1.5 )
232 +# perl? ( dev-lang/perl )
233 +# php? ( dev-lang/php )
234 +# tcl? ( dev-lang/tcl:0= )
235 +# vidstab? ( media-libs/libvidstab )
236 +SWIG_DEPEND=">=dev-lang/swig-2.0"
237 +DEPEND="${COMMON_DEPEND}
238 + virtual/pkgconfig
239 + compressed-lumas? ( virtual/imagemagick-tools[png] )
240 + lua? ( ${SWIG_DEPEND} virtual/pkgconfig )
241 + python? ( ${SWIG_DEPEND} )
242 + ruby? ( ${SWIG_DEPEND} )"
243 +# java? ( ${SWIG_DEPEND} >=virtual/jdk-1.5 )
244 +# perl? ( ${SWIG_DEPEND} )
245 +# php? ( ${SWIG_DEPEND} )
246 +# tcl? ( ${SWIG_DEPEND} )
247 +RDEPEND="${COMMON_DEPEND}
248 + !media-libs/mlt++
249 +"
250 +
251 +PATCHES=(
252 + "${FILESDIR}"/${PN}-6.2.0-ruby-link.patch
253 + "${FILESDIR}"/${P}-libebur128-unbundle.patch
254 +)
255 +
256 +pkg_setup() {
257 + use python && python-single-r1_pkg_setup
258 +}
259 +
260 +src_prepare() {
261 + default
262 +
263 + # respect CFLAGS LDFLAGS when building shared libraries. Bug #308873
264 + for x in python lua; do
265 + sed -i "/mlt.so/s: -lmlt++ :& ${CFLAGS} ${LDFLAGS} :" src/swig/$x/build || die
266 + done
267 + sed -i "/^LDFLAGS/s: += :& ${LDFLAGS} :" src/swig/ruby/build || die
268 +
269 + sed -i -e "s/env ruby/${USE_RUBY}/" src/swig/ruby/* || die
270 +}
271 +
272 +src_configure() {
273 + tc-export CC CXX
274 +
275 + # bug 589848
276 + append-cxxflags -std=c++11
277 +
278 + local myconf="--enable-gpl
279 + --enable-gpl3
280 + --enable-motion-est
281 + --target-arch=$(tc-arch)
282 + --disable-kde
283 + --disable-swfdec
284 + $(use_enable debug)
285 + $(use compressed-lumas && echo ' --luma-compress')
286 + $(use_enable cpu_flags_x86_sse sse)
287 + $(use_enable cpu_flags_x86_sse2 sse2)
288 + $(use_enable gtk gtk2)
289 + $(use_enable sdl)
290 + $(use_enable jack jackrack)
291 + $(use_enable ffmpeg avformat)
292 + $(use ffmpeg && echo ' --avformat-swscale')
293 + $(use_enable fftw plus)
294 + $(use_enable frei0r)
295 + $(use_enable melt)
296 + $(use_enable opencv)
297 + $(use_enable opengl)
298 + $(use_enable libsamplerate resample)
299 + $(use_enable rtaudio)
300 + $(use vdpau && echo ' --avformat-vdpau')
301 + $(use_enable xml)
302 + $(use_enable xine)
303 + $(use_enable kdenlive)
304 + --disable-sox"
305 + #$(use_enable sox) FIXME
306 +
307 + if use qt5 ; then
308 + myconf+=" --enable-qt
309 + --qt-includedir=$(pkg-config Qt5Core --variable=includedir)
310 + --qt-libdir=$(pkg-config Qt5Core --variable=libdir)"
311 + else
312 + myconf+=" --disable-qt"
313 + fi
314 +
315 + if use x86 || use amd64 ; then
316 + myconf+=" $(use_enable cpu_flags_x86_mmx mmx)"
317 + else
318 + myconf+=" --disable-mmx"
319 + fi
320 +
321 + if ! use melt; then
322 + sed -i -e "s;src/melt;;" Makefile || die
323 + fi
324 +
325 + # TODO: add swig language bindings
326 + # see also https://www.mltframework.org/twiki/bin/view/MLT/ExtremeMakeover
327 +
328 + local swig_lang
329 + # TODO: java perl php tcl
330 + for i in lua python ruby ; do
331 + use $i && swig_lang="${swig_lang} $i"
332 + done
333 + [ -z "${swig_lang}" ] && swig_lang="none"
334 +
335 + econf ${myconf} --swig-languages="${swig_lang}"
336 +
337 + sed -i -e s/^OPT/#OPT/ "${S}/config.mak" || die
338 + if use qt5 ; then
339 + if ! use opengl ; then
340 + sed -i -e "/^USE_QT_OPENGL/ s/^/#/" "${S}/src/modules/qt/config.mak" || die
341 + fi
342 + fi
343 +}
344 +
345 +src_install() {
346 + emake DESTDIR="${D}" install
347 + dodoc AUTHORS ChangeLog NEWS README docs/*.txt
348 +
349 + dodir /usr/share/${PN}
350 + insinto /usr/share/${PN}
351 + doins -r demo
352 +
353 + docinto swig
354 +
355 + # Install SWIG bindings
356 + if use lua; then
357 + cd "${S}"/src/swig/lua || die
358 + exeinto $(pkg-config --variable INSTALL_CMOD lua)
359 + doexe mlt.so
360 + dodoc play.lua
361 + fi
362 +
363 + if use python; then
364 + cd "${S}"/src/swig/python || die
365 + insinto $(python_get_sitedir)
366 + doins mlt.py
367 + exeinto $(python_get_sitedir)
368 + doexe _mlt.so
369 + dodoc play.py
370 + python_optimize
371 + fi
372 +
373 + if use ruby; then
374 + cd "${S}"/src/swig/ruby || die
375 + exeinto $("${EPREFIX}"/usr/bin/${USE_RUBY} -r rbconfig -e 'print RbConfig::CONFIG["sitearchdir"]')
376 + doexe mlt.so
377 + dodoc play.rb thumbs.rb
378 + fi
379 + # TODO: java perl php tcl
380 +}