%global commit fb2884b0835a25a1bd53f1163858c653d8b1c06d %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global commitdate 20261123 # libpiglitutil*.so etc. are private libraries in %%{_libdir}/piglit/lib; # do not advertise them as system-wide Provides/Requires %global __provides_exclude_from ^%{_libdir}/%{name}/.*$ %global __requires_exclude ^lib(piglit|hiz-util).*\\.so.*$ Name: piglit Version: 1^%{commitdate}git%{shortcommit} Release: %autorelease Summary: Automated test suite for OpenGL, Vulkan and OpenCL implementations # Framework, runner and test profiles (piglit): MIT # Subpackages carry their own License tags, see below. License: MIT URL: https://gitlab.freedesktop.org/mesa/piglit Source0: %{url}/-/archive/%{commit}/%{name}-%{commit}.tar.gz # Python 3.14.10+ gzip.GzipFile range-checks mtime before int() conversion, # so SOURCE_DATE_EPOCH (a string) raises TypeError during the build. # TODO: add upstream MR link (GPU-5679) Patch0: fix-serializer-mtime-type.patch BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: cmake BuildRequires: ninja-build BuildRequires: python3-devel BuildRequires: python3-numpy BuildRequires: python3-mako BuildRequires: python3-lxml BuildRequires: glslang BuildRequires: ocl-icd-devel BuildRequires: opencl-headers BuildRequires: pkgconfig(bash-completion) BuildRequires: pkgconfig(egl) BuildRequires: pkgconfig(gbm) BuildRequires: pkgconfig(gl) BuildRequires: pkgconfig(glproto) BuildRequires: pkgconfig(libdrm) BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(vulkan) BuildRequires: pkgconfig(waffle-1) BuildRequires: pkgconfig(wayland-client) BuildRequires: pkgconfig(wayland-egl) BuildRequires: pkgconfig(wayland-protocols) BuildRequires: pkgconfig(wayland-scanner) BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xcb) BuildRequires: pkgconfig(xcb-dri2) BuildRequires: pkgconfig(xkbcommon) BuildRequires: pkgconfig(zlib) Requires: python3-numpy Requires: python3-mako Requires: python3-lxml %description Piglit is a collection of automated tests for OpenGL, OpenGL ES, Vulkan and OpenCL implementations, developed as part of the Mesa project. This package contains the piglit runner, the test framework and the test profiles. The tests themselves are in the piglit-gl, piglit-vulkan and piglit-cl subpackages. %package cl Summary: OpenCL tests for piglit # tests/cl/program/execute/gegl-*.cl: LGPL-3.0-or-later License: MIT AND LGPL-3.0-or-later Requires: %{name}%{?_isa} = %{version}-%{release} %description cl OpenCL tests for piglit, for conformance and regression testing of OpenCL runtimes such as rusticl and intel-compute-runtime. %package gl Summary: OpenGL, OpenGL ES, EGL and GLX tests for piglit # tests/glslparsertest/glsl2/gst-gl-*: LGPL-2.0-or-later # tests/general/triangle-guardband-viewport.c, # tests/shaders/glsl-uniform-out-of-bounds-2.c: LGPL-2.1-or-later # tests/glslparsertest/glsl2/norsetto-*: GPL-3.0-only # tests/glslparsertest/glsl2/{xreal,xonotic}-*, # tests/shaders/glsl-gnome-shell-*: GPL-2.0-or-later # tests/glslparsertest/shaders/*: BSD-3-Clause # tests/spec/gl-2.0/vertex-{attr-0,const-attr}.c, # tests/spec/glsl-1.20/execution/fs-array-deref-then-write.shader_test: MIT-Khronos-old License: MIT AND BSD-3-Clause AND GPL-2.0-or-later AND GPL-3.0-only AND LGPL-2.0-or-later AND LGPL-2.1-or-later AND MIT-Khronos-old Requires: %{name}%{?_isa} = %{version}-%{release} %description gl OpenGL, OpenGL ES, EGL and GLX tests for piglit, including shader_runner and the GLSL/ARB assembly parser tests. %package vulkan Summary: Vulkan tests for piglit License: MIT Requires: %{name}%{?_isa} = %{version}-%{release} %description vulkan Vulkan shader tests for piglit. Running them requires the VkRunner binary (set PIGLIT_VKRUNNER_BINARY or [vkrunner] bin in piglit.conf). %prep %autosetup -n %{name}-%{commit} -p1 %py3_shebang_fix . %build %cmake -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ -DPIGLIT_BUILD_CL_TESTS=ON \ -DPIGLIT_BUILD_GL_TESTS=ON \ -DPIGLIT_BUILD_GLES1_TESTS=ON \ -DPIGLIT_BUILD_GLES2_TESTS=ON \ -DPIGLIT_BUILD_GLES3_TESTS=ON \ -DPIGLIT_BUILD_VK_TESTS=ON \ -DPIGLIT_BUILD_DMA_BUF_TESTS=ON \ -DPIGLIT_BUILD_GLX_TESTS=ON \ -DPIGLIT_BUILD_EGL_TESTS=ON \ -DPIGLIT_USE_WAFFLE=ON \ -DPIGLIT_USE_GBM=ON \ -DPIGLIT_USE_WAYLAND=ON \ -DPIGLIT_USE_X11=ON %cmake_build %install %cmake_install # Upstream installs COPYING into the docdir too; it is shipped via %%license rm %{buildroot}%{_docdir}/%{name}/COPYING # Helper scripts installed without the executable bit are not meant to be # run directly; drop their shebangs find %{buildroot}%{_libdir}/%{name} -name '*.py' ! -perm -u+x \ -exec sed -i '1{/^#!/d}' {} + # Python modules live in a private directory, so byte-compile them explicitly %py_byte_compile %{python3} %{buildroot}%{_libdir}/%{name} # Split the test tree into subpackages by path listdir=$PWD pushd %{buildroot}%{_libdir}/%{name} for f in bin/* lib/* tests/* generated_tests/*; do case "$f" in bin/cl-*|lib/libpiglitutil_cl.so*|tests/cl|tests/cl.xml.gz|tests/quick_cl.meta.xml|generated_tests/cl) pkg=cl ;; tests/vulkan|tests/vulkan.xml.gz|generated_tests/vulkan) pkg=vulkan ;; bin/replayer.py|bin/__pycache__|lib/libpiglitutil.so*|tests/*.py|tests/__pycache__|tests/py_modules|tests/*.meta.xml|generated_tests/templates|generated_tests/modules|generated_tests/__pycache__) pkg=core ;; *) pkg=gl ;; esac echo "%{_libdir}/%{name}/$f" >> "$listdir/%{name}-$pkg.files" done popd %check # The tests need GPU/OpenCL/Vulkan devices and cannot run in the build # environment; only check that the runner starts. %{buildroot}%{_bindir}/%{name} --help >/dev/null %files -f %{name}-core.files %license COPYING licences/GPL-2 licences/GPL-3 licences/LGPL-2 %{_bindir}/%{name} %dir %{_libdir}/%{name} %dir %{_libdir}/%{name}/bin %dir %{_libdir}/%{name}/lib %dir %{_libdir}/%{name}/tests %dir %{_libdir}/%{name}/generated_tests %{_libdir}/%{name}/framework/ %{_libdir}/%{name}/templates/ %{_datadir}/doc/%{name}/ %{bash_completions_dir}/%{name} %files cl -f %{name}-cl.files %files gl -f %{name}-gl.files %files vulkan -f %{name}-vulkan.files %changelog %autochangelog