media-video/ffmpeg: When using samba, require the client use flag
[gentoo.git] / media-video / ffmpeg / ffmpeg-3.3.8.ebuild
1 # Copyright 1999-2018 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 # Subslot: libavutil major.libavcodec major.libavformat major
7 # Since FFmpeg ships several libraries, subslot is kind of limited here.
8 # Most consumers will use those three libraries, if a "less used" library
9 # changes its soname, consumers will have to be rebuilt the old way
10 # (preserve-libs).
11 # If, for example, a package does not link to libavformat and only libavformat
12 # changes its ABI then this package will be rebuilt needlessly. Hence, such a
13 # package is free _not_ to := depend on FFmpeg but I would strongly encourage
14 # doing so since such a case is unlikely.
15 FFMPEG_SUBSLOT=55.57.57
16
17 SCM=""
18 if [ "${PV#9999}" != "${PV}" ] ; then
19         SCM="git-r3"
20         EGIT_REPO_URI="git://source.ffmpeg.org/ffmpeg.git"
21 fi
22
23 inherit eutils flag-o-matic multilib multilib-minimal toolchain-funcs ${SCM}
24
25 DESCRIPTION="Complete solution to record, convert and stream audio and video. Includes libavcodec"
26 HOMEPAGE="http://ffmpeg.org/"
27 if [ "${PV#9999}" != "${PV}" ] ; then
28         SRC_URI=""
29 elif [ "${PV%_p*}" != "${PV}" ] ; then # Snapshot
30         SRC_URI="mirror://gentoo/${P}.tar.bz2"
31 else # Release
32         SRC_URI="http://ffmpeg.org/releases/${P/_/-}.tar.bz2"
33 fi
34 FFMPEG_REVISION="${PV#*_p}"
35
36 SLOT="0/${FFMPEG_SUBSLOT}"
37 LICENSE="
38         !gpl? ( LGPL-2.1 )
39         gpl? ( GPL-2 )
40         amr? (
41                 gpl? ( GPL-3 )
42                 !gpl? ( LGPL-3 )
43         )
44         gmp? (
45                 gpl? ( GPL-3 )
46                 !gpl? ( LGPL-3 )
47         )
48         encode? (
49                 amrenc? (
50                         gpl? ( GPL-3 )
51                         !gpl? ( LGPL-3 )
52                 )
53         )
54         samba? ( GPL-3 )
55 "
56 if [ "${PV#9999}" = "${PV}" ] ; then
57         KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
58 fi
59
60 # Options to use as use_enable in the foo[:bar] form.
61 # This will feed configure with $(use_enable foo bar)
62 # or $(use_enable foo foo) if no :bar is set.
63 # foo is added to IUSE.
64 FFMPEG_FLAG_MAP=(
65                 +bzip2:bzlib cpudetection:runtime-cpudetect debug gcrypt gnutls gmp
66                 +gpl +hardcoded-tables +iconv lzma +network openssl +postproc
67                 samba:libsmbclient sdl:ffplay sdl:sdl2 vaapi vdpau X:xlib xcb:libxcb
68                 xcb:libxcb-shm xcb:libxcb-xfixes +zlib
69                 # libavdevice options
70                 cdio:libcdio iec61883:libiec61883 ieee1394:libdc1394 libcaca openal
71                 opengl
72                 # indevs
73                 libv4l:libv4l2 pulseaudio:libpulse
74                 # decoders
75                 amr:libopencore-amrwb amr:libopencore-amrnb fdk:libfdk-aac
76                 jpeg2k:libopenjpeg bluray:libbluray gme:libgme gsm:libgsm
77                 mmal modplug:libmodplug opus:libopus libilbc librtmp ssh:libssh
78                 schroedinger:libschroedinger speex:libspeex vorbis:libvorbis vpx:libvpx
79                 zvbi:libzvbi
80                 # libavfilter options
81                 bs2b:libbs2b chromaprint flite:libflite frei0r
82                 fribidi:libfribidi fontconfig ladspa libass truetype:libfreetype
83                 rubberband:librubberband sofalizer:netcdf zeromq:libzmq zimg:libzimg
84                 # libswresample options
85                 libsoxr
86                 # Threads; we only support pthread for now but ffmpeg supports more
87                 +threads:pthreads
88 )
89
90 # Same as above but for encoders, i.e. they do something only with USE=encode.
91 FFMPEG_ENCODER_FLAG_MAP=(
92         amrenc:libvo-amrwbenc mp3:libmp3lame
93         kvazaar:libkvazaar nvenc:nvenc
94         openh264:libopenh264 snappy:libsnappy theora:libtheora twolame:libtwolame
95         wavpack:libwavpack webp:libwebp x264:libx264 x265:libx265 xvid:libxvid
96 )
97
98 IUSE="
99         alsa chromium doc +encode jack oss pic static-libs test v4l
100         ${FFMPEG_FLAG_MAP[@]%:*}
101         ${FFMPEG_ENCODER_FLAG_MAP[@]%:*}
102 "
103
104 # Strings for CPU features in the useflag[:configure_option] form
105 # if :configure_option isn't set, it will use 'useflag' as configure option
106 ARM_CPU_FEATURES=(
107         cpu_flags_arm_thumb:armv5te
108         cpu_flags_arm_v6:armv6
109         cpu_flags_arm_thumb2:armv6t2
110         cpu_flags_arm_neon:neon
111         cpu_flags_arm_vfp:vfp
112         cpu_flags_arm_vfpv3:vfpv3
113         cpu_flags_arm_v8:armv8
114 )
115 ARM_CPU_REQUIRED_USE="
116         arm64? ( cpu_flags_arm_v8 )
117         cpu_flags_arm_v8? (  cpu_flags_arm_vfpv3 cpu_flags_arm_neon )
118         cpu_flags_arm_neon? ( cpu_flags_arm_thumb2 cpu_flags_arm_vfp )
119         cpu_flags_arm_vfpv3? ( cpu_flags_arm_vfp )
120         cpu_flags_arm_thumb2? ( cpu_flags_arm_v6 )
121         cpu_flags_arm_v6? ( cpu_flags_arm_thumb )
122 "
123 MIPS_CPU_FEATURES=( mipsdspr1:mipsdsp mipsdspr2 mipsfpu )
124 PPC_CPU_FEATURES=( altivec )
125 X86_CPU_FEATURES_RAW=( 3dnow:amd3dnow 3dnowext:amd3dnowext aes:aesni avx:avx avx2:avx2 fma3:fma3 fma4:fma4 mmx:mmx mmxext:mmxext sse:sse sse2:sse2 sse3:sse3 ssse3:ssse3 sse4_1:sse4 sse4_2:sse42 xop:xop )
126 X86_CPU_FEATURES=( ${X86_CPU_FEATURES_RAW[@]/#/cpu_flags_x86_} )
127 X86_CPU_REQUIRED_USE="
128         cpu_flags_x86_avx2? ( cpu_flags_x86_avx )
129         cpu_flags_x86_fma4? ( cpu_flags_x86_avx )
130         cpu_flags_x86_fma3? ( cpu_flags_x86_avx )
131         cpu_flags_x86_xop?  ( cpu_flags_x86_avx )
132         cpu_flags_x86_avx?  ( cpu_flags_x86_sse4_2 )
133         cpu_flags_x86_aes? ( cpu_flags_x86_sse4_2 )
134         cpu_flags_x86_sse4_2?  ( cpu_flags_x86_sse4_1 )
135         cpu_flags_x86_sse4_1?  ( cpu_flags_x86_ssse3 )
136         cpu_flags_x86_ssse3?  ( cpu_flags_x86_sse3 )
137         cpu_flags_x86_sse3?  ( cpu_flags_x86_sse2 )
138         cpu_flags_x86_sse2?  ( cpu_flags_x86_sse )
139         cpu_flags_x86_sse?  ( cpu_flags_x86_mmxext )
140         cpu_flags_x86_mmxext?  ( cpu_flags_x86_mmx )
141         cpu_flags_x86_3dnowext?  ( cpu_flags_x86_3dnow )
142         cpu_flags_x86_3dnow?  ( cpu_flags_x86_mmx )
143 "
144
145 IUSE="${IUSE}
146         ${ARM_CPU_FEATURES[@]%:*}
147         ${MIPS_CPU_FEATURES[@]%:*}
148         ${PPC_CPU_FEATURES[@]%:*}
149         ${X86_CPU_FEATURES[@]%:*}
150 "
151
152 CPU_REQUIRED_USE="
153         ${ARM_CPU_REQUIRED_USE}
154         ${X86_CPU_REQUIRED_USE}
155 "
156
157 # "$(tc-arch):XXX" form where XXX_CPU_FEATURES are the cpu features that apply to
158 # $(tc-arch).
159 CPU_FEATURES_MAP="
160         arm:ARM
161         arm64:ARM
162         mips:MIPS
163         ppc:PPC
164         ppc64:PPC
165         x86:X86
166         amd64:X86
167 "
168
169 FFTOOLS=( aviocat cws2fws ffescape ffeval ffhash fourcc2pixfmt graph2dot ismindex pktdumper qt-faststart sidxindex trasher )
170 IUSE="${IUSE} ${FFTOOLS[@]/#/+fftools_}"
171
172 RDEPEND="
173         alsa? ( >=media-libs/alsa-lib-1.0.27.2[${MULTILIB_USEDEP}] )
174         amr? ( >=media-libs/opencore-amr-0.1.3-r1[${MULTILIB_USEDEP}] )
175         bluray? ( >=media-libs/libbluray-0.3.0-r1:=[${MULTILIB_USEDEP}] )
176         bs2b? ( >=media-libs/libbs2b-3.1.0-r1[${MULTILIB_USEDEP}] )
177         bzip2? ( >=app-arch/bzip2-1.0.6-r4[${MULTILIB_USEDEP}] )
178         cdio? ( >=dev-libs/libcdio-paranoia-0.90_p1-r1[${MULTILIB_USEDEP}] )
179         chromaprint? ( >=media-libs/chromaprint-1.2-r1[${MULTILIB_USEDEP}] )
180         encode? (
181                 amrenc? ( >=media-libs/vo-amrwbenc-0.1.2-r1[${MULTILIB_USEDEP}] )
182                 kvazaar? ( media-libs/kvazaar[${MULTILIB_USEDEP}] )
183                 mp3? ( >=media-sound/lame-3.99.5-r1[${MULTILIB_USEDEP}] )
184                 nvenc? ( media-video/nvidia_video_sdk )
185                 openh264? ( >=media-libs/openh264-1.4.0-r1[${MULTILIB_USEDEP}] )
186                 snappy? ( >=app-arch/snappy-1.1.2-r1:=[${MULTILIB_USEDEP}] )
187                 theora? (
188                         >=media-libs/libtheora-1.1.1[encode,${MULTILIB_USEDEP}]
189                         >=media-libs/libogg-1.3.0[${MULTILIB_USEDEP}]
190                 )
191                 twolame? ( >=media-sound/twolame-0.3.13-r1[${MULTILIB_USEDEP}] )
192                 wavpack? ( >=media-sound/wavpack-4.60.1-r1[${MULTILIB_USEDEP}] )
193                 webp? ( >=media-libs/libwebp-0.3.0:=[${MULTILIB_USEDEP}] )
194                 x264? ( >=media-libs/x264-0.0.20130506:=[${MULTILIB_USEDEP}] )
195                 x265? ( >=media-libs/x265-1.6:=[${MULTILIB_USEDEP}] )
196                 xvid? ( >=media-libs/xvid-1.3.2-r1[${MULTILIB_USEDEP}] )
197         )
198         fdk? ( >=media-libs/fdk-aac-0.1.3:=[${MULTILIB_USEDEP}] )
199         flite? ( >=app-accessibility/flite-1.4-r4[${MULTILIB_USEDEP}] )
200         fontconfig? ( >=media-libs/fontconfig-2.10.92[${MULTILIB_USEDEP}] )
201         frei0r? ( media-plugins/frei0r-plugins )
202         fribidi? ( >=dev-libs/fribidi-0.19.6[${MULTILIB_USEDEP}] )
203         gcrypt? ( >=dev-libs/libgcrypt-1.6:0=[${MULTILIB_USEDEP}] )
204         gme? ( >=media-libs/game-music-emu-0.6.0[${MULTILIB_USEDEP}] )
205         gmp? ( >=dev-libs/gmp-6:0=[${MULTILIB_USEDEP}] )
206         gnutls? ( >=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}] )
207         gsm? ( >=media-sound/gsm-1.0.13-r1[${MULTILIB_USEDEP}] )
208         iconv? ( >=virtual/libiconv-0-r1[${MULTILIB_USEDEP}] )
209         iec61883? (
210                 >=media-libs/libiec61883-1.2.0-r1[${MULTILIB_USEDEP}]
211                 >=sys-libs/libraw1394-2.1.0-r1[${MULTILIB_USEDEP}]
212                 >=sys-libs/libavc1394-0.5.4-r1[${MULTILIB_USEDEP}]
213         )
214         ieee1394? (
215                 >=media-libs/libdc1394-2.2.1[${MULTILIB_USEDEP}]
216                 >=sys-libs/libraw1394-2.1.0-r1[${MULTILIB_USEDEP}]
217         )
218         jack? ( virtual/jack[${MULTILIB_USEDEP}] )
219         jpeg2k? ( >=media-libs/openjpeg-2:2[${MULTILIB_USEDEP}] )
220         libass? ( >=media-libs/libass-0.10.2:=[${MULTILIB_USEDEP}] )
221         libcaca? ( >=media-libs/libcaca-0.99_beta18-r1[${MULTILIB_USEDEP}] )
222         libilbc? ( >=media-libs/libilbc-2[${MULTILIB_USEDEP}] )
223         libsoxr? ( >=media-libs/soxr-0.1.0[${MULTILIB_USEDEP}] )
224         libv4l? ( >=media-libs/libv4l-0.9.5[${MULTILIB_USEDEP}] )
225         lzma? ( >=app-arch/xz-utils-5.0.5-r1[${MULTILIB_USEDEP}] )
226         mmal? ( media-libs/raspberrypi-userland )
227         modplug? ( >=media-libs/libmodplug-0.8.8.4-r1[${MULTILIB_USEDEP}] )
228         openal? ( >=media-libs/openal-1.15.1[${MULTILIB_USEDEP}] )
229         opengl? ( >=virtual/opengl-7.0-r1[${MULTILIB_USEDEP}] )
230         openssl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
231         opus? ( >=media-libs/opus-1.0.2-r2[${MULTILIB_USEDEP}] )
232         pulseaudio? ( >=media-sound/pulseaudio-2.1-r1[${MULTILIB_USEDEP}] )
233         librtmp? ( >=media-video/rtmpdump-2.4_p20131018[${MULTILIB_USEDEP}] )
234         rubberband? ( >=media-libs/rubberband-1.8.1-r1[${MULTILIB_USEDEP}] )
235         samba? ( >=net-fs/samba-3.6.23-r1[client,${MULTILIB_USEDEP}] )
236         schroedinger? ( >=media-libs/schroedinger-1.0.11-r1[${MULTILIB_USEDEP}] )
237         sdl? ( media-libs/libsdl2[sound,video,${MULTILIB_USEDEP}] )
238         sofalizer? (
239                 >=sci-libs/netcdf-4.3.2-r1[hdf5]
240                 >=sci-libs/hdf5-1.8.18[hl]
241         )
242         speex? ( >=media-libs/speex-1.2_rc1-r1[${MULTILIB_USEDEP}] )
243         ssh? ( >=net-libs/libssh-0.5.5[${MULTILIB_USEDEP}] )
244         truetype? ( >=media-libs/freetype-2.5.0.1:2[${MULTILIB_USEDEP}] )
245         vaapi? ( >=x11-libs/libva-1.2.1-r1[${MULTILIB_USEDEP}] )
246         vdpau? ( >=x11-libs/libvdpau-0.7[${MULTILIB_USEDEP}] )
247         vorbis? (
248                 >=media-libs/libvorbis-1.3.3-r1[${MULTILIB_USEDEP}]
249                 >=media-libs/libogg-1.3.0[${MULTILIB_USEDEP}]
250         )
251         vpx? ( >=media-libs/libvpx-1.4.0:=[${MULTILIB_USEDEP}] )
252         X? (
253                 >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
254                 >=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
255                 >=x11-libs/libXv-1.0.10[${MULTILIB_USEDEP}]
256         )
257         xcb? ( >=x11-libs/libxcb-1.4[${MULTILIB_USEDEP}] )
258         zeromq? ( >=net-libs/zeromq-4.1.6 )
259         zimg? ( >=media-libs/zimg-2.4:=[${MULTILIB_USEDEP}] )
260         zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
261         zvbi? ( >=media-libs/zvbi-0.2.35[${MULTILIB_USEDEP}] )
262         !media-video/qt-faststart
263         postproc? ( !media-libs/libpostproc )
264 "
265
266 DEPEND="${RDEPEND}
267         >=sys-devel/make-3.81
268         doc? ( sys-apps/texinfo )
269         >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
270         ladspa? ( >=media-libs/ladspa-sdk-1.13-r2[${MULTILIB_USEDEP}] )
271         cpu_flags_x86_mmx? ( >=dev-lang/yasm-1.2 )
272         test? ( net-misc/wget sys-devel/bc )
273         v4l? ( sys-kernel/linux-headers )
274 "
275
276 # Code requiring FFmpeg to be built under gpl license
277 GPL_REQUIRED_USE="
278         postproc? ( gpl )
279         frei0r? ( gpl )
280         cdio? ( gpl )
281         samba? ( gpl )
282         encode? (
283                 x264? ( gpl )
284                 x265? ( gpl )
285                 xvid? ( gpl )
286                 X? ( !xcb? ( gpl ) )
287         )
288 "
289 REQUIRED_USE="
290         libv4l? ( v4l )
291         fftools_cws2fws? ( zlib )
292         test? ( encode )
293         ${GPL_REQUIRED_USE}
294         ${CPU_REQUIRED_USE}"
295 RESTRICT="
296         gpl? ( openssl? ( bindist ) fdk? ( bindist ) )
297 "
298
299 S=${WORKDIR}/${P/_/-}
300
301 MULTILIB_WRAPPED_HEADERS=(
302         /usr/include/libavutil/avconfig.h
303 )
304
305 PATCHES=(
306         "${FILESDIR}"/openjpeg22.patch
307         "${FILESDIR}"/openjpeg23.patch
308         "${FILESDIR}"/chromium.patch
309 )
310
311 src_prepare() {
312         if [[ "${PV%_p*}" != "${PV}" ]] ; then # Snapshot
313                 export revision=git-N-${FFMPEG_REVISION}
314         fi
315         default
316         echo 'include $(SRC_PATH)/ffbuild/libffmpeg.mak' >> Makefile || die
317 }
318
319 multilib_src_configure() {
320         local myconf=( ${EXTRA_FFMPEG_CONF} )
321
322         local ffuse=( "${FFMPEG_FLAG_MAP[@]}" )
323         use openssl && use gpl && myconf+=( --enable-nonfree )
324         use samba && myconf+=( --enable-version3 )
325
326         # Encoders
327         if use encode ; then
328                 ffuse+=( "${FFMPEG_ENCODER_FLAG_MAP[@]}" )
329
330                 # Licensing.
331                 if use amrenc ; then
332                         myconf+=( --enable-version3 )
333                 fi
334         else
335                 myconf+=( --disable-encoders )
336         fi
337
338         # Indevs
339         use v4l || myconf+=( --disable-indev=v4l2 --disable-outdev=v4l2 )
340         for i in alsa oss jack ; do
341                 use ${i} || myconf+=( --disable-indev=${i} )
342         done
343
344         # Outdevs
345         for i in alsa oss sdl ; do
346                 use ${i} || myconf+=( --disable-outdev=${i} )
347         done
348
349         # Decoders
350         use amr && myconf+=( --enable-version3 )
351         use gmp && myconf+=( --enable-version3 )
352         use fdk && use gpl && myconf+=( --enable-nonfree )
353
354         for i in "${ffuse[@]#+}" ; do
355                 myconf+=( $(use_enable ${i%:*} ${i#*:}) )
356         done
357
358         # (temporarily) disable non-multilib deps
359         if ! multilib_is_native_abi; then
360                 for i in frei0r netcdf libzmq ; do
361                         myconf+=( --disable-${i} )
362                 done
363         fi
364
365         # CPU features
366         for i in ${CPU_FEATURES_MAP} ; do
367                 if [ "$(tc-arch)" = "${i%:*}" ] ; then
368                         local var="${i#*:}_CPU_FEATURES[@]"
369                         for j in ${!var} ; do
370                                 use ${j%:*} || myconf+=( --disable-${j#*:} )
371                         done
372                 fi
373         done
374
375         if use pic ; then
376                 myconf+=( --enable-pic )
377                 # disable asm code if PIC is required
378                 # as the provided asm decidedly is not PIC for x86.
379                 [[ ${ABI} == x86 ]] && myconf+=( --disable-asm )
380         fi
381         [[ ${ABI} == x32 ]] && myconf+=( --disable-asm ) #427004
382
383         # Try to get cpu type based on CFLAGS.
384         # Bug #172723
385         # We need to do this so that features of that CPU will be better used
386         # If they contain an unknown CPU it will not hurt since ffmpeg's configure
387         # will just ignore it.
388         for i in $(get-flag mcpu) $(get-flag march) ; do
389                 [[ ${i} = native ]] && i="host" # bug #273421
390                 myconf+=( --cpu=${i} )
391                 break
392         done
393
394         # LTO support, bug #566282
395         is-flagq "-flto*" && myconf+=( "--enable-lto" )
396
397         # Mandatory configuration
398         myconf=(
399                 --enable-avfilter
400                 --enable-avresample
401                 --disable-stripping
402                 --disable-libcelt # bug #664158
403                 "${myconf[@]}"
404         )
405
406         # cross compile support
407         if tc-is-cross-compiler ; then
408                 myconf+=( --enable-cross-compile --arch=$(tc-arch-kernel) --cross-prefix=${CHOST}- --host-cc="$(tc-getBUILD_CC)" )
409                 case ${CHOST} in
410                         *freebsd*)
411                                 myconf+=( --target-os=freebsd )
412                                 ;;
413                         *mingw32*)
414                                 myconf+=( --target-os=mingw32 )
415                                 ;;
416                         *linux*)
417                                 myconf+=( --target-os=linux )
418                                 ;;
419                 esac
420         fi
421
422         # doc
423         myconf+=(
424                 $(multilib_native_use_enable doc)
425                 $(multilib_native_use_enable doc htmlpages)
426                 $(multilib_native_enable manpages)
427         )
428
429         set -- "${S}/configure" \
430                 --prefix="${EPREFIX}/usr" \
431                 --libdir="${EPREFIX}/usr/$(get_libdir)" \
432                 --shlibdir="${EPREFIX}/usr/$(get_libdir)" \
433                 --docdir="${EPREFIX}/usr/share/doc/${PF}/html" \
434                 --mandir="${EPREFIX}/usr/share/man" \
435                 --enable-shared \
436                 --cc="$(tc-getCC)" \
437                 --cxx="$(tc-getCXX)" \
438                 --ar="$(tc-getAR)" \
439                 --optflags="${CFLAGS}" \
440                 $(use_enable static-libs static) \
441                 "${myconf[@]}"
442         echo "${@}"
443         "${@}" || die
444
445         if multilib_is_native_abi && use chromium; then
446                 einfo "Configuring for Chromium"
447                 mkdir -p ../chromium || die
448                 pushd ../chromium >/dev/null || die
449                 set -- "${@}" \
450                         --disable-shared \
451                         --enable-static \
452                         --enable-pic \
453                         --extra-cflags="-DFF_API_CONVERGENCE_DURATION=0"
454                 echo "${@}"
455                 "${@}" || die
456                 popd >/dev/null || die
457         fi
458 }
459
460 multilib_src_compile() {
461         emake V=1
462
463         if multilib_is_native_abi; then
464                 for i in "${FFTOOLS[@]}" ; do
465                         if use fftools_${i} ; then
466                                 emake V=1 tools/${i}$(get_exeext)
467                         fi
468                 done
469
470                 if use chromium; then
471                         einfo "Compiling for Chromium"
472                         pushd ../chromium >/dev/null || die
473                         emake V=1 libffmpeg
474                         popd >/dev/null || die
475                 fi
476         fi
477 }
478
479 multilib_src_install() {
480         emake V=1 DESTDIR="${D}" install install-doc
481
482         if multilib_is_native_abi; then
483                 for i in "${FFTOOLS[@]}" ; do
484                         if use fftools_${i} ; then
485                                 dobin tools/${i}$(get_exeext)
486                         fi
487                 done
488
489                 if use chromium; then
490                         einfo "Installing for Chromium"
491                         pushd ../chromium >/dev/null || die
492                         emake V=1 DESTDIR="${D}" install-libffmpeg
493                         popd >/dev/null || die
494                 fi
495         fi
496 }
497
498 multilib_src_install_all() {
499         dodoc Changelog README.md CREDITS doc/*.txt doc/APIchanges
500         [ -f "RELEASE_NOTES" ] && dodoc "RELEASE_NOTES"
501 }
502
503 multilib_src_test() {
504         LD_LIBRARY_PATH="${BUILD_DIR}/libpostproc:${BUILD_DIR}/libswscale:${BUILD_DIR}/libswresample:${BUILD_DIR}/libavcodec:${BUILD_DIR}/libavdevice:${BUILD_DIR}/libavfilter:${BUILD_DIR}/libavformat:${BUILD_DIR}/libavutil:${BUILD_DIR}/libavresample" \
505                 emake V=1 fate
506 }