Build steam for aarch64 on Valve's native arm64 client
Arch ships steam for x86_64 only, so on AArch64 `omarchy-pkg-add steam` found nothing. This aarch64 build installs the same Valve launcher files (desktop entry, icons, steam-devices udev rules) but replaces the x86 bootstrap with Valve's native arm64 client, which then updates itself from the stable steam_client_linuxarm64 channel. The bootstrap is just the client binary, which links only glibc, taken from the manifest's bins_linuxarm64_linuxarm64 zip and pinned to the sha2 the manifest publishes. /usr/bin/steam unpacks it on first launch, keeps the ~/.steam links the client requires, and restarts the client when it exits with 42 after updating. Valve's bin_steam.sh cannot do this: it only knows the ubuntu12_32 bootstrap. Beyond Arch's dependencies the client needs gtk2 and libibus for its UI, and lsof, which it runs to find its own IPC ports.
This commit is contained in:
1 parent
17724a8018
commit
97a8032cd5
3 files changed
+174
No files matched your search
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"source": "local"
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
# Maintainer: Ryan Hughes <ryan@omarchy.org>
|
||||
# Contributor: Levente Polyak <anthraxx[at]archlinux[dot]org>
|
||||
# Contributor: Giancarlo Razzolini <grazzolini@archlinux.org>
|
||||
# Contributor: Christian Heusel <gromit@archlinux.org>
|
||||
#
|
||||
# Arch builds steam for x86_64 only; this is the aarch64 build. It installs
|
||||
# the same Valve launcher files (desktop entry, icons, udev rules) but swaps
|
||||
# the x86 bootstrap for Valve's native arm64 client, which then updates itself
|
||||
# from Valve's linuxarm64 client channel. _client is the client build the
|
||||
# bootstrap was taken from; it only matters for the first launch, so it moves
|
||||
# with the launcher rather than with every client release.
|
||||
|
||||
pkgbase=steam
|
||||
pkgname=(steam steam-devices)
|
||||
pkgver=1.0.0.87
|
||||
pkgrel=1
|
||||
_client=1788652215
|
||||
_client_zip=bins_linuxarm64_linuxarm64.zip.dc817d33f8308815bf4fde6a3cb61fd4529728c8
|
||||
pkgdesc="Valve's digital software delivery system"
|
||||
url='https://steampowered.com/'
|
||||
arch=('aarch64')
|
||||
license=('LicenseRef-steam-subscriber-agreement')
|
||||
# the beta directory is a superset of stable and also contains the stable releases
|
||||
source=(
|
||||
"https://repo.steampowered.com/$pkgbase/archive/beta/${pkgbase}_$pkgver.tar.gz"
|
||||
"$pkgbase-client-$_client.zip::https://client-update.steamstatic.com/$_client_zip"
|
||||
steam.sh
|
||||
)
|
||||
noextract=("$pkgbase-client-$_client.zip")
|
||||
# The client checksum is the sha2 Valve's steam_client_linuxarm64 manifest
|
||||
# publishes for that zip.
|
||||
sha256sums=('649375d2f9377f8009aaf3e2ff09978041eb9114897d9c5a3886f1d82e27ba1f'
|
||||
'c2d7c0ecb8de7e209504cd657b785127cd1ac3d905668c296e87c360b2b54163'
|
||||
'6f8d705e7d615b2debf8449898c51ad687136cd8f6605ef3c7573b4aa768e342')
|
||||
|
||||
build() {
|
||||
# The arm64 counterpart of Valve's bootstraplinux_ubuntu12_32.tar.xz. The
|
||||
# client binary links only glibc and downloads the rest of Steam itself.
|
||||
mkdir -p bootstrap
|
||||
bsdtar -xf "$pkgbase-client-$_client.zip" -C bootstrap steamrtarm64/steam
|
||||
chmod 755 bootstrap/steamrtarm64 bootstrap/steamrtarm64/steam
|
||||
tar --sort=name --mtime="@$SOURCE_DATE_EPOCH" --owner=0 --group=0 --numeric-owner \
|
||||
-cJf bootstraplinux_linuxarm64.tar.xz -C bootstrap steamrtarm64
|
||||
}
|
||||
|
||||
package_steam() {
|
||||
# Libraries the arm64 client links against from the host, plus lsof, which
|
||||
# the client runs to find its own IPC ports.
|
||||
depends=(
|
||||
alsa-lib
|
||||
at-spi2-core
|
||||
bash
|
||||
cairo
|
||||
coreutils
|
||||
dbus
|
||||
fontconfig
|
||||
freetype2
|
||||
gdk-pixbuf2
|
||||
glib2
|
||||
glibc
|
||||
gtk2
|
||||
hicolor-icon-theme
|
||||
libcups
|
||||
libdrm
|
||||
libgcc
|
||||
libglvnd
|
||||
libibus
|
||||
libnm
|
||||
libpipewire
|
||||
libpulse
|
||||
libsm
|
||||
libstdc++
|
||||
libva
|
||||
libvdpau
|
||||
libx11
|
||||
libxcomposite
|
||||
libxdamage
|
||||
libxext
|
||||
libxfixes
|
||||
libxi
|
||||
libxinerama
|
||||
libxkbcommon
|
||||
libxrandr
|
||||
libxrender
|
||||
libxtst
|
||||
lsof
|
||||
mesa
|
||||
nss
|
||||
openal
|
||||
pango
|
||||
sdl2-compat
|
||||
systemd-libs
|
||||
tar
|
||||
ttf-font
|
||||
vulkan-driver
|
||||
vulkan-icd-loader
|
||||
xdg-user-dirs
|
||||
xz
|
||||
)
|
||||
optdepends=(
|
||||
'ntsync-autoload: for NTSync support'
|
||||
'polkit: to setup SteamVR without root access'
|
||||
'xdg-desktop-portal-impl: file & folder picker'
|
||||
'xorg-fonts-misc: for non-latin locales'
|
||||
)
|
||||
depends+=(steam-devices)
|
||||
|
||||
cd "$pkgbase-launcher"
|
||||
make DESTDIR="$pkgdir" install-docs install-icons install-desktop install-appdata
|
||||
|
||||
install -Dm755 "$srcdir/steam.sh" "$pkgdir/usr/bin/steam"
|
||||
install -Dm644 "$srcdir/bootstraplinux_linuxarm64.tar.xz" -t "$pkgdir/usr/lib/steam"
|
||||
|
||||
install -d "$pkgdir/usr/share/licenses/$pkgname"
|
||||
ln -s "../../doc/$pkgname/steam_subscriber_agreement.txt" "$pkgdir/usr/share/licenses/$pkgname/"
|
||||
install -Dm644 debian/changelog -t "$pkgdir/usr/share/doc/$pkgname"
|
||||
}
|
||||
|
||||
package_steam-devices() {
|
||||
pkgdesc="List of devices Steam and SteamVR will want read/write permissions on"
|
||||
license=(MIT)
|
||||
depends=(udev)
|
||||
|
||||
cd "$srcdir/$pkgbase-launcher/subprojects/steam-devices"
|
||||
|
||||
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
||||
install -Dm644 60-steam-input.rules "$pkgdir/usr/lib/udev/rules.d/60-steam-input.rules"
|
||||
install -Dm644 60-steam-vr.rules "$pkgdir/usr/lib/udev/rules.d/60-steam-vr.rules"
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
# Launches Valve's native arm64 Steam client.
|
||||
#
|
||||
# Valve's own launcher (bin_steam.sh) only knows the x86 bootstrap, so this
|
||||
# does its job for linuxarm64: unpack the client on first run, keep the
|
||||
# ~/.steam links the client refuses to start without, and start the client
|
||||
# again whenever it exits asking to be restarted after updating itself.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
bootstrap=/usr/lib/steam/bootstraplinux_linuxarm64.tar.xz
|
||||
# The exit status Steam uses to ask to be started again.
|
||||
restart_status=42
|
||||
|
||||
if [[ $(id -u) == 0 ]]; then
|
||||
echo "steam: cannot run as root" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Like Valve's launcher, follow ~/.steam/steam when it points at a working
|
||||
# install, so a library that was moved keeps working.
|
||||
steamroot=$(readlink -e "$HOME/.steam/steam" || true)
|
||||
if [[ -z $steamroot || ! -x $steamroot/steamrtarm64/steam ]]; then
|
||||
steamroot=${XDG_DATA_HOME:-$HOME/.local/share}/Steam
|
||||
if [[ ! -x $steamroot/steamrtarm64/steam ]]; then
|
||||
(umask 077 && mkdir -p "$steamroot" && tar -xJf "$bootstrap" -C "$steamroot")
|
||||
fi
|
||||
fi
|
||||
|
||||
mkdir -p "$HOME/.steam"
|
||||
ln -sfn "$steamroot" "$HOME/.steam/steam"
|
||||
ln -sfn "$steamroot" "$HOME/.steam/root"
|
||||
# The arm64 counterpart of the sdk32/sdk64 links steam.sh makes for games
|
||||
# that load the Steam API from ~/.steam.
|
||||
ln -sfn "$steamroot/linuxarm64" "$HOME/.steam/sdkarm64"
|
||||
|
||||
cd "$steamroot"
|
||||
while :; do
|
||||
status=0
|
||||
"$steamroot/steamrtarm64/steam" "$@" || status=$?
|
||||
((status == restart_status)) || exit "$status"
|
||||
done
|
||||
Reference in new issue
Block a user