diff options
author | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2017-12-06 04:00:21 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2017-12-06 04:00:21 +0300 |
commit | 7dcd8f6ff18292756013ef44590ff4e0dbe7a432 (patch) | |
tree | 1a1d44f3808ea34a013c2769646918cb0c0cf47d /media-video/mpv | |
parent | 9c6a970be1ea7d3c2cbdba9e5f008957c6c34f2c (diff) |
better solution for mpv shit from https://bugs.gentoo.org/show_bug.cgi?id=635650
Diffstat (limited to 'media-video/mpv')
-rw-r--r-- | media-video/mpv/mpv-scm.ebuild | 153 |
1 files changed, 88 insertions, 65 deletions
diff --git a/media-video/mpv/mpv-scm.ebuild b/media-video/mpv/mpv-scm.ebuild index c390f04..68c5834 100644 --- a/media-video/mpv/mpv-scm.ebuild +++ b/media-video/mpv/mpv-scm.ebuild @@ -1,63 +1,63 @@ # Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/media-video/mpv/mpv-9999.ebuild,v 1.74 2015/05/24 04:44:23 yngwin Exp $ EAPI=6 PYTHON_COMPAT=( python{2_7,3_4,3_5} ) PYTHON_REQ_USE='threads(+)' -inherit eutils python-any-r1 waf-utils pax-utils fdo-mime gnome2-utils git-r3 -WAF_PV=1.8.12 +WAF_PV=1.9.8 + +inherit gnome2-utils pax-utils python-r1 toolchain-funcs versionator waf-utils xdg-utils git-r3 DESCRIPTION="Media player based on MPlayer and mplayer2" HOMEPAGE="https://mpv.io/" -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" +SRC_URI+=" https://waf.io/waf-${WAF_PV}" +DOCS+=( README.md DOCS/{client-api,interface}-changes.rst ) + +# See Copyright in sources and Gentoo bug 506946. Waf is BSD, libmpv is ISC. +LICENSE="LGPL-2.1+ GPL-2+ BSD ISC samba? ( GPL-3+ )" SLOT="0" -IUSE="aqua +alsa archive bluray cdda +cli coreaudio cplugins cuda doc drm dvb dvd +egl - encode gbm +iconv jack jpeg lcms +libass libav libcaca libmpv +lua - luajit openal +opengl oss pulseaudio raspberry-pi rubberband samba -sdl - selinux test tools +uchardet v4l vaapi vdpau wayland +X - +xscreensaver +xv zsh-completion" -IUSE+=" cpu_flags_x86_sse4_1" +IUSE="+alsa aqua archive bluray cdda +cli coreaudio cplugins cuda doc drm dvb + dvd +egl encode gbm +iconv jack javascript jpeg lcms +libass libav libcaca + libmpv +lua luajit openal +opengl oss pulseaudio raspberry-pi rubberband + samba sdl selinux test tools +uchardet v4l vaapi vdpau wayland +X +xv zlib + zsh-completion" REQUIRED_USE=" || ( cli libmpv ) aqua? ( opengl ) - cuda? ( !libav || ( opengl egl ) ) + cuda? ( !libav opengl ) egl? ( || ( gbm X wayland ) ) - gbm? ( drm egl ) - lcms? ( || ( opengl egl ) ) + gbm? ( drm egl opengl ) + lcms? ( opengl ) luajit? ( lua ) - opengl? ( || ( aqua X !cli? ( libmpv ) ) ) - test? ( || ( opengl egl ) ) + opengl? ( || ( aqua egl X raspberry-pi !cli ) ) + raspberry-pi? ( opengl ) + test? ( opengl ) tools? ( cli ) uchardet? ( iconv ) v4l? ( || ( alsa oss ) ) vaapi? ( || ( gbm X wayland ) ) vdpau? ( X ) wayland? ( egl ) - xscreensaver? ( X ) + X? ( egl? ( opengl ) ) xv? ( X ) zsh-completion? ( cli ) ${PYTHON_REQUIRED_USE} " COMMON_DEPEND=" - !libav? ( >=media-video/ffmpeg-3.2.2:0=[encode?,threads,vaapi?,vdpau?,mpv-fork] ) + !libav? ( media-video/ffmpeg-mpv:=[encode?,threads,vaapi?,vdpau?] ) libav? ( >=media-video/libav-12:0=[encode?,threads,vaapi?,vdpau?] ) - sys-libs/zlib alsa? ( >=media-libs/alsa-lib-1.0.18 ) archive? ( >=app-arch/libarchive-3.0.0:= ) bluray? ( >=media-libs/libbluray-0.3.0 ) cdda? ( dev-libs/libcdio-paranoia ) - cuda? ( >=media-video/ffmpeg-3.3:0 ) + cuda? ( media-video/ffmpeg-mpv ) drm? ( x11-libs/libdrm ) dvd? ( >=media-libs/libdvdnav-4.2.0 @@ -69,6 +69,7 @@ COMMON_DEPEND=" uchardet? ( app-i18n/uchardet ) ) jack? ( virtual/jack ) + javascript? ( >=dev-lang/mujs-1.0.0 ) jpeg? ( virtual/jpeg:0 ) lcms? ( >=media-libs/lcms-2.6:2 ) libass? ( @@ -81,30 +82,39 @@ COMMON_DEPEND=" luajit? ( dev-lang/luajit:2 ) ) openal? ( >=media-libs/openal-1.13 ) - opengl? ( X? ( virtual/opengl ) ) pulseaudio? ( media-sound/pulseaudio ) - raspberry-pi? ( - >=media-libs/raspberrypi-userland-0_pre20160305-r1 - virtual/opengl - ) + raspberry-pi? ( >=media-libs/raspberrypi-userland-0_pre20160305-r1 ) rubberband? ( >=media-libs/rubberband-1.8.0 ) - samba? ( net-fs/samba[smbclient(+)] ) - sdl? ( media-libs/libsdl2[sound,threads,video,X?,wayland?] ) + samba? ( net-fs/samba ) + sdl? ( media-libs/libsdl2[sound,threads,video] ) v4l? ( media-libs/libv4l ) - vaapi? ( >=x11-libs/libva-1.4.0[drm?,X?,wayland?] ) - vdpau? ( >=x11-libs/libvdpau-0.2 ) + vaapi? ( + !libav? ( media-video/ffmpeg-mpv ) + libav? ( >=media-video/libav-13:0 ) + x11-libs/libva[drm?,X?,wayland?] + ) + vdpau? ( + !libav? ( >=media-video/ffmpeg-mpv-9999:0 ) + libav? ( >=media-video/libav-13:0 ) + x11-libs/libvdpau + ) wayland? ( >=dev-libs/wayland-1.6.0 >=x11-libs/libxkbcommon-0.3.0 ) X? ( x11-libs/libX11 + x11-libs/libXScrnSaver x11-libs/libXext - >=x11-libs/libXrandr-1.2.0 - opengl? ( x11-libs/libXdamage ) - xscreensaver? ( x11-libs/libXScrnSaver ) + x11-libs/libXinerama + x11-libs/libXrandr + opengl? ( + x11-libs/libXdamage + virtual/opengl + ) xv? ( x11-libs/libXv ) ) + zlib? ( sys-libs/zlib ) " DEPEND="${COMMON_DEPEND} ${PYTHON_DEPS} @@ -123,21 +133,12 @@ RDEPEND="${COMMON_DEPEND} " PATCHES=( - "${FILESDIR}/${PN}-0.19.0-make-ffmpeg-version-check-non-fatal.patch" - ) - -mpv_check_compiler() { - if [[ ${MERGE_TYPE} != "binary" ]] && use vaapi && use egl && ! tc-has-tls; then - die "Your compiler lacks C++11 TLS support. Use GCC>=4.8.0 or Clang>=3.3." - fi -} - -pkg_pretend() { - mpv_check_compiler -} + "${FILESDIR}/${PN}-0.19.0-make-ffmpeg-version-check-non-fatal.patch" + "${FILESDIR}/${PN}-fix-ffmpeg-mpv-version-check.patch" + #"${FILESDIR}/${PN}-0.23.0-make-libavdevice-check-accept-libav.patch" +) pkg_setup() { - mpv_check_compiler [[ ${MERGE_TYPE} != "binary" ]] && python_setup } @@ -148,6 +149,17 @@ src_prepare() { } src_configure() { + tc-export CC PKG_CONFIG AR + + local -x CFLAGS="${CFLAGS} -I/usr/lib/ffmpeg-mpv/include -L/usr/lib/ffmpeg-mpv/lib64" + local -x LDFLAGS="${CFLAGS} -Wl,-rpath=/usr/lib/ffmpeg-mpv/lib64" + + if tc-is-cross-compiler && use raspberry-pi; then + export EXTRA_PKG_CONFIG_LIBDIR="${SYSROOT%/}${EPREFIX}/opt/vc/lib/pkgconfig" + # Drop next line when Gentoo bug 607344 is fixed or if you fixed it locally. + die "${PN} can't be cross built with raspberry-pi USE enabled. See Gentoo bug 607344." + fi + local mywafargs=( --confdir="${EPREFIX}/etc/${PN}" --docdir="${EPREFIX}/usr/share/doc/${PF}" @@ -156,9 +168,9 @@ src_configure() { $(usex cli '' '--disable-cplayer') $(use_enable libmpv libmpv-shared) - # See deep down below for build-date. --disable-libmpv-static --disable-static-build + # See deep down below for build-date. --disable-optimize # Don't add '-O2' to CFLAGS. --disable-debug-build # Don't add '-g' to CFLAGS. @@ -168,12 +180,15 @@ src_configure() { $(use_enable zsh-completion zsh-comp) $(use_enable test) + --disable-android $(use_enable iconv) $(use_enable samba libsmbclient) $(use_enable lua) $(usex luajit '--lua=luajit' '') + $(use_enable javascript) $(use_enable libass) $(use_enable libass libass-osd) + $(use_enable zlib) $(use_enable encode encoding) $(use_enable bluray libbluray) $(use_enable dvd dvdread) @@ -193,6 +208,7 @@ src_configure() { --disable-sdl1 $(use_enable oss oss-audio) --disable-rsound # Only available in overlays. + --disable-sndio # Only available in overlays. $(use_enable pulseaudio pulse) $(use_enable jack) $(use_enable openal) @@ -211,7 +227,7 @@ src_configure() { $(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) + $(usex opengl "$(use_enable wayland gl-wayland)" '--disable-gl-wayland') $(use_enable vdpau) $(usex vdpau "$(use_enable opengl vdpau-gl-x11)" '--disable-vdpau-gl-x11') $(use_enable vaapi) # See below for vaapi-glx, vaapi-x-egl. @@ -220,16 +236,15 @@ src_configure() { $(usex vaapi "$(use_enable gbm vaapi-drm)" '--disable-vaapi-drm') $(use_enable libcaca caca) $(use_enable jpeg) - --disable-android $(use_enable raspberry-pi rpi) - --disable-ios-gl $(usex libmpv "$(use_enable opengl plain-gl)" '--disable-plain-gl') --disable-mali-fbdev # Only available in overlays. + $(usex opengl '' '--disable-gl') # HWaccels: # Automagic Video Toolbox HW acceleration. See Gentoo bug 577332. - # $(use_enable vaapi vaapi-hwaccel) -# $(use_enable vdpau vdpau-hwaccel) + $(use_enable vaapi vaapi) + $(use_enable vdpau vdpau) $(use_enable cuda cuda-hwaccel) # TV features: @@ -250,10 +265,6 @@ src_configure() { ) fi - if ! use egl && ! use opengl && ! use raspberry-pi; then - mywafargs+=(--disable-gl) - fi - # Create reproducible non-live builds. [[ ${PV} != *9999* ]] && mywafargs+=(--disable-build-date) @@ -279,18 +290,18 @@ src_install() { fi } -pkg_preinst() { - gnome2_icon_savelist -} - pkg_postinst() { - local rv softvol_0_18_1=0 osc_0_21_0=0 + local rv softvol_0_18_1=0 osc_0_21_0=0 txtsubs_0_24_0=0 opengl_0_25_0=0 for rv in ${REPLACING_VERSIONS}; do version_compare ${rv} 0.18.1 [[ $? -eq 1 ]] && softvol_0_18_1=1 version_compare ${rv} 0.21.0 [[ $? -eq 1 ]] && osc_0_21_0=1 + version_compare ${rv} 0.24.0 + [[ $? -eq 1 ]] && txtsubs_0_24_0=1 + version_compare ${rv} 0.25.0 + [[ $? -eq 1 ]] && ! use opengl && opengl_0_25_0=1 done if [[ ${softvol_0_18_1} -eq 1 ]]; then @@ -311,9 +322,21 @@ pkg_postinst() { elog fi - # 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 + if [[ ${txtsubs_0_24_0} -eq 1 ]]; then + elog "Since version 0.24.0 subtitles with .txt extension aren't autoloaded." + elog "If you want to restore the previous behaviour, please refer to" + elog + elog "https://wiki.gentoo.org/wiki/Mpv#Subtitles_with_.txt_extension_in_0.24.0" + elog + fi + + if [[ ${opengl_0_25_0} -eq 1 ]]; then + elog "Since version 0.25.0 the 'opengl' USE flag is mapped to" + elog "the 'opengl' video output and no longer explicitly requires" + elog "X11 or Mac OS Aqua. Consider enabling the 'opengl' USE flag." + fi + + if use cli && ! 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 |