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/, media-libs/mlt/files/
Date: Wed, 12 Dec 2018 11:56:23
Message-Id: 1544615747.10c29d339cd28361f4c79daa80b3e8c2d094f62d.asturm@gentoo
1 commit: 10c29d339cd28361f4c79daa80b3e8c2d094f62d
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Wed Dec 12 11:39:10 2018 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 12 11:55:47 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=10c29d33
7
8 media-libs/mlt: 6.12.0 version bump, switch to ruby25
9
10 Bug: https://bugs.gentoo.org/672984
11 Package-Manager: Portage-2.3.52, Repoman-2.3.12
12 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
13
14 media-libs/mlt/Manifest | 1 +
15 .../mlt/files/mlt-6.12.0-frei0r-w-tractor.patch | 37 ++++
16 .../mlt/files/mlt-6.12.0-rgb-to-yuv-accuracy.patch | 169 ++++++++++++++++
17 .../mlt/files/mlt-6.12.0-seconds-digits.patch | 22 +++
18 media-libs/mlt/mlt-6.12.0.ebuild | 219 +++++++++++++++++++++
19 5 files changed, 448 insertions(+)
20
21 diff --git a/media-libs/mlt/Manifest b/media-libs/mlt/Manifest
22 index b884ece8480..22521d2f15e 100644
23 --- a/media-libs/mlt/Manifest
24 +++ b/media-libs/mlt/Manifest
25 @@ -1 +1,2 @@
26 DIST mlt-6.10.0.tar.gz 1384632 BLAKE2B 4bbcf95409df1ea1828d2b34e6d6663cf83f5672641034f775d029037505051c5490c46c69e104811aaf776794be2df95913d094319f4a2dbba0c42117abe15e SHA512 6f374f20f1dc851792c1075537cf7e977038fb557b2bd5d5816c1fc69d471947c8469c914cf662766f3b503ae819881bf2b4e1673e0f7a84309e0fb671a9de1b
27 +DIST mlt-6.12.0.tar.gz 1395646 BLAKE2B 18dc06c4075d8d51bc7f62d027adda92c359275b9ad2131cc015b4402b1b7a9438fe87b617075017b9fd5e9696b82c4c840fa6dd83188bd0cedb7f01d2158283 SHA512 ed2cc0eeda45558ae6f1ec8780dfd413641953dc12dc32dccf655649f68f8e6088d39fefb7bef7bae042a41096976004446019d82ea162785bc487009cb97680
28
29 diff --git a/media-libs/mlt/files/mlt-6.12.0-frei0r-w-tractor.patch b/media-libs/mlt/files/mlt-6.12.0-frei0r-w-tractor.patch
30 new file mode 100644
31 index 00000000000..e655f805f53
32 --- /dev/null
33 +++ b/media-libs/mlt/files/mlt-6.12.0-frei0r-w-tractor.patch
34 @@ -0,0 +1,37 @@
35 +From 30621f28fd3a21a4162de17a12d943e811566b5e Mon Sep 17 00:00:00 2001
36 +From: Dan Dennedy <dan@×××××××.org>
37 +Date: Wed, 5 Dec 2018 11:14:54 -0800
38 +Subject: [PATCH] Fix frei0r producer not working with tractor.
39 +
40 +Reported in https://forum.shotcut.org/t/color-bars-working-not-
41 +correctly/8308
42 +---
43 + src/modules/frei0r/producer_frei0r.c | 8 ++------
44 + 1 file changed, 2 insertions(+), 6 deletions(-)
45 +
46 +diff --git a/src/modules/frei0r/producer_frei0r.c b/src/modules/frei0r/producer_frei0r.c
47 +index 9a90f6b6b..d1547f6c5 100644
48 +--- a/src/modules/frei0r/producer_frei0r.c
49 ++++ b/src/modules/frei0r/producer_frei0r.c
50 +@@ -26,12 +26,7 @@
51 +
52 + static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable )
53 + {
54 +-
55 +- // Obtain properties of frame
56 +- mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
57 +-
58 +- // Obtain the producer for this frame
59 +- mlt_producer producer = mlt_properties_get_data( properties, "producer_frei0r", NULL );
60 ++ mlt_producer producer = mlt_frame_pop_service( frame );
61 +
62 + // Choose suitable out values if nothing specific requested
63 + if ( *width <= 0 )
64 +@@ -83,6 +78,7 @@ int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int index )
65 + mlt_properties_set_double( properties, "aspect_ratio", mlt_profile_sar( profile ) );
66 +
67 + // Push the get_image method
68 ++ mlt_frame_push_service( *frame, producer );
69 + mlt_frame_push_get_image( *frame, producer_get_image );
70 + }
71 +
72 \ No newline at end of file
73
74 diff --git a/media-libs/mlt/files/mlt-6.12.0-rgb-to-yuv-accuracy.patch b/media-libs/mlt/files/mlt-6.12.0-rgb-to-yuv-accuracy.patch
75 new file mode 100644
76 index 00000000000..d0930c5ac63
77 --- /dev/null
78 +++ b/media-libs/mlt/files/mlt-6.12.0-rgb-to-yuv-accuracy.patch
79 @@ -0,0 +1,169 @@
80 +From adc5a2284b3a1073cb364c5f07d1d7c97e94c937 Mon Sep 17 00:00:00 2001
81 +From: Dan Dennedy <dan@×××××××.org>
82 +Date: Fri, 30 Nov 2018 15:26:15 -0800
83 +Subject: [PATCH] Fix color accuracy of RGB->YUV conversion.
84 +
85 +Fixes https://github.com/mltframework/shotcut/issues/674
86 +---
87 + src/modules/avformat/common.c | 2 ++
88 + src/modules/avformat/common.h | 1 +
89 + src/modules/avformat/consumer_avformat.c | 7 +------
90 + src/modules/avformat/filter_avcolour_space.c | 7 +------
91 + src/modules/avformat/filter_swscale.c | 12 ++++--------
92 + src/modules/avformat/producer_avformat.c | 12 ++++++------
93 + 6 files changed, 15 insertions(+), 26 deletions(-)
94 +
95 +diff --git a/src/modules/avformat/common.c b/src/modules/avformat/common.c
96 +index 2b1f1fd5d..dca9dbaee 100644
97 +--- a/src/modules/avformat/common.c
98 ++++ b/src/modules/avformat/common.c
99 +@@ -22,6 +22,8 @@
100 + #include <libavutil/channel_layout.h>
101 + #include <libavutil/samplefmt.h>
102 +
103 ++int mlt_default_sws_flags = SWS_BICUBIC | SWS_FULL_CHR_H_INP | SWS_FULL_CHR_H_INT | SWS_ACCURATE_RND;
104 ++
105 + int mlt_to_av_sample_format( mlt_audio_format format )
106 + {
107 + switch( format )
108 +diff --git a/src/modules/avformat/common.h b/src/modules/avformat/common.h
109 +index 54df63e93..ce0f0f079 100644
110 +--- a/src/modules/avformat/common.h
111 ++++ b/src/modules/avformat/common.h
112 +@@ -29,5 +29,6 @@ mlt_channel_layout av_channel_layout_to_mlt( int64_t layout );
113 + mlt_channel_layout get_channel_layout_or_default( const char* name, int channels );
114 + int set_luma_transfer( struct SwsContext *context, int src_colorspace,
115 + int dst_colorspace, int src_full_range, int dst_full_range );
116 ++extern int mlt_default_sws_flags;
117 +
118 + #endif // COMMON_H
119 +diff --git a/src/modules/avformat/consumer_avformat.c b/src/modules/avformat/consumer_avformat.c
120 +index eab96271f..1e445ef76 100644
121 +--- a/src/modules/avformat/consumer_avformat.c
122 ++++ b/src/modules/avformat/consumer_avformat.c
123 +@@ -1956,12 +1956,7 @@ static void *consumer_thread( void *arg )
124 + mlt_image_format_planes( img_fmt, width, height, image, video_avframe.data, video_avframe.linesize );
125 +
126 + // Do the colour space conversion
127 +- int flags = SWS_BICUBIC | SWS_ACCURATE_RND;
128 +- if ( pix_fmt == AV_PIX_FMT_YUYV422 || pix_fmt == AV_PIX_FMT_YUV422P16LE )
129 +- flags |= SWS_FULL_CHR_H_INP;
130 +- else
131 +- flags |= SWS_FULL_CHR_H_INT;
132 +-
133 ++ int flags = mlt_default_sws_flags;
134 + struct SwsContext *context = sws_getContext( width, height, pick_pix_fmt( img_fmt ),
135 + width, height, pix_fmt, flags, NULL, NULL, NULL);
136 + int src_colorspace = mlt_properties_get_int( frame_properties, "colorspace" );
137 +diff --git a/src/modules/avformat/filter_avcolour_space.c b/src/modules/avformat/filter_avcolour_space.c
138 +index f25cf092b..89ee6b522 100644
139 +--- a/src/modules/avformat/filter_avcolour_space.c
140 ++++ b/src/modules/avformat/filter_avcolour_space.c
141 +@@ -84,14 +84,9 @@ static int av_convert_image( uint8_t *out, uint8_t *in, int out_fmt, int in_fmt,
142 + int in_stride[4];
143 + uint8_t *out_data[4];
144 + int out_stride[4];
145 +- int flags = SWS_BICUBIC | SWS_ACCURATE_RND;
146 ++ int flags = mlt_default_sws_flags;
147 + int error = -1;
148 +
149 +- if ( out_fmt == AV_PIX_FMT_YUYV422 || out_fmt == AV_PIX_FMT_YUV422P16LE )
150 +- flags |= SWS_FULL_CHR_H_INP;
151 +- else
152 +- flags |= SWS_FULL_CHR_H_INT;
153 +-
154 + if ( in_fmt == AV_PIX_FMT_YUV422P16LE )
155 + mlt_image_format_planes(mlt_image_yuv422p16, width, height, in, in_data, in_stride);
156 + else
157 +diff --git a/src/modules/avformat/filter_swscale.c b/src/modules/avformat/filter_swscale.c
158 +index 475036a6f..52c165f9f 100644
159 +--- a/src/modules/avformat/filter_swscale.c
160 ++++ b/src/modules/avformat/filter_swscale.c
161 +@@ -1,6 +1,6 @@
162 + /*
163 + * filter_swscale.c -- image scaling filter
164 +- * Copyright (C) 2008-2017 Meltytech, LLC
165 ++ * Copyright (C) 2008-2018 Meltytech, LLC
166 + *
167 + * This library is free software; you can redistribute it and/or
168 + * modify it under the terms of the GNU Lesser General Public
169 +@@ -88,23 +88,19 @@ static int filter_scale( mlt_frame frame, uint8_t **image, mlt_image_format *for
170 + interp = SWS_LANCZOS;
171 + else if ( strcmp( interps, "spline" ) == 0 )
172 + interp = SWS_SPLINE;
173 +- interp |= SWS_ACCURATE_RND;
174 ++
175 ++ // Set swscale flags to get good quality
176 ++ interp |= SWS_FULL_CHR_H_INP | SWS_FULL_CHR_H_INT | SWS_ACCURATE_RND;
177 +
178 + // Determine the output image size.
179 + int out_size = mlt_image_format_size( *format, owidth, oheight, NULL );
180 +
181 +- // Set swscale flags to get good quality
182 + switch ( *format )
183 + {
184 + case mlt_image_yuv422:
185 +- interp |= SWS_FULL_CHR_H_INP;
186 +- break;
187 + case mlt_image_rgb24:
188 +- interp |= SWS_FULL_CHR_H_INT;
189 +- break;
190 + case mlt_image_rgb24a:
191 + case mlt_image_opengl:
192 +- interp |= SWS_FULL_CHR_H_INT;
193 + break;
194 + default:
195 + // XXX: we only know how to rescale packed formats
196 +diff --git a/src/modules/avformat/producer_avformat.c b/src/modules/avformat/producer_avformat.c
197 +index 9b96b4e5c..d24ca41e7 100644
198 +--- a/src/modules/avformat/producer_avformat.c
199 ++++ b/src/modules/avformat/producer_avformat.c
200 +@@ -1281,7 +1281,7 @@ static int sliced_h_pix_fmt_conv_proc( int id, int idx, int jobs, void* cookie )
201 + av_opt_set_int( sws, "dstw", slice_w, 0 );
202 + av_opt_set_int( sws, "dsth", h, 0 );
203 + av_opt_set_int( sws, "dst_format", ctx->dst_format, 0 );
204 +- av_opt_set_int( sws, "sws_flags", ctx->flags | SWS_FULL_CHR_H_INP, 0 );
205 ++ av_opt_set_int( sws, "sws_flags", ctx->flags, 0 );
206 +
207 + av_opt_set_int( sws, "src_h_chr_pos", -513, 0 );
208 + av_opt_set_int( sws, "src_v_chr_pos", src_v_chr_pos, 0 );
209 +@@ -1338,7 +1338,7 @@ static int sliced_h_pix_fmt_conv_proc( int id, int idx, int jobs, void* cookie )
210 + static int convert_image( producer_avformat self, AVFrame *frame, uint8_t *buffer, int pix_fmt,
211 + mlt_image_format *format, int width, int height, uint8_t **alpha )
212 + {
213 +- int flags = SWS_BICUBIC | SWS_ACCURATE_RND;
214 ++ int flags = mlt_default_sws_flags;
215 + mlt_profile profile = mlt_service_profile( MLT_PRODUCER_SERVICE( self->parent ) );
216 + int result = self->yuv_colorspace;
217 +
218 +@@ -1400,7 +1400,7 @@ static int convert_image( producer_avformat self, AVFrame *frame, uint8_t *buffe
219 + else if ( *format == mlt_image_rgb24 )
220 + {
221 + struct SwsContext *context = sws_getContext( width, height, src_pix_fmt,
222 +- width, height, AV_PIX_FMT_RGB24, flags | SWS_FULL_CHR_H_INT, NULL, NULL, NULL);
223 ++ width, height, AV_PIX_FMT_RGB24, flags, NULL, NULL, NULL);
224 + uint8_t *out_data[4];
225 + int out_stride[4];
226 + av_image_fill_arrays(out_data, out_stride, buffer, AV_PIX_FMT_RGB24, width, height, IMAGE_ALIGN);
227 +@@ -1413,7 +1413,7 @@ static int convert_image( producer_avformat self, AVFrame *frame, uint8_t *buffe
228 + else if ( *format == mlt_image_rgb24a || *format == mlt_image_opengl )
229 + {
230 + struct SwsContext *context = sws_getContext( width, height, src_pix_fmt,
231 +- width, height, AV_PIX_FMT_RGBA, flags | SWS_FULL_CHR_H_INT, NULL, NULL, NULL);
232 ++ width, height, AV_PIX_FMT_RGBA, flags, NULL, NULL, NULL);
233 + uint8_t *out_data[4];
234 + int out_stride[4];
235 + av_image_fill_arrays(out_data, out_stride, buffer, AV_PIX_FMT_RGBA, width, height, IMAGE_ALIGN);
236 +@@ -1475,10 +1475,10 @@ static int convert_image( producer_avformat self, AVFrame *frame, uint8_t *buffe
237 + {
238 + #if defined(FFUDIV) && (LIBAVFORMAT_VERSION_INT >= ((55<<16)+(48<<8)+100))
239 + struct SwsContext *context = sws_getContext( width, height, src_pix_fmt,
240 +- width, height, AV_PIX_FMT_YUYV422, flags | SWS_FULL_CHR_H_INP, NULL, NULL, NULL);
241 ++ width, height, AV_PIX_FMT_YUYV422, flags, NULL, NULL, NULL);
242 + #else
243 + struct SwsContext *context = sws_getContext( width, height, pix_fmt,
244 +- width, height, AV_PIX_FMT_YUYV422, flags | SWS_FULL_CHR_H_INP, NULL, NULL, NULL);
245 ++ width, height, AV_PIX_FMT_YUYV422, flags, NULL, NULL, NULL);
246 + #endif
247 + AVPicture output;
248 + avpicture_fill( &output, buffer, AV_PIX_FMT_YUYV422, width, height );
249 \ No newline at end of file
250
251 diff --git a/media-libs/mlt/files/mlt-6.12.0-seconds-digits.patch b/media-libs/mlt/files/mlt-6.12.0-seconds-digits.patch
252 new file mode 100644
253 index 00000000000..c00accefd1e
254 --- /dev/null
255 +++ b/media-libs/mlt/files/mlt-6.12.0-seconds-digits.patch
256 @@ -0,0 +1,22 @@
257 +From 64a71150650616ab0309da1a76e37e762572f641 Mon Sep 17 00:00:00 2001
258 +From: Brian Matherly <code@×××××××××××××.com>
259 +Date: Mon, 19 Nov 2018 22:44:07 -0600
260 +Subject: [PATCH] Fix number of digits for seconds.
261 +
262 +---
263 + src/modules/plus/filter_timer.c | 2 +-
264 + 1 file changed, 1 insertion(+), 1 deletion(-)
265 +
266 +diff --git a/src/modules/plus/filter_timer.c b/src/modules/plus/filter_timer.c
267 +index 519f1f72a..32da3281d 100644
268 +--- a/src/modules/plus/filter_timer.c
269 ++++ b/src/modules/plus/filter_timer.c
270 +@@ -90,7 +90,7 @@ static void get_timer_str( mlt_filter filter, mlt_frame frame, char* text )
271 + }
272 + else if ( !strcmp( format, "MM:SS.SS" ) )
273 + {
274 +- snprintf( text, MAX_TEXT_LEN, "%02d:%02.2f", hours * 60 + mins, secs );
275 ++ snprintf( text, MAX_TEXT_LEN, "%02d:%05.2f", hours * 60 + mins, secs );
276 + }
277 + else if ( !strcmp( format, "SS" ) )
278 + {
279 \ No newline at end of file
280
281 diff --git a/media-libs/mlt/mlt-6.12.0.ebuild b/media-libs/mlt/mlt-6.12.0.ebuild
282 new file mode 100644
283 index 00000000000..cb1ff2b9908
284 --- /dev/null
285 +++ b/media-libs/mlt/mlt-6.12.0.ebuild
286 @@ -0,0 +1,219 @@
287 +# Copyright 1999-2018 Gentoo Authors
288 +# Distributed under the terms of the GNU General Public License v2
289 +
290 +EAPI=6
291 +
292 +PYTHON_COMPAT=( python2_7 )
293 +# this ebuild currently only supports installing ruby bindings for a single ruby version
294 +# so USE_RUBY must contain only a single value (the latest stable) as the ebuild calls
295 +# /usr/bin/${USE_RUBY} directly
296 +USE_RUBY="ruby25"
297 +inherit python-single-r1 ruby-single toolchain-funcs
298 +
299 +DESCRIPTION="Open source multimedia framework for television broadcasting"
300 +HOMEPAGE="https://www.mltframework.org/"
301 +SRC_URI="https://github.com/mltframework/${PN}/releases/download/v${PV}/${P}.tar.gz"
302 +
303 +LICENSE="GPL-3"
304 +SLOT="0"
305 +KEYWORDS="~amd64 ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
306 +IUSE="compressed-lumas cpu_flags_x86_mmx cpu_flags_x86_sse cpu_flags_x86_sse2 debug ffmpeg fftw frei0r
307 +gtk jack kdenlive libav libsamplerate lua melt opencv opengl python qt5 rtaudio ruby sdl vdpau xine xml"
308 +# java perl php tcl vidstab
309 +IUSE="${IUSE} kernel_linux"
310 +
311 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
312 +
313 +#rtaudio will use OSS on non linux OSes
314 +RDEPEND="
315 + >=media-libs/libebur128-1.2.2
316 + ffmpeg? (
317 + libav? ( >=media-video/libav-12:0=[vdpau?] )
318 + !libav? ( media-video/ffmpeg:0=[vdpau?] )
319 + )
320 + fftw? ( sci-libs/fftw:3.0= )
321 + frei0r? ( media-plugins/frei0r-plugins )
322 + gtk? (
323 + media-libs/libexif
324 + x11-libs/gtk+:2
325 + x11-libs/pango
326 + )
327 + jack? (
328 + >=dev-libs/libxml2-2.5
329 + media-libs/ladspa-sdk
330 + virtual/jack
331 + )
332 + libsamplerate? ( >=media-libs/libsamplerate-0.1.2 )
333 + lua? ( >=dev-lang/lua-5.1.4-r4:= )
334 + opencv? ( >=media-libs/opencv-3.2.0:= )
335 + opengl? ( media-video/movit )
336 + python? ( ${PYTHON_DEPS} )
337 + qt5? (
338 + dev-qt/qtcore:5
339 + dev-qt/qtgui:5
340 + dev-qt/qtsvg:5
341 + dev-qt/qtwidgets:5
342 + dev-qt/qtxml:5
343 + media-libs/libexif
344 + x11-libs/libX11
345 + )
346 + rtaudio? (
347 + >=media-libs/rtaudio-4.1.2
348 + kernel_linux? ( media-libs/alsa-lib )
349 + )
350 + ruby? ( ${RUBY_DEPS} )
351 + sdl? (
352 + media-libs/libsdl2[X,opengl,video]
353 + media-libs/sdl2-image
354 + )
355 + xine? ( >=media-libs/xine-lib-1.1.2_pre20060328-r7 )
356 + xml? ( >=dev-libs/libxml2-2.5 )"
357 +# java? ( >=virtual/jre-1.5 )
358 +# perl? ( dev-lang/perl )
359 +# php? ( dev-lang/php )
360 +# sox? ( media-sound/sox )
361 +# tcl? ( dev-lang/tcl:0= )
362 +# vidstab? ( media-libs/libvidstab )
363 +SWIG_DEPEND=">=dev-lang/swig-2.0"
364 +DEPEND="${RDEPEND}
365 + virtual/pkgconfig
366 + compressed-lumas? ( virtual/imagemagick-tools[png] )
367 + lua? ( ${SWIG_DEPEND} virtual/pkgconfig )
368 + python? ( ${SWIG_DEPEND} )
369 + ruby? ( ${SWIG_DEPEND} )"
370 +# java? ( ${SWIG_DEPEND} >=virtual/jdk-1.5 )
371 +# perl? ( ${SWIG_DEPEND} )
372 +# php? ( ${SWIG_DEPEND} )
373 +# tcl? ( ${SWIG_DEPEND} )
374 +
375 +DOCS=( AUTHORS ChangeLog NEWS README docs/{framework,melt,mlt{++,-xml}}.txt )
376 +
377 +PATCHES=(
378 + "${FILESDIR}"/${PN}-6.10.0-swig-underlinking.patch
379 + "${FILESDIR}"/${P}-seconds-digits.patch
380 + "${FILESDIR}"/${P}-rgb-to-yuv-accuracy.patch
381 + "${FILESDIR}"/${P}-frei0r-w-tractor.patch
382 +)
383 +
384 +pkg_setup() {
385 + use python && python-single-r1_pkg_setup
386 +}
387 +
388 +src_prepare() {
389 + default
390 +
391 + # respect CFLAGS LDFLAGS when building shared libraries. Bug #308873
392 + for x in python lua; do
393 + sed -i "/mlt.so/s: -lmlt++ :& ${CFLAGS} ${LDFLAGS} :" src/swig/$x/build || die
394 + done
395 + sed -i "/^LDFLAGS/s: += :& ${LDFLAGS} :" src/swig/ruby/build || die
396 +
397 + sed -i -e "s/env ruby/${USE_RUBY}/" src/swig/ruby/* || die
398 +}
399 +
400 +src_configure() {
401 + tc-export CC CXX
402 +
403 + local myconf=(
404 + --enable-gpl
405 + --enable-gpl3
406 + --enable-motion-est
407 + --target-arch=$(tc-arch)
408 + --disable-kde
409 + --disable-sdl
410 + --disable-swfdec
411 + $(use_enable debug)
412 + $(use compressed-lumas && echo ' --luma-compress')
413 + $(use_enable cpu_flags_x86_sse sse)
414 + $(use_enable cpu_flags_x86_sse2 sse2)
415 + $(use_enable gtk gtk2)
416 + $(use_enable jack jackrack)
417 + $(use_enable ffmpeg avformat)
418 + $(use ffmpeg && echo ' --avformat-swscale')
419 + $(use_enable fftw plus)
420 + $(use_enable frei0r)
421 + $(use_enable melt)
422 + $(use_enable opencv)
423 + $(use_enable opengl)
424 + $(use_enable libsamplerate resample)
425 + $(use_enable rtaudio)
426 + $(use vdpau && echo ' --avformat-vdpau')
427 + $(use_enable sdl sdl2)
428 + $(use_enable xml)
429 + $(use_enable xine)
430 + $(use_enable kdenlive)
431 + --disable-sox
432 + )
433 + #$(use_enable sox) FIXME
434 +
435 + if use qt5 ; then
436 + myconf+=(
437 + --enable-qt
438 + --qt-includedir=$(pkg-config Qt5Core --variable=includedir)
439 + --qt-libdir=$(pkg-config Qt5Core --variable=libdir)
440 + )
441 + else
442 + myconf+=( --disable-qt )
443 + fi
444 +
445 + if use x86 || use amd64 ; then
446 + myconf+=( $(use_enable cpu_flags_x86_mmx mmx) )
447 + else
448 + myconf+=( --disable-mmx )
449 + fi
450 +
451 + if ! use melt; then
452 + sed -i -e "s;src/melt;;" Makefile || die
453 + fi
454 +
455 + # TODO: add swig language bindings
456 + # see also https://www.mltframework.org/twiki/bin/view/MLT/ExtremeMakeover
457 +
458 + local swig_lang
459 + # TODO: java perl php tcl
460 + for i in lua python ruby ; do
461 + use $i && swig_lang="${swig_lang} $i"
462 + done
463 + [[ -z "${swig_lang}" ]] && swig_lang="none"
464 +
465 + econf ${myconf[@]} --swig-languages="${swig_lang}"
466 +
467 + sed -i -e s/^OPT/#OPT/ "${S}/config.mak" || die
468 +}
469 +
470 +src_install() {
471 + emake DESTDIR="${D}" install
472 + einstalldocs
473 +
474 + dodir /usr/share/${PN}
475 + insinto /usr/share/${PN}
476 + doins -r demo
477 +
478 + docinto swig
479 +
480 + # Install SWIG bindings
481 + if use lua; then
482 + cd "${S}"/src/swig/lua || die
483 + exeinto $(pkg-config --variable INSTALL_CMOD lua)
484 + doexe mlt.so
485 + dodoc play.lua
486 + fi
487 +
488 + if use python; then
489 + cd "${S}"/src/swig/python || die
490 + insinto $(python_get_sitedir)
491 + doins mlt.py
492 + exeinto $(python_get_sitedir)
493 + doexe _mlt.so
494 + dodoc play.py
495 + python_optimize
496 + fi
497 +
498 + if use ruby; then
499 + cd "${S}"/src/swig/ruby || die
500 + exeinto $("${EPREFIX}"/usr/bin/${USE_RUBY} -r rbconfig -e 'print RbConfig::CONFIG["sitearchdir"]')
501 + doexe mlt.so
502 + dodoc play.rb thumbs.rb
503 + fi
504 + # TODO: java perl php tcl
505 +}