steam: use XDG_DATA_DIRS to specify vulkan icd paths
This commit is contained in:
parent
26c6b2eb79
commit
d9fe24c1f9
1 changed files with 4 additions and 10 deletions
|
@ -243,14 +243,7 @@ in buildFHSUserEnv rec {
|
|||
libvdpau
|
||||
] ++ steamPackages.steam-runtime-wrapped.overridePkgs) ++ extraLibraries pkgs;
|
||||
|
||||
extraBuildCommands = ''
|
||||
if [ -f $out/usr/share/vulkan/icd.d/nvidia_icd.json ]; then
|
||||
cp $out/usr/share/vulkan/icd.d/nvidia_icd{,32}.json
|
||||
nvidia32Lib=$(realpath $out/lib32/libGLX_nvidia.so.0 | cut -d'/' -f-4)
|
||||
escapedNvidia32Lib="''${nvidia32Lib//\//\\\/}"
|
||||
sed -i "s/\/nix\/store\/.*\/lib\/libGLX_nvidia\.so\.0/$escapedNvidia32Lib\/lib\/libGLX_nvidia\.so\.0/g" $out/usr/share/vulkan/icd.d/nvidia_icd32.json
|
||||
fi
|
||||
'' + (if (!nativeOnly) then ''
|
||||
extraBuildCommands = if (!nativeOnly) then ''
|
||||
mkdir -p steamrt
|
||||
ln -s ../lib/steam-runtime steamrt/${steam-runtime-wrapped.arch}
|
||||
${lib.optionalString (steam-runtime-wrapped-i686 != null) ''
|
||||
|
@ -263,7 +256,7 @@ in buildFHSUserEnv rec {
|
|||
${lib.optionalString (steam-runtime-wrapped-i686 != null) ''
|
||||
ln -s /usr/lib32/libbz2.so usr/lib32/libbz2.so.1.0
|
||||
''}
|
||||
'');
|
||||
'';
|
||||
|
||||
extraInstallCommands = ''
|
||||
mkdir -p $out/share/applications
|
||||
|
@ -284,7 +277,8 @@ in buildFHSUserEnv rec {
|
|||
|
||||
export STEAM_RUNTIME=${if nativeOnly then "0" else "/steamrt"}
|
||||
|
||||
export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/intel_icd.x86_64.json:/usr/share/vulkan/icd.d/intel_icd.i686.json:/usr/share/vulkan/icd.d/lvp_icd.x86_64.json:/usr/share/vulkan/icd.d/lvp_icd.i686.json:/usr/share/vulkan/icd.d/nvidia_icd.json:/usr/share/vulkan/icd.d/nvidia_icd32.json:/usr/share/vulkan/icd.d/radeon_icd.x86_64.json:/usr/share/vulkan/icd.d/radeon_icd.i686.json
|
||||
# XDG_DATA_DIRS is used by pressure-vessel and vulkan loaders to find the corresponding icd
|
||||
export XDG_DATA_DIRS=$XDG_DATA_DIRS''${XDG_DATA_DIRS:+:}/run/opengl-driver/share:/run/opengl-driver-32/share
|
||||
'' + extraProfile;
|
||||
|
||||
runScript = writeScript "steam-wrapper.sh" ''
|
||||
|
|
Loading…
Reference in a new issue