mesa: allow overriding driver compilation #23451
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Mesa has encumbered features which are disabled by default. This is fine, because users need only enable them for the
mesa_drivers
package, which does not cause a mass-rebuild. But, themesa_drivers
package builds all the drivers Mesa provides; users building custom drivers probably only care about the drivers for their machine. This patch allows the user to build selected drivers by overriding thedriDrivers
,galliumDrivers
, andvulkanDrivers
attributes.Testing
I have been using this patch on my own for about a month on two different machines. By carefully tweaking the default driver sets, I have avoided a mass-rebuild of packages dependent on the Mesa library.
Future work may include disabling the driver build from the library, since it is presumably not needed. (Actually, the
svga
andswrast
drivers are not optional, but even leaving those two drivers in the library build would speed it up significantly.)(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)