1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 if [ "${PV%9999}" != "${PV}" ] ; then
10 if [ "${PV%.9999}" != "${PV}" ] ; then
11 EGIT_REPO_URI="git://git.videolan.org/vlc/vlc-${PV%.9999}.git"
13 EGIT_REPO_URI="git://git.videolan.org/vlc.git"
17 inherit autotools flag-o-matic toolchain-funcs versionator virtualx ${SCM}
20 MY_PV="${MY_PV/-beta/-test}"
23 DESCRIPTION="VLC media player - Video player and streamer"
24 HOMEPAGE="http://www.videolan.org/vlc/"
25 if [ "${PV%9999}" != "${PV}" ] ; then # Live ebuild
27 elif [[ "${MY_P}" == "${P}" ]]; then
28 SRC_URI="http://download.videolan.org/pub/videolan/${PN}/${PV}/${P}.tar.xz"
30 SRC_URI="http://download.videolan.org/pub/videolan/testing/${MY_P}/${MY_P}.tar.xz"
33 LICENSE="LGPL-2.1 GPL-2"
34 SLOT="0/5-8" # vlc - vlccore
36 if [[ ${PV} != *9999 ]] ; then
37 KEYWORDS="amd64 ~arm ppc ppc64 -sparc x86 ~x86-fbsd"
40 IUSE="a52 aalib alsa altivec atmo +audioqueue +avcodec
41 +avformat bidi bluray cdda cddb chromaprint dbus dc1394 debug
42 directfb directx dts dvb +dvbpsi dvd dxva2 elibc_glibc +encode faad fdk
43 fluidsynth +ffmpeg flac fontconfig +gcrypt gme gnome gnutls
44 growl httpd ieee1394 jack jpeg kate kde libass libav libcaca libnotify
45 +libsamplerate libtiger linsys libtar lirc live lua
46 macosx-dialog-provider macosx-eyetv macosx-quartztext macosx-qtkit
47 matroska cpu_flags_x86_mmx modplug mp3 mpeg
48 mtp musepack ncurses neon ogg omxil opencv opengl optimisememory opus
49 png postproc projectm pulseaudio +qt4 qt5 rdp rtsp run-as-root samba
50 schroedinger sdl sdl-image sftp shout sid skins speex cpu_flags_x86_sse svg +swscale
51 taglib theora tremor truetype twolame udev upnp vaapi v4l vcdx vdpau
52 vlm vnc vorbis vpx wma-fixed +X x264 x265 +xcb xml xv zeroconf zvbi"
55 !<media-video/ffmpeg-1.2:0
56 dev-libs/libgpg-error:0
58 >=sys-libs/zlib-1.2.5.1-r2:0[minizip]
60 a52? ( >=media-libs/a52dec-0.7.4-r3:0 )
61 aalib? ( media-libs/aalib:0 )
62 alsa? ( >=media-libs/alsa-lib-1.0.24:0 )
64 !libav? ( >=media-video/ffmpeg-2.8:0= )
65 libav? ( >=media-video/libav-11:0= )
68 !libav? ( >=media-video/ffmpeg-2.8:0= )
69 libav? ( media-video/libav:0= )
71 bidi? ( >=dev-libs/fribidi-0.10.4:0 )
72 bluray? ( >=media-libs/libbluray-0.3:0 )
73 cddb? ( >=media-libs/libcddb-1.2:0 )
74 chromaprint? ( >=media-libs/chromaprint-0.6:0 )
75 dbus? ( >=sys-apps/dbus-1.6:0 )
76 dc1394? ( >=sys-libs/libraw1394-2.0.1:0 >=media-libs/libdc1394-2.1:2 )
77 directfb? ( dev-libs/DirectFB:0 sys-libs/zlib:0 )
78 dts? ( >=media-libs/libdca-0.0.5:0 )
79 dvbpsi? ( >=media-libs/libdvbpsi-0.2.1:0= )
80 dvd? ( >=media-libs/libdvdread-4.9:0 >=media-libs/libdvdnav-4.9:0 )
81 elibc_glibc? ( >=sys-libs/glibc-2.8:2.2 )
82 faad? ( >=media-libs/faad2-2.6.1:0 )
83 fdk? ( media-libs/fdk-aac:0 )
84 flac? ( >=media-libs/libogg-1:0 >=media-libs/flac-1.1.2:0 )
85 fluidsynth? ( >=media-sound/fluidsynth-1.1.2:0 )
86 fontconfig? ( media-libs/fontconfig:1.0 )
87 gcrypt? ( >=dev-libs/libgcrypt-1.2.0:0= )
88 gme? ( media-libs/game-music-emu:0 )
89 gnome? ( gnome-base/gnome-vfs:2 dev-libs/glib:2 )
90 gnutls? ( >=net-libs/gnutls-3.0.20:0 )
91 ieee1394? ( >=sys-libs/libraw1394-2.0.1:0 >=sys-libs/libavc1394-0.5.3:0 )
92 jack? ( virtual/jack )
93 jpeg? ( virtual/jpeg:0 )
94 kate? ( >=media-libs/libkate-0.3:0 )
95 libass? ( >=media-libs/libass-0.9.8:0= media-libs/fontconfig:1.0 )
96 libcaca? ( >=media-libs/libcaca-0.99_beta14:0 )
97 libnotify? ( x11-libs/libnotify:0 x11-libs/gtk+:2 x11-libs/gdk-pixbuf:2 dev-libs/glib:2 )
98 libsamplerate? ( media-libs/libsamplerate:0 )
99 libtar? ( >=dev-libs/libtar-1.2.11-r3:0 )
100 libtiger? ( >=media-libs/libtiger-0.3.1:0 )
101 linsys? ( >=media-libs/zvbi-0.2.28:0 )
102 lirc? ( app-misc/lirc:0 )
103 live? ( >=media-plugins/live-2011.12.23:0 )
104 lua? ( >=dev-lang/lua-5.1:0 )
105 matroska? ( >=dev-libs/libebml-1:0= >=media-libs/libmatroska-1:0= )
106 modplug? ( >=media-libs/libmodplug-0.8.4:0 !~media-libs/libmodplug-0.8.8 )
107 mp3? ( media-libs/libmad:0 )
108 mpeg? ( >=media-libs/libmpeg2-0.3.2:0 )
109 mtp? ( >=media-libs/libmtp-1:0 )
110 musepack? ( >=media-sound/musepack-tools-444:0 )
111 ncurses? ( sys-libs/ncurses:0=[unicode] )
112 ogg? ( >=media-libs/libogg-1:0 )
113 opencv? ( >media-libs/opencv-2:0 )
114 opengl? ( virtual/opengl:0 >=x11-libs/libX11-1.3.99.901:0 )
115 opus? ( >=media-libs/opus-1.0.3:0 )
116 png? ( media-libs/libpng:0= sys-libs/zlib:0 )
118 !libav? ( >=media-video/ffmpeg-2.2:0= )
119 libav? ( media-libs/libpostproc:0= )
121 projectm? ( media-libs/libprojectm:0 media-fonts/dejavu:0 )
122 pulseaudio? ( >=media-sound/pulseaudio-1:0 )
123 !qt5? ( qt4? ( dev-qt/qtcore:4 dev-qt/qtgui:4 ) )
124 qt5? ( dev-qt/qtcore:5 dev-qt/qtgui:5 dev-qt/qtwidgets:5 dev-qt/qtx11extras:5 )
125 rdp? ( >=net-misc/freerdp-1.0.1:0=[client] <net-misc/freerdp-2 )
126 samba? ( >=net-fs/samba-4.0.0_alpha1:0[client] )
127 schroedinger? ( >=media-libs/schroedinger-1.0.10:0 )
128 sdl? ( >=media-libs/libsdl-1.2.10:0
129 sdl-image? ( >=media-libs/sdl-image-1.2.10:0 sys-libs/zlib:0 ) )
130 sftp? ( net-libs/libssh2:0 )
131 shout? ( >=media-libs/libshout-2.1:0 )
132 sid? ( media-libs/libsidplay:2 )
133 skins? ( x11-libs/libXext:0 x11-libs/libXpm:0 x11-libs/libXinerama:0 )
134 speex? ( media-libs/speex:0 )
135 svg? ( >=gnome-base/librsvg-2.9:2 >=x11-libs/cairo-1.13.1:0 )
137 !libav? ( media-video/ffmpeg:0= )
138 libav? ( media-video/libav:0= )
140 taglib? ( >=media-libs/taglib-1.9:0 sys-libs/zlib:0 )
141 theora? ( >=media-libs/libtheora-1.0_beta3:0 )
142 tremor? ( media-libs/tremor:0 )
143 truetype? ( media-libs/freetype:2 virtual/ttf-fonts:0
144 !fontconfig? ( media-fonts/dejavu:0 ) )
145 twolame? ( media-sound/twolame:0 )
146 udev? ( >=virtual/udev-142:0 )
147 upnp? ( net-libs/libupnp:0 )
148 v4l? ( media-libs/libv4l:0 )
150 x11-libs/libva:0[X,drm]
151 !libav? ( >=media-video/ffmpeg-2.8:0=[vaapi] )
152 libav? ( media-video/libav:0=[vaapi] )
154 vcdx? ( >=dev-libs/libcdio-0.78.2:0 >=media-video/vcdimager-0.7.22:0 )
155 zeroconf? ( >=net-dns/avahi-0.6:0[dbus] )
158 # Temporarily block non-live FFMPEG versions as they break vdpau, 9999 works;
159 # thus we'll have to wait for a new release there.
162 >=x11-libs/libvdpau-0.6:0
164 >=media-video/ffmpeg-2.8:0=
166 libav? ( >=media-video/libav-10:0= )
168 vnc? ( >=net-libs/libvncserver-0.9.9:0 )
169 vorbis? ( >=media-libs/libvorbis-1.1:0 )
170 vpx? ( media-libs/libvpx:0= )
171 X? ( x11-libs/libX11:0 )
172 x264? ( >=media-libs/x264-0.0.20090923:0= )
173 x265? ( media-libs/x265:0= )
174 xcb? ( >=x11-libs/libxcb-1.6:0 >=x11-libs/xcb-util-0.3.4:0 >=x11-libs/xcb-util-keysyms-0.3.4:0 )
175 xml? ( >=dev-libs/libxml2-2.5:2 )
176 zvbi? ( >=media-libs/zvbi-0.2.25:0 )
180 !qt5? ( kde? ( kde-frameworks/kdelibs:4 ) )
181 xcb? ( x11-proto/xproto:0 )
183 x86? ( dev-lang/yasm:* )
184 amd64? ( dev-lang/yasm:* )
185 >=sys-devel/gettext-0.18.3:*
195 ffmpeg? ( avcodec avformat swscale )
196 fontconfig? ( truetype )
205 skins? ( truetype X xml || ( qt4 qt5 ) )
213 # Fix build system mistake.
214 "${FILESDIR}"/${PN}-2.1.0-fix-libtremor-libs.patch
216 # Patch up incompatibilities and reconfigure autotools.
217 "${FILESDIR}"/${PN}-9999-libva-1.2.1-compat.patch
219 # Fix up broken audio when skipping using a fixed reversed bisected commit.
220 "${FILESDIR}"/${PN}-2.1.0-TomWij-bisected-PA-broken-underflow.patch
223 "${FILESDIR}"/qt4-select.patch
225 # Allow QT5.5 since Gentoo has a patched QTwidgets
226 "${FILESDIR}"/${PN}-2.2.2-qt5widgets.patch
229 "${FILESDIR}"/${PN}-2.2.4-relax_ffmpeg.patch
230 "${FILESDIR}"/${PN}-2.2.4-ffmpeg3.patch
233 "${FILESDIR}"/${PN}-2.2.4-qt57.patch
234 "${FILESDIR}"/${PN}-2.2.4-cxx0x.patch
237 DOCS=( AUTHORS THANKS NEWS README doc/fortunes.txt doc/intf-vcd.txt )
239 S="${WORKDIR}/${MY_P}"
242 if [[ "${MERGE_TYPE}" != "binary" ]] && tc-is-gcc ; then
243 if ! version_is_at_least 4.5 $(gcc-version) ; then
244 die "You need to have at least >=sys-devel/gcc-4.5 to build and/or have a working vlc, see bug #426754."
250 if [ "${PV%9999}" != "${PV}" ] ; then
258 # Remove unnecessary warnings about unimplemented pragmas on gcc for now.
259 # Need to recheck this with gcc 4.9 and every subsequent minor bump of gcc.
261 # config.h:792: warning: ignoring #pragma STDC FENV_ACCESS [-Wunknown-pragmas]
262 # config.h:793: warning: ignoring #pragma STDC FP_CONTRACT [-Wunknown-pragmas]
264 # https://gcc.gnu.org/c99status.html
266 sed -i 's/ifndef __FAST_MATH__/if 0/g' configure.ac || die
269 # Bootstrap when we are on a git checkout.
270 if [[ "${PV%9999}" != "${PV}" ]] ; then
274 # Make it build with libtool 1.5
275 rm -f m4/lt* m4/libtool.m4 || die
277 # We are not in a real git checkout due to the absence of a .git directory.
278 touch src/revision.txt || die
282 # Don't use --started-from-file when not using dbus.
284 sed -i 's/ --started-from-file//' share/vlc.desktop.in || die
289 # Disable automatic running of tests.
290 find . -name 'Makefile.in' -exec sed -i 's/\(..*\)check-TESTS/\1/' {} \; || die
292 # If qtchooser is installed, it may break the build, because moc,rcc and uic binaries for wrong qt
293 # version may be used. Setting QT_SELECT environment variable will enforce correct binaries.
304 # Compatibility fix for Samba 4.
305 use samba && append-cppflags "-I/usr/include/samba-4.0"
307 # We need to disable -fstack-check if use >=gcc 4.8.0.
309 use x86 && append-cflags $(test-flags-CC -fno-stack-check)
311 # Needs libresid-builder from libsidplay:2 which is in another directory...
313 append-ldflags "-L/usr/$(get_libdir)/sidplay/builders/"
315 if use truetype || use projectm ; then
316 local dejavu="/usr/share/fonts/dejavu/"
317 myconf="--with-default-font=${dejavu}/DejaVuSans.ttf \
318 --with-default-font-family=Sans \
319 --with-default-monospace-font=${dejavu}/DejaVuSansMono.ttf
320 --with-default-monospace-font-family=Monospace"
324 myconf+=" --enable-qt=5"
327 myconf+=" --enable-qt=4"
329 myconf+=" --disable-qt"
331 use kde && myconf+=" --with-kde-solid"
337 --docdir=/usr/share/doc/${PF} \
338 --disable-dependency-tracking \
339 --disable-optimizations \
340 --disable-update-check \
341 --enable-fast-install \
344 $(use_enable aalib aa) \
346 $(use_enable altivec) \
348 $(use_enable audioqueue) \
349 $(use_enable avcodec) \
350 $(use_enable avformat) \
351 $(use_enable bidi fribidi) \
352 $(use_enable bluray) \
353 $(use_enable cdda vcd) \
354 $(use_enable cddb libcddb) \
355 $(use_enable chromaprint) \
357 $(use_enable directfb) \
358 $(use_enable directx) \
359 $(use_enable dc1394) \
360 $(use_enable debug) \
361 $(use_enable dts dca) \
362 $(use_enable dvbpsi) \
363 $(use_enable dvd dvdread) $(use_enable dvd dvdnav) \
364 $(use_enable dxva2) \
365 $(use_enable encode sout) \
367 $(use_enable fdk fdkaac) \
369 $(use_enable fluidsynth) \
370 $(use_enable fontconfig) \
371 $(use_enable gcrypt libgcrypt) \
373 $(use_enable gnome gnomevfs) \
374 $(use_enable gnutls) \
375 $(use_enable growl) \
376 $(use_enable httpd) \
377 $(use_enable ieee1394 dv1394) \
381 $(use_enable libass) \
382 $(use_enable libcaca caca) \
383 $(use_enable libnotify notify) \
384 $(use_enable libsamplerate samplerate) \
385 $(use_enable libtar) \
386 $(use_enable libtiger tiger) \
387 $(use_enable linsys) \
389 $(use_enable live live555) \
391 $(use_enable macosx-dialog-provider) \
392 $(use_enable macosx-eyetv) \
393 $(use_enable macosx-qtkit) \
394 $(use_enable macosx-quartztext) \
395 $(use_enable matroska mkv) \
396 $(use_enable cpu_flags_x86_mmx mmx) \
397 $(use_enable modplug mod) \
398 $(use_enable mp3 mad) \
399 $(use_enable mpeg libmpeg2) \
401 $(use_enable musepack mpc) \
402 $(use_enable ncurses) \
404 $(use_enable ogg) $(use_enable ogg mux_ogg) \
405 $(use_enable omxil) \
406 $(use_enable omxil omxil-vout) \
407 $(use_enable opencv) \
408 $(use_enable opengl glspectrum) \
410 $(use_enable optimisememory optimize-memory) \
412 $(use_enable postproc) \
413 $(use_enable projectm) \
414 $(use_enable pulseaudio pulse) \
415 $(use_enable rdp freerdp) \
416 $(use_enable rtsp realrtsp) \
417 $(use_enable run-as-root) \
418 $(use_enable samba smbclient) \
419 $(use_enable schroedinger) \
421 $(use_enable sdl-image) \
424 $(use_enable shout) \
425 $(use_enable skins skins2) \
426 $(use_enable speex) \
427 $(use_enable cpu_flags_x86_sse sse) \
429 $(use_enable svg svgdec) \
430 $(use_enable swscale) \
431 $(use_enable taglib) \
432 $(use_enable theora) \
433 $(use_enable tremor) \
434 $(use_enable truetype freetype) \
435 $(use_enable twolame) \
438 $(use_enable v4l v4l2) \
439 $(use_enable vaapi libva) \
441 $(use_enable vdpau) \
444 $(use_enable vorbis) \
446 $(use_enable wma-fixed) \
451 $(use_enable xml libxml2) \
452 $(use_enable xv xvideo) \
453 $(use_enable zeroconf bonjour) \
454 $(use_enable zvbi) $(use_enable !zvbi telx) \
458 --disable-crystalhd \
465 --disable-maintainer-mode \
466 --disable-merge-ffmpeg \
468 --disable-mmal-codec \
469 --disable-mmal-vout \
472 --disable-quicktime \
473 --disable-rpi-omxil \
480 # ^ We don't have these disabled libraries in the Portage tree yet.
482 # _FORTIFY_SOURCE is set to 2 in config.h, which is also the default value on Gentoo.
483 # Other values of _FORTIFY_SOURCE may break the build (bug 523144), so definition should not be removed from config.h.
484 # To prevent redefinition warnings, we undefine _FORTIFY_SOURCE at the very start of config.h file
485 sed -i '1i#undef _FORTIFY_SOURCE' "${S}"/config.h || die
489 virtx emake check-TESTS
495 # Punt useless libtool's .la files
496 find "${D}" -name '*.la' -delete || die
500 if [ "$ROOT" = "/" ] && [ -x "/usr/$(get_libdir)/vlc/vlc-cache-gen" ] ; then
501 einfo "Running /usr/$(get_libdir)/vlc/vlc-cache-gen on /usr/$(get_libdir)/vlc/plugins/"
502 "/usr/$(get_libdir)/vlc/vlc-cache-gen" -f "/usr/$(get_libdir)/vlc/plugins/"
504 ewarn "We cannot run vlc-cache-gen (most likely ROOT!=/)"
505 ewarn "Please run /usr/$(get_libdir)/vlc/vlc-cache-gen manually"
506 ewarn "If you do not do it, vlc will take a long time to load."