diff --git a/handheld/cachyos-handheld/.SRCINFO b/handheld/cachyos-handheld/.SRCINFO index 97005fcdb..e06bb2ac4 100644 --- a/handheld/cachyos-handheld/.SRCINFO +++ b/handheld/cachyos-handheld/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = cachyos-handheld pkgdesc = CachyOS - Handheld! pkgver = 1.3.2 - pkgrel = 1 + pkgrel = 2 url = https://github.com/CachyOS/CachyOS-Handheld install = cachyos-handheld.install arch = any @@ -16,7 +16,7 @@ pkgbase = cachyos-handheld depends = mesa-utils depends = plasma-login-manager depends = scx-scheds - depends = steam + depends = steamos-jupiter-stable provides = cachyos-deckify replaces = cachyos-deckify options = !strip diff --git a/handheld/cachyos-handheld/PKGBUILD b/handheld/cachyos-handheld/PKGBUILD index 0db221891..28d910322 100644 --- a/handheld/cachyos-handheld/PKGBUILD +++ b/handheld/cachyos-handheld/PKGBUILD @@ -3,7 +3,7 @@ pkgname=cachyos-handheld pkgver=1.3.2 -pkgrel=1 +pkgrel=2 arch=('any') license=('GPL-3.0-later') pkgdesc='CachyOS - Handheld!' @@ -30,7 +30,7 @@ depends=( 'mesa-utils' 'plasma-login-manager' 'scx-scheds' - 'steam' + 'steamos-jupiter-stable' ) package() { diff --git a/handheld/cachyos-handheld/cachyos-handheld.install b/handheld/cachyos-handheld/cachyos-handheld.install index 9a06249f8..e5fa2b799 100644 --- a/handheld/cachyos-handheld/cachyos-handheld.install +++ b/handheld/cachyos-handheld/cachyos-handheld.install @@ -30,29 +30,6 @@ EOF fi } -bootstrap_setup() { - # Use SteamOS bootstrap to speed up first boot setup. - URL="https://steamdeck-packages.steamos.cloud/archlinux-mirror/jupiter-main/os/x86_64/steam-jupiter-stable-1.0.0.85-2-x86_64.pkg.tar.zst" - BOOTSTRAP_SHA512=a013473d28a9d10a865b543ee1c42fa514c4af383b63f7dbf8e38d18e358ebdbc247caff1e39cc372a71b05fdd506f2356e1af0c5404a95f6615191d994e0fbf - - echo "Downloading SteamOS bootstrap" - curl -o /tmp/steam-jupiter-stable.tar.zst "$URL" - - echo "Extracting /tmp/bootstraplinux_ubuntu12_32.tar.xz" - tar -I zstd -xOf /tmp/steam-jupiter-stable.tar.zst usr/lib/steam/bootstraplinux_ubuntu12_32.tar.xz > /tmp/bootstraplinux_ubuntu12_32.tar.xz - - echo "$BOOTSTRAP_SHA512 /tmp/bootstraplinux_ubuntu12_32.tar.xz" | sha512sum -c - >/dev/null 2>&1 || { - echo "Extraction failed!" - exit 1 - } - - # Move to Steam path - mv -f /tmp/bootstraplinux_ubuntu12_32.tar.xz /usr/lib/steam/bootstraplinux_ubuntu12_32.tar.xz - - # Cleanup - rm -f /tmp/steam-jupiter-stable.tar.zst /tmp/bootstraplinux_ubuntu12_32.tar.xz -} - post_install() { # Use scx_lavd as default scheduler scx_lavd_default @@ -66,7 +43,6 @@ post_install() { ln -sf /usr/lib/systemd/system/plasmalogin.service /etc/systemd/system/display-manager.service # First boot setup - bootstrap_setup touch /etc/handheld-first-boot # Update users plasmalogin config to reflect the changes diff --git a/handheld/steam-jupiter-stable/.nvchecker.toml b/handheld/steam-jupiter-stable/.nvchecker.toml new file mode 100644 index 000000000..f4fc34043 --- /dev/null +++ b/handheld/steam-jupiter-stable/.nvchecker.toml @@ -0,0 +1,4 @@ +[steam-jupiter-stable] +source = "regex" +url = "https://steamdeck-packages.steamos.cloud/archlinux-mirror/jupiter-main/os/x86_64/" +regex = "steam-jupiter-stable-([\\d.]+)-\\d+-x86_64\\.pkg\\.tar\\.zst" diff --git a/handheld/steam-jupiter-stable/99-power-wakeup.rules b/handheld/steam-jupiter-stable/99-power-wakeup.rules new file mode 100644 index 000000000..c7f4e933c --- /dev/null +++ b/handheld/steam-jupiter-stable/99-power-wakeup.rules @@ -0,0 +1,5 @@ +# 3x PIDs (USB-Puck, USB-Neried (internal), USB-Controller) need to wake up Fremont + +ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="1302", ATTR{power/wakeup}="enabled" +ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="1304", ATTR{power/wakeup}="enabled" +ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="1305", ATTR{power/wakeup}="enabled" diff --git a/handheld/steam-jupiter-stable/PKGBUILD b/handheld/steam-jupiter-stable/PKGBUILD new file mode 100644 index 000000000..1f0241f61 --- /dev/null +++ b/handheld/steam-jupiter-stable/PKGBUILD @@ -0,0 +1,137 @@ +# Maintainer: John Schoenick +# Maintainer: Levente Polyak +# Maintainer: Giancarlo Razzolini +# Contributor: Daniel Wallace +# Contributor: K900 + +_basename=steam +pkgname=steam-jupiter-stable +pkgver=1.0.0.85 +pkgrel=9 +pkgdesc="Valve's digital software delivery system - Jupiter bootstrapped packaging" +url='https://steampowered.com/' +arch=('x86_64') +license=('custom') +depends=( + bash + desktop-file-utils + diffutils + hicolor-icon-theme + curl + dbus + freetype2 + gdk-pixbuf2 + ttf-font + zenity + lsb-release + nss + usbutils + xorg-xrandr + vulkan-driver + vulkan-icd-loader + lsof + 'python>=3.13' + 'python<3.14' + xdg-user-dirs + glibc + libxcrypt + libxcrypt-compat + gcc-libs +) +depends_x86_64=( + # Holo + # https://gitlab.archlinux.org/archlinux/packaging/packages/steam/-/issues/9 + lib32-pipewire + # https://gitlab.archlinux.org/archlinux/packaging/packages/steam/-/issues/6 + lib32-fontconfig + # https://gitlab.archlinux.org/archlinux/packaging/packages/steam/-/issues/10 + lib32-systemd + lib32-libxinerama + # https://gitlab.archlinux.org/archlinux/packaging/packages/steam/-/issues/11 + lib32-libnm + lib32-libva + + lib32-glibc + lib32-libxcrypt + lib32-libxcrypt-compat + lib32-libgl + lib32-gcc-libs + lib32-libx11 + lib32-libxss + lib32-alsa-plugins + lib32-libgpg-error + lib32-nss + lib32-vulkan-driver + lib32-vulkan-icd-loader +) +provides=('steam') +conflicts=('steam') + +# Jupiter: Drops native-runtime patches +# optdepends=('steam-native-runtime: steam native runtime support') +optdepends=('lib32-libnm: integration with networkmanager') + +# Jupiter: Including fully bootstrapped steam image on expected branch +_fat_bootstrap=steam_jupiter_stable_bootstrapped_20251031.0.tar.xz +noextract=("$_fat_bootstrap") +source=(https://repo.steampowered.com/${_basename}/archive/beta/${_basename}_${pkgver}{.tar.gz,.dsc} + https://steamdeck-packages.steamos.cloud/misc/steam-snapshots/"$_fat_bootstrap" + 99-power-wakeup.rules + steam-jupiter.sh + steam-runtime.sh + # Remove when we go to 1.0.0.81 (https://gitlab.steamos.cloud/holo-team/tasks/-/issues/1398) + bin_steam.sh + ) +sha512sums=('81d404fcbd516fa1d984a991be3530855c0ded826ea8aca68c8cb5492e95d3d430cd7c556a9997a7c0780055a810239322181b1785e78f8d8fabe01c39fee2f7' + 'e3722d006485249fc91113feee0df018d341dc8d7327199a9161022c84b04ca5faa2be36268d50ae0bc29b6fd6063fe2b69a29a354adb32dd6b75d78dc7f9702' + 'a013473d28a9d10a865b543ee1c42fa514c4af383b63f7dbf8e38d18e358ebdbc247caff1e39cc372a71b05fdd506f2356e1af0c5404a95f6615191d994e0fbf' + '34f667354b8e0b1bd28c4c4abd3072fa36d3e470a5d1dcab5461ae8f7025f3862079e70396afe561af0d2d52ac4191336a3c595427e20429ca97a33c1eae0b2d' + '2bb741aa1698f354ba98d48ceaaf0eb1dd76b4c08078a51e34ab4b94a8129105c89d17fa7786499e6337562fef5c2d3fe9633ec490b31b8ddb9afc2afec9af7f' + '5e75c019e9fe8c67d686c4e3343dac1180a69a4bdb7d39b333415c63201eef9b98da5619dbf6fd8daa6884e65bc7f8afc9e52778682425e5a75987d527eae6f0' + '47e2b8d2ecdb40ef2d5555e31122f1e863920998089f9dc7ce58b112ba72df6745ae30927ef158cfa735faad41b82bd6cdf25e9c69d7e780374648f57bdc3b72') +b2sums=('6cc699e7b740693529845ef76d39570a977716735da46e21b681629aebf3e5ee80b09a3b47b1c84debb066ca43456f1c78509de7ddfe8e35df21903cceebde4f' + '833edc4b6b8aa32861fb6caccdc4f7441a0462600315b68eae0bbbebf7c94cc64a8be61ce2e30842ea2f354ac0630898b7829d0d9eafd97eb7b621a72befb897' + '05d91f055a0ce36737d065705d4817d57381a6e28a055cc505b4ddd3e2546e4bee8fa5e0d0c17df45bbb3caac0e8fd57aed7277f8c43b0f5a40c0feb83218c81' + '5165ac5f212abb2bcf31fdcb492c06a49772f9203bdb2e6c66d4ecc620b863f34405d228ffa314935d00b08f7539e5007ed37af90d119029075b1d7a4d02bc62' + '26b6a0c04f414c623dcace7ac6d5e0ed398bd2fe2f7ab2b5408f6a9b0d2be66bbddaaded3b5b637edaf23697a718eb0cedd77294c92e6c8f3d2ced2f84a2f3b8' + 'c6bac99336b7c30fec7cdbaf9e949555c687dd9dff50bcae136134d6314f4b841f5fc66ddb2caac1b003690b926fd4afbdc11da143b4674db4b75f27709fdd23' + 'fb6df965a9e537835262a2e0e722469799d72b2a7afa1793efa69685a60dfb8624e25f9dced7dcde2549eb4c2a37fc588593e6182c83a77956e4263e0c87853e') + +validpgpkeys=('BA1816EF8E75005FCF5E27A1F24AEA9FB05498B7') # linux@steampowered.com + +package() { + cd ${_basename}-launcher + make DESTDIR="${pkgdir}" install + + install -Dm 755 "${srcdir}/steam-runtime.sh" "${pkgdir}/usr/bin/steam-runtime" + install -d "${pkgdir}/usr/lib/steam" + mv "${pkgdir}/usr/bin/steam" "${pkgdir}/usr/lib/steam/steam" + ln -sf /usr/bin/steam-runtime "${pkgdir}/usr/bin/steam" + + install -Dm 644 COPYING steam_subscriber_agreement.txt -t "${pkgdir}/usr/share/licenses/${pkgname}" + install -Dm 644 debian/changelog -t "${pkgdir}/usr/share/doc/${pkgname}" + + # blank steamdeps because apt-get + ln -sf /usr/bin/true "${pkgdir}/usr/bin/steamdeps" + + install -Dm 644 subprojects/steam-devices/60-steam-input.rules \ + "${pkgdir}/usr/lib/udev/rules.d/60-steam-input.rules" + install -Dm 644 subprojects/steam-devices/60-steam-vr.rules \ + "${pkgdir}/usr/lib/udev/rules.d/60-steam-vr.rules" + + # Additional wakeup rules for fremont. These should be upstreamed + install -Dm 644 "${srcdir}/99-power-wakeup.rules" \ + "${pkgdir}/usr/lib/udev/rules.d/99-power-wakeup.rules" + + # Jupiter + # Replace the runtime with our own wrapper + rm "${pkgdir}/usr/bin/steam-runtime" + install -Dm 755 "${srcdir}/steam-jupiter.sh" "${pkgdir}/usr/bin/steam-jupiter" + ln -sf /usr/bin/steam-jupiter "${pkgdir}/usr/bin/steam" + + # Replace bootstrapper with fat one + rm "$pkgdir"/usr/lib/steam/bootstraplinux_ubuntu12_32.tar.xz + install -Dm 644 "$srcdir/$_fat_bootstrap" "$pkgdir"/usr/lib/steam/bootstraplinux_ubuntu12_32.tar.xz +} + +# vim: ts=2 sw=2 et: diff --git a/handheld/steam-jupiter-stable/bin_steam.sh b/handheld/steam-jupiter-stable/bin_steam.sh new file mode 100755 index 000000000..91d251985 --- /dev/null +++ b/handheld/steam-jupiter-stable/bin_steam.sh @@ -0,0 +1,232 @@ +#!/usr/bin/env bash +# +# bin_steam.sh - launcher script for Steam on Linux +# Copyright Valve Corporation. All rights reserved +# +# This is the Steam script that typically resides in /usr/bin +# It will create the Steam bootstrap if necessary and then launch steam. + +# verbose +#set -x + +set -e + +# Get the full name of this script +STEAMSCRIPT="$(cd "${0%/*}" && echo "$PWD")/${0##*/}" +export STEAMSCRIPT +bootstrapscript="$(readlink -f "$STEAMSCRIPT")" +bootstrapdir="$(dirname "$bootstrapscript")" + +log () { + echo "bin_steam.sh[$$]: $*" >&2 || : +} + +export STEAMSCRIPT_VERSION=1.0.0.81 + +# Set up domain for script localization +export TEXTDOMAIN=steam + +function show_message() +{ + style=$1 + shift + + case "$style" in + --error) + title=$"Error" + ;; + --warning) + title=$"Warning" + ;; + *) + title=$"Note" + ;; + esac + + if [ "${XDG_CURRENT_DESKTOP}" == "gamescope" ]; then + log "$title: $*" + return + fi + + if ! zenity "$style" --text="$*" 2>/dev/null; then + # Save the prompt in a temporary file because it can have newlines in it + tmpfile="$(mktemp || echo "/tmp/steam_message.txt")" + echo -e "$*" >"$tmpfile" + xterm -T "$title" -e "cat $tmpfile; echo -n 'Press enter to continue: '; read input" + rm -f "$tmpfile" + fi +} + +function detect_platform() +{ + # Maybe be smarter someday + # Right now this is the only platform we have a bootstrap for, so hard-code it. + echo ubuntu12_32 +} + +function setup_variables() +{ + STEAMPACKAGE="${0##*/}" + + if [ "$STEAMPACKAGE" = bin_steam.sh ]; then + STEAMPACKAGE=steam + fi + + STEAMCONFIG=~/.steam + STEAMDATALINK="$STEAMCONFIG/$STEAMPACKAGE" + STEAMBOOTSTRAP=steam.sh + LAUNCHSTEAMDIR="$(readlink -e -q "$STEAMDATALINK" || true)" + LAUNCHSTEAMPLATFORM="$(detect_platform)" + LAUNCHSTEAMBOOTSTRAPFILE="$bootstrapdir/bootstraplinux_$LAUNCHSTEAMPLATFORM.tar.xz" + if [ ! -f "$LAUNCHSTEAMBOOTSTRAPFILE" ]; then + LAUNCHSTEAMBOOTSTRAPFILE="/usr/lib/$STEAMPACKAGE/bootstraplinux_$LAUNCHSTEAMPLATFORM.tar.xz" + fi + + # Get the default data path + STEAM_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" + case "$STEAMPACKAGE" in + steam) + CLASSICSTEAMDIR="$HOME/Steam" + DEFAULTSTEAMDIR="$STEAM_DATA_HOME/Steam" + ;; + steambeta) + CLASSICSTEAMDIR="$HOME/SteamBeta" + DEFAULTSTEAMDIR="$STEAM_DATA_HOME/SteamBeta" + ;; + *) + log $"Unknown Steam package '$STEAMPACKAGE'" + exit 1 + ;; + esac + + # Create the config directory if needed + if [[ ! -d "$STEAMCONFIG" ]]; then + mkdir "$STEAMCONFIG" + fi +} + +function install_bootstrap() +{ + STEAMDIR="$1" + + # Save the umask and set strong permissions + omask="$(umask)" + umask 0077 + + log $"Setting up Steam content in $STEAMDIR" + mkdir -p "$STEAMDIR" + cd "$STEAMDIR" + if ! tar xJf "$LAUNCHSTEAMBOOTSTRAPFILE" ; then + log $"Failed to extract $LAUNCHSTEAMBOOTSTRAPFILE, aborting installation." + exit 1 + fi + ln -fns "$STEAMDIR" "$STEAMDATALINK" + setup_variables + + # put the Steam icon on the user's desktop + # try to read ~/.config/user-dirs.dirs to get the current desktop configuration + # http://www.freedesktop.org/wiki/Software/xdg-user-dirs + # shellcheck source=/dev/null + test -f "${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs" && source "${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs" + DESKTOP_DIR="${XDG_DESKTOP_DIR:-$HOME/Desktop}" + + if [ -d "$DESKTOP_DIR" ] && [ "$bootstrapdir" = "/usr/lib/$STEAMPACKAGE" ]; then + # There might be a symlink in place already, in such case we do nothing + if [ ! -L "$DESKTOP_DIR/$STEAMPACKAGE.desktop" ]; then + cp "$bootstrapdir/$STEAMPACKAGE.desktop" "$DESKTOP_DIR" + # Older .desktop implementations used the execute bits as + # a marker for a .desktop being safe to treat as a shortcut + chmod a+x "$DESKTOP_DIR/$STEAMPACKAGE.desktop" + if command -v gio >/dev/null; then + # Making it executable is not enough in recent + # (Ubuntu 20.04) versions of + # https://gitlab.gnome.org/World/ShellExtensions/desktop-icons + gio set --type=string "$DESKTOP_DIR/$STEAMPACKAGE.desktop" metadata::trusted true || : + # Generate an inotify event so the desktop + # implementation reloads it + touch "$DESKTOP_DIR/$STEAMPACKAGE.desktop" + fi + fi + fi + + # Restore the umask + umask "$omask" +} + +function repair_bootstrap() +{ + rm -f "$STEAMDATALINK" && ln -s "$1" "$STEAMDATALINK" + setup_variables +} + +function check_bootstrap() +{ + if [[ -n "$1" && -x "$1/$STEAMBOOTSTRAP" ]]; then + # Looks good... + return 0 + else + return 1 + fi +} + +function forward_command_line() +{ + if ! [ -p "$STEAMCONFIG/steam.pipe" ]; then + return 1 + fi + + local runtime="$STEAMCONFIG/root/ubuntu12_32/steam-runtime" + local remote="$runtime/amd64/usr/bin/steam-runtime-steam-remote" + + if [ -x "$remote" ] && "$remote" "$@" 2>/dev/null; then + return 0 + else + return 1 + fi +} + +# Don't allow running as root +if [ "$(id -u)" == "0" ]; then + show_message --error $"Cannot run as root user" + exit 1 +fi + +# Look for the Steam data files +setup_variables + +# If Steam is already running, try to forward the command-line to it. +# If successful, there's nothing more to do. +if forward_command_line "$@"; then + exit 0 +fi + +if ! check_bootstrap "$LAUNCHSTEAMDIR"; then + # See if we just need to recreate the data link + if check_bootstrap "$DEFAULTSTEAMDIR"; then + log $"Repairing installation, linking $STEAMDATALINK to $DEFAULTSTEAMDIR" + repair_bootstrap "$DEFAULTSTEAMDIR" + elif check_bootstrap "$CLASSICSTEAMDIR"; then + log $"Repairing installation, linking $STEAMDATALINK to $CLASSICSTEAMDIR" + repair_bootstrap "$CLASSICSTEAMDIR" + fi +fi + +if [[ ! -L "$STEAMDATALINK" ]] || ( ! check_bootstrap "$LAUNCHSTEAMDIR" ); then + install_bootstrap "$DEFAULTSTEAMDIR" +fi + +if ! check_bootstrap "$LAUNCHSTEAMDIR"; then + show_message --error $"Couldn't set up Steam data - please contact technical support" + exit 1 +fi + +# Leave a copy of the bootstrap tarball in ~/.steam so that Steam can +# re-bootstrap itself if required +if ! cmp -s "$LAUNCHSTEAMBOOTSTRAPFILE" "$LAUNCHSTEAMDIR/bootstrap.tar.xz"; then + cp "$LAUNCHSTEAMBOOTSTRAPFILE" "$LAUNCHSTEAMDIR/bootstrap.tar.xz" +fi + +# go to the install directory and run the client +cd "$LAUNCHSTEAMDIR" + +exec "$LAUNCHSTEAMDIR/$STEAMBOOTSTRAP" "$@" diff --git a/handheld/steam-jupiter-stable/steam-jupiter.sh b/handheld/steam-jupiter-stable/steam-jupiter.sh new file mode 100644 index 000000000..ae4b68e27 --- /dev/null +++ b/handheld/steam-jupiter-stable/steam-jupiter.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +set -euo pipefail + +STEAM_LINKS="$HOME"/.steam +STEAM_DIR="$HOME"/.local/share/Steam + +REGISTRY="$STEAM_LINKS"/registry.vdf +REGISTRY_BAK="$HOME"/.local/share/steam_registry_oobe.vdf + +( + if [[ -f "$STEAM_DIR"/Steam.cfg ]] && grep -q "^# OOBE Inhibit" "$STEAM_DIR"/Steam.cfg; then + # If steam is setup in an OOBE fashion, we want to blow it away and re-bootstrap + # See steam-jupiter-oobe's variant of this entrypoint. + + # Move the registry to a oobe backup copy + [[ ! -e "$REGISTRY" ]] || cp -v "$REGISTRY" "$REGISTRY_BAK" + + # Blow away + rm -rf --one-file-system "$STEAM_DIR" "$STEAM_LINKS" + fi + + # If we're bootstrapping a fresh instance of Steam, use the oobe registry.vdf if we have it + if [[ -e "$REGISTRY_BAK" && ! -e "$REGISTRY" ]]; then + mkdir -pv "$STEAM_LINKS" + cp -v "$REGISTRY_BAK" "$REGISTRY" + fi + + # For beta lifecycle, we need to be on a steampal branch. + if cd ~/.steam/root/package || cd ~/.local/share/Steam/package; then + if [[ ! -e beta || $(cat beta) = *neptune || $(cat beta) = publicbeta || $(cat beta) = "steampal_stable_d89c8fc0c37b9f06864d20456852ed2eb7e350b3" ]]; then + echo -n "steamdeck_stable" > beta + fi + fi +) +exec /usr/lib/steam/steam -steamdeck -pipewire "$@" diff --git a/handheld/steam-jupiter-stable/steam-runtime.sh b/handheld/steam-jupiter-stable/steam-runtime.sh new file mode 100755 index 000000000..fc10ad523 --- /dev/null +++ b/handheld/steam-jupiter-stable/steam-runtime.sh @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/lib/steam/steam "$@"