media-video/mpv: add vulkan support to 9999
authorIlya Tumaykin <itumaykin@gmail.com>
Sat, 16 Jun 2018 19:29:52 +0000 (22:29 +0300)
committerGeorgy Yakovlev <gyakovlev@gentoo.org>
Wed, 20 Jun 2018 22:41:14 +0000 (15:41 -0700)
Implementation details:
- mpv requires at least one enabled vulkan context (X or wayland),
  even though this isn't reflected by the build system. Hence the
  REQUIRED_USE. Without this you cannot enable vulkan backend.
- The appropriate context must be enabled in vulkan-loader.
- mpv technically allows vulkan without shaderc on NVIDIA cards,
  but support for this in NVIDIA drivers is deprecated and going
  away, see [1]. Thus always require shaderc.

[1]: https://github.com/mpv-player/mpv/issues/5867
Package-Manager: Portage-2.3.40, Repoman-2.3.9

media-video/mpv/metadata.xml
media-video/mpv/mpv-9999.ebuild

index df0200d2936c55518453dcd01444213701bbb372..1eb1494cbbc88c4e02fbb78407b1b9c5afe53dc8 100644 (file)
@@ -33,6 +33,7 @@
                        (Note: these outputs exist for compatibility reasons only, avoid if possible)</flag>
                <flag name="tools">Install extra tools: mpv_identify.sh, mpv_idet.sh, and umpv</flag>
                <flag name="uchardet">Enable subtitles charset discovery via <pkg>app-i18n/uchardet</pkg></flag>
+               <flag name="vulkan">Enable support for various Vulkan-based video backends</flag>
        </use>
        <upstream>
                <remote-id type="github">mpv-player/mpv</remote-id>
index 8601e37b4bdf6438ec7d1737c04a36faa3d824c0..f99a57b4a26770967800bc966de25bec512aa40f 100644 (file)
@@ -31,7 +31,7 @@ SLOT="0"
 IUSE="+alsa aqua archive bluray cdda +cli coreaudio cplugins cuda doc drm dvb
        dvd +egl 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
+       selinux test tools +uchardet v4l vaapi vdpau vulkan wayland +X +xv zlib
        zsh-completion"
 
 REQUIRED_USE="
@@ -50,6 +50,7 @@ REQUIRED_USE="
        v4l? ( || ( alsa oss ) )
        vaapi? ( || ( gbm X wayland ) )
        vdpau? ( X )
+       vulkan? ( || ( X wayland ) )
        wayland? ( egl )
        X? ( egl? ( opengl ) )
        xv? ( X )
@@ -96,6 +97,10 @@ COMMON_DEPEND="
        v4l? ( media-libs/libv4l )
        vaapi? ( x11-libs/libva:=[drm?,X?,wayland?] )
        vdpau? ( x11-libs/libvdpau )
+       vulkan? (
+               media-libs/shaderc
+               media-libs/vulkan-loader[X?,wayland?]
+       )
        wayland? (
                >=dev-libs/wayland-1.6.0
                >=dev-libs/wayland-protocols-1.14
@@ -231,10 +236,12 @@ src_configure() {
                $(usex vaapi "$(use_enable gbm vaapi-drm)" '--disable-vaapi-drm')
                $(use_enable libcaca caca)
                $(use_enable jpeg)
+               $(use_enable vulkan shaderc)
                $(use_enable raspberry-pi rpi)
                $(usex libmpv "$(use_enable opengl plain-gl)" '--disable-plain-gl')
                --disable-mali-fbdev # Only available in overlays.
                $(usex opengl '' '--disable-gl')
+               $(use_enable vulkan)
 
                # HWaccels:
                # Automagic Video Toolbox HW acceleration. See Gentoo bug 577332.