summaryrefslogtreecommitdiff
path: root/media-video
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss123next@list.ru>2016-12-13 08:15:35 +0300
committerGluzskiy Alexandr <sss123next@list.ru>2016-12-13 08:15:35 +0300
commit0bd898e2db589280e186c1d68afe827d3898d680 (patch)
treea6e0fa337b98dfe43dbbf3ccabbe1957ff13f8ca /media-video
parent346b98b3bf3d1c9eac59f3827b0f12f129372662 (diff)
mpv: sync with gentoo, adapted to upstream
Diffstat (limited to 'media-video')
-rw-r--r--media-video/mpv/files/mpv-0.19.0-make-ffmpeg-version-check-non-fatal.patch28
-rw-r--r--media-video/mpv/mpv-scm.ebuild97
2 files changed, 100 insertions, 25 deletions
diff --git a/media-video/mpv/files/mpv-0.19.0-make-ffmpeg-version-check-non-fatal.patch b/media-video/mpv/files/mpv-0.19.0-make-ffmpeg-version-check-non-fatal.patch
new file mode 100644
index 0000000..96a1f56
--- /dev/null
+++ b/media-video/mpv/files/mpv-0.19.0-make-ffmpeg-version-check-non-fatal.patch
@@ -0,0 +1,28 @@
+player: make ffmpeg/libav version check non-fatal
+
+We already enforce mpv rebuilds when ffmpeg/libav SONAME changes.
+
+diff --git a/player/main.c b/player/main.c
+index 67dde34..ee133a9 100644
+--- a/player/main.c
++++ b/player/main.c
+@@ -419,13 +419,12 @@ int mp_initialize(struct MPContext *mpctx, char **options)
+ if (!print_libav_versions(mp_null_log, 0)) {
+ // Using mismatched libraries can be legitimate, but even then it's
+ // a bad idea. We don't acknowledge its usefulness and stability.
+- print_libav_versions(mpctx->log, MSGL_FATAL);
+- MP_FATAL(mpctx, "\nmpv was compiled against a different version of "
+- "FFmpeg/Libav than the shared\nlibrary it is linked against. "
+- "This is most likely a broken build and could\nresult in "
+- "misbehavior and crashes.\n\nmpv does not support this "
+- "configuration and will not run - rebuild mpv instead.\n");
+- return -1;
++ print_libav_versions(mpctx->log, MSGL_WARN);
++ MP_WARN(mpctx, "\nmpv was compiled against a different version of "
++ "FFmpeg/Libav than the shared\nlibrary it is linked against. "
++ "This is most likely a broken build and could\nresult in "
++ "misbehavior and crashes.\n\nUpstream does not support this "
++ "configuration.\nPlease rebuild mpv in case of any problems.\n");
+ }
+
+ if (opts->dump_stats && opts->dump_stats[0]) {
diff --git a/media-video/mpv/mpv-scm.ebuild b/media-video/mpv/mpv-scm.ebuild
index da8c0ff..b6e943b 100644
--- a/media-video/mpv/mpv-scm.ebuild
+++ b/media-video/mpv/mpv-scm.ebuild
@@ -2,8 +2,9 @@
# 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=5
-PYTHON_COMPAT=( python{2_7,3_4} )
+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
@@ -19,21 +20,20 @@ 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-3+ BSD ISC"
SLOT="0"
-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
+IUSE="aqua +alsa archive bluray cdda +cli coreaudio 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 uchardet v4l vaapi vdpau vf-dlopen wayland +X xinerama
+ selinux test tools +uchardet v4l vaapi vdpau vf-dlopen wayland +X xinerama
+xscreensaver +xv zsh-completion"
REQUIRED_USE="
|| ( cli libmpv )
aqua? ( opengl )
egl? ( || ( gbm X wayland ) )
- enca? ( iconv )
gbm? ( drm egl )
lcms? ( || ( opengl egl ) )
- libguess? ( iconv )
luajit? ( lua )
+ tools? ( cli )
uchardet? ( iconv )
v4l? ( || ( alsa oss ) )
vaapi? ( || ( gbm X wayland ) )
@@ -42,7 +42,8 @@ REQUIRED_USE="
xinerama? ( X )
xscreensaver? ( X )
xv? ( X )
- zsh-completion? ( cli )"
+ zsh-completion? ( cli )
+"
COMMON_DEPEND="
!libav? ( >=media-video/ffmpeg-2.4:0=[encode?,threads,vaapi?,vdpau?] )
@@ -61,8 +62,6 @@ COMMON_DEPEND="
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 )
@@ -85,7 +84,7 @@ COMMON_DEPEND="
media-libs/mesa[egl,gles2]
)
rubberband? ( >=media-libs/rubberband-1.8.0 )
- samba? ( net-fs/samba )
+ samba? ( net-fs/samba[smbclient(+)] )
sdl? ( media-libs/libsdl2[sound,threads,video,X?,wayland?] )
v4l? ( media-libs/libv4l )
vaapi? ( >=x11-libs/libva-1.4.0[drm?,X?,wayland?] )
@@ -106,7 +105,7 @@ COMMON_DEPEND="
"
DEPEND="${COMMON_DEPEND}
${PYTHON_DEPS}
- >=dev-lang/perl-5.8
+ dev-lang/perl
dev-python/docutils
virtual/pkgconfig
doc? ( dev-python/rst2pdf )
@@ -114,27 +113,37 @@ DEPEND="${COMMON_DEPEND}
"
RDEPEND="${COMMON_DEPEND}
selinux? ( sec-policy/selinux-mplayer )
- "
-
+ tools? ( ${PYTHON_DEPS} )
+"
+
+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() {
- 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
+ mpv_check_compiler
+}
+
+pkg_setup() {
+ mpv_check_compiler
+ [[ ${MERGE_TYPE} != "binary" ]] && python_setup
}
src_prepare() {
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}"
+ --htmldir="${EPREFIX}/usr/share/doc/${PF}/html"
$(usex cli '' '--disable-cplayer')
$(use_enable libmpv libmpv-shared)
@@ -162,8 +171,6 @@ src_configure() {
$(use_enable dvd dvdread)
$(use_enable dvd dvdnav)
$(use_enable cdda)
- $(use_enable enca)
- $(use_enable libguess)
$(use_enable uchardet)
$(use_enable rubberband)
$(use_enable lcms lcms2)
@@ -211,12 +218,15 @@ src_configure() {
$(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.
# HWaccels:
# Automagic Video Toolbox HW acceleration. See Gentoo bug 577332.
$(use_enable vaapi vaapi-hwaccel)
# Automagic VDPAU HW acceleration. See Gentoo bug 558870.
+ --disable-cuda # No support in ffmpeg. See Gentoo bug 595450.
# TV features:
$(use_enable v4l tv)
@@ -236,6 +246,10 @@ 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)
@@ -245,9 +259,20 @@ src_configure() {
src_install() {
waf-utils_src_install
+ if use lua; then
+ insinto /usr/share/${PN}
+ doins -r TOOLS/lua
+ fi
+
if use cli && use luajit; then
pax-mark -m "${ED}"usr/bin/${PN}
fi
+
+ if use tools; then
+ dobin TOOLS/{mpv_identify.sh,umpv}
+ newbin TOOLS/idet.sh mpv_idet.sh
+ python_replicate_script "${ED}"usr/bin/umpv
+ fi
}
pkg_preinst() {
@@ -255,8 +280,25 @@ pkg_preinst() {
}
pkg_postinst() {
- fdo-mime_desktop_database_update
- gnome2_icon_cache_update
+ local rv softvol_0_18_1=0
+ for rv in ${REPLACING_VERSIONS}; do
+ version_compare ${rv} 0.18.1-r1
+ [[ $? -eq 1 ]] && softvol_0_18_1=1
+ done
+
+ if [[ ${softvol_0_18_1} -eq 1 ]]; then
+ elog "Starting from version 0.18.1 the software volume control is"
+ elog "enabled by default, see:"
+ elog "https://github.com/mpv-player/mpv/blob/v0.18.1/DOCS/interface-changes.rst"
+ elog "https://github.com/mpv-player/mpv/issues/3322"
+ elog
+ elog "This means that volume controls don't change the system volume,"
+ elog "e.g. per-application volume with PulseAudio."
+ elog "If you want to restore the old behaviour, please refer to"
+ elog
+ elog "https://bugs.gentoo.org/show_bug.cgi?id=588492#c7"
+ 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' && \
@@ -270,14 +312,19 @@ pkg_postinst() {
elog "If command-line completion doesn't work after mpv update,"
elog "please rebuild app-shells/mpv-bash-completion."
fi
+
+ gnome2_icon_cache_update
+ xdg_desktop_database_update
}
pkg_postrm() {
- fdo-mime_desktop_database_update
gnome2_icon_cache_update
+ xdg_desktop_database_update
}
+
src_test() {
cd "${S}"/build/test || die
+ local test
for test in *; do
if [[ -x ${test} ]]; then
./"${test}" || die "Test suite failed"