Gentoo Archives: gentoo-commits

From: Marek Szuba <marecki@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: profiles/, media-libs/mlt/files/, media-libs/mlt/
Date: Tue, 22 Dec 2020 15:53:08
Message-Id: 1608652375.25a7cc6fc8ef7e6e85d7ff1e975a5e235d8b7188.marecki@gentoo
1 commit: 25a7cc6fc8ef7e6e85d7ff1e975a5e235d8b7188
2 Author: Marek Szuba <marecki <AT> gentoo <DOT> org>
3 AuthorDate: Tue Dec 22 15:50:49 2020 +0000
4 Commit: Marek Szuba <marecki <AT> gentoo <DOT> org>
5 CommitDate: Tue Dec 22 15:52:55 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=25a7cc6f
7
8 media-libs/mlt: migrate to lua.eclass
9
10 Multi-impl. Uses a custom build system for all language bindings but
11 fortunately one that has been simple enough to adapt. Builds fine against
12 all Lua implementations currently in the tree.
13
14 Closes: https://bugs.gentoo.org/752753
15 Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>
16
17 .../mlt/files/mlt-6.22.1-no_lua_bdepend.patch | 11 +
18 media-libs/mlt/mlt-6.22.1-r100.ebuild | 235 +++++++++++++++++++++
19 profiles/package.mask | 1 +
20 3 files changed, 247 insertions(+)
21
22 diff --git a/media-libs/mlt/files/mlt-6.22.1-no_lua_bdepend.patch b/media-libs/mlt/files/mlt-6.22.1-no_lua_bdepend.patch
23 new file mode 100644
24 index 00000000000..2b441a2df72
25 --- /dev/null
26 +++ b/media-libs/mlt/files/mlt-6.22.1-no_lua_bdepend.patch
27 @@ -0,0 +1,11 @@
28 +--- a/src/swig/lua/build
29 ++++ b/src/swig/lua/build
30 +@@ -8,7 +8,7 @@
31 + exit 0
32 + fi
33 +
34 +-path=`which lua 2> /dev/null`
35 ++path=`/bin/true`
36 +
37 + if [ $? = 0 ]
38 + then
39
40 diff --git a/media-libs/mlt/mlt-6.22.1-r100.ebuild b/media-libs/mlt/mlt-6.22.1-r100.ebuild
41 new file mode 100644
42 index 00000000000..1645da00814
43 --- /dev/null
44 +++ b/media-libs/mlt/mlt-6.22.1-r100.ebuild
45 @@ -0,0 +1,235 @@
46 +# Copyright 1999-2020 Gentoo Authors
47 +# Distributed under the terms of the GNU General Public License v2
48 +
49 +EAPI=7
50 +
51 +LUA_COMPAT=( lua5-{1..4} luajit )
52 +PYTHON_COMPAT=( python3_{6,7,8,9} )
53 +
54 +inherit lua python-single-r1 qmake-utils toolchain-funcs
55 +
56 +DESCRIPTION="Open source multimedia framework for television broadcasting"
57 +HOMEPAGE="https://www.mltframework.org/"
58 +SRC_URI="https://github.com/mltframework/${PN}/releases/download/v${PV}/${P}.tar.gz"
59 +
60 +LICENSE="GPL-3"
61 +SLOT="0"
62 +KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86 ~amd64-linux ~x86-linux"
63 +IUSE="compressed-lumas cpu_flags_x86_mmx cpu_flags_x86_sse cpu_flags_x86_sse2 debug ffmpeg
64 +fftw frei0r gtk jack kdenlive kernel_linux libsamplerate lua melt opencv opengl python
65 +qt5 rtaudio sdl vdpau vidstab xine xml"
66 +# java perl php tcl
67 +
68 +REQUIRED_USE="lua? ( ${LUA_REQUIRED_USE} )
69 + python? ( ${PYTHON_REQUIRED_USE} )"
70 +
71 +SWIG_DEPEND=">=dev-lang/swig-2.0"
72 +# java? ( ${SWIG_DEPEND} >=virtual/jdk-1.5 )
73 +# perl? ( ${SWIG_DEPEND} )
74 +# php? ( ${SWIG_DEPEND} )
75 +# tcl? ( ${SWIG_DEPEND} )
76 +# ruby? ( ${SWIG_DEPEND} )
77 +BDEPEND="
78 + virtual/pkgconfig
79 + compressed-lumas? ( virtual/imagemagick-tools[png] )
80 + lua? ( ${SWIG_DEPEND} virtual/pkgconfig )
81 + python? ( ${SWIG_DEPEND} )
82 +"
83 +#rtaudio will use OSS on non linux OSes
84 +DEPEND="
85 + >=media-libs/libebur128-1.2.2:=
86 + ffmpeg? ( media-video/ffmpeg:0=[vdpau?,-flite] )
87 + fftw? ( sci-libs/fftw:3.0= )
88 + frei0r? ( media-plugins/frei0r-plugins )
89 + gtk? (
90 + media-libs/libexif
91 + x11-libs/pango
92 + )
93 + jack? (
94 + >=dev-libs/libxml2-2.5
95 + media-libs/ladspa-sdk
96 + virtual/jack
97 + )
98 + libsamplerate? ( >=media-libs/libsamplerate-0.1.2 )
99 + lua? ( ${LUA_DEPS} )
100 + opencv? ( >=media-libs/opencv-3.2.0:= )
101 + opengl? ( media-video/movit )
102 + python? ( ${PYTHON_DEPS} )
103 + qt5? (
104 + dev-qt/qtcore:5
105 + dev-qt/qtgui:5
106 + dev-qt/qtsvg:5
107 + dev-qt/qtwidgets:5
108 + dev-qt/qtxml:5
109 + media-libs/libexif
110 + x11-libs/libX11
111 + )
112 + rtaudio? (
113 + >=media-libs/rtaudio-4.1.2
114 + kernel_linux? ( media-libs/alsa-lib )
115 + )
116 + sdl? (
117 + media-libs/libsdl2[X,opengl,video]
118 + media-libs/sdl2-image
119 + )
120 + vidstab? ( media-libs/vidstab )
121 + xine? ( >=media-libs/xine-lib-1.1.2_pre20060328-r7 )
122 + xml? ( >=dev-libs/libxml2-2.5 )"
123 +# java? ( >=virtual/jre-1.5 )
124 +# perl? ( dev-lang/perl )
125 +# php? ( dev-lang/php )
126 +# ruby? ( ${RUBY_DEPS} )
127 +# sox? ( media-sound/sox )
128 +# tcl? ( dev-lang/tcl:0= )
129 +RDEPEND="${DEPEND}"
130 +
131 +DOCS=( AUTHORS NEWS README docs/{framework,melt,mlt{++,-xml}}.txt )
132 +
133 +PATCHES=(
134 + "${FILESDIR}"/${PN}-6.10.0-swig-underlinking.patch
135 + "${FILESDIR}"/${PN}-6.22.1-no_lua_bdepend.patch
136 + "${FILESDIR}"/${P}-fix-regression-w-multiple-affine-filters.patch
137 +)
138 +
139 +pkg_setup() {
140 + use python && python-single-r1_pkg_setup
141 +}
142 +
143 +src_prepare() {
144 + default
145 +
146 + # respect CFLAGS LDFLAGS when building shared libraries. Bug #308873
147 + for x in python lua; do
148 + sed -i "/mlt.so/s/ -lmlt++ /& ${CFLAGS} ${LDFLAGS} /" src/swig/$x/build || die
149 + done
150 +
151 + use python && python_fix_shebang src/swig/python
152 +}
153 +
154 +src_configure() {
155 + tc-export CC CXX
156 +
157 + local myconf=(
158 + --enable-gpl
159 + --enable-gpl3
160 + --enable-motion-est
161 + --target-arch=$(tc-arch)
162 + --disable-gtk2
163 + --disable-kde
164 + --disable-sdl
165 + --disable-swfdec
166 + $(use_enable debug)
167 + $(use_enable cpu_flags_x86_sse sse)
168 + $(use_enable cpu_flags_x86_sse2 sse2)
169 + $(use_enable ffmpeg avformat)
170 + $(use_enable fftw plus)
171 + $(use_enable frei0r)
172 + $(use_enable gtk gdk)
173 + $(use_enable jack jackrack)
174 + $(use_enable kdenlive)
175 + $(use_enable libsamplerate resample)
176 + $(use_enable melt)
177 + $(use_enable opencv)
178 + $(use_enable opengl)
179 + $(use_enable qt5 qt)
180 + $(use_enable rtaudio)
181 + $(use_enable sdl sdl2)
182 + $(use_enable vidstab vid.stab )
183 + $(use_enable xine)
184 + $(use_enable xml)
185 + --disable-sox
186 + )
187 + #$(use_enable sox) FIXME
188 +
189 + use compressed-lumas && myconf+=( --luma-compress )
190 + use ffmpeg && myconf+=( --avformat-swscale )
191 + use vdpau && myconf+=( --avformat-vdpau )
192 +
193 + if use qt5 ; then
194 + myconf+=(
195 + --qt-includedir=$(qt5_get_headerdir)
196 + --qt-libdir=$(qt5_get_libdir)
197 + )
198 + fi
199 +
200 + if use amd64 || use x86 ; then
201 + myconf+=( $(use_enable cpu_flags_x86_mmx mmx) )
202 + else
203 + myconf+=( --disable-mmx )
204 + fi
205 +
206 + if ! use melt ; then
207 + sed -i -e "s;src/melt;;" Makefile || die
208 + fi
209 +
210 + # TODO: add swig language bindings
211 + # see also https://www.mltframework.org/twiki/bin/view/MLT/ExtremeMakeover
212 +
213 + local swig_lang=()
214 + # not done: java perl php ruby tcl
215 + # handled separately: lua
216 + for i in python; do
217 + use $i && swig_lang+=( $i )
218 + done
219 + [[ -z "${swig_lang}" ]] && swig_lang=( none )
220 +
221 + econf "${myconf[@]}" --swig-languages="${swig_lang[*]}"
222 +
223 + sed -i -e s/^OPT/#OPT/ config.mak || die
224 +}
225 +
226 +src_compile() {
227 + default
228 +
229 + if use lua; then
230 + # Only copy sources now to avoid unnecessary rebuilds
231 + lua_copy_sources
232 +
233 + lua_compile() {
234 + pushd "${BUILD_DIR}"/src/swig/lua > /dev/null || die
235 +
236 + sed -i -e "s| mlt_wrap.cxx| $(lua_get_CFLAGS) mlt_wrap.cxx|" build || die
237 + ./build
238 +
239 + popd > /dev/null || die
240 + }
241 + lua_foreach_impl lua_compile
242 + fi
243 +}
244 +
245 +src_install() {
246 + default
247 +
248 + insinto /usr/share/${PN}
249 + doins -r demo
250 +
251 + #
252 + # Install SWIG bindings
253 + #
254 +
255 + docinto swig
256 +
257 + if use lua; then
258 + lua_install() {
259 + pushd "${BUILD_DIR}"/src/swig/lua > /dev/null || die
260 +
261 + exeinto "$(lua_get_cmod_dir)"
262 + doexe mlt.so
263 +
264 + popd > /dev/null || die
265 + }
266 + lua_foreach_impl lua_install
267 +
268 + dodoc "${S}"/src/swig/lua/play.lua
269 + fi
270 +
271 + if use python; then
272 + cd "${S}"/src/swig/python || die
273 + python_domodule mlt.py _mlt.so
274 + chmod +x "${D}$(python_get_sitedir)/_mlt.so" || die
275 + dodoc play.py
276 + python_optimize
277 + fi
278 +
279 + # not done: java perl php ruby tcl
280 +}
281
282 diff --git a/profiles/package.mask b/profiles/package.mask
283 index 549f1b2c39d..c8e8f1f5600 100644
284 --- a/profiles/package.mask
285 +++ b/profiles/package.mask
286 @@ -539,6 +539,7 @@ kde-apps/kdebase-meta:5
287 >=media-gfx/geeqie-1.5.1-r1
288 >=media-libs/libquvi-0.9.4-r100
289 >=media-libs/libquvi-scripts-0.9.20131130-r100
290 +>=media-libs/mlt-6.22.1-r100
291 >=media-sound/aqualung-1.1-r100
292 >=media-video/aegisub-3.2.2_p20160518-r100
293 >=media-video/vlc-3.0.11.1-r100