commit:     74901ccab9bd8148912f66e752d7c37168588500
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 30 21:49:41 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Tue Jul 30 22:26:58 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=74901cca

gui-libs/egl-gbm: backport fix for nvidia-drivers:0/560

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 ...gbm-1.1.1-r1.ebuild => egl-gbm-1.1.1-r2.ebuild} |  1 +
 .../egl-gbm/files/egl-gbm-1.1.1-abi-check.patch    | 27 ++++++++++++++++++++++
 2 files changed, 28 insertions(+)

diff --git a/gui-libs/egl-gbm/egl-gbm-1.1.1-r1.ebuild 
b/gui-libs/egl-gbm/egl-gbm-1.1.1-r2.ebuild
similarity index 95%
rename from gui-libs/egl-gbm/egl-gbm-1.1.1-r1.ebuild
rename to gui-libs/egl-gbm/egl-gbm-1.1.1-r2.ebuild
index 4ec0bbc9775c..0f2b9faf47b5 100644
--- a/gui-libs/egl-gbm/egl-gbm-1.1.1-r1.ebuild
+++ b/gui-libs/egl-gbm/egl-gbm-1.1.1-r2.ebuild
@@ -28,6 +28,7 @@ DEPEND="
 
 PATCHES=(
        "${FILESDIR}"/${PN}-1.1.0-werror.patch
+       "${FILESDIR}"/${P}-abi-check.patch
 )
 
 src_install() {

diff --git a/gui-libs/egl-gbm/files/egl-gbm-1.1.1-abi-check.patch 
b/gui-libs/egl-gbm/files/egl-gbm-1.1.1-abi-check.patch
new file mode 100644
index 000000000000..8d46edb71b0f
--- /dev/null
+++ b/gui-libs/egl-gbm/files/egl-gbm-1.1.1-abi-check.patch
@@ -0,0 +1,27 @@
+Backport required to function properly with >=nvidia-drivers-560,
+but no release with this change has been made yet.
+
+https://github.com/NVIDIA/egl-gbm/commit/1352ca845fb78b28e3a097586abee2bcf2dbafb8
+From: Kyle Brenneman <[email protected]>
+Date: Fri, 12 Apr 2024 09:10:23 -0600
+Subject: [PATCH] Fix the ABI version check.
+
+The EGL_EXTERNAL_PLATFORM_VERSION_CHECK macro checks whether the given
+version is older than EGL_EXTERNAL_PLATFORM_VERSION_MAJOR/MINOR, not
+newer.
+
+That's correct for using it in EGL_EXTERNAL_PLATFORM_HAS, since it'll
+check whether the build-time version supports a given feature, but it's
+wrong for checking the ABI version that the driver reports.
+
+Instead, use EGL_EXTERNAL_PLATFORM_VERSION_CMP.
+--- a/src/gbm-platform.c
++++ b/src/gbm-platform.c
+@@ -167,5 +167,6 @@
+ {
+     if (!platform ||
+-        !EGL_EXTERNAL_PLATFORM_VERSION_CHECK(major, minor)) {
++        !EGL_EXTERNAL_PLATFORM_VERSION_CMP(major, minor,
++            GBM_EXTERNAL_VERSION_MAJOR, GBM_EXTERNAL_VERSION_MINOR)) {
+         return EGL_FALSE;
+     }

Reply via email to