mesa: fix cross compilation to x86_64

In particular, fix cross compilation of rusticl.

+12 -10
+12 -10
pkgs/development/libraries/mesa/default.nix
··· 1 - { stdenv, lib, fetchurl, fetchpatch 1 + { stdenv, lib, fetchurl, fetchpatch, buildPackages 2 2 , meson, pkg-config, ninja 3 3 , intltool, bison, flex, file, python3Packages, wayland-scanner 4 4 , expat, libdrm, xorg, wayland, wayland-protocols, openssl ··· 66 66 , enablePatentEncumberedCodecs ? true 67 67 , jdupes 68 68 , rustc 69 - , rust-bindgen 70 69 , spirv-llvm-translator 71 70 , zstd 72 71 , directx-headers ··· 98 97 # Align all the Mesa versions used. Required to prevent explosions when 99 98 # two different LLVMs are loaded in the same process. 100 99 # FIXME: these should really go into some sort of versioned LLVM package set 101 - rust-bindgen' = rust-bindgen.override { 102 - rust-bindgen-unwrapped = rust-bindgen.unwrapped.override { 103 - clang = llvmPackages.clang; 100 + rust-bindgen' = buildPackages.rust-bindgen.override { 101 + rust-bindgen-unwrapped = buildPackages.rust-bindgen.unwrapped.override { 102 + clang = buildPackages.llvmPackages_15.clang; 104 103 }; 105 104 }; 106 105 spirv-llvm-translator' = spirv-llvm-translator.override { ··· 201 200 "-Dglvnd=true" 202 201 203 202 # Enable RT for Intel hardware 204 - "-Dintel-clc=enabled" 203 + # https://gitlab.freedesktop.org/mesa/mesa/-/issues/9080 204 + (lib.mesonEnable "intel-clc" (stdenv.buildPlatform == stdenv.hostPlatform)) 205 205 ] ++ lib.optionals enableOpenCL [ 206 206 # Clover, old OpenCL frontend 207 207 "-Dgallium-opencl=icd" ··· 217 217 ++ lib.optional (vulkanLayers != []) "-D vulkan-layers=${builtins.concatStringsSep "," vulkanLayers}"; 218 218 219 219 buildInputs = with xorg; [ 220 - expat llvmPackages.libllvm libglvnd xorgproto 220 + expat glslang llvmPackages.libllvm libglvnd xorgproto 221 221 libX11 libXext libxcb libXt libXfixes libxshmfence libXrandr 222 222 libffi libvdpau libelf libXvMC 223 223 libpthreadstubs openssl /*or another sha1 provider*/ ··· 225 225 python3Packages.python # for shebang 226 226 ] ++ lib.optionals haveWayland [ wayland wayland-protocols ] 227 227 ++ lib.optionals stdenv.isLinux [ libomxil-bellagio libva-minimal udev lm_sensors ] 228 - ++ lib.optionals enableOpenCL [ llvmPackages.libclc llvmPackages.clang llvmPackages.clang-unwrapped rustc rust-bindgen' spirv-llvm-translator' ] 228 + ++ lib.optionals enableOpenCL [ llvmPackages.libclc llvmPackages.clang llvmPackages.clang-unwrapped spirv-llvm-translator' ] 229 229 ++ lib.optional withValgrind valgrind-light 230 230 ++ lib.optional haveZink vulkan-loader 231 231 ++ lib.optional haveDozen directx-headers; 232 232 233 - depsBuildBuild = [ pkg-config ]; 233 + depsBuildBuild = [ pkg-config ] 234 + ++ lib.optional enableOpenCL buildPackages.stdenv.cc; 234 235 235 236 nativeBuildInputs = [ 236 237 meson pkg-config ninja 237 238 intltool bison flex file 238 239 python3Packages.python python3Packages.mako python3Packages.ply 239 240 jdupes glslang 240 - ] ++ lib.optional haveWayland wayland-scanner; 241 + ] ++ lib.optionals enableOpenCL [ rust-bindgen' rustc ] 242 + ++ lib.optional haveWayland wayland-scanner; 241 243 242 244 propagatedBuildInputs = with xorg; [ 243 245 libXdamage libXxf86vm