mesa: Move the DriConf defaults from $drivers to $out
The effective change is that "drirc.d/00-mesa-defaults.conf" will now be installed to $out instead of $drivers and not appear under "/run/opengl-driver/share/" anymore. This is done to fix #89421, i.e. so that Mesa will find and load the included DriConf defaults. The other files in "$drivers/share" will not be moved to $out as some Nixpkgs logic might depend on them being available under "/run/opengl-driver/share/" (e.g. addOpenGLRunpath).
This commit is contained in:
@@ -79,6 +79,12 @@ stdenv.mkDerivation {
|
|||||||
substituteInPlace meson.build --replace \
|
substituteInPlace meson.build --replace \
|
||||||
"find_program('pkg-config')" \
|
"find_program('pkg-config')" \
|
||||||
"find_program('${buildPackages.pkg-config.targetPrefix}pkg-config')"
|
"find_program('${buildPackages.pkg-config.targetPrefix}pkg-config')"
|
||||||
|
|
||||||
|
# The drirc.d directory cannot be installed to $drivers as that would cause a cyclic dependency:
|
||||||
|
substituteInPlace src/util/xmlconfig.c --replace \
|
||||||
|
'DATADIR "/drirc.d"' '"${placeholder "out"}/drirc.d"'
|
||||||
|
substituteInPlace src/util/meson.build --replace \
|
||||||
|
"get_option('datadir')" "'${placeholder "out"}'"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
outputs = [ "out" "dev" "drivers" ] ++ lib.optional enableOSMesa "osmesa";
|
outputs = [ "out" "dev" "drivers" ] ++ lib.optional enableOSMesa "osmesa";
|
||||||
@@ -86,6 +92,7 @@ stdenv.mkDerivation {
|
|||||||
# TODO: Figure out how to enable opencl without having a runtime dependency on clang
|
# TODO: Figure out how to enable opencl without having a runtime dependency on clang
|
||||||
mesonFlags = [
|
mesonFlags = [
|
||||||
"--sysconfdir=/etc"
|
"--sysconfdir=/etc"
|
||||||
|
"--datadir=${placeholder "drivers"}/share" # Vendor files
|
||||||
|
|
||||||
# Don't build in debug mode
|
# Don't build in debug mode
|
||||||
# https://gitlab.freedesktop.org/mesa/mesa/blob/master/docs/meson.html#L327
|
# https://gitlab.freedesktop.org/mesa/mesa/blob/master/docs/meson.html#L327
|
||||||
@@ -156,9 +163,6 @@ stdenv.mkDerivation {
|
|||||||
mv $out/lib/lib*_mesa* $drivers/lib
|
mv $out/lib/lib*_mesa* $drivers/lib
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# move vendor files
|
|
||||||
mv $out/share/ $drivers/
|
|
||||||
|
|
||||||
# Update search path used by glvnd
|
# Update search path used by glvnd
|
||||||
for js in $drivers/share/glvnd/egl_vendor.d/*.json; do
|
for js in $drivers/share/glvnd/egl_vendor.d/*.json; do
|
||||||
substituteInPlace "$js" --replace '"libEGL_' '"'"$drivers/lib/libEGL_"
|
substituteInPlace "$js" --replace '"libEGL_' '"'"$drivers/lib/libEGL_"
|
||||||
|
|||||||
Reference in New Issue
Block a user