diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2016-06-19 05:37:07 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2016-06-19 05:37:07 +0300 |
commit | 8c0e2981349bf20ca7cae34024fcca6ae8ad5ee0 (patch) | |
tree | 4966245c029e2dd89e948cf5dc87b378fa6003ce /media-video | |
parent | 64588f0bb44645193c891ce90547fa6db6b0bd23 (diff) |
vuild fixes
upstream sync
Diffstat (limited to 'media-video')
-rw-r--r-- | media-video/mpv/mpv-scm.ebuild | 261 |
1 files changed, 149 insertions, 112 deletions
diff --git a/media-video/mpv/mpv-scm.ebuild b/media-video/mpv/mpv-scm.ebuild index 5ca398e..1bc3ee7 100644 --- a/media-video/mpv/mpv-scm.ebuild +++ b/media-video/mpv/mpv-scm.ebuild @@ -3,198 +3,194 @@ # $Header: /var/cvsroot/gentoo-x86/media-video/mpv/mpv-9999.ebuild,v 1.74 2015/05/24 04:44:23 yngwin Exp $ EAPI=5 -PYTHON_COMPAT=( python{2_7,3_3,3_4} ) +PYTHON_COMPAT=( python{2_7,3_4} ) PYTHON_REQ_USE='threads(+)' inherit eutils python-any-r1 waf-utils pax-utils fdo-mime gnome2-utils git-r3 -WAF_V="1.8.4" +WAF_PV="1.8.12" DESCRIPTION="Media player based on MPlayer and mplayer2" HOMEPAGE="http://mpv.io/" -SRC_URI="http://ftp.waf.io/pub/release/waf-${WAF_V}" +SRC_URI+=" https://waf.io/waf-${WAF_PV}" DOCS=( README.md etc/input.conf ) EGIT_REPO_URI="https://github.com/mpv-player/mpv.git" # See Copyright in source tarball and bug #506946. Waf is BSD, libmpv is ISC. -LICENSE="GPL-2+ BSD ISC" +LICENSE="GPL-3+ BSD ISC" SLOT="0" -IUSE="+alsa bluray bs2b cdio +cli doc-pdf drm dvb +dvd egl +enca encode +iconv -jack jpeg ladspa lcms +libass libav libcaca libguess libmpv lua luajit openal -+opengl oss pulseaudio raspberry-pi rubberband samba sdl selinux v4l vaapi -vdpau vf-dlopen wayland +X xinerama +xscreensaver xv" +IUSE="aqua +alsa archive bluray cdda +cli coreaudio doc drm dvb dvd +egl +enca + encode gbm +iconv jack jpeg lcms +libass libav libcaca libguess libmpv lua + luajit openal +opengl oss pulseaudio raspberry-pi rubberband samba -sdl + selinux test uchardet v4l vaapi vdpau vf-dlopen wayland +X xinerama + +xscreensaver +xv zsh-completion" REQUIRED_USE=" || ( cli libmpv ) - egl? ( opengl X ) + aqua? ( opengl ) + egl? ( || ( gbm X wayland ) ) enca? ( iconv ) - lcms? ( opengl ) + gbm? ( drm egl ) + lcms? ( || ( opengl egl ) ) libguess? ( iconv ) luajit? ( lua ) - opengl? ( || ( wayland X ) ) - vaapi? ( X ) + uchardet? ( iconv ) + v4l? ( || ( alsa oss ) ) + vaapi? ( || ( gbm X wayland ) ) vdpau? ( X ) - wayland? ( opengl ) + wayland? ( egl ) xinerama? ( X ) xscreensaver? ( X ) xv? ( X ) -" + zsh-completion? ( cli )" -RDEPEND=" +COMMON_DEPEND=" + !libav? ( >=media-video/ffmpeg-2.4:0=[encode?,threads,vaapi?,vdpau?] ) libav? ( >=media-video/libav-11:0=[encode?,threads,vaapi?,vdpau?] ) - !libav? ( >=media-video/ffmpeg-2.4.0:0=[encode?,threads,vaapi?,vdpau?] ) sys-libs/zlib - X? ( - x11-libs/libX11 - x11-libs/libXext - >=x11-libs/libXrandr-1.2.0 - opengl? ( - virtual/opengl - egl? ( media-libs/mesa[egl] ) - ) - lcms? ( >=media-libs/lcms-2.6:2 ) - vaapi? ( >=x11-libs/libva-0.34.0[X(+)] ) - vdpau? ( >=x11-libs/libvdpau-0.2 ) - xinerama? ( x11-libs/libXinerama ) - xscreensaver? ( x11-libs/libXScrnSaver ) - xv? ( x11-libs/libXv ) - ) alsa? ( >=media-libs/alsa-lib-1.0.18 ) + archive? ( >=app-arch/libarchive-3.0.0:= ) bluray? ( >=media-libs/libbluray-0.3.0 ) - bs2b? ( media-libs/libbs2b ) - cdio? ( - dev-libs/libcdio - dev-libs/libcdio-paranoia - ) + cdda? ( dev-libs/libcdio-paranoia ) drm? ( x11-libs/libdrm ) dvb? ( virtual/linuxtv-dvb-headers ) dvd? ( - >=media-libs/libdvdread-4.1.3 >=media-libs/libdvdnav-4.2.0 + >=media-libs/libdvdread-4.1.0 ) - enca? ( app-i18n/enca ) - iconv? ( virtual/libiconv ) - jack? ( media-sound/jack-audio-connection-kit ) + egl? ( media-libs/mesa[egl,gbm(-)?,wayland(-)?] ) + iconv? ( + virtual/libiconv + enca? ( app-i18n/enca ) + libguess? ( >=app-i18n/libguess-1.0 ) + uchardet? ( dev-libs/uchardet ) + ) + jack? ( virtual/jack ) jpeg? ( virtual/jpeg:0 ) - ladspa? ( media-libs/ladspa-sdk ) + lcms? ( >=media-libs/lcms-2.6:2 ) libass? ( - >=media-libs/libass-0.12.1:=[enca?,fontconfig] + >=media-libs/libass-0.12.1:=[fontconfig,harfbuzz] virtual/ttf-fonts ) libcaca? ( >=media-libs/libcaca-0.99_beta18 ) - libguess? ( >=app-i18n/libguess-1.0 ) lua? ( !luajit? ( || ( =dev-lang/lua-5.1*:= =dev-lang/lua-5.2*:= ) ) luajit? ( dev-lang/luajit:2 ) ) openal? ( >=media-libs/openal-1.13 ) + opengl? ( !aqua? ( virtual/opengl ) ) pulseaudio? ( media-sound/pulseaudio ) + raspberry-pi? ( + >=media-libs/raspberrypi-userland-0_pre20160305-r1 + media-libs/mesa[egl,gles2] + ) rubberband? ( >=media-libs/rubberband-1.8.0 ) samba? ( net-fs/samba ) - sdl? ( media-libs/libsdl2[threads] ) + sdl? ( media-libs/libsdl2[sound,threads,video,X?,wayland?] ) v4l? ( media-libs/libv4l ) + vaapi? ( >=x11-libs/libva-1.4.0[drm?,X?,wayland?] ) wayland? ( >=dev-libs/wayland-1.6.0 - media-libs/mesa[egl,wayland] >=x11-libs/libxkbcommon-0.3.0 ) + X? ( + x11-libs/libX11 + x11-libs/libXext + >=x11-libs/libXrandr-1.2.0 + opengl? ( x11-libs/libXdamage ) + vdpau? ( >=x11-libs/libvdpau-0.2 ) + xinerama? ( x11-libs/libXinerama ) + xscreensaver? ( x11-libs/libXScrnSaver ) + xv? ( x11-libs/libXv ) + ) " -DEPEND="${RDEPEND} +DEPEND="${COMMON_DEPEND} ${PYTHON_DEPS} - virtual/pkgconfig >=dev-lang/perl-5.8 dev-python/docutils - doc-pdf? ( dev-python/rst2pdf ) - X? ( - x11-proto/videoproto - xinerama? ( x11-proto/xineramaproto ) - xscreensaver? ( x11-proto/scrnsaverproto ) - ) + virtual/pkgconfig + doc? ( dev-python/rst2pdf ) + test? ( >=dev-util/cmocka-1.0.0 ) " -RDEPEND+=" +RDEPEND="${COMMON_DEPEND} selinux? ( sec-policy/selinux-mplayer ) -" - -pkg_setup() { - if ! use libass; then - ewarn "You have disabled the libass flag. No OSD or subtitles will be displayed." - fi - - if use openal; then - ewarn "You have enabled the openal audio output which is a fallback" - ewarn "and disabled by upstream." - fi - - if use sdl; then - ewarn "You have enabled the sdl video and audio outputs which are fallbacks" - ewarn "and disabled by upstream." - fi - - if use libav; then - einfo "You have enabled media-video/libav instead of media-video/ffmpeg." - einfo "Upstream recommends media-video/ffmpeg, as some functionality is not" - einfo "provided by media-video/libav." - fi - - einfo "For additional format support you need to enable the support on your" - einfo "libavcodec/libavformat provider:" - einfo " media-video/ffmpeg or media-video/libav" - - python-any-r1_pkg_setup + " + +pkg_pretend() { + if [[ ${MERGE_TYPE} != "binary" ]] && ! tc-has-tls && use vaapi && use egl; then + die "Your compiler lacks C++11 TLS support. Use GCC>=4.8.0 or Clang>=3.3." + fi } src_prepare() { - cp "${DISTDIR}"/waf-${WAF_V} "${S}"/waf || die - chmod 0755 "${S}"/waf || die + cp "${DISTDIR}/waf-${WAF_PV}" "${S}"/waf || die + chmod +x "${S}"/waf || die + default_src_prepare +# EPATCH_SUFFIX=patch EPATCH_FORCE=yes epatch "${WORKDIR}/${PV}" epatch_user } + src_configure() { local mywafargs=( - --confdir="${EPREFIX}"/etc/${PN} - --docdir="${EPREFIX}"/usr/share/doc/${PF} + --confdir="${EPREFIX}/etc/${PN}" + --docdir="${EPREFIX}/usr/share/doc/${PF}" + + --enable-gpl3 + $(usex cli '' '--disable-cplayer') $(use_enable libmpv libmpv-shared) + + # See deep down below for build-date. --disable-libmpv-static - --disable-build-date # keep build reproducible - --disable-optimize # do not add '-O2' to CFLAGS - --disable-debug-build # do not add '-g' to CFLAGS - --disable-test # avoid dev-util/cmocka automagic - $(use_enable doc-pdf pdf-build) + --disable-static-build + --disable-optimize # Don't add '-O2' to CFLAGS. + --disable-debug-build # Don't add '-g' to CFLAGS. + + $(use_enable doc html-build) + $(use_enable doc pdf-build) $(use_enable vf-dlopen vf-dlopen-filters) - $(use_enable cli zsh-comp) + $(use_enable zsh-completion zsh-comp) + $(use_enable test) - # optional features $(use_enable iconv) - $(use_enable libguess) $(use_enable samba libsmbclient) $(use_enable lua) + $(usex luajit '--lua=luajit' '') $(use_enable libass) $(use_enable libass libass-osd) $(use_enable encode encoding) $(use_enable bluray libbluray) $(use_enable dvd dvdread) $(use_enable dvd dvdnav) - $(use_enable cdio cdda) + $(use_enable cdda) $(use_enable enca) + $(use_enable libguess) + $(use_enable uchardet) $(use_enable rubberband) $(use_enable lcms lcms2) - --disable-vapoursynth # vapoursynth is not packaged + --disable-vapoursynth # Only available in overlays. --disable-vapoursynth-lazy + $(use_enable archive libarchive) + --enable-libavdevice - $(usex luajit '--lua=luajit' '') - # audio outputs - $(use_enable sdl sdl2) # SDL output is fallback for platforms where nothing better is available + # Audio outputs: + $(use_enable sdl sdl2) # Listed under audio, but also includes video. --disable-sdl1 $(use_enable oss oss-audio) - --disable-rsound # media-sound/rsound is in pro-audio overlay only + --disable-rsound # Only available in overlays. $(use_enable pulseaudio pulse) $(use_enable jack) $(use_enable openal) + --disable-opensles $(use_enable alsa) + $(use_enable coreaudio) - # video outputs + # Video outputs: + $(use_enable aqua cocoa) + $(use_enable drm) + $(use_enable gbm) $(use_enable wayland) $(use_enable X x11) $(use_enable xscreensaver xss) @@ -202,29 +198,49 @@ src_configure() { $(use_enable xv) $(use_enable xinerama) $(use_enable X xrandr) - $(usex X "$(use_enable opengl gl-x11)" '--disable-gl-x11') - $(use_enable egl egl-x11) - $(usex wayland "$(use_enable opengl gl-wayland)" '--disable-gl-wayland') - $(use_enable opengl gl) + $(usex opengl "$(use_enable aqua gl-cocoa)" '--disable-gl-cocoa') + $(usex opengl "$(use_enable X gl-x11)" '--disable-gl-x11') + $(usex egl "$(use_enable X egl-x11)" '--disable-egl-x11') + $(usex egl "$(use_enable gbm egl-drm)" '--disable-egl-drm') + $(use_enable wayland gl-wayland) $(use_enable vdpau) $(usex vdpau "$(use_enable opengl vdpau-gl-x11)" '--disable-vdpau-gl-x11') - $(use_enable vaapi) - $(usex vaapi "$(use_enable opengl vaapi-glx)" '--disable-vaapi-glx') + $(use_enable vaapi) # See below for vaapi-glx, vaapi-x-egl. + $(usex vaapi "$(use_enable X vaapi-x11)" '--disable-vaapi-x11') + $(usex vaapi "$(use_enable wayland vaapi-wayland)" '--disable-vaapi-wayland') + $(usex vaapi "$(use_enable gbm vaapi-drm)" '--disable-vaapi-drm') $(use_enable libcaca caca) - $(use_enable drm) $(use_enable jpeg) + --disable-android $(use_enable raspberry-pi rpi) + $(usex libmpv "$(use_enable opengl plain-gl)" '--disable-plain-gl') - # hwaccels + # HWaccels: + # Automagic Video Toolbox HW acceleration. See Gentoo bug 577332. $(use_enable vaapi vaapi-hwaccel) - $(use_enable vdpau vdpau-hwaccel) + # Automagic VDPAU HW acceleration. See Gentoo bug 558870. - # tv features + # TV features: $(use_enable v4l tv) $(use_enable v4l tv-v4l2) $(use_enable v4l libv4l2) + $(use_enable v4l audio-input) $(use_enable dvb dvbin) + + # Miscellaneous features: + --disable-apple-remote # Needs testing first. See Gentoo bug 577332. ) + + if use vaapi && use X; then + mywafargs+=( + $(use_enable opengl vaapi-glx) + $(use_enable egl vaapi-x-egl) + ) + fi + + # Create reproducible non-live builds. + [[ ${PV} != *9999* ]] && mywafargs+=(--disable-build-date) + waf-utils_src_configure "${mywafargs[@]}" } @@ -232,7 +248,7 @@ src_install() { waf-utils_src_install if use cli && use luajit; then - pax-mark -m "${ED}"usr/bin/mpv + pax-mark -m "${ED}"usr/bin/${PN} fi } @@ -243,9 +259,30 @@ pkg_preinst() { pkg_postinst() { fdo-mime_desktop_database_update gnome2_icon_cache_update + + # bash-completion < 2.3-r1 already installs (mostly broken) mpv completion. + if use cli && ! has_version '<app-shells/bash-completion-2.3-r1' && \ + ! has_version 'app-shells/mpv-bash-completion'; then + elog "If you want to have command-line completion via bash-completion," + elog "please install app-shells/mpv-bash-completion." + fi + + if use cli && [[ -n ${REPLACING_VERSIONS} ]] && \ + has_version 'app-shells/mpv-bash-completion'; then + elog "If command-line completion doesn't work after mpv update," + elog "please rebuild app-shells/mpv-bash-completion." + fi } pkg_postrm() { fdo-mime_desktop_database_update gnome2_icon_cache_update } +src_test() { + cd "${S}"/build/test || die + for test in *; do + if [[ -x ${test} ]]; then + ./"${test}" || die "Test suite failed" + fi + done +} |