commit:     32f681c4c3fa986e5aacebf53621e277215c8854
Author:     Paul Zander <negril.nx+gentoo <AT> gmail <DOT> com>
AuthorDate: Wed Apr  9 14:13:27 2025 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Fri Apr 11 01:38:27 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=32f681c4

media-libs/libva: add USE=glx

Unbreaks pre-compiled binaries that were linked against that library.

This was originally disabled in e9eaf08653a2ada19b94c9807a6b85008a125b3c to
break a libva -> virtual/opengl -> mesa -> libva circular dependency.

With 7c3a6d4e46909e5fe81284e29265d70fcd18f293 and
6208af8875d0e69b7b8bb9f2b7497f0cc858c438 virtual/opengl depends on libglvnd and
the circular dependency can no longer occur.

We use glx as a separate USE flag as this is only needed for prebuilt binaries
we do not control.

Closes: https://bugs.gentoo.org/916192
Signed-off-by: Paul Zander <negril.nx+gentoo <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/41512
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 .../{libva-9999.ebuild => libva-2.22.0-r1.ebuild}     | 19 ++++++++++++++-----
 media-libs/libva/libva-9999.ebuild                    | 12 +++++++++---
 media-libs/libva/metadata.xml                         |  3 +++
 3 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/media-libs/libva/libva-9999.ebuild 
b/media-libs/libva/libva-2.22.0-r1.ebuild
similarity index 78%
copy from media-libs/libva/libva-9999.ebuild
copy to media-libs/libva/libva-2.22.0-r1.ebuild
index bfc76885c3de..5fa18768df19 100644
--- a/media-libs/libva/libva-9999.ebuild
+++ b/media-libs/libva/libva-2.22.0-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -14,12 +14,13 @@ if [[ ${PV} = *9999 ]] ; then
        EGIT_REPO_URI="https://github.com/intel/libva";
 else
        SRC_URI="https://github.com/intel/libva/archive/${PV}.tar.gz -> 
${P}.tar.gz"
-       KEYWORDS="~amd64 ~arm64 ~loong ~mips ~ppc64 ~riscv ~x86 ~amd64-linux 
~x86-linux"
+       KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc64 ~riscv ~x86 
~amd64-linux ~x86-linux"
 fi
 
 LICENSE="MIT"
 SLOT="0/$(ver_cut 1)"
-IUSE="wayland X"
+IUSE="glx wayland X"
+REQUIRED_USE="glx? ( X )"
 
 RDEPEND="
        >=x11-libs/libdrm-2.4.75[${MULTILIB_USEDEP}]
@@ -27,22 +28,30 @@ RDEPEND="
                >=dev-libs/wayland-1.11[${MULTILIB_USEDEP}]
        )
        X? (
+               glx? (
+                       media-libs/libglvnd[X?,${MULTILIB_USEDEP}]
+               )
                >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
                >=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
                >=x11-libs/libXfixes-5.0.1[${MULTILIB_USEDEP}]
                x11-libs/libxcb:=[${MULTILIB_USEDEP}]
        )
 "
-DEPEND="${RDEPEND}"
+DEPEND="
+       ${RDEPEND}
+       X? ( x11-base/xorg-proto )
+"
 BDEPEND="
        wayland? ( dev-util/wayland-scanner )
        virtual/pkgconfig
 "
 
 MULTILIB_WRAPPED_HEADERS=(
+       /usr/include/va/va_backend_glx.h
        /usr/include/va/va_x11.h
        /usr/include/va/va_dri2.h
        /usr/include/va/va_dricommon.h
+       /usr/include/va/va_glx.h
 )
 
 multilib_src_configure() {
@@ -50,7 +59,7 @@ multilib_src_configure() {
                -Ddriverdir="${EPREFIX}/usr/$(get_libdir)/va/drivers"
                -Ddisable_drm=false
                -Dwith_x11=$(usex X)
-               -Dwith_glx=no
+               -Dwith_glx=$(usex X $(usex glx))
                -Dwith_wayland=$(usex wayland)
                -Denable_docs=false
        )

diff --git a/media-libs/libva/libva-9999.ebuild 
b/media-libs/libva/libva-9999.ebuild
index bfc76885c3de..6d2c5c7172e0 100644
--- a/media-libs/libva/libva-9999.ebuild
+++ b/media-libs/libva/libva-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -19,7 +19,8 @@ fi
 
 LICENSE="MIT"
 SLOT="0/$(ver_cut 1)"
-IUSE="wayland X"
+IUSE="glx wayland X"
+REQUIRED_USE="glx? ( X )"
 
 RDEPEND="
        >=x11-libs/libdrm-2.4.75[${MULTILIB_USEDEP}]
@@ -27,6 +28,9 @@ RDEPEND="
                >=dev-libs/wayland-1.11[${MULTILIB_USEDEP}]
        )
        X? (
+               glx? (
+                       media-libs/libglvnd[X?,${MULTILIB_USEDEP}]
+               )
                >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
                >=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
                >=x11-libs/libXfixes-5.0.1[${MULTILIB_USEDEP}]
@@ -40,9 +44,11 @@ BDEPEND="
 "
 
 MULTILIB_WRAPPED_HEADERS=(
+       /usr/include/va/va_backend_glx.h
        /usr/include/va/va_x11.h
        /usr/include/va/va_dri2.h
        /usr/include/va/va_dricommon.h
+       /usr/include/va/va_glx.h
 )
 
 multilib_src_configure() {
@@ -50,7 +56,7 @@ multilib_src_configure() {
                -Ddriverdir="${EPREFIX}/usr/$(get_libdir)/va/drivers"
                -Ddisable_drm=false
                -Dwith_x11=$(usex X)
-               -Dwith_glx=no
+               -Dwith_glx=$(usex X $(usex glx))
                -Dwith_wayland=$(usex wayland)
                -Denable_docs=false
        )

diff --git a/media-libs/libva/metadata.xml b/media-libs/libva/metadata.xml
index 503fb56bd40a..1ba0d2f37793 100644
--- a/media-libs/libva/metadata.xml
+++ b/media-libs/libva/metadata.xml
@@ -8,4 +8,7 @@
   <upstream>
   <remote-id type="github">intel/libva</remote-id>
   </upstream>
+  <use>
+    <flag name="glx">Enable GLX backend (requires X). Provides libva-glx.so, 
needed only by some prebuilt binaries.</flag>
+  </use>
 </pkgmetadata>

Reply via email to