From e0c378d692bd4d08301b30949a71fd867de27a23 Mon Sep 17 00:00:00 2001 From: Tom Hochstein Date: Mon, 22 Aug 2022 17:04:14 -0500 Subject: piglit: Add PACKAGECONFIG for glx and opencl - Allow GLX tests to be disabled for systems that don't support it. - Allow OpenCL tests to be enabled. (From OE-Core rev: 53c90930fca17cdaec2a5492320a286b6db6bdda) Signed-off-by: Tom Hochstein Signed-off-by: Luca Ceresoli Signed-off-by: Richard Purdie --- ...CMakeLists.txt-add-missing-endian.h-check.patch | 25 ----------------- ...-use-proper-WAYLAND_INCLUDE_DIRS-variable.patch | 32 ---------------------- ...-use-proper-WAYLAND_INCLUDE_DIRS-variable.patch | 32 ++++++++++++++++++++++ ...piglit-shader.c-do-not-hardcode-build-pat.patch | 30 -------------------- ...piglit-shader.c-do-not-hardcode-build-pat.patch | 30 ++++++++++++++++++++ ...CMakeLists.txt-add-missing-endian.h-check.patch | 25 +++++++++++++++++ ...ke-Don-t-enable-GLX-if-tests-are-disabled.patch | 32 ++++++++++++++++++++++ meta/recipes-graphics/piglit/piglit_git.bb | 12 ++++---- 8 files changed, 126 insertions(+), 92 deletions(-) delete mode 100644 meta/recipes-graphics/piglit/piglit/0001-CMakeLists.txt-add-missing-endian.h-check.patch delete mode 100644 meta/recipes-graphics/piglit/piglit/0001-cmake-use-proper-WAYLAND_INCLUDE_DIRS-variable.patch create mode 100644 meta/recipes-graphics/piglit/piglit/0002-cmake-use-proper-WAYLAND_INCLUDE_DIRS-variable.patch delete mode 100644 meta/recipes-graphics/piglit/piglit/0002-tests-util-piglit-shader.c-do-not-hardcode-build-pat.patch create mode 100644 meta/recipes-graphics/piglit/piglit/0003-tests-util-piglit-shader.c-do-not-hardcode-build-pat.patch create mode 100644 meta/recipes-graphics/piglit/piglit/0004-CMakeLists.txt-add-missing-endian.h-check.patch create mode 100644 meta/recipes-graphics/piglit/piglit/0005-cmake-Don-t-enable-GLX-if-tests-are-disabled.patch (limited to 'meta/recipes-graphics/piglit') diff --git a/meta/recipes-graphics/piglit/piglit/0001-CMakeLists.txt-add-missing-endian.h-check.patch b/meta/recipes-graphics/piglit/piglit/0001-CMakeLists.txt-add-missing-endian.h-check.patch deleted file mode 100644 index 68f783ebe4..0000000000 --- a/meta/recipes-graphics/piglit/piglit/0001-CMakeLists.txt-add-missing-endian.h-check.patch +++ /dev/null @@ -1,25 +0,0 @@ -From a8ea135125b284a8a9c965d8091b3d1d9a31849c Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Tue, 5 Apr 2022 16:51:34 +0200 -Subject: [PATCH] CMakeLists.txt: add missing endian.h check - -This is needed to actually have HAVE_ENDIAN_H defined properly in config.h. - -Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/648] -Signed-off-by: Alexander Kanavin ---- - CMakeLists.txt | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 9fb0508da..158fac4bc 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -481,6 +481,7 @@ check_include_file(sys/stat.h HAVE_SYS_STAT_H) - check_include_file(unistd.h HAVE_UNISTD_H) - check_include_file(fcntl.h HAVE_FCNTL_H) - check_include_file(linux/sync_file.h HAVE_LINUX_SYNC_FILE_H) -+check_include_file(endian.h HAVE_ENDIAN_H) - - if(DEFINED PIGLIT_INSTALL_VERSION) - set(PIGLIT_INSTALL_VERSION_SUFFIX diff --git a/meta/recipes-graphics/piglit/piglit/0001-cmake-use-proper-WAYLAND_INCLUDE_DIRS-variable.patch b/meta/recipes-graphics/piglit/piglit/0001-cmake-use-proper-WAYLAND_INCLUDE_DIRS-variable.patch deleted file mode 100644 index 5d6ec368ba..0000000000 --- a/meta/recipes-graphics/piglit/piglit/0001-cmake-use-proper-WAYLAND_INCLUDE_DIRS-variable.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 3bf1beee1ddd19bc536ff2856e04ac269d43daa2 Mon Sep 17 00:00:00 2001 -From: Pascal Bach -Date: Thu, 4 Oct 2018 14:43:17 +0200 -Subject: [PATCH] cmake: use proper WAYLAND_INCLUDE_DIRS variable - -WAYLAND_wayland-client_INCLUDEDIR is an internal variable and is not correctly -set when cross compiling. WAYLAND_INCLUDE_DIRS includes the correct path even -when cross compiling. - -Signed-off-by: Pascal Bach - -Upstream-Status: Submitted [piglit@lists.freedesktop.org] ---- - tests/util/CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tests/util/CMakeLists.txt b/tests/util/CMakeLists.txt -index a5f080156..a303a9f58 100644 ---- a/tests/util/CMakeLists.txt -+++ b/tests/util/CMakeLists.txt -@@ -97,7 +97,7 @@ if(PIGLIT_USE_WAFFLE) - piglit-framework-gl/piglit_wl_framework.c - ) - list(APPEND UTIL_GL_INCLUDES -- ${WAYLAND_wayland-client_INCLUDEDIR} -+ ${WAYLAND_INCLUDE_DIRS} - ) - endif() - if(PIGLIT_HAS_X11) --- -2.11.0 - diff --git a/meta/recipes-graphics/piglit/piglit/0002-cmake-use-proper-WAYLAND_INCLUDE_DIRS-variable.patch b/meta/recipes-graphics/piglit/piglit/0002-cmake-use-proper-WAYLAND_INCLUDE_DIRS-variable.patch new file mode 100644 index 0000000000..5d6ec368ba --- /dev/null +++ b/meta/recipes-graphics/piglit/piglit/0002-cmake-use-proper-WAYLAND_INCLUDE_DIRS-variable.patch @@ -0,0 +1,32 @@ +From 3bf1beee1ddd19bc536ff2856e04ac269d43daa2 Mon Sep 17 00:00:00 2001 +From: Pascal Bach +Date: Thu, 4 Oct 2018 14:43:17 +0200 +Subject: [PATCH] cmake: use proper WAYLAND_INCLUDE_DIRS variable + +WAYLAND_wayland-client_INCLUDEDIR is an internal variable and is not correctly +set when cross compiling. WAYLAND_INCLUDE_DIRS includes the correct path even +when cross compiling. + +Signed-off-by: Pascal Bach + +Upstream-Status: Submitted [piglit@lists.freedesktop.org] +--- + tests/util/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/util/CMakeLists.txt b/tests/util/CMakeLists.txt +index a5f080156..a303a9f58 100644 +--- a/tests/util/CMakeLists.txt ++++ b/tests/util/CMakeLists.txt +@@ -97,7 +97,7 @@ if(PIGLIT_USE_WAFFLE) + piglit-framework-gl/piglit_wl_framework.c + ) + list(APPEND UTIL_GL_INCLUDES +- ${WAYLAND_wayland-client_INCLUDEDIR} ++ ${WAYLAND_INCLUDE_DIRS} + ) + endif() + if(PIGLIT_HAS_X11) +-- +2.11.0 + diff --git a/meta/recipes-graphics/piglit/piglit/0002-tests-util-piglit-shader.c-do-not-hardcode-build-pat.patch b/meta/recipes-graphics/piglit/piglit/0002-tests-util-piglit-shader.c-do-not-hardcode-build-pat.patch deleted file mode 100644 index 16c7c5c803..0000000000 --- a/meta/recipes-graphics/piglit/piglit/0002-tests-util-piglit-shader.c-do-not-hardcode-build-pat.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 1c67250308a92d4991ed05d9d240090ab84accae Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Tue, 10 Nov 2020 17:13:50 +0000 -Subject: [PATCH 2/2] tests/util/piglit-shader.c: do not hardcode build path - into target binary - -This helps reproducibilty. - -Upstream-Status: Inappropriate [oe-core specific] -Signed-off-by: Alexander Kanavin ---- - tests/util/piglit-shader.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tests/util/piglit-shader.c b/tests/util/piglit-shader.c -index 4fd68d21e..c9ea8295e 100644 ---- a/tests/util/piglit-shader.c -+++ b/tests/util/piglit-shader.c -@@ -73,7 +73,7 @@ piglit_compile_shader(GLenum target, const char *filename) - - source_dir = getenv("PIGLIT_SOURCE_DIR"); - if (source_dir == NULL) { -- source_dir = SOURCE_DIR; -+ source_dir = "."; - } - - snprintf(filename_with_path, FILENAME_MAX - 1, --- -2.17.1 - diff --git a/meta/recipes-graphics/piglit/piglit/0003-tests-util-piglit-shader.c-do-not-hardcode-build-pat.patch b/meta/recipes-graphics/piglit/piglit/0003-tests-util-piglit-shader.c-do-not-hardcode-build-pat.patch new file mode 100644 index 0000000000..16c7c5c803 --- /dev/null +++ b/meta/recipes-graphics/piglit/piglit/0003-tests-util-piglit-shader.c-do-not-hardcode-build-pat.patch @@ -0,0 +1,30 @@ +From 1c67250308a92d4991ed05d9d240090ab84accae Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Tue, 10 Nov 2020 17:13:50 +0000 +Subject: [PATCH 2/2] tests/util/piglit-shader.c: do not hardcode build path + into target binary + +This helps reproducibilty. + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin +--- + tests/util/piglit-shader.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/util/piglit-shader.c b/tests/util/piglit-shader.c +index 4fd68d21e..c9ea8295e 100644 +--- a/tests/util/piglit-shader.c ++++ b/tests/util/piglit-shader.c +@@ -73,7 +73,7 @@ piglit_compile_shader(GLenum target, const char *filename) + + source_dir = getenv("PIGLIT_SOURCE_DIR"); + if (source_dir == NULL) { +- source_dir = SOURCE_DIR; ++ source_dir = "."; + } + + snprintf(filename_with_path, FILENAME_MAX - 1, +-- +2.17.1 + diff --git a/meta/recipes-graphics/piglit/piglit/0004-CMakeLists.txt-add-missing-endian.h-check.patch b/meta/recipes-graphics/piglit/piglit/0004-CMakeLists.txt-add-missing-endian.h-check.patch new file mode 100644 index 0000000000..68f783ebe4 --- /dev/null +++ b/meta/recipes-graphics/piglit/piglit/0004-CMakeLists.txt-add-missing-endian.h-check.patch @@ -0,0 +1,25 @@ +From a8ea135125b284a8a9c965d8091b3d1d9a31849c Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Tue, 5 Apr 2022 16:51:34 +0200 +Subject: [PATCH] CMakeLists.txt: add missing endian.h check + +This is needed to actually have HAVE_ENDIAN_H defined properly in config.h. + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/648] +Signed-off-by: Alexander Kanavin +--- + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9fb0508da..158fac4bc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -481,6 +481,7 @@ check_include_file(sys/stat.h HAVE_SYS_STAT_H) + check_include_file(unistd.h HAVE_UNISTD_H) + check_include_file(fcntl.h HAVE_FCNTL_H) + check_include_file(linux/sync_file.h HAVE_LINUX_SYNC_FILE_H) ++check_include_file(endian.h HAVE_ENDIAN_H) + + if(DEFINED PIGLIT_INSTALL_VERSION) + set(PIGLIT_INSTALL_VERSION_SUFFIX diff --git a/meta/recipes-graphics/piglit/piglit/0005-cmake-Don-t-enable-GLX-if-tests-are-disabled.patch b/meta/recipes-graphics/piglit/piglit/0005-cmake-Don-t-enable-GLX-if-tests-are-disabled.patch new file mode 100644 index 0000000000..ef6fda0f4e --- /dev/null +++ b/meta/recipes-graphics/piglit/piglit/0005-cmake-Don-t-enable-GLX-if-tests-are-disabled.patch @@ -0,0 +1,32 @@ +From 13ff43fe760ac343b33d8e8c84b89886aac07116 Mon Sep 17 00:00:00 2001 +From: Tom Hochstein +Date: Fri, 3 Jun 2022 10:44:29 -0500 +Subject: [PATCH] cmake: Don't enable GLX if tests are disabled + +Allow building for systems that don't support GLX. + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/720] +Signed-off-by: Tom Hochstein +--- + CMakeLists.txt | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e1aeb5ddf..85e171aba 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -134,10 +134,7 @@ if(PIGLIT_BUILD_CL_TESTS) + endif(PIGLIT_BUILD_CL_TESTS) + + IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") +- if(X11_FOUND AND OPENGL_gl_LIBRARY) +- # Assume the system has GLX. In the future, systems may exist +- # with libGL and libX11 but no GLX, but that world hasn't +- # arrived yet. ++ if(X11_FOUND AND OPENGL_gl_LIBRARY AND PIGLIT_BUILD_GLX_TESTS) + set(PIGLIT_HAS_GLX True) + add_definitions(-DPIGLIT_HAS_GLX) + endif() +-- +2.17.1 + diff --git a/meta/recipes-graphics/piglit/piglit_git.bb b/meta/recipes-graphics/piglit/piglit_git.bb index 7c1bc89c22..29360a246b 100644 --- a/meta/recipes-graphics/piglit/piglit_git.bb +++ b/meta/recipes-graphics/piglit/piglit_git.bb @@ -8,10 +8,10 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b2beded7103a3d8a442a2a0391d607b0" SRC_URI = "git://gitlab.freedesktop.org/mesa/piglit.git;protocol=https;branch=main \ file://0001-cmake-install-bash-completions-in-the-right-place.patch \ - file://0001-cmake-use-proper-WAYLAND_INCLUDE_DIRS-variable.patch \ - file://0002-tests-util-piglit-shader.c-do-not-hardcode-build-pat.patch \ - file://0001-CMakeLists.txt-add-missing-endian.h-check.patch \ - " + file://0002-cmake-use-proper-WAYLAND_INCLUDE_DIRS-variable.patch \ + file://0003-tests-util-piglit-shader.c-do-not-hardcode-build-pat.patch \ + file://0004-CMakeLists.txt-add-missing-endian.h-check.patch \ + file://0005-cmake-Don-t-enable-GLX-if-tests-are-disabled.patch" UPSTREAM_CHECK_COMMITS = "1" SRCREV = "6403e90dc7da02d486906cddab8d02c2552a8d46" @@ -36,8 +36,10 @@ REQUIRED_DISTRO_FEATURES += "opengl" export TEMP = "${B}/temp/" do_compile[dirs] =+ "${B}/temp/" -PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" +PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 glx', '', d)}" PACKAGECONFIG[freeglut] = "-DPIGLIT_USE_GLUT=1,-DPIGLIT_USE_GLUT=0,freeglut," +PACKAGECONFIG[glx] = "-DPIGLIT_BUILD_GLX_TESTS=ON,-DPIGLIT_BUILD_GLX_TESTS=OFF" +PACKAGECONFIG[opencl] = "-DPIGLIT_BUILD_CL_TESTS=ON,-DPIGLIT_BUILD_CL_TESTS=OFF,opencl-icd-loader" PACKAGECONFIG[x11] = "-DPIGLIT_BUILD_GL_TESTS=ON,-DPIGLIT_BUILD_GL_TESTS=OFF,${X11_DEPS}, ${X11_RDEPS}" PACKAGECONFIG[vulkan] = "-DPIGLIT_BUILD_VK_TESTS=ON,-DPIGLIT_BUILD_VK_TESTS=OFF,vulkan-loader" -- cgit v1.2.3-54-g00ecf