summary refs log tree commit diff
path: root/pkgs/games
diff options
context:
space:
mode:
authorJonathan Ringer <jonringer117@gmail.com>2020-07-30 16:51:38 -0700
committerJon <jonringer@users.noreply.github.com>2020-08-08 13:27:55 -0700
commit7a18043f650065682ba6b8ea964393bdd790f485 (patch)
treea6e83814140f3ce785aa81acdf21fc4f9624ebc0 /pkgs/games
parent08ba31a6606bab9fc226c64866ea341581a1975b (diff)
downloadnixpkgs-7a18043f650065682ba6b8ea964393bdd790f485.tar
nixpkgs-7a18043f650065682ba6b8ea964393bdd790f485.tar.gz
nixpkgs-7a18043f650065682ba6b8ea964393bdd790f485.tar.bz2
nixpkgs-7a18043f650065682ba6b8ea964393bdd790f485.tar.lz
nixpkgs-7a18043f650065682ba6b8ea964393bdd790f485.tar.xz
nixpkgs-7a18043f650065682ba6b8ea964393bdd790f485.tar.zst
nixpkgs-7a18043f650065682ba6b8ea964393bdd790f485.zip
steam: chroot: export STEAM_LD_LIBRARY_PATH
Diffstat (limited to 'pkgs/games')
-rw-r--r--pkgs/games/steam/chrootenv.nix10
1 files changed, 9 insertions, 1 deletions
diff --git a/pkgs/games/steam/chrootenv.nix b/pkgs/games/steam/chrootenv.nix
index 56e1a09f36e..2c7cde78c43 100644
--- a/pkgs/games/steam/chrootenv.nix
+++ b/pkgs/games/steam/chrootenv.nix
@@ -42,6 +42,12 @@ let
   ldPath = map (x: "/steamrt/${steam-runtime-wrapped.arch}/" + x) steam-runtime-wrapped.libs
            ++ lib.optionals (steam-runtime-wrapped-i686 != null) (map (x: "/steamrt/${steam-runtime-wrapped-i686.arch}/" + x) steam-runtime-wrapped-i686.libs);
 
+  # Zachtronics and a few other studios expect STEAM_LD_LIBRARY_PATH to be present
+  exportLDPath = ''
+    export LD_LIBRARY_PATH=/lib32:/lib64:${lib.concatStringsSep ":" ldPath}\''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
+    export STEAM_LD_LIBRARY_PATH="$STEAM_LD_LIBRARY_PATH''${STEAM_LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
+  '';
+
   setupSh = writeScript "setup.sh" ''
     #!${runtimeShell}
   '';
@@ -54,6 +60,7 @@ let
       exit 0
     fi
     export LD_LIBRARY_PATH="$runtime_paths''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
+    export STEAM_LD_LIBRARY_PATH="$STEAM_LD_LIBRARY_PATH''${STEAM_LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
     exec "$@"
   '';
 
@@ -251,6 +258,7 @@ in buildFHSUserEnv rec {
     EOF
       fi
     fi
+    ${lib.optionalString (!nativeOnly) exportLDPath}
     exec steam "$@"
   '';
 
@@ -272,7 +280,7 @@ in buildFHSUserEnv rec {
         exit 1
       fi
       shift
-      ${lib.optionalString (!nativeOnly) "export LD_LIBRARY_PATH=/lib32:/lib64:${lib.concatStringsSep ":" ldPath}\${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"}
+      ${lib.optionalString (!nativeOnly) exportLDPath}
       exec -- "$run" "$@"
     '';
   };