The required modifications in the postInstall phase are only applied on
Linux and the test currently fails on Darwin:
https://github.com/NixOS/nixpkgs/runs/5344236204
> building '/nix/store/45s58pv9j6a19wr9izx49s6i0i4qshxs-mesa-dev-does-not-depend-on-llvm.drv'...
> error: output '/nix/store/czmszfcwdx87vx2wf80lhp3h9skqqcfs-mesa-dev-does-not-depend-on-llvm' is not allowed to refer to the following paths:
> /nix/store/cwb5g57al7iizw456ah9rk49cxb47wi3-mesa-21.3.7-drivers
I've also updated the URL for the RISC-V patch in case the content of
the old URL will change (not sure if that's possible after a merge
request is merged but now that the patch is upstream it seems like a
good idea regardless; and the content has actually already changed so
the old hash wasn't correct anymore).
Note: This update likely causes some issues when running an application
that has a direct dependency on Mesa (e.g. Sway and XWayland) and was
compiled against a different Nixpkgs revision. See 7106fca0fe for more
details regarding that issue.
Note: The update to Mesa 21.0.2 was reverted (25ae1fd29f) because it
caused major issues with Sway (segfault on startup [0]).
This is still the case and might affect all packages that directly
depend on "mesa" (for libgbm or libglapi) but it only causes issues when
the package depends on a "mesa" version that differs from "mesa.drivers"
used for "/run/opengl-driver/". I've noticed this while testing Mesa
updates with the NixOS option "hardware.opengl.package" (as usual)
instead of rebuilding my whole system (which would work). Unfortunately
this can/will likely also cause issues when mixing different channels,
using Flakes/Overlays, etc.
The cause of this should be similar to [1] ("mesa" updates now cause the
same issues that "glibc" updates already do, maybe triggered by certain
Mesa changes) and some additional discussions is in [2],[3].
Note: Don't backport this to NixOS 21.05, at least not without careful
consideration.
[0]: https://github.com/NixOS/nixpkgs/pull/118753#issuecomment-818950977
[1]: https://github.com/NixOS/nixpkgs/issues/95808
[2]: https://github.com/NixOS/nixpkgs/pull/120325
[3]: https://github.com/NixOS/nixpkgs/pull/119558
OpenGL applications should not depend on the Mesa drivers, since these
are supposed to be loaded at runtime from /run/opengl-driver using the
glvnd library. Furthermore, the drivers output has a large closure
since it depends on LLVM.
The only dependency from dev to drivers came from the xatracker
pkg-config file. This commit moves this file into a new
output called driversdev.
The glvnd library contains a copy of the OpenGL headers. By compiling
against the glvnd headers we completely avoid a dependency on Mesa (and
LLVM). This reduces rebuild time. It also prevents accidents, such as
where some packages kept a reference to the mesa.drivers output and thus
had all Mesa drivers in their runtime closure.