commit:     6d12bd1af38d8887a89d21a7c7b1807e0eafd029
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Sun Nov  6 14:29:22 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Mon Nov  7 19:28:00 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6d12bd1a

media-video/mpv: add 0.34.1_p20221105

mpv releases are rare and it can be difficult to backport fixes
(e.g. old libplacebo is broken with newer glslang, but new
libplacebo breaks current mpv, not that can't disable glslang
or vulkan on mpv if need be).

So will release snapshots if felt necessary, please report if feel
a newer snapshot would be useful.

One quirk is that a whole year ago it switched to API 2.0 and not
all revdeps are ready for this (mostly a few trivial deprecations).
Personally see this as a good time to get this sorted out.

Note this also include meson migration, which may still have
oversights. MacOS / rpi builds are also untested, feel free to
make any changes to improve these two if you use/know them.

rough list of non-style changes from -9999 (non-exhaustive):
* update DESCRIPTION, upstream been dissociating itself with the
  original MPlayer
* drop pkg_postinst versions messages (0.18-0.25 is rather ancient)
* drop docdir patch as it installed examples .conf to /usr/share/mpv,
  instead just move these to docdir/examples
* drop IUSE=cplugins and enable by default, upstream default and
  not seeing a motivation to be optional
* drop IUSE=gbm, rather redundant with IUSE=drm and is default on mesa
* limit USE=opengl to controlling gl-x11/gl-cocoa backends rather than
  the general `gl` option, avoids e.g. `egl? ( opengl )` req use
* make IUSE=opengl non-default given gl-x11 is deprecated, albeit
  still let it be enabled by desktop profiles
* add IUSE=+libplacebo split off from IUSE=vulkan and depend on newer
  version, if recent enough this enables `-vo gpu-next` which is not
  limited to vulkan (default given libplacebo main author is same as
  mpv's and this is the obvious focus)
* invert IUSE=debug logic, was passing N(no)DEBUG with debug
* swap mesa with libglvnd for IUSE=egl, low level driver packages
  handling is not for us (and mesa is meaningless with nvidia with
  the exception of getting libgbm)
* ^ likewise, drop nvidia-drivers (ffmpeg/obs/etc.. also don't check
  drivers for nvenc)
* only depend on docutils + build man/html with USE=cli, and drop
  IUSE=doc (mpv.html has same dependency as the man page)
* fix python-exec[-native-symlinks] when USE=-tools, calls 'python3'
  at build time too
* depend on vulkan-loader[X?,wayland?] wrt bug #753434 and #777774
* various deps and tentative REQUIRED_USE adjustments

Closes: https://bugs.gentoo.org/753434
Closes: https://bugs.gentoo.org/777774
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 media-video/mpv/Manifest                    |   1 +
 media-video/mpv/metadata.xml                |   1 +
 media-video/mpv/mpv-0.34.1_p20221105.ebuild | 289 ++++++++++++++++++++++++++++
 3 files changed, 291 insertions(+)

diff --git a/media-video/mpv/Manifest b/media-video/mpv/Manifest
index 4e3bbca9d645..fbe295dcbc3d 100644
--- a/media-video/mpv/Manifest
+++ b/media-video/mpv/Manifest
@@ -1,2 +1,3 @@
 DIST mpv-0.34.1.tar.gz 3288356 BLAKE2B 
c0e5dc3cd23307449a526bd2cf0df5d870322aa1914a139784fd50d77274d42648a769ee4da3ba74e34a7a080700a5740dae13ed0827df1b3cfef36846f983ab
 SHA512 
77ea349d6999f8cce9b5cce4cebd3506a224fc18ab08d22dd16bd34c34d012bb170879b268ddd62db40d116b4cc0b2d9d651b8097f387ed9115c426834cac77e
+DIST mpv-0.34.1_p20221105.tar.gz 3366581 BLAKE2B 
52bf8f339e6535c17430d4a8f865a4559681200bfff379e98104ad1365addade3899a3339ae480c23f7e8470623374395aa2e948ee3d616fa8ce152821340fd0
 SHA512 
a246087a5af191459af71c729e5da5f09a7466792774e1114b8775294ed1de6a9d882e0d2076e35f7d09cd2a57780f504fedbbfc572fb533dc1d72f87e59dabc
 DIST waf-2.0.22 104880 BLAKE2B 
6cae9e764712012ef97f790c723b86a2603dc64e9bafcec02c5251dbc1b23ec629db26c02eee2a72a77cf70c11d2729a626ea71f3cb50a6281257fd6f63eadf0
 SHA512 
4156cefa65b7e6349ddb1ca643bbdf3e4444449d137e5f595535564271d521362291f257765329015671584ac2c596a0ad98cfdbd621f5d5352141a55d384292

diff --git a/media-video/mpv/metadata.xml b/media-video/mpv/metadata.xml
index 60caeb2ccc60..76c201612ef0 100644
--- a/media-video/mpv/metadata.xml
+++ b/media-video/mpv/metadata.xml
@@ -20,6 +20,7 @@
                <flag name="gbm">Enable Graphics Buffer Manager based EGL video 
backend</flag>
                <flag name="jpeg">Enable support for saving screenshots in JPEG 
format</flag>
                <flag name="libmpv">Build mpv shared library</flag>
+               <flag name="libplacebo">Enable support for GPU accelerated 
video rendering with <pkg>media-libs/libplacebo</pkg></flag>
                <flag name="lua">Enable Lua scripting, OSC (On Screen 
Controller) GUI and <pkg>net-misc/youtube-dl</pkg> hook-script</flag>
                <flag name="mmal">Enables Multi-Media Abstraction Layer (MMAL) 
decoding support: Available e.g. on the Raspberry Pi.</flag>
                <flag name="opengl" 
restrict="&lt;media-video/mpv-0.28.0">Enable the recommended 'opengl' video 
output</flag>

diff --git a/media-video/mpv/mpv-0.34.1_p20221105.ebuild 
b/media-video/mpv/mpv-0.34.1_p20221105.ebuild
new file mode 100644
index 000000000000..44b6c139ad77
--- /dev/null
+++ b/media-video/mpv/mpv-0.34.1_p20221105.ebuild
@@ -0,0 +1,289 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LUA_COMPAT=( lua5-1 luajit )
+PYTHON_COMPAT=( python3_{8..11} )
+inherit edo flag-o-matic lua-single meson optfeature pax-utils 
python-single-r1 xdg
+
+if [[ ${PV} == 9999 ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/mpv-player/mpv.git";
+else
+       HASH_MPV=c416a38ef227067ef7b81b9650a13157300cdfbe
+       SRC_URI="https://github.com/mpv-player/mpv/archive/${HASH_MPV}.tar.gz 
-> ${P}.tar.gz"
+       S="${WORKDIR}/${PN}-${HASH_MPV}"
+       KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv 
~x86 ~amd64-linux"
+fi
+
+DESCRIPTION="Media player for the command line"
+HOMEPAGE="https://mpv.io/";
+
+LICENSE="LGPL-2.1+ GPL-2+ BSD ISC MIT" #506946
+SLOT="0/2" # soname
+IUSE="
+       +X +alsa aqua archive bluray cdda +cli coreaudio debug drm dvb
+       dvd +egl gamepad +iconv jack javascript jpeg lcms libcaca libmpv
+       +libplacebo +lua mmal nvenc openal opengl pipewire pulseaudio
+       raspberry-pi rubberband sdl selinux sndio test tools +uchardet
+       vaapi vdpau +vector vulkan wayland +xv zimg zlib"
+REQUIRED_USE="
+       ${PYTHON_REQUIRED_USE}
+       || ( cli libmpv )
+       egl? ( || ( X drm wayland ) )
+       libplacebo? ( || ( egl opengl vulkan ) )
+       lua? ( ${LUA_REQUIRED_USE} )
+       nvenc? ( || ( egl opengl vulkan ) )
+       opengl? ( || ( X aqua ) )
+       test? ( cli )
+       tools? ( cli )
+       uchardet? ( iconv )
+       vaapi? ( || ( X egl libplacebo wayland ) )
+       vdpau? ( X )
+       vulkan? ( || ( X wayland ) libplacebo )
+       xv? ( X )"
+RESTRICT="!test? ( test )"
+
+COMMON_DEPEND="
+       media-libs/libass:=[fontconfig]
+       media-video/ffmpeg:=[encode,threads,vaapi?,vdpau?]
+       X? (
+               x11-libs/libX11
+               x11-libs/libXScrnSaver
+               x11-libs/libXext
+               x11-libs/libXinerama
+               x11-libs/libXpresent
+               x11-libs/libXrandr
+               xv? ( x11-libs/libXv )
+       )
+       alsa? ( media-libs/alsa-lib )
+       archive? ( app-arch/libarchive:= )
+       bluray? ( media-libs/libbluray:= )
+       cdda? (
+               dev-libs/libcdio-paranoia:=
+               dev-libs/libcdio:=
+       )
+       drm? (
+               media-libs/mesa[gbm(+)]
+               x11-libs/libdrm
+       )
+       dvd? (
+               media-libs/libdvdnav
+               media-libs/libdvdread:=
+       )
+       egl? ( media-libs/libglvnd )
+       gamepad? ( media-libs/libsdl2[joystick] )
+       iconv? (
+               virtual/libiconv
+               uchardet? ( app-i18n/uchardet )
+       )
+       jack? ( virtual/jack )
+       javascript? ( dev-lang/mujs:= )
+       jpeg? ( media-libs/libjpeg-turbo:= )
+       lcms? ( media-libs/lcms:2 )
+       libcaca? ( media-libs/libcaca )
+       libplacebo? (
+               >=media-libs/libplacebo-4.202:=[opengl?,vulkan?]
+               egl? ( media-libs/libplacebo[opengl] )
+       )
+       lua? ( ${LUA_DEPS} )
+       openal? ( media-libs/openal )
+       opengl? ( media-libs/libglvnd[X?] )
+       pipewire? ( media-video/pipewire:= )
+       pulseaudio? ( media-libs/libpulse )
+       raspberry-pi? ( media-libs/raspberrypi-userland )
+       rubberband? ( media-libs/rubberband )
+       sdl? ( media-libs/libsdl2[sound,threads,video] )
+       sndio? ( media-sound/sndio:= )
+       vaapi? ( media-libs/libva:=[X?,drm(+)?,wayland?] )
+       vdpau? ( x11-libs/libvdpau )
+       vulkan? (
+               media-libs/shaderc
+               media-libs/vulkan-loader[X?,wayland?]
+       )
+       wayland? (
+               dev-libs/wayland
+               dev-libs/wayland-protocols
+               x11-libs/libxkbcommon
+       )
+       zimg? ( media-libs/zimg )
+       zlib? ( sys-libs/zlib:= )"
+RDEPEND="
+       ${COMMON_DEPEND}
+       selinux? ( sec-policy/selinux-mplayer )
+       tools? ( ${PYTHON_DEPS} )"
+DEPEND="
+       ${COMMON_DEPEND}
+       X? ( x11-base/xorg-proto )
+       dvb? ( virtual/linuxtv-dvb-headers )
+       nvenc? ( media-libs/nv-codec-headers )
+       wayland? ( dev-libs/wayland-protocols )"
+BDEPEND="
+       ${PYTHON_DEPS}
+       virtual/pkgconfig
+       cli? ( dev-python/docutils )
+       wayland? ( dev-util/wayland-scanner )"
+
+pkg_setup() {
+       use lua && lua-single_pkg_setup
+       python-single-r1_pkg_setup
+}
+
+src_prepare() {
+       default
+
+       [[ ${PV} == 9999 ]] || sed -i "s/UNKNOWN/${HASH_MPV::11}/" VERSION || 
die
+
+       sed -i "s/'rst2html/&.py/" meson.build || die
+}
+
+src_configure() {
+       if use !debug; then
+               if use test; then
+                       einfo "Skipping -DNDEBUG due to USE=test"
+               else
+                       append-cppflags -DNDEBUG # treated specially
+               fi
+       fi
+
+       if use raspberry-pi; then
+               append-cflags -I"${ESYSROOT}"/opt/vc/include
+               append-ldflags -L"${ESYSROOT}"/opt/vc/lib
+       fi
+
+       mpv_feature_multi() {
+               local use set
+               for use in ${1} ${2}; do
+                       use ${use} || set=disabled
+               done
+               echo -D${3-${2}}=${set-enabled}
+       }
+
+       local emesonargs=(
+               $(meson_use cli cplayer)
+               $(meson_use libmpv)
+               $(meson_use test tests)
+
+               $(meson_feature cli html-build)
+               $(meson_feature cli manpage-build)
+               -Dpdf-build=disabled
+
+               -Dbuild-date=false
+
+               # misc options
+               $(meson_feature archive libarchive)
+               $(meson_feature bluray libbluray)
+               $(meson_feature cdda)
+               -Dcplugins=enabled
+               $(meson_feature dvb dvbin)
+               $(meson_feature dvd dvdnav)
+               $(meson_feature gamepad sdl2-gamepad)
+               $(meson_feature iconv)
+               $(meson_feature javascript)
+               -Dlibavdevice=enabled
+               $(meson_feature lcms lcms2)
+               -Dlua=$(usex lua "${ELUA}" disabled)
+               $(meson_feature rubberband)
+               -Dsdl2=$(use gamepad || use sdl && echo enabled || echo 
disabled) #857156
+               $(meson_feature uchardet)
+               -Dvapoursynth=disabled # only available in overlays
+               $(meson_feature vector)
+               $(meson_feature zimg)
+               $(meson_feature zlib)
+
+               # audio output
+               $(meson_feature alsa)
+               $(meson_feature coreaudio)
+               $(meson_feature jack)
+               $(meson_feature openal)
+               $(meson_feature pipewire)
+               $(meson_feature pulseaudio pulse)
+               $(meson_feature sdl sdl2-audio)
+               $(meson_feature sndio)
+
+               # video output
+               $(meson_feature X x11)
+               $(meson_feature aqua cocoa)
+               $(meson_feature drm)
+               $(meson_feature drm gbm)
+               $(meson_feature jpeg)
+               $(meson_feature libcaca caca)
+               $(meson_feature libplacebo)
+               $(meson_feature mmal rpi-mmal)
+               $(meson_feature sdl sdl2-video)
+               -Dsixel=disabled # TODO? needs keywording/testing
+               $(meson_feature wayland)
+               $(meson_feature xv)
+
+               -Dgl=$(use egl || use libmpv || use opengl || use raspberry-pi 
&&
+                       echo enabled || echo disabled)
+               $(meson_feature egl)
+               $(mpv_feature_multi egl X egl-x11)
+               $(mpv_feature_multi egl drm egl-drm)
+               $(mpv_feature_multi egl wayland egl-wayland)
+               $(meson_feature libmpv plain-gl)
+               $(mpv_feature_multi opengl X gl-x11)
+               $(mpv_feature_multi opengl aqua gl-cocoa)
+               $(meson_feature raspberry-pi rpi)
+
+               $(meson_feature vulkan)
+               $(meson_feature vulkan shaderc)
+
+               # hardware decoding
+               $(meson_feature nvenc cuda-hwaccel)
+               $(meson_feature nvenc cuda-interop)
+
+               $(meson_feature vaapi)
+               $(mpv_feature_multi vaapi X vaapi-x11)
+               $(mpv_feature_multi 'vaapi X' egl vaapi-x-egl)
+               $(mpv_feature_multi 'vaapi egl' drm vaapi-drm)
+               $(mpv_feature_multi 'vaapi egl' wayland vaapi-wayland)
+
+               $(meson_feature vdpau)
+               $(mpv_feature_multi vdpau opengl vdpau-gl-x11)
+
+               $(mpv_feature_multi aqua opengl videotoolbox-gl)
+       )
+
+       meson_src_configure
+}
+
+src_test() {
+       # 
https://github.com/mpv-player/mpv/blob/master/DOCS/man/options.rst#debugging
+       edo "${BUILD_DIR}"/mpv --no-config -v --unittest=all-simple
+}
+
+src_install() {
+       meson_src_install
+
+       if use lua; then
+               insinto /usr/share/${PN}
+               doins -r TOOLS/lua
+
+               if use cli && use lua_single_target_luajit; then
+                       pax-mark -m "${ED}"/usr/bin/${PN}
+               fi
+       fi
+
+       if use tools; then
+               dobin TOOLS/{mpv_identify.sh,umpv}
+               newbin TOOLS/idet.sh mpv_idet.sh
+               python_fix_shebang "${ED}"/usr/bin/umpv
+       fi
+
+       if use cli; then
+               dodir /usr/share/doc/${PF}/html
+               mv "${ED}"/usr/share/doc/{mpv,${PF}/html}/mpv.html || die
+               mv "${ED}"/usr/share/doc/{mpv,${PF}/examples} || die
+       fi
+
+       local GLOBIGNORE=*/*build*:*/*policy*
+       dodoc RELEASE_NOTES DOCS/*.{md,rst}
+}
+
+pkg_postinst() {
+       xdg_pkg_postinst
+
+       optfeature "URL support" net-misc/yt-dlp
+}

Reply via email to