Fix the following error appearing if building on a pure-X11 distros:

<PATH>/git/tests/egl/egl-wayland.c:29:10: fatal error: wayland-client.h: No 
such file or directory
   29 | #include <wayland-client.h>
      |          ^~~~~~~~~~~~~~~~~~

Signed-off-by: Dmitry Baryshkov <[email protected]>
---
 ...ake-egl_ext_surface_compression-cond.patch | 33 ------------
 ...rface_compression-stop-using-egl_uti.patch | 50 +++++++++++++++++++
 ...rface_compression-make-create-test-w.patch | 37 ++++++++++++++
 meta/recipes-graphics/piglit/piglit_git.bb    |  3 +-
 4 files changed, 89 insertions(+), 34 deletions(-)
 delete mode 100644 
meta/recipes-graphics/piglit/piglit/0001-tests-egl-spec-make-egl_ext_surface_compression-cond.patch
 create mode 100644 
meta/recipes-graphics/piglit/piglit/0001-tests-egl_ext_surface_compression-stop-using-egl_uti.patch
 create mode 100644 
meta/recipes-graphics/piglit/piglit/0002-tests-egl_ext_surface_compression-make-create-test-w.patch

diff --git 
a/meta/recipes-graphics/piglit/piglit/0001-tests-egl-spec-make-egl_ext_surface_compression-cond.patch
 
b/meta/recipes-graphics/piglit/piglit/0001-tests-egl-spec-make-egl_ext_surface_compression-cond.patch
deleted file mode 100644
index 47f8b03961c6..000000000000
--- 
a/meta/recipes-graphics/piglit/piglit/0001-tests-egl-spec-make-egl_ext_surface_compression-cond.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 0c97d5eacae4f584313c9251e585bb0246cceffc Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <[email protected]>
-Date: Fri, 22 Nov 2024 22:52:31 +0100
-Subject: [PATCH] tests/egl/spec: make egl_ext_surface_compression conditional
- to X11
-
-Otherwise, this error occurs:
-| In file included from 
/srv/storage/alex/yocto/build-64/workspace/sources/piglit/tests/egl/spec/egl_ext_surface_compression/create_surface.c:28:
-| 
/srv/storage/alex/yocto/build-64/workspace/sources/piglit/tests/egl/spec/egl_ext_surface_compression/../../egl-util.h:12:10:
 fatal error: X11/Xlib.h: No such file or directory
-|    12 | #include <X11/Xlib.h>
-|       |          ^~~~~~~~~~~~
-
-Upstream-Status: Submitted 
[https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/974]
-Signed-off-by: Alexander Kanavin <[email protected]>
----
- tests/egl/spec/CMakeLists.txt | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/tests/egl/spec/CMakeLists.txt b/tests/egl/spec/CMakeLists.txt
-index 33c504978..1dea6d8fc 100644
---- a/tests/egl/spec/CMakeLists.txt
-+++ b/tests/egl/spec/CMakeLists.txt
-@@ -7,7 +7,9 @@ add_subdirectory (egl_ext_device_drm)
- add_subdirectory (egl_ext_platform_device)
- add_subdirectory (egl_ext_image_dma_buf_import_modifiers)
- add_subdirectory (egl_ext_protected_content)
--add_subdirectory (egl_ext_surface_compression)
-+if (PIGLIT_HAS_X11)
-+      add_subdirectory (egl_ext_surface_compression)
-+endif (PIGLIT_HAS_X11)
- add_subdirectory (egl_khr_create_context)
- add_subdirectory (egl_khr_display_reference)
- add_subdirectory (egl_khr_get_all_proc_addresses)
diff --git 
a/meta/recipes-graphics/piglit/piglit/0001-tests-egl_ext_surface_compression-stop-using-egl_uti.patch
 
b/meta/recipes-graphics/piglit/piglit/0001-tests-egl_ext_surface_compression-stop-using-egl_uti.patch
new file mode 100644
index 000000000000..575477bc4ca7
--- /dev/null
+++ 
b/meta/recipes-graphics/piglit/piglit/0001-tests-egl_ext_surface_compression-stop-using-egl_uti.patch
@@ -0,0 +1,50 @@
+From ea48657a33015ad1f94c0d639fd9ee76e0e374c4 Mon Sep 17 00:00:00 2001
+From: Dmitry Baryshkov <[email protected]>
+Date: Fri, 6 Dec 2024 01:55:28 +0200
+Subject: [PATCH 1/2] tests/egl_ext_surface_compression: stop using egl_utils
+
+Otherwise, if X11 includes are not available, the build fails:
+| In file included from 
<PATH>/piglit/tests/egl/spec/egl_ext_surface_compression/create_surface.c:28:
+| 
<PATH>/piglit/tests/egl/spec/egl_ext_surface_compression/../../egl-util.h:12:10:
 fatal error: X11/Xlib.h: No such file or directory
+|    12 | #include <X11/Xlib.h>
+|       |          ^~~~~~~~~~~~
+
+Signed-off-by: Dmitry Baryshkov <[email protected]>
+Upstream-Status: Submitted 
[https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/977]
+---
+ .../egl/spec/egl_ext_surface_compression/CMakeLists.gles3.txt | 4 ++--
+ tests/egl/spec/egl_ext_surface_compression/create_surface.c   | 1 -
+ 2 files changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/tests/egl/spec/egl_ext_surface_compression/CMakeLists.gles3.txt 
b/tests/egl/spec/egl_ext_surface_compression/CMakeLists.gles3.txt
+index d9540bcfde27..2daf8167c81d 100644
+--- a/tests/egl/spec/egl_ext_surface_compression/CMakeLists.gles3.txt
++++ b/tests/egl/spec/egl_ext_surface_compression/CMakeLists.gles3.txt
+@@ -2,10 +2,10 @@ link_libraries(
+       piglitutil_${piglit_target_api}
+ )
+ 
+-piglit_add_executable(egl_ext_surface_compression-create ../../egl-util.c
++piglit_add_executable(egl_ext_surface_compression-create
+       ../../egl-wayland.c create_surface.c)
+ 
+-piglit_add_executable(egl_ext_surface_compression-image ../../egl-util.c
++piglit_add_executable(egl_ext_surface_compression-image
+       image_storage.c)
+ 
+ # vim: ft=cmake:
+diff --git a/tests/egl/spec/egl_ext_surface_compression/create_surface.c 
b/tests/egl/spec/egl_ext_surface_compression/create_surface.c
+index e3d55d4331fb..35f13fd007b4 100644
+--- a/tests/egl/spec/egl_ext_surface_compression/create_surface.c
++++ b/tests/egl/spec/egl_ext_surface_compression/create_surface.c
+@@ -25,7 +25,6 @@
+ #include "piglit-util.h"
+ #include "piglit-util-egl.h"
+ #include "piglit-util-gl.h"
+-#include "../../egl-util.h"
+ #include "../../egl-wayland.h"
+ 
+ static enum piglit_result
+-- 
+2.39.5
+
diff --git 
a/meta/recipes-graphics/piglit/piglit/0002-tests-egl_ext_surface_compression-make-create-test-w.patch
 
b/meta/recipes-graphics/piglit/piglit/0002-tests-egl_ext_surface_compression-make-create-test-w.patch
new file mode 100644
index 000000000000..3de983afb73d
--- /dev/null
+++ 
b/meta/recipes-graphics/piglit/piglit/0002-tests-egl_ext_surface_compression-make-create-test-w.patch
@@ -0,0 +1,37 @@
+From 0a985979d68b181b9014e49c0eb1908dd51345e4 Mon Sep 17 00:00:00 2001
+From: Dmitry Baryshkov <[email protected]>
+Date: Fri, 6 Dec 2024 01:57:18 +0200
+Subject: [PATCH 2/2] tests/egl_ext_surface_compression: make create test
+ wayland-only
+
+The egl_ext_surface_compression-create uses egl-wayland.c, it should not
+be enabled if Wayland is not available:
+
+<PATH>/tests/egl/egl-wayland.c:29:10: fatal error: wayland-client.h: No such 
file or directory
+   29 | #include <wayland-client.h>
+      |          ^~~~~~~~~~~~~~~~~~
+
+Signed-off-by: Dmitry Baryshkov <[email protected]>
+Upstream-Status: Submitted 
[https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/977]
+---
+ tests/egl/spec/egl_ext_surface_compression/CMakeLists.gles3.txt | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tests/egl/spec/egl_ext_surface_compression/CMakeLists.gles3.txt 
b/tests/egl/spec/egl_ext_surface_compression/CMakeLists.gles3.txt
+index 2daf8167c81d..01a70164f444 100644
+--- a/tests/egl/spec/egl_ext_surface_compression/CMakeLists.gles3.txt
++++ b/tests/egl/spec/egl_ext_surface_compression/CMakeLists.gles3.txt
+@@ -2,8 +2,10 @@ link_libraries(
+       piglitutil_${piglit_target_api}
+ )
+ 
++if (PIGLIT_HAS_WAYLAND)
+ piglit_add_executable(egl_ext_surface_compression-create
+       ../../egl-wayland.c create_surface.c)
++endif (PIGLIT_HAS_WAYLAND)
+ 
+ piglit_add_executable(egl_ext_surface_compression-image
+       image_storage.c)
+-- 
+2.39.5
+
diff --git a/meta/recipes-graphics/piglit/piglit_git.bb 
b/meta/recipes-graphics/piglit/piglit_git.bb
index 3e950ff61c55..a5629476860f 100644
--- a/meta/recipes-graphics/piglit/piglit_git.bb
+++ b/meta/recipes-graphics/piglit/piglit_git.bb
@@ -11,7 +11,8 @@ SRC_URI = 
"git://gitlab.freedesktop.org/mesa/piglit.git;protocol=https;branch=ma
            
file://0003-tests-util-piglit-shader.c-do-not-hardcode-build-pat.patch \
            file://0001-tests-Fix-narrowing-errors-seen-with-clang.patch \
            
file://0001-CMakeLists.txt-do-not-obtain-wayland-scanner-path-fr.patch \
-           
file://0001-tests-egl-spec-make-egl_ext_surface_compression-cond.patch \
+           
file://0001-tests-egl_ext_surface_compression-stop-using-egl_uti.patch \
+           
file://0002-tests-egl_ext_surface_compression-make-create-test-w.patch \
            "
 UPSTREAM_CHECK_COMMITS = "1"
 
-- 
2.39.5

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#208402): 
https://lists.openembedded.org/g/openembedded-core/message/208402
Mute This Topic: https://lists.openembedded.org/mt/109950320/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to