From d10ab3d397d0d26fd832cbcb60d4756f2f65ce7c Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Wed, 10 Jul 2024 19:48:30 +0300 Subject: gnu: mesa: Fix building on aarch64-linux. * gnu/packages/gl.scm (mesa)[inputs]: When building for aarch64-linux use clang-18 and llvm-18 instead of llvm-for-mesa. [native-inputs]: When building for aarch64-linux add libclc. [arguments]: Adjust the 'disable-failing-test phase when building for aarch64-linux to skip a test. (mesa-opencl)[native-inputs]: When building for aarch64-linux don't add clang-15. * gnu/packages/check.scm (python-lit), * gnu/packages/llvm.scm (libclc), * gnu/packages/vulkan.scm (spirv-llvm-translator): Add a note about it being a dependency for mesa. Change-Id: I0bf5ab019ffd0626ad2d0c38bafceec401e3c886 --- gnu/packages/check.scm | 1 + gnu/packages/gl.scm | 56 ++++++++++++++++++++++++++++++------------------- gnu/packages/llvm.scm | 1 + gnu/packages/vulkan.scm | 1 + 4 files changed, 38 insertions(+), 21 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index 516db5dbf8..4d722c30c6 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -2755,6 +2755,7 @@ seamlessly into your existing Python unit testing work flow.") programs, something like CSmith, a random generator of C programs.") (license license:mpl2.0))) +;; WARNING: This package is a dependency of mesa. (define-public python-lit (package (name "python-lit") diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm index 91472d2540..101dffa01c 100644 --- a/gnu/packages/gl.scm +++ b/gnu/packages/gl.scm @@ -321,19 +321,24 @@ also known as DXTn or DXTC) for Mesa.") libxxf86vm xorgproto)) (inputs - (list elfutils ;libelf required for r600 when using llvm - expat - (force libva-without-mesa) - libxml2 - libxrandr - libxvmc - llvm-for-mesa - vulkan-loader - wayland - wayland-protocols - `(,zstd "lib"))) + (append + (if (target-aarch64?) + (list clang-18 + llvm-18) + (list llvm-for-mesa)) + (list elfutils ;libelf required for r600 when using llvm + expat + (force libva-without-mesa) + libxml2 + libxrandr + libxvmc + vulkan-loader + wayland + wayland-protocols + `(,zstd "lib")))) (native-inputs - (cons* bison + (append + (list bison flex gettext-minimal glslang @@ -341,13 +346,16 @@ also known as DXTn or DXTC) for Mesa.") python-libxml2 ;for OpenGL ES 1.1 and 2.0 support python-mako python-wrapper - (@ (gnu packages base) which) - (if (%current-target-system) - (list cmake-minimal-cross - pkg-config-for-build - wayland - wayland-protocols) - '()))) + (@ (gnu packages base) which)) + (if (target-aarch64?) + (list libclc) + '()) + (if (%current-target-system) + (list cmake-minimal-cross + pkg-config-for-build + wayland + wayland-protocols) + '()))) (outputs '("out" "bin")) (arguments (list @@ -465,6 +473,10 @@ svga,swrast,virgl,zink"))) ;; https://gitlab.freedesktop.org/mesa/mesa/-/issues/4091). `((substitute* "src/util/meson.build" ((".*'tests/u_debug_stack_test.cpp',.*") "")))) + ("aarch64-linux" + ;; Disable some of the llvmpipe tests. + `((substitute* "src/gallium/drivers/llvmpipe/meson.build" + (("'lp_test_format', ") "")))) ("armhf-linux" ;; Disable some of the llvmpipe tests. `((substitute* "src/gallium/drivers/llvmpipe/meson.build" @@ -587,8 +599,10 @@ from software emulation to complete hardware acceleration for modern GPUs.") (modify-inputs (package-inputs mesa) (prepend libclc))) (native-inputs - (modify-inputs (package-native-inputs mesa) - (prepend clang-15))))) + (if (target-aarch64?) + (package-native-inputs mesa) + (modify-inputs (package-native-inputs mesa) + (prepend clang-15)))))) (define-public mesa-opencl-icd (package/inherit mesa-opencl diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index a8c6e552c7..7a689cd9c6 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -1949,6 +1949,7 @@ standard C++ library.") (native-inputs (list clang-6 llvm-6 libcxxabi-6)))) +;; WARNING: This package is a dependency of mesa. (define-public libclc (package (name "libclc") diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm index 753d8e246d..1b69da1a4d 100644 --- a/gnu/packages/vulkan.scm +++ b/gnu/packages/vulkan.scm @@ -154,6 +154,7 @@ parser,disassembler, validator, and optimizer for SPIR-V.") SPIR-V, aiming to emit GLSL or MSL that looks like human-written code.") (license license:asl2.0))) +;; WARNING: This package is a dependency of mesa. (define-public spirv-llvm-translator (package (name "spirv-llvm-translator") -- cgit v1.2.3