mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 05:16:01 +00:00
fix: a half-built steamrt shim is removed, and its launcher accepts --directory DIR
This commit is contained in:
1 parent
2eb18f5540
commit
70eec3cc32
3 files changed
+17
-2
No files matched your search
@@ -521,7 +521,7 @@ ln -sfn "$STEAM_X64/ubuntu12_64" "$X64_HOME/.steam/bin64"
|
||||
ln -sfn "$STEAM_X64/linux32" "$X64_HOME/.steam/sdk32"
|
||||
ln -sfn "$STEAM_X64/linux64" "$X64_HOME/.steam/sdk64"
|
||||
# Valve's Steam Runtime container needs user namespaces and a session-bus launcher; steamrt-shim stands in for both.
|
||||
droiddeck-steamrt-shim "$STEAM_X64/steamrt64" "$X64_HOME/steamrt-shim" || true
|
||||
droiddeck-steamrt-shim "$STEAM_X64/steamrt64" "$X64_HOME/steamrt-shim" || rm -rf "$X64_HOME/steamrt-shim"
|
||||
# Valve's platform libraries ship without soname links (pressure-vessel makes them); ldconfig adds them here.
|
||||
srt_libs=$X64_HOME/steamrt-libs
|
||||
rm -rf "$srt_libs"
|
||||
|
||||
@@ -15,6 +15,7 @@ if [ -z "$srt_real" ] || [ ! -d "$srt_real" ]; then
|
||||
exit 1
|
||||
fi
|
||||
rm -rf "$shim"
|
||||
trap 'rm -rf "$shim"' ERR
|
||||
mkdir -p "$shim/bin"
|
||||
for e in "$srt_real"/* "$srt_real"/.[!.]*; do
|
||||
[ -e "$e" ] || continue
|
||||
@@ -40,6 +41,14 @@ while [ $# -gt 0 ]; do
|
||||
--directory=*) cd "${1#--directory=}" || exit 127 ;;
|
||||
--env=*) export "${1#--env=}" ;;
|
||||
--unset-env=*) unset "${1#--unset-env=}" ;;
|
||||
--directory|--env|--unset-env)
|
||||
[ $# -ge 2 ] || exit 127
|
||||
case $1 in
|
||||
--directory) cd "$2" || exit 127 ;;
|
||||
--env) export "$2" ;;
|
||||
--unset-env) unset "$2" ;;
|
||||
esac
|
||||
shift ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
@@ -46,6 +46,12 @@ class SteamrtShimTest(unittest.TestCase):
|
||||
launched = self.sh(self.shim / 'bin/steam-runtime-launch-client', '--env=BL_SHIM_TEST=yes',
|
||||
f'--directory={self.root}', '--', 'sh', '-c', 'echo "$BL_SHIM_TEST $(basename "$PWD")"')
|
||||
self.assertEqual(f'yes {self.root.name}\n', launched.stdout)
|
||||
launched = self.sh(self.shim / 'bin/steam-runtime-launch-client', '--env', 'BL_SHIM_TEST=split',
|
||||
'--directory', self.root, '--', 'sh', '-c', 'echo "$BL_SHIM_TEST $(basename "$PWD")"')
|
||||
self.assertEqual(f'split {self.root.name}\n', launched.stdout)
|
||||
missing = self.sh(self.shim / 'bin/steam-runtime-launch-client', '--directory', self.root / 'missing',
|
||||
'--', 'true')
|
||||
self.assertEqual(127, missing.returncode)
|
||||
|
||||
def test_a_client_without_a_container_gets_no_shim(self):
|
||||
self.shim.mkdir()
|
||||
@@ -82,7 +88,7 @@ class SteamrtShimTest(unittest.TestCase):
|
||||
self.assertLess(guard, SESSION.index('"${steam_client[@]}" "${_bl_ui[@]}"'))
|
||||
self.assertIn('-u STEAM_STEAMRT_RECURSION_GUARD', SESSION[:guard])
|
||||
self.assertIn('export STEAM_STEAMRT_RECURSION_GUARD=1', X64)
|
||||
self.assertIn('droiddeck-steamrt-shim "$STEAM_X64/steamrt64" "$X64_HOME/steamrt-shim"', X64)
|
||||
self.assertIn('droiddeck-steamrt-shim "$STEAM_X64/steamrt64" "$X64_HOME/steamrt-shim" || rm -rf "$X64_HOME/steamrt-shim"', X64)
|
||||
|
||||
|
||||
class SessionChannelTest(unittest.TestCase):
|
||||
|
||||
Reference in new issue
Block a user