Skip to content

Commit

Permalink
media-video/mpv: use more sane logic for opengl and egl USE flags
Browse files Browse the repository at this point in the history
Currently 'opengl' USE stands for 'anything that draws using OpenGL
API', and 'egl' USE stands for 'EGL for X11'. Notice these are not
complementary.

Thus, for example, on Wayland one should use 'mpv[wayland,opengl,-egl]',
which is a bit counterintuitive, since Wayland (compositor) uses EGL
only. Also one cannot disable GLX support, but leave EGL on X11, because
of USE flags interdependencies.

Both X11 and Wayland use OpenGL API to do drawing, but historically the
first one was native OpenGL in X11 aka GLX and later came EGL in X11 and
Wayland. However, now there is a tendency to prefer EGL to not bind
oneself to X11.

There is no global 'egl' USE atm, but the logic of local 'egl' USEs
across the tree is 'not bind oneself to GLX'. On Linux there is no need
to repeat that drawing is done using OpenGL API even when EGL comes to
play.

Taking all of the above into account more sane and expected meaning
should be given to 'opengl' and 'egl' USE flags.

After this change 'opengl' USE stands for 'OpenGL in X11 aka GLX' and
'egl' USE stands for 'any EGL-based output'. Notice these are now
complementary.

Package-Manager: portage-2.2.24
  • Loading branch information
Coacher committed Dec 28, 2015
1 parent 88caaa5 commit 411d5bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion media-video/mpv/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<flag name="cdio">Enable CDDA support via <pkg>dev-libs/libcdio-paranoia</pkg></flag>
<flag name="doc-pdf">Build documentation in pdf format</flag>
<flag name="drm">Enable Kernel Mode Setting / Direct Rendering Manager based video output</flag>
<flag name="egl">Enable EGL backend for X11 OpenGL video output (experimental)</flag>
<flag name="egl">Enable support for various EGL-based video outputs</flag>
<flag name="enca">Enable subtitles charset discovery via <pkg>app-i18n/enca</pkg></flag>
<flag name="jpeg">Enable support for saving screenshots in JPEG format</flag>
<flag name="libguess">Enable subtitles charset discovery via <pkg>app-i18n/libguess</pkg></flag>
Expand Down
14 changes: 7 additions & 7 deletions media-video/mpv/mpv-9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,20 @@ DOCS+=( README.md etc/example.conf etc/input.conf )
# See Copyright in source tarball and bug #506946. Waf is BSD, libmpv is ISC.
LICENSE="GPL-2+ BSD ISC"
SLOT="0"
# Here 'opengl' stands for GLX, 'egl' stands for any EGL-based output
IUSE="+alsa archive bluray cdda +cli doc drm dvb +dvd egl +enca encode +iconv
jack jpeg lcms +libass libav libcaca libguess libmpv lua luajit openal +opengl
oss pulseaudio pvr raspberry-pi rubberband samba sdl selinux test uchardet v4l
vaapi vdpau vf-dlopen wayland +X xinerama +xscreensaver xv"

REQUIRED_USE="
|| ( cli libmpv )
egl? ( opengl X )
egl? ( || ( X wayland ) )
enca? ( iconv )
lcms? ( opengl )
lcms? ( || ( opengl egl ) )
libguess? ( iconv )
luajit? ( lua )
opengl? ( || ( wayland X ) )
opengl? ( X )
pvr? ( v4l )
uchardet? ( iconv )
v4l? ( || ( alsa oss ) )
Expand Down Expand Up @@ -71,6 +72,7 @@ COMMON_DEPEND="
iconv? ( virtual/libiconv )
jack? ( media-sound/jack-audio-connection-kit )
jpeg? ( virtual/jpeg:0 )
lcms? ( >=media-libs/lcms-2.6:2 )
libass? (
>=media-libs/libass-0.12.1:=[fontconfig,harfbuzz]
virtual/ttf-fonts
Expand Down Expand Up @@ -100,7 +102,6 @@ COMMON_DEPEND="
x11-libs/libXdamage
virtual/opengl
)
lcms? ( >=media-libs/lcms-2.6:2 )
vaapi? ( >=x11-libs/libva-1.2.0[X] )
vdpau? ( >=x11-libs/libvdpau-0.2 )
xinerama? ( x11-libs/libXinerama )
Expand Down Expand Up @@ -219,10 +220,9 @@ src_configure() {
$(use_enable xv)
$(use_enable xinerama)
$(use_enable X xrandr)
$(usex X "$(use_enable opengl gl-x11)" '--disable-gl-x11')
$(use_enable egl egl-x11)
$(use_enable opengl gl-x11)
$(usex egl "$(use_enable X egl-x11)" '--disable-egl-x11')
$(use_enable wayland gl-wayland)
$(use_enable opengl gl)
$(use_enable vdpau)
$(usex vdpau "$(use_enable opengl vdpau-gl-x11)" '--disable-vdpau-gl-x11')
$(use_enable vaapi)
Expand Down

0 comments on commit 411d5bb

Please sign in to comment.