Skip to content

Bundling Steam

probonopd edited this page Apr 2, 2017 · 1 revision

Bundling Steam

People have asked for a Steam AppImage. Steam seems to behave very strangely and put its stuff all over $HOME. Wouldn't it be nice to have the Steam runtime and client be bundled in one neat read-only AppImage file that would bundle everything that Steam apparently needs, like a 32-bit linker and libraries?

Notes

This is just for my own reference at this point, as it is not working yet.

# ./usr/share/doc/steam/steam_install_agreement.txt.gz
# 1B. Limited Redistribution License
# allows to redistribute Steam in its entirety, provided that
# files containing the term “bootstrap” in the file name
# are not changed, and other provisions

mkdir steam
cd steam/

wget -c https://steamcdn-a.akamaihd.net/client/installer/steam.deb
dpkg -x steam.deb .

deb [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam

apt-get install steam-launcher # seems to be the same as the above

# Or
http://repo.steampowered.com/steam/archive/precise/steam_latest.tar.gz # again same payload
# but it still uses apt

tar xf steam_latest.tar.gz

steam/steam

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  cpp-6 gcc-6-base gcc-6-base:i386 libcc1-0 libdrm-amdgpu1 libdrm-amdgpu1:i386
  libdrm-intel1 libdrm-intel1:i386 libdrm-nouveau2 libdrm-nouveau2:i386
  libdrm-radeon1 libdrm-radeon1:i386 libdrm2 libdrm2:i386 libedit2:i386
  libegl1-mesa libelf1:i386 libexpat1:i386 libffi6:i386 libgbm1 libgcc1
  libgcc1:i386 libgfortran3 libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa
  libglapi-mesa:i386 libgles2-mesa libgomp1 libllvm4.0:i386 libmirclient9
  libmircommon7 libmircore1 libmirprotobuf3 libpciaccess0:i386 libquadmath0
  libsensors4:i386 libstdc++6 libstdc++6:i386 libtinfo5:i386
  libtxc-dxtn-s2tc:i386 libwayland-egl1-mesa libx11-6:i386 libx11-xcb1:i386
  libxau6:i386 libxcb-dri2-0:i386 libxcb-dri3-0:i386 libxcb-glx0:i386
  libxcb-present0:i386 libxcb-sync1:i386 libxcb1:i386 libxdamage1:i386
  libxdmcp6:i386 libxext6:i386 libxfixes3:i386 libxshmfence1:i386
  libxxf86vm1:i386 zlib1g:i386
Suggested packages:
  gcc-6-locales glibc-doc:i386 locales:i386 lm-sensors:i386 python-apt-dbg
  python-apt-doc
The following NEW packages will be installed:
  curl gcc-6-base:i386 libc6:i386 libdrm-amdgpu1:i386 libdrm-intel1:i386
  libdrm-nouveau2:i386 libdrm-radeon1:i386 libdrm2:i386 libedit2:i386
  libelf1:i386 libexpat1:i386 libffi6:i386 libgcc1:i386 libgl1-mesa-dri:i386
  libgl1-mesa-glx:i386 libglapi-mesa:i386 libllvm4.0:i386 libpciaccess0:i386
  libsensors4:i386 libstdc++6:i386 libtinfo5:i386 libtxc-dxtn-s2tc:i386
  libx11-6:i386 libx11-xcb1:i386 libxau6:i386 libxcb-dri2-0:i386
  libxcb-dri3-0:i386 libxcb-glx0:i386 libxcb-present0:i386 libxcb-sync1:i386
  libxcb1:i386 libxdamage1:i386 libxdmcp6:i386 libxext6:i386 libxfixes3:i386
  libxshmfence1:i386 libxxf86vm1:i386 python-apt zlib1g:i386
The following packages will be upgraded:
  cpp-6 gcc-6-base libcc1-0 libdrm-amdgpu1 libdrm-intel1 libdrm-nouveau2
  libdrm-radeon1 libdrm2 libegl1-mesa libgbm1 libgcc1 libgfortran3
  libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libgles2-mesa libgomp1
  libmirclient9 libmircommon7 libmircore1 libmirprotobuf3 libquadmath0
  libstdc++6 libwayland-egl1-mesa

me@host:~$ /home/me/Downloads/steam/steam
Running Steam on ubuntu 17.04 64-bit
STEAM_RUNTIME is enabled automatically
Installing breakpad exception handler for appid(steam)/version(0)
libGL error: unable to load driver: r600_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: r600
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast

BUT NOW
/home/me/.steam/bin/steam

# Starts to download a crazy shitload of stuff

[2017-04-02 13:12:33] Package file tenfoot_misc_all.zip.008ed314d467eecacba58d188fdf082d23f264d2 missing or incorrect size
[2017-04-02 13:12:33] Package file tenfoot_dicts_all.zip.87bb49891925214df2d745e12a53518fd2ea86f0 missing or incorrect size
[2017-04-02 13:12:33] Package file tenfoot_fonts_all.zip.vz.7673e4cd32b6752bc621d8bc1a7118a9af19b64a_12077027 missing or incorrect size
[2017-04-02 13:12:33] Package file tenfoot_ambientsounds_all.zip.12963b9dbc3d331e26559cc2d323ca0661942b6b missing or incorrect size
[2017-04-02 13:12:33] Package file tenfoot_sounds_all.zip.vz.ffef2b2fc386819a842ea79484b966a937c2ca7e_1209792 missing or incorrect size
[2017-04-02 13:12:33] Package file tenfoot_images_all.zip.vz.1fd7f0586e6dfeb8fb1c385aa1775de6c7007c05_29397462 missing or incorrect size
[2017-04-02 13:12:33] Package file tenfoot_all.zip.vz.90cd479e9f90d8c951062e042635284dcc702fc8_2264698 missing or incorrect size
[2017-04-02 13:12:33] Package file resources_misc_all.zip.vz.6596f073f874e66a5af7a41ca94e54e1b091fcb7_2030550 missing or incorrect size
[2017-04-02 13:12:33] Package file resources_all.zip.vz.e4473120a4f4551fe56a1c0b4fb67259933019ea_5053566 missing or incorrect size
[2017-04-02 13:12:33] Package file strings_en_all.zip.vz.df86c3dc958b9d8fa316c7d09871722dbdcce665_84922 missing or incorrect size
[2017-04-02 13:12:33] Package file strings_all.zip.vz.002d939ea5272fcd77bd5ba7582833a5f333d5f5_2107246 missing or incorrect size
[2017-04-02 13:12:33] Package file public_all.zip.vz.8b049a0bca557f33a96699930e9ff62968237449_752204 missing or incorrect size
[2017-04-02 13:12:33] Package file bins_ubuntu12.zip.vz.f6b2834b24bfce994387ee463543767c89ca71d8_16378549 missing or incorrect size
[2017-04-02 13:12:33] Package file bins_pub_ubuntu12.zip.vz.1029f1d4ce3663742f7a51a0e3c51adbe2ec6857_9037200 missing or incorrect size
[2017-04-02 13:12:33] Package file bins_sdk_ubuntu12.zip.vz.0488a6d51b2a4b312f2a25be1c341ddbe09c54bf_10539880 missing or incorrect size
[2017-04-02 13:12:33] Package file bins_codecs_ubuntu12.zip.vz.84b14918e1591ffd02e819b8f7fc79315dbedb03_1832666 missing or incorrect size
[2017-04-02 13:12:33] Package file bins_misc_ubuntu12.zip.cf9dc936aa2a0c125b11de645d091048f205431a missing or incorrect size
[2017-04-02 13:12:33] Package file webkit_ubuntu12.zip.vz.21f7fdb79ffcdcd93794340a220234f7aa45a4ff_43196149 missing or incorrect size
[2017-04-02 13:12:33] Package file miles_ubuntu12.zip.vz.4fd048667c97ef6eb976f4c42ce5c18f8695ac9e_295483 missing or incorrect size
[2017-04-02 13:12:33] Package file sdl2_ubuntu12.zip.vz.348a53e752d80c3688feca0c67456309bc42660b_278476 missing or incorrect size
[2017-04-02 13:12:33] Package file steam_ubuntu12.zip.vz.5b220861fc371778e4bb259fd361890dbe4665bc_1448423 missing or incorrect size
[2017-04-02 13:12:33] Package file runtime_part0_ubuntu12.zip.74bd7230dea7a12b91615e70c0f6b82866558915 missing or incorrect size
[2017-04-02 13:12:33] Package file runtime_part1_ubuntu12.zip.bc5c3df828cc2fe31d3ae3819ea4dbeb5537332c missing or incorrect size

# Seems to have downloaded and installed something, but running it a second time gives

[2017-04-02 13:15:14] Startup - updater built Mar 22 2017 23:44:00
Installing breakpad exception handler for appid(steam)/version(1490228413)
Installing breakpad exception handler for appid(steam)/version(1490228413)
[2017-04-02 13:15:14] Verifying installation...
[2017-04-02 13:15:14] Verification complete
Failed to load steamui.so - dlerror(): steamui.so: cannot open shared object file: No such file or directory

/home/me/.steam/steam/steam.sh
# Says "unpacking Steam runtime"
# and then LAUNCHES Steam! Finally!

# Jay, I can launch it like this:

LD_LIBRARY_PATH=/home/me/.steam/steam/ubuntu12_32:/home/me/.steam/steam/ubuntu12_32/panorama:/lib/i386-linux-gnu:/usr/lib/i386-linux-gnu:/usr/lib/i386-linux-gnu/mesa:/usr/local/lib:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu/mesa-egl:/usr/lib/x86_64-linux-gnu/mesa:/lib:/usr/lib:/home/me/.steam/steam/ubuntu12_32/steam-runtime/i386/lib/i386-linux-gnu:/home/me/.steam/steam/ubuntu12_32/steam-runtime/i386/lib:/home/me/.steam/steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu:/home/me/.steam/steam/ubuntu12_32/steam-runtime/i386/usr/lib:/home/me/.steam/steam/ubuntu12_32/steam-runtime/amd64/lib/x86_64-linux-gnu:/home/me/.steam/steam/ubuntu12_32/steam-runtime/amd64/lib:/home/me/.steam/steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu:/home/me/.steam/steam/ubuntu12_32/steam-runtime/amd64/usr/lib: /home/me/.steam/steam/ubuntu12_32/steam

But then, if you look at it, it is not THAT bad:

me@host:~/Downloads/steam$ LD_LIBRARY_PATH=/home/me/.steam/steam/ubuntu12_32:/home/me/.steam/steam/ubuntu12_32/panorama:/lib/i386-linux-gnu:/usr/lib/i386-linux-gnu:/usr/lib/i386-linux-gnu/mesa:/usr/local/lib:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu/mesa-egl:/usr/lib/x86_64-linux-gnu/mesa:/lib:/usr/lib:/home/me/.steam/steam/ubuntu12_32/steam-runtime/i386/lib/i386-linux-gnu:/home/me/.steam/steam/ubuntu12_32/steam-runtime/i386/lib:/home/me/.steam/steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu:/home/me/.steam/steam/ubuntu12_32/steam-runtime/i386/usr/lib:/home/me/.steam/steam/ubuntu12_32/steam-runtime/amd64/lib/x86_64-linux-gnu:/home/me/.steam/steam/ubuntu12_32/steam-runtime/amd64/lib:/home/me/.steam/steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu:/home/me/.steam/steam/ubuntu12_32/steam-runtime/amd64/usr/lib: ldd /home/me/.steam/steam/ubuntu12_32/steam
	linux-gate.so.1 =>  (0xf7706000)
	libX11.so.6 => /usr/lib/i386-linux-gnu/libX11.so.6 (0xf7192000)
	librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xf7189000)
	libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf7133000)
	libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf712e000)
	libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xf6fab000)
	libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf6f8e000)
	libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf6dd4000)
	libxcb.so.1 => /usr/lib/i386-linux-gnu/libxcb.so.1 (0xf6dae000)
	/lib/ld-linux.so.2 (0x565ec000)
	libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf6d90000)
	libXau.so.6 => /usr/lib/i386-linux-gnu/libXau.so.6 (0xf6d8c000)
	libXdmcp.so.6 => /usr/lib/i386-linux-gnu/libXdmcp.so.6 (0xf6d85000)

Now, why is it using stuff from e.g., /usr/lib/i386-linux-gnu/libstdc++.so.6 and not from its own runtime?

It would be available in
/home/me/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6

patchelf --print-rpath /home/me/.steam/steam/ubuntu12_32/steam
# EMPTY

patchelf --set-rpath '$ORIGIN:$ORIGIN/steam-runtime/i386/usr/lib/i386-linux-gnu/' /home/me/.steam/steam/ubuntu12_32/steam

find /home/me/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/ -name '*.so*' -exec patchelf --set-rpath '$ORIGIN' {} \;

# Looks like as soon as I modify Steam, it reinstalls itself

https://wiki.archlinux.org/index.php/Steam/Troubleshooting#Steam_runtime_issues