From f704f050bfdcc3bad4cd597edcce143ca6133848 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 6 Mar 2023 23:55:40 +0000 Subject: gentoo auto-resync : 06:03:2023 - 23:55:39 --- media-video/mpv/Manifest | 3 +- .../files/mpv-0.35.1-yt-dlp-edl-fragments.patch | 55 ++++ media-video/mpv/mpv-0.35.1-r1.ebuild | 302 +++++++++++++++++++++ media-video/mpv/mpv-0.35.1.ebuild | 298 -------------------- 4 files changed, 359 insertions(+), 299 deletions(-) create mode 100644 media-video/mpv/files/mpv-0.35.1-yt-dlp-edl-fragments.patch create mode 100644 media-video/mpv/mpv-0.35.1-r1.ebuild delete mode 100644 media-video/mpv/mpv-0.35.1.ebuild (limited to 'media-video/mpv') diff --git a/media-video/mpv/Manifest b/media-video/mpv/Manifest index efc492ca0e9b..5a5a9a2b0f39 100644 --- a/media-video/mpv/Manifest +++ b/media-video/mpv/Manifest @@ -1,9 +1,10 @@ +AUX mpv-0.35.1-yt-dlp-edl-fragments.patch 2446 BLAKE2B f43d78be7d9914abf87c3c34f99c8cb84fd463dac7b4f4cfa96268d4351006580454a2c609a655d3d036d4a72c534205d226fd4ecf8334c9a0ff016b7eecc1c0 SHA512 0cd0415dcd06f4732e87ca52f9d43ec1cbef7fab531d4f3ba7398f7a80718dc5e0b373850c5324fe9a151c3edb31a4a624854c2e09b19ab91a3c655e84261866 DIST mpv-0.34.1.tar.gz 3288356 BLAKE2B c0e5dc3cd23307449a526bd2cf0df5d870322aa1914a139784fd50d77274d42648a769ee4da3ba74e34a7a080700a5740dae13ed0827df1b3cfef36846f983ab SHA512 77ea349d6999f8cce9b5cce4cebd3506a224fc18ab08d22dd16bd34c34d012bb170879b268ddd62db40d116b4cc0b2d9d651b8097f387ed9115c426834cac77e DIST mpv-0.35.0.tar.gz 3365752 BLAKE2B 9b8dca943fc60a68f8474549d75c021dd9157195253c5ec09721969e500b2756c033e86975499f5632f0c943ac7bb54699f47340f0dee73d7284668d4419b17f SHA512 d5c1f734057f6b6c27e7f59de43cf7c0e7f813d842b8c7fd2ae1073dbe649c8187b7686df4efe928db2952e9f1efc171245e6f8780c1d9f174f4d7abff1e073a DIST mpv-0.35.1.tar.gz 3367913 BLAKE2B 706a2031a2ca973eb3a092ec7f62ba40ca4dfd78e3ffe5d6e432486b0018852b034152a21805be594054178ccb17856dafe2b860cddcc22d27df895d163871de SHA512 42f3564a9ed4d972d14b2c697b0163f06a8bb68a0606a86c34935181247c783e3cb62286b445799998def0919fb13fce8b8f6453f82652d5bfaea5929119127a DIST waf-2.0.22 104880 BLAKE2B 6cae9e764712012ef97f790c723b86a2603dc64e9bafcec02c5251dbc1b23ec629db26c02eee2a72a77cf70c11d2729a626ea71f3cb50a6281257fd6f63eadf0 SHA512 4156cefa65b7e6349ddb1ca643bbdf3e4444449d137e5f595535564271d521362291f257765329015671584ac2c596a0ad98cfdbd621f5d5352141a55d384292 EBUILD mpv-0.34.1-r1.ebuild 9733 BLAKE2B 0edc617690adea48d4cd253a28aa56906684a55272630a9163b2573887afad4fd288bd9db72133494ac9cb58cb9415b9195415d61671430e4a1c19f63e833df3 SHA512 8710249d67c5c48dc4c9788ad8e0fef7a6ace8b52306da1b900a3098227115c547ed3b86b2389c32798df3d13bfa7a458303d8e0266258ffc205f7387823572b EBUILD mpv-0.35.0-r1.ebuild 7715 BLAKE2B 697a5320c5f572b7932894656313661c99d0ccc8824ba40d23de535824ae4a48ba93dc34f64f341e901f190a5fa8d32b8303839bb10eab9f7a9891da899180ad SHA512 6bb601e58c4c5cbc161d6dc71f253557c17359d7c1bb0505d0db407fda2b259c519cd98eb268608ba8054034c2ff9312596505044c1d75d85b3d51160da73e1f -EBUILD mpv-0.35.1.ebuild 7523 BLAKE2B 7fc73d01058aaddab3708b04730cd0bc9485111212245450d2036e46eaa518423c2023da427553f3f09d539fd4837ed61db9de7abd3ed03fa36a1cbf32775c7f SHA512 99decef6d6f899b259deb7f304ef05b66c5f9983adb7d2f55fc6b8294f3ff332a5e000d5f8c2d087e43dbc2329bc13f1b6417e787b596c3cb843b4e199c6781c +EBUILD mpv-0.35.1-r1.ebuild 7583 BLAKE2B 5a177a136a316bf639310d240c805384bc787f1f4741cd0bf318174a1c5998cf5bde55a469e0cf16664db29df7f7c389d3fa4ce9723c40eff314c6d93bad63de SHA512 5ad755fadd14b6083ced955f598c4968da98b83dc15615b026d6ff175e85e152a05f64eeb6a0f560a1e9761887429ad27c6640ec74eb5b6998c429c9baf88d31 EBUILD mpv-9999.ebuild 7013 BLAKE2B f1a7f7bebd38ef06b455c16bf8be0bfeb4cd050d805ecffb9c9d5445e15c82ba766be6995b8503582568b8c708c0051081ae4db367a5c0f984f063a22b022bb8 SHA512 6e53676790a99b5c6610747fcc652962aacb79b18df2db905e4483ec8c7f7f149bf6f3757b8f98ad36fa8364dc22e8ab639ccd71a51f65e8fecec4d63a784767 MISC metadata.xml 2537 BLAKE2B ce08ff18966b0937d5c1564a32d8da1225d603626d02b081f8a236531683890770d134fb7898a208bceffeb7ed2d1cabf34f4d211a97d1d0d95287830b93ddbc SHA512 5dc6cdacffed6f751a05d261a23e765cf3eaa16bd0757853635da977176666f5fc75f0a6c759ccbfcfdd63c2732a0b53858f0379d5f3437bcd9b40a7cb82f59c diff --git a/media-video/mpv/files/mpv-0.35.1-yt-dlp-edl-fragments.patch b/media-video/mpv/files/mpv-0.35.1-yt-dlp-edl-fragments.patch new file mode 100644 index 000000000000..058c608233d4 --- /dev/null +++ b/media-video/mpv/files/mpv-0.35.1-yt-dlp-edl-fragments.patch @@ -0,0 +1,55 @@ +https://bugs.gentoo.org/899956 +https://github.com/mpv-player/mpv/pull/11398 + +From 985655ebfd77ceddc44d76f8cc6dc446002f34ee Mon Sep 17 00:00:00 2001 +From: Christoph Heinrich +Date: Fri, 3 Mar 2023 00:45:45 +0100 +Subject: [PATCH 1/2] ytdl_hook: init fragment requires other fragments + +With dash the first fragment was always considered an init fragment if +there wasn't a duration. However that only makes sense when there are +also other fragments, so check if there are other fragments in addition +to the lack of a duration. +--- a/player/lua/ytdl_hook.lua ++++ b/player/lua/ytdl_hook.lua +@@ -297,7 +297,7 @@ local function edl_track_joined(fragments, protocol, is_live, base) + local args = "" + + -- assume MP4 DASH initialization segment +- if not fragments[1].duration then ++ if not fragments[1].duration and #fragments > 1 then + msg.debug("Using init segment") + args = args .. ",init=" .. edl_escape(join_url(base, fragments[1])) + offset = 2 + +From a5961ad096b1361a12f836c8b170fc748f46962a Mon Sep 17 00:00:00 2001 +From: Christoph Heinrich +Date: Fri, 3 Mar 2023 00:50:58 +0100 +Subject: [PATCH 2/2] ytdl_hook: only log error when no fallback url available + +An error indicates that something doesn't work, but as long as a +safe url is available, playback is still expected to work. + +Thus reduce logging level of MP4 DASH without fragments message and +add a new error message for when there is no safe url available either. + +Also adds a missing space. +--- a/player/lua/ytdl_hook.lua ++++ b/player/lua/ytdl_hook.lua +@@ -309,7 +309,7 @@ local function edl_track_joined(fragments, protocol, is_live, base) + -- if not available in all, give up. + for i = offset, #fragments do + if not fragments[i].duration then +- msg.error("EDL doesn't support fragments" .. ++ msg.verbose("EDL doesn't support fragments " .. + "without duration with MP4 DASH") + return nil + end +@@ -423,6 +423,7 @@ local function formats_to_edl(json, formats, use_all_formats) + track.protocol, json.is_live, + track.fragment_base_url) + if not edl_track and not url_is_safe(track.url) then ++ msg.error("No safe URL or supported fragmented stream available") + return nil + end + diff --git a/media-video/mpv/mpv-0.35.1-r1.ebuild b/media-video/mpv/mpv-0.35.1-r1.ebuild new file mode 100644 index 000000000000..9d2d6ee62ae3 --- /dev/null +++ b/media-video/mpv/mpv-0.35.1-r1.ebuild @@ -0,0 +1,302 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +LUA_COMPAT=( lua5-1 luajit ) +PYTHON_COMPAT=( python3_{9..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 + SRC_URI="https://github.com/mpv-player/mpv/archive/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="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 sixel sndio test tools +uchardet + vaapi vdpau 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 ) + wayland? ( drm ) + ) + vdpau? ( X ) + vulkan? ( || ( X wayland ) libplacebo ) + xv? ( X )" +RESTRICT="!test? ( test )" + +# raspberry-pi: default to -bin given non-bin is known broken (bug #893422) +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-bin + media-libs/raspberrypi-userland + ) + ) + rubberband? ( media-libs/rubberband ) + sdl? ( media-libs/libsdl2[sound,threads,video] ) + sixel? ( media-libs/libsixel ) + 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 )" + +PATCHES=( + "${FILESDIR}"/${P}-yt-dlp-edl-fragments.patch +) + +pkg_setup() { + use lua && lua-single_pkg_setup + python-single-r1_pkg_setup +} + +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 + + 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 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) + $(meson_feature sixel) + $(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 + local tests=($("${BUILD_DIR}"/mpv --no-config --unittest=help | tail -n +2; assert)) + (( ${#tests[@]} )) || die "failed to gather any tests" + + local skip=( + all-simple + + # fails on non-issue minor inconsistencies (bug #888639) + img_format + repack_sws + ) + + local test + for test in "${tests[@]}"; do + [[ ${test} == @($(IFS='|'; echo "${skip[*]}")) ]] || + edo "${BUILD_DIR}"/mpv -v --no-config --unittest="${test}" + done +} + +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 with USE=lua" net-misc/yt-dlp +} diff --git a/media-video/mpv/mpv-0.35.1.ebuild b/media-video/mpv/mpv-0.35.1.ebuild deleted file mode 100644 index 5ea6dc240af6..000000000000 --- a/media-video/mpv/mpv-0.35.1.ebuild +++ /dev/null @@ -1,298 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -LUA_COMPAT=( lua5-1 luajit ) -PYTHON_COMPAT=( python3_{9..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 - SRC_URI="https://github.com/mpv-player/mpv/archive/v${PV}.tar.gz -> ${P}.tar.gz" - KEYWORDS="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 sixel sndio test tools +uchardet - vaapi vdpau 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 ) - wayland? ( drm ) - ) - vdpau? ( X ) - vulkan? ( || ( X wayland ) libplacebo ) - xv? ( X )" -RESTRICT="!test? ( test )" - -# raspberry-pi: default to -bin given non-bin is known broken (bug #893422) -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-bin - media-libs/raspberrypi-userland - ) - ) - rubberband? ( media-libs/rubberband ) - sdl? ( media-libs/libsdl2[sound,threads,video] ) - sixel? ( media-libs/libsixel ) - 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_configure() { - if use !debug; then - if use test; then - einfo "Skipping -DNDEBUG due to USE=test" - else - append-cppflags -DNDEBUG # treated specially - fi - 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 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) - $(meson_feature sixel) - $(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 - local tests=($("${BUILD_DIR}"/mpv --no-config --unittest=help | tail -n +2; assert)) - (( ${#tests[@]} )) || die "failed to gather any tests" - - local skip=( - all-simple - - # fails on non-issue minor inconsistencies (bug #888639) - img_format - repack_sws - ) - - local test - for test in "${tests[@]}"; do - [[ ${test} == @($(IFS='|'; echo "${skip[*]}")) ]] || - edo "${BUILD_DIR}"/mpv -v --no-config --unittest="${test}" - done -} - -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 with USE=lua" net-misc/yt-dlp -} -- cgit v1.2.3