diff options
author | 2011-06-08 19:33:06 +0000 | |
---|---|---|
committer | 2011-06-08 19:33:06 +0000 | |
commit | cc539fd8f1b299942f03fb3172157b688e4df3c2 (patch) | |
tree | cdd1d256542c9a1dac3d84b09b38c2ec99b25790 /media-video/mplayer | |
parent | Add jruby (diff) | |
download | gentoo-2-cc539fd8f1b299942f03fb3172157b688e4df3c2.tar.gz gentoo-2-cc539fd8f1b299942f03fb3172157b688e4df3c2.tar.bz2 gentoo-2-cc539fd8f1b299942f03fb3172157b688e4df3c2.zip |
Always use system ffmpeg, use only the required internal headers from ffmpeg, bug #361731
(Portage version: 2.2.0_alpha38/cvs/Linux x86_64)
Diffstat (limited to 'media-video/mplayer')
-rw-r--r-- | media-video/mplayer/ChangeLog | 7 | ||||
-rwxr-xr-x | media-video/mplayer/files/dump_ffmpeg.sh | 76 | ||||
-rw-r--r-- | media-video/mplayer/metadata.xml | 1 | ||||
-rw-r--r-- | media-video/mplayer/mplayer-9999.ebuild | 42 |
4 files changed, 98 insertions, 28 deletions
diff --git a/media-video/mplayer/ChangeLog b/media-video/mplayer/ChangeLog index 0ba0c0b34494..7bd3eaebc410 100644 --- a/media-video/mplayer/ChangeLog +++ b/media-video/mplayer/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for media-video/mplayer # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-video/mplayer/ChangeLog,v 1.790 2011/05/22 23:42:13 josejx Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-video/mplayer/ChangeLog,v 1.791 2011/06/08 19:33:06 aballier Exp $ + + 08 Jun 2011; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild, + +files/dump_ffmpeg.sh, metadata.xml: + Always use system ffmpeg, use only the required internal headers from ffmpeg, + bug #361731 22 May 2011; Joseph Jezak <josejx@gentoo.org> mplayer-1.0_rc4_p20101114.ebuild: diff --git a/media-video/mplayer/files/dump_ffmpeg.sh b/media-video/mplayer/files/dump_ffmpeg.sh new file mode 100755 index 000000000000..e36cd0afa21b --- /dev/null +++ b/media-video/mplayer/files/dump_ffmpeg.sh @@ -0,0 +1,76 @@ +#!/bin/sh + +FFMPEG_DIR=ffmpeg +FFMPEG_MOVED_DIR=ffmpeg_removed +SYSTEM_FFMPEG_DIR=${EPREFIX}/usr/include + +# Move directories + +[ -d "${FFMPEG_DIR}/.git" ] && mv "${FFMPEG_DIR}" "${FFMPEG_MOVED_DIR}" +[ -d "${FFMPEG_MOVED_DIR}" ] || exit 1 +[ -d "${FFMPEG_DIR}" ] || mkdir "${FFMPEG_DIR}" + +# Keep required files and check them + +SANITIZED_REGEXP='^\#[[:space:]]*include.*\".*[.]h\"' +sanitize_includes() { + sed -e "s/^\#[[:space:]]*include.*\"config[.]h\"/#include <config.h>/" \ + -e "s/^\#[[:space:]]*include.*\"\(libav.*\/.*[.]h\)\"/#include \<\1\>/" \ + -e "/${SANITIZED_REGEXP}/{s:\"\(.*\)\":\<${2}\/\1\>:}" ${1} +} + +check_sanitized_includes() { + grep -q "${SANITIZED_REGEXP}" $1 +} + +get_header_deps() { + grep "^#[[:space:]]*include.*\<libav.*[.]h\>" ${1} | \ + sed -e "s/^#[[:space:]]*include.*\<\(libav.*[.]h\)\>/\1/" | \ + tr -d '<>' | tr '\n' ' ' +} + +check_header_deps() { + for i ; do + printf "Checking for the presence of ${i}...\n" + if [ ! -f "${SYSTEM_FFMPEG_DIR}/${i}" -a ! -f "${FFMPEG_DIR}/${i}" ] ; then + printf "Header depends on ${i}\n" + printf "... but that file cannot be found, aborting\n" + exit 1 + fi + done +} + +move_file() { + mydir="$(dirname $1)" + printf "Moving and checking file: ${1}\n" + [ -d "${FFMPEG_DIR}/${mydir}" ] || mkdir -p "${FFMPEG_DIR}/${mydir}" + if [ ! -f "${FFMPEG_DIR}/${1}" ] ; then + sanitize_includes "${FFMPEG_MOVED_DIR}/${1}" ${mydir} > "${FFMPEG_DIR}/${1}" + fi + if $(check_sanitized_includes "${FFMPEG_DIR}/${1}") ; then + printf "Error, found non sanitized file in ffmpeg:\n" + printf "${FFMPEG_DIR}/${1}\n" + printf "Please report it at bugs.gentoo.org\n" + exit 1 + fi + if [ "${1%.h}" != "${1}" ] ; then + mydeps=$(get_header_deps "${FFMPEG_DIR}/${1}") + check_header_deps ${mydeps} + fi +} + +# HEADERS (order matters for the consistency checks: leaves come first) +FILES=" libavutil/x86_cpu.h \ + libavformat/internal.h \ + libavformat/riff.h" +# Files that are sed'ed but not compiled, used to check for availability of +# some codecs +FILES="${FILES} libavcodec/allcodecs.c libavformat/allformats.c" + +for i in ${FILES} ; do + move_file $i +done + +rm -rf "${FFMPEG_MOVED_DIR}" + +exit 0 diff --git a/media-video/mplayer/metadata.xml b/media-video/mplayer/metadata.xml index 08bac1f5bd45..79accb75f0ec 100644 --- a/media-video/mplayer/metadata.xml +++ b/media-video/mplayer/metadata.xml @@ -19,7 +19,6 @@ <flag name="dvdnav">Use forked libdvdnav, navigate menus in GUIs</flag> <flag name="dxr3">Enable DXR3/H+ video output</flag> <flag name="enca">Enables support for charset discovery and conversion</flag> - <flag name="external-ffmpeg">Use shared FFmpeg libraries instead of static bundled ones. Discouraged by upstream.</flag> <flag name="faac">Use external faac library for AAC encoding</flag> <flag name="faad">Use external faad library for AAC decoding</flag> <flag name="gmplayer">Build gmplayer, a GTK+ MPlayer gui (UNSUPPORTED)</flag> diff --git a/media-video/mplayer/mplayer-9999.ebuild b/media-video/mplayer/mplayer-9999.ebuild index b463d6a172b3..0013736758aa 100644 --- a/media-video/mplayer/mplayer-9999.ebuild +++ b/media-video/mplayer/mplayer-9999.ebuild @@ -1,11 +1,11 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/media-video/mplayer/mplayer-9999.ebuild,v 1.99 2011/04/03 10:24:10 scarabeus Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-video/mplayer/mplayer-9999.ebuild,v 1.100 2011/06/08 19:33:06 aballier Exp $ EAPI=4 -EGIT_REPO_URI="git://git.libav.org/libav.git" -EGIT_PROJECT="libav" # git eclass sets it to PN otherwise +EGIT_REPO_URI="git://git.videolan.org/ffmpeg.git" +EGIT_PROJECT="ffmpeg" # git eclass sets it to PN otherwise ESVN_REPO_URI="svn://svn.mplayerhq.hu/mplayer/trunk" [[ ${PV} = *9999* ]] && SVN_ECLASS="subversion git" || SVN_ECLASS="" @@ -15,16 +15,15 @@ inherit toolchain-funcs eutils flag-o-matic multilib base ${SVN_ECLASS} [[ ${PV} != *9999* ]] && MPLAYER_REVISION=SVN-r33094 IUSE="3dnow 3dnowext +a52 aalib +alsa altivec aqua +ass bidi bindist bl bluray -bs2b cddb +cdio cdparanoia cpudetection custom-cpuopts debug dga +dirac +bs2b cddb +cdio cdparanoia cpudetection custom-cpuopts debug dga directfb doc +dts +dv dvb +dvd +dvdnav dxr3 +enca +encode esd +faac +faad fbcon ftp gif ggi gsm +iconv ipv6 jack joystick jpeg jpeg2k kernel_linux ladspa libcaca libmpeg2 lirc +live lzo mad md5sum +mmx mmxext mng +mp3 mpg123 nas -+network nut openal amr +opengl +osdmenu oss png pnm pulseaudio pvr +quicktime -radio +rar +real +rtc rtmp samba +shm +schroedinger sdl +speex sse sse2 ssse3 ++network nut openal +opengl +osdmenu oss png pnm pulseaudio pvr +quicktime +radio +rar +real +rtc rtmp samba +shm sdl +speex sse sse2 ssse3 tga +theora +tremor +truetype +toolame +twolame +unicode v4l v4l2 vdpau vidix -+vorbis vpx win32codecs +X +x264 xanim xinerama +xscreensaver +xv +xvid xvmc ++vorbis win32codecs +X +x264 xanim xinerama +xscreensaver +xv +xvid xvmc zoran" -[[ ${PV} == *9999* ]] && IUSE+=" external-ffmpeg" VIDEO_CARDS="s3virge mga tdfx vesa" for x in ${VIDEO_CARDS}; do @@ -57,13 +56,13 @@ X_RDEPS=" x11-libs/libXext x11-libs/libXxf86vm " -[[ ${PV} == *9999* ]] && RDEPEND+=" external-ffmpeg? ( virtual/ffmpeg )" # Rar: althrought -gpl version is nice, it cant do most functions normal rars can # nemesi? ( net-libs/libnemesi ) RDEPEND+=" sys-libs/ncurses app-arch/bzip2 sys-libs/zlib + >=virtual/ffmpeg-0.6.90 !bindist? ( x86? ( win32codecs? ( media-libs/win32codecs ) @@ -88,14 +87,12 @@ RDEPEND+=" a52? ( media-libs/a52dec ) aalib? ( media-libs/aalib ) alsa? ( media-libs/alsa-lib ) - amr? ( !bindist? ( media-libs/opencore-amr ) ) ass? ( ${FONT_RDEPS} >=media-libs/libass-0.9.10[enca?] ) bidi? ( dev-libs/fribidi ) bluray? ( media-libs/libbluray ) bs2b? ( media-libs/libbs2b ) cdio? ( dev-libs/libcdio ) cdparanoia? ( !cdio? ( media-sound/cdparanoia ) ) - dirac? ( media-video/dirac ) directfb? ( dev-libs/DirectFB ) dts? ( media-libs/libdca ) dv? ( media-libs/libdv ) @@ -144,13 +141,11 @@ RDEPEND+=" ) rtmp? ( media-video/rtmpdump ) samba? ( net-fs/samba ) - schroedinger? ( media-libs/schroedinger ) sdl? ( media-libs/libsdl ) speex? ( media-libs/speex ) theora? ( media-libs/libtheora[encode?] ) truetype? ( ${FONT_RDEPS} ) vorbis? ( media-libs/libvorbis ) - vpx? ( media-libs/libvpx ) xanim? ( media-video/xanim ) " @@ -185,7 +180,7 @@ else KEYWORDS="" fi -# bindist does not cope with amr codecs (#299405#c6), faac codecs are nonfree, win32codecs are nonfree +# faac codecs are nonfree, win32codecs are nonfree # libcdio support: prefer libcdio over cdparanoia and don't check for cddb w/cdio # dvd navigation requires dvd read support # ass and freetype font require iconv and ass requires freetype fonts @@ -193,7 +188,7 @@ fi # libvorbis require external tremor to work # radio requires oss or alsa backend # xvmc requires xvideo support -REQUIRED_USE="bindist? ( !amr !faac !win32codecs )" +REQUIRED_USE="bindist? ( !faac !win32codecs )" PATCHES=( ) @@ -243,6 +238,10 @@ src_unpack() { cd "${WORKDIR}" rm -rf "${WORKDIR}/${P}/ffmpeg/" ( S="${WORKDIR}/${P}/ffmpeg/" git_src_unpack ) + cd "${S}" + cp "${FILESDIR}/dump_ffmpeg.sh" . || die + chmod +x dump_ffmpeg.sh + ./dump_ffmpeg.sh || die else unpack ${A} fi @@ -400,12 +399,10 @@ src_configure() { ########## myconf+=" --disable-musepack" # Use internal musepack codecs for SV7 and SV8 support myconf+=" --disable-libmpeg2-internal" # always use system media-libs/libmpeg2 - use dirac || myconf+=" --disable-libdirac-lavc" use dts || myconf+=" --disable-libdca" if ! use mp3; then myconf+=" --disable-mp3lame - --disable-mp3lame-lavc --disable-mp3lib " fi @@ -413,8 +410,6 @@ src_configure() { for i in ${uses}; do use ${i} || myconf+=" --disable-lib${i}" done - use schroedinger || myconf+=" --disable-libschroedinger-lavc" - use amr || myconf+=" --disable-libopencore_amrnb --disable-libopencore_amrwb" uses="faad gif jpeg libmpeg2 live mad mng mpg123 png pnm speex tga theora xanim" for i in ${uses}; do @@ -431,21 +426,18 @@ src_configure() { --disable-libvorbis " fi - use vpx || myconf+=" --disable-libvpx-lavc" # Encoding uses="faac x264 xvid toolame twolame" if use encode; then for i in ${uses}; do use ${i} || myconf+=" --disable-${i}" done - use faac || myconf+=" --disable-faac-lavc" if use bindist && use faac; then ewarn "faac is nonfree and cannot be distributed; disabling faac support." - myconf+=" --disable-faac --disable-faac-lavc" + myconf+=" --disable-faac" fi else myconf+=" --disable-mencoder" - myconf+=" --disable-faac-lavc" for i in ${uses}; do myconf+=" --disable-${i}" use ${i} && elog "Useflag \"${i}\" require \"encode\" useflag enabled to work." @@ -622,9 +614,7 @@ src_configure() { ################### # External FFmpeg # ################### - if [[ ${PV} == *9999* ]]; then - use external-ffmpeg && myconf+=" --disable-ffmpeg_a" - fi + myconf+=" --disable-ffmpeg_a" myconf="--cc=$(tc-getCC) --host-cc=$(tc-getBUILD_CC) |