From 7fe86c3911ab6dfb20f6ef5b673d24f509a42d6e Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Sun, 11 Jun 2023 16:10:42 -0700 Subject: [PATCH] mesa: apply patch to fix gallium-xa detection This commit applies a patch submitted upstream that allows mesa's meson to set `gallium-xa` automatically depending on (a large number of) other features' enablement/disablement. https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23581 In order to get mesa to do this detection for us, we must use `mesonAutoFeatures="auto"` for mesa; otherwise it cannot distinguish between `auto` and `enabled`. Without this commit, mesa does not make it past the configurePhase on powerpc64le. --- pkgs/development/libraries/mesa/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix index 38afcd174db33..45d4ecffc7f75 100644 --- a/pkgs/development/libraries/mesa/default.nix +++ b/pkgs/development/libraries/mesa/default.nix @@ -134,6 +134,12 @@ self = stdenv.mkDerivation { ./opencl.patch ./disk_cache-include-dri-driver-path-in-cache-key.patch + + (fetchpatch { + # mesa: automatically detect gallium-xa + url = "https://gitlab.freedesktop.org/mesa/mesa/-/commit/35b440ead5e0713838985361715cc768cfe5f5bc.diff"; + hash = "sha256-bDyHhFa0yCZNw/GwuW4EvcsfqvDcgNdg6j/WbAaC3Uc="; + }) ]; postPatch = '' @@ -214,6 +220,13 @@ self = stdenv.mkDerivation { "-Dvideo-codecs=h264dec,h264enc,h265dec,h265enc,vc1dec" ++ lib.optional (vulkanLayers != []) "-D vulkan-layers=${builtins.concatStringsSep "," vulkanLayers}"; + # setting mesonAutoFeatures="disabled" breaks mesa's ability to + # resolve defaults that depend on multiple features (for example, + # gallium-xa should be disabled if *none of* a certain set of + # drivers are enabled) and would require us to replicate that + # defaulting logic here in nixpkgs and also keep it in sync. + mesonAutoFeatures = "auto"; + buildInputs = with xorg; [ expat llvmPackages.libllvm libglvnd xorgproto libX11 libXext libxcb libXt libXfixes libxshmfence libXrandr