--- /usr/portage/media-video/mplayer/mplayer-9999.ebuild 2010-03-26 18:06:48.000000000 +0300 +++ mplayer-git-9999.ebuild 2010-03-31 00:32:55.000000000 +0400 @@ -4,23 +4,26 @@ EAPI="2" -ESVN_REPO_URI="svn://svn.mplayerhq.hu/mplayer/trunk" -[[ ${PV} = *9999* ]] && SVN_ECLASS="subversion" || SVN_ECLASS="" +EGIT_REPO_URI="git://repo.or.cz/mplayer-build.git" +EGIT_BOOTSTRAP="./init;./update" +EGIT_HAS_SUBMODULES="true" -inherit eutils flag-o-matic multilib base ${SVN_ECLASS} +inherit eutils flag-o-matic multilib base git [[ ${PV} != *9999* ]] && MPLAYER_REVISION=SVN-r30554 +namesuf="-git" + IUSE="3dnow 3dnowext +a52 +aac aalib +alsa altivec +ass bidi bindist bl bs2b +cddb +cdio cdparanoia cpudetection custom-cpuopts debug dga +dirac directfb doc +dts +dv dvb +dvd +dvdnav dxr3 +enca +encode esd +faac +faad fbcon ftp -gif ggi -gmplayer +iconv ipv6 jack joystick jpeg jpeg2k kernel_linux ladspa +gif ggi +iconv ipv6 jack joystick jpeg kernel_linux ladspa libcaca lirc +live lzo mad md5sum +mmx mmxext mng +mp3 nas +network nut openal opencore-amr +opengl +osdmenu oss png pnm pulseaudio pvr +quicktime radio +rar +real +rtc samba +shm +schroedinger sdl +speex sse sse2 ssse3 svga tga +theora +tremor +truetype +toolame +twolame +unicode v4l v4l2 vdpau vidix +vorbis win32codecs +X +x264 xanim xinerama +xscreensaver +xv +xvid xvmc zoran" -[[ ${PV} == *9999* ]] && IUSE+=" external-ffmpeg" +[[ ${PV} == *9999* ]] && IUSE+=" +ffmpeg-mt -external-ffmpeg symlink" VIDEO_CARDS="s3virge mga tdfx vesa" for x in ${VIDEO_CARDS}; do @@ -42,7 +45,6 @@ fi SRC_URI="${RELEASE_URI} !truetype? ( ${FONT_URI} ) - gmplayer? ( mirror://mplayer/skins/Blue-${BLUV}.tar.bz2 ) svga? ( mirror://gentoo/svgalib_helper-${SVGV}-mplayer.tar.gz )" # svga? ( http://mplayerhq.hu/~alex/svgalib_helper-${SVGV}-mplayer.tar.bz2 ) @@ -58,7 +60,7 @@ x11-libs/libXext x11-libs/libXxf86vm " -[[ ${PV} == *9999* ]] && RDEPEND+=" external-ffmpeg? ( media-video/ffmpeg )" +[[ ${PV} == *9999* ]] && RDEPEND+=" external-ffmpeg? ( !ffmpeg-mt? ( >=media-video/ffmpeg-0.5_p20373 ) )" # Rar: althrought -gpl version is nice, it cant do most functions normal rars can # nemesi? ( net-libs/libnemesi ) RDEPEND+=" @@ -76,11 +78,6 @@ media-libs/libggi media-libs/libggiwmh ) - gmplayer? ( - media-libs/libpng - x11-libs/gtk+:2 - x11-libs/libXi - ) opengl? ( virtual/opengl ) truetype? ( ${FONT_RDEPS} ) vdpau? ( || ( x11-libs/libvdpau >=x11-drivers/nvidia-drivers-180.51 ) ) @@ -127,7 +124,6 @@ nut? ( >=media-libs/libnut-661 ) openal? ( media-libs/openal ) opencore-amr? ( media-libs/opencore-amr ) - jpeg2k? ( media-libs/openjpeg ) png? ( media-libs/libpng ) pnm? ( media-libs/netpbm ) pulseaudio? ( media-sound/pulseaudio ) @@ -159,7 +155,6 @@ ${X_DEPS} dga? ( x11-proto/xf86dgaproto ) dxr3? ( media-video/em8300-libraries ) - gmplayer? ( x11-proto/xextproto ) xinerama? ( x11-proto/xineramaproto ) xscreensaver? ( x11-proto/scrnsaverproto ) ) @@ -172,11 +167,7 @@ SLOT="0" LICENSE="GPL-2" -if [[ ${PV} != *9999* ]]; then - KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" -else - KEYWORDS="" -fi +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" PATCHES=( ) @@ -185,18 +176,11 @@ if [[ ${PV} == *9999* ]]; then elog "" elog "This is a live ebuild which installs the latest from upstream's" - elog "subversion repository, and is unsupported by Gentoo." + elog "git repository, and is unsupported by Gentoo." elog "Everything but bugs in the ebuild itself will be ignored." elog "" fi - if use gmplayer; then - ewarn "" - ewarn "GMPlayer is no longer actively developed upstream" - ewarn "and is not supported by Gentoo. There are alternatives" - ewarn "for a GUI frontend: smplayer, gnome-mplayer or kmplayer." - fi - if use cpudetection; then ewarn "" ewarn "You've enabled the cpudetection flag. This feature is" @@ -228,7 +212,15 @@ } src_unpack() { - [[ ${PV} = *9999* ]] && subversion_src_unpack || unpack ${A} + [[ ${PV} = *9999* ]] && git_src_unpack || unpack ${A} + + cd "${S}" + use ffmpeg-mt && python ./enable-mt + + if use dvd; then + svn export svn://svn.mplayerhq.hu/dvdnav/trunk/libdvdread/src mplayer/libdvdread4 + use dvdnav && svn export svn://svn.mplayerhq.hu/dvdnav/trunk/libdvdnav/src mplayer/libdvdnav + fi if ! use truetype; then unpack font-arial-iso-8859-1.tar.bz2 \ @@ -236,20 +228,39 @@ font-arial-cp1250.tar.bz2 fi - use gmplayer && unpack "Blue-${BLUV}.tar.bz2" use svga && unpack "svgalib_helper-${SVGV}-mplayer.tar.gz" } src_prepare() { if [[ ${PV} = *9999* ]]; then - # Set SVN version manually - subversion_wc_info - sed -i s/UNKNOWN/${ESVN_WC_REVISION}/ "${S}/version.sh" + git_src_prepare + # Set GIT version manually + cd "${S}/mplayer" + sed -i s/UNKNOWN/$(git describe --always)/ version.sh || die "sed failed" + cd "${S}" else # Set version # sed -i s/UNKNOWN/${MPLAYER_REVISION}/ "${S}/version.sh" fi + # We want mplayer${namesuf} + if [[ "${namesuf}" != "" ]]; then + sed -i -e "/elif linux ; then/a\ _exesuf=\"${namesuf}\"" \ + mplayer/configure || die "sed configure failed" + sed -i -e "/ -m 644 DOCS\/man\/en\/mplayer/i\ mv DOCS\/man\/en\/mplayer.1 DOCS\/man\/en\/mplayer${namesuf}.1" \ + -e "/ -m 644 DOCS\/man\/\$(lang)\/mplayer/i\ mv DOCS\/man\/\$(lang)\/mplayer.1 DOCS\/man\/\$(lang)\/mplayer${namesuf}.1" \ + -e "s/er.1/er${namesuf}.1/g" \ + mplayer/Makefile || die "sed Makefile failed" + sed -i -e "s/mplayer/mplayer${namesuf}/" \ + mplayer/TOOLS/midentify.sh || die "sed midentify failed" + fi + + ! use ffmpeg-mt && use external-ffmpeg && \ + sed -i -e 's/mplayer: ffmpeg/mplayer:/' Makefile + + use ffmpeg-mt && use external-ffmpeg && \ + ewarn "USE flags ffmpeg-mt and external-ffmpeg are not compatible, ffmpeg-mt will be used" + if use svga; then echo einfo "Enabling vidix non-root mode." @@ -266,6 +277,7 @@ src_configure() { local myconf="" local uses i + local ffconf="--enable-version3" # set LINGUAS [[ -n $LINGUAS ]] && LINGUAS="${LINGUAS/da/dk}" @@ -284,12 +296,11 @@ $(use_enable network) $(use_enable joystick) " - uses="bl enca ftp rtc" # nemesi <- not working with in-tree ebuild + uses="ass bl enca ftp rtc" # nemesi <- not working with in-tree ebuild myconf+=" --disable-nemesi" # nemesi automagic disable for i in ${uses}; do use ${i} || myconf+=" --disable-${i}" done - use ass || myconf+=" --disable-ass --disable-ass-internal" use bidi || myconf+=" --disable-fribidi" use encode || myconf+=" --disable-mencoder" use ipv6 || myconf+=" --disable-inet6" @@ -405,30 +416,17 @@ myconf+=" --disable-musepack" use aac || myconf+=" --disable-faad-internal" - use dirac || myconf+=" --disable-libdirac-lavc" use dts || myconf+=" --disable-libdca" use dv || myconf+=" --disable-libdv" use faad || myconf+=" --disable-faad" use lzo || myconf+=" --disable-liblzo" - if ! use mp3; then - myconf+=" - --disable-mp3lame - --disable-mp3lame-lavc - --disable-mp3lib - " - fi use bs2b || myconf+=" --disable-libbs2b" - use schroedinger || myconf+=" --disable-libschroedinger-lavc" use xanim && myconf+=" --xanimcodecsdir=/usr/lib/xanim/mods" - if ! use png && ! use gmplayer; then - myconf+=" --disable-png" - fi uses="gif jpeg live mad mng pnm speex tga theora xanim" for i in ${uses}; do use ${i} || myconf+=" --disable-${i}" done - use jpeg2k || myconf+=" --disable-libopenjpeg" if use vorbis || use tremor; then use tremor || myconf+=" --disable-tremor-internal" use vorbis || myconf+=" --disable-libvorbis" @@ -439,21 +437,23 @@ --disable-libvorbis " fi + + # ffmpeg decoders + for i in faad dirac schroedinger speex; do + use $i && ffconf+=" --enable-lib$i" + done + # Encoding if use encode; then uses="faac x264 xvid toolame twolame" for i in ${uses}; do use ${i} || myconf+=" --disable-${i}" done - use aac || myconf+=" --disable-faac-lavc" else myconf+=" - --disable-faac-lavc --disable-faac --disable-x264 --disable-xvid - --disable-x264-lavc - --disable-xvid-lavc --disable-twolame --disable-toolame " @@ -581,10 +581,6 @@ use vidix || myconf+=" --disable-vidix --disable-vidix-pcidb" use xscreensaver || myconf+=" --disable-xss" - # GTK gmplayer gui - # Unsupported by Gentoo, upstream has dropped development - myconf+=" $(use_enable gmplayer gui)" - if use xv; then if use xvmc; then myconf+=" --enable-xvmc --with-xvmclib=XvMCW" @@ -626,15 +622,21 @@ use external-ffmpeg && myconf+=" --disable-libavutil_a --disable-libavcodec_a --disable-libavformat_a --disable-libpostproc_a --disable-libswscale_a" fi - myconf="--cc=$(tc-getCC) \ - --host-cc=$(tc-getBUILD_CC) \ + common_options="--cc=$(tc-getCC) + --host-cc=$(tc-getBUILD_CC) + " + myconf=" --prefix=/usr \ --confdir=/etc/mplayer \ - --datadir=/usr/share/mplayer \ + --datadir=/usr/share/mplayer${namesuf} \ --libdir=/usr/$(get_libdir) \ ${myconf}" - CFLAGS="${CFLAGS}" ./configure ${myconf} || die "configure died" + echo "${common_options}" > common_options + echo "${myconf}" > mplayer_options + echo "${ffconf}" > ffmpeg_options + sed -i -e 's/ --/\n--/g' \ + common_options mplayer_options ffmpeg_options || die "sed _options failed" } src_compile() { @@ -650,11 +652,13 @@ BINDIR="${D}/usr/bin" \ LIBDIR="${D}/usr/$(get_libdir)" \ CONFDIR="${D}/etc/mplayer" \ - DATADIR="${D}/usr/share/mplayer" \ + DATADIR="${D}/usr/share/mplayer${namesuf}" \ MANDIR="${D}/usr/share/man" \ INSTALLSTRIP="" \ install || die "emake install failed" + S="${S}/mplayer" + cd "${S}" dodoc AUTHORS Changelog Copyright README etc/codecs.conf || die docinto tech/ @@ -674,27 +678,16 @@ dohtml -r "${S}"/DOCS/HTML/* || die fi - # Install the default Skin and Gnome menu entry - if use gmplayer; then - dodir /usr/share/mplayer/skins - cp -r "${WORKDIR}/Blue" \ - "${D}/usr/share/mplayer/skins/default" || die "cp skins died" - - # Fix the symlink - rm -rf "${D}/usr/bin/gmplayer" - dosym mplayer /usr/bin/gmplayer - fi - if ! use ass && ! use truetype; then - dodir /usr/share/mplayer/fonts + dodir /usr/share/mplayer${namesuf}/fonts # Do this generic, as the mplayer people like to change the structure # of their zips ... for i in $(find "${WORKDIR}/" -type d -name 'font-arial-*'); do - cp -pPR "${i}" "${D}/usr/share/mplayer/fonts" + cp -pPR "${i}" "${D}/usr/share/mplayer${namesuf}/fonts" done # Fix the font symlink ... - rm -rf "${D}/usr/share/mplayer/font" - dosym fonts/font-arial-14-iso-8859-1 /usr/share/mplayer/font + rm -rf "${D}/usr/share/mplayer${namesuf}/font" + dosym fonts/font-arial-14-iso-8859-1 /usr/share/mplayer${namesuf}/font fi insinto /etc/mplayer @@ -719,22 +712,28 @@ _EOF_ fi - dosym ../../../etc/mplayer/mplayer.conf /usr/share/mplayer/mplayer.conf - newbin "${S}/TOOLS/midentify.sh" midentify || die + dosym ../../../etc/mplayer/mplayer.conf /usr/share/mplayer${namesuf}/mplayer.conf + newbin "${S}/TOOLS/midentify.sh" midentify${namesuf} || die + + if [[ "${namesuf}" != "" ]] && use symlink; then + dosym mplayer-git /usr/bin/mplayer + dosym mencoder-git /usr/bin/mencoder + dosym midentify-git /usr/bin/midentify + fi } pkg_preinst() { - [[ -d ${ROOT}/usr/share/mplayer/Skin/default ]] && \ - rm -rf "${ROOT}/usr/share/mplayer/Skin/default" + [[ -d ${ROOT}/usr/share/mplayer${namesuf}/Skin/default ]] && \ + rm -rf "${ROOT}/usr/share/mplayer${namesuf}/Skin/default" } pkg_postrm() { # Cleanup stale symlinks - [ -L "${ROOT}/usr/share/mplayer/font" -a \ - ! -e "${ROOT}/usr/share/mplayer/font" ] && \ - rm -f "${ROOT}/usr/share/mplayer/font" - - [ -L "${ROOT}/usr/share/mplayer/subfont.ttf" -a \ - ! -e "${ROOT}/usr/share/mplayer/subfont.ttf" ] && \ - rm -f "${ROOT}/usr/share/mplayer/subfont.ttf" + [ -L "${ROOT}/usr/share/mplayer${namesuf}/font" -a \ + ! -e "${ROOT}/usr/share/mplayer${namesuf}/font" ] && \ + rm -f "${ROOT}/usr/share/mplayer${namesuf}/font" + + [ -L "${ROOT}/usr/share/mplayer${namesuf}/subfont.ttf" -a \ + ! -e "${ROOT}/usr/share/mplayer${namesuf}/subfont.ttf" ] && \ + rm -f "${ROOT}/usr/share/mplayer${namesuf}/subfont.ttf" }