-
Notifications
You must be signed in to change notification settings - Fork 12
Add steam to rsetup #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
RadxaPanda
wants to merge
23
commits into
radxa-pkg:main
Choose a base branch
from
RadxaPanda:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
6774ce0
feat: add steam to rsetup
RadxaPanda f5dfb9e
fix: add requirested changes
RadxaPanda 728f67f
fix: curl with -Ls to follow 302 redirection
RadxaYuntian 828adcd
fix: overwrite existing keyring
RadxaYuntian 521b7e0
fix: use redirection as -o won't overwrite existing file
RadxaYuntian ba18f2e
refactor: wrap package list
RadxaYuntian 617307f
refactor: move foreign arch setup to parent function
RadxaYuntian 70c0c5b
fix: avoid GitHub API due to quota limit
RadxaYuntian 64fa98d
fix: use HEAD instead GET to avoid data download
RadxaYuntian 861365d
refactor: create run script directly in the final destination
RadxaYuntian 0836e12
refactor: unpack steam.deb in a temp dir
RadxaYuntian 2377b9a
refactor: use logname to get real user
RadxaYuntian 94d9721
fix: remove duplicated set -e
RadxaYuntian e754cf0
refactor: replace cd with pushd/popd
RadxaYuntian a264dfe
fix: ensure wine install with correct file owner
RadxaYuntian 2fc4ce1
fix: wine and steam not being able to launch
RadxaPanda e9c9610
fix: escape $HOME and $@ when creating executables for wine and steam
RadxaPanda b95ed9a
fix: add an ignore shellcheck option
RadxaPanda 46f30b5
chore: use cat instead of echo for the steam executable
RadxaPanda 5a4a751
chore: fix typo in the steam executable
RadxaPanda c17f096
chore: fix binfmtd
RadxaPanda e9f9456
feat: improve Steam installation prompt for devices without panthor
RadxaPanda 428b93a
chore: fix uninstall so it doesnt remove every single package it finds
RadxaPanda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,189 @@ | ||
| # shellcheck shell=bash | ||
|
|
||
| get_user_home() { | ||
| if [ -n "${PKEXEC_UID:-}" ]; then | ||
| getent passwd "${PKEXEC_UID}" | cut -d: -f6 | ||
| elif [ -n "${SUDO_USER:-}" ]; then | ||
| getent passwd "${SUDO_USER}" | cut -d: -f6 | ||
| else | ||
| echo "/home/$(whoami)" | ||
RadxaPanda marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| fi | ||
| } | ||
|
|
||
| install_box64() { | ||
| wget https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list | ||
RadxaPanda marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg | ||
| apt update -y && apt install -y box64-rk3588 | ||
RadxaPanda marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| install_box86() { | ||
| dpkg --add-architecture armhf | ||
| wget https://itai-nelken.github.io/weekly-box86-debs/debian/box86.list -O /etc/apt/sources.list.d/box86.list | ||
| wget -qO- https://itai-nelken.github.io/weekly-box86-debs/debian/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg | ||
| apt update -y && apt install -y box86 | ||
| } | ||
|
|
||
| # shellcheck disable=SC2120 | ||
| # files are script files and reference arguments | ||
| install_winex86() { | ||
| local -r user_home="$(get_user_home)" | ||
| rm -rf "${user_home}/.wine/" "${user_home}/wine/" | ||
| # cp wine /usr/local/bin/ | ||
| cat <<EOF > /usr/local/bin/wine | ||
| #!/bin/bash | ||
| #export GALLIUM_HUD=simple,fps | ||
| setarch linux32 -L box86 $HOME/wine/bin/wine "$@" | ||
| EOF | ||
| cat <<EOF > /usr/local/bin/wineserver | ||
| #!/bin/bash | ||
| box86 $HOME/wine/bin/wineserver "$@" | ||
| EOF | ||
| cat <<EOF > /usr/local/bin/winetricks | ||
| #!/bin/bash | ||
| env BOX86_NOBANNER=1 box86 $HOME/wine/winetricks "$@" | ||
| EOF | ||
| chmod +x /usr/local/bin/winetricks | ||
| chmod +x /usr/local/bin/wineserver | ||
| chmod +x /usr/local/bin/wine | ||
| mkdir -p "${user_home}/.local/share/applications/" | ||
| cat <<EOF > "${user_home}/.local/share/applications/wine-config.desktop" | ||
| [Desktop Entry] | ||
| Version=1.0 | ||
| Type=Application | ||
| Name=Wine Configuration | ||
| Comment=Configuration utility for Wine | ||
| Icon=wine | ||
| box86 Exec=/usr/local/bin/wine winecfg | ||
| Categories=Game; | ||
| Terminal=false | ||
| EOF | ||
| cat <<EOF > "${user_home}/.local/share/applications/wine-desktop.desktop" | ||
| [Desktop Entry] | ||
| Version=1.0 | ||
| Type=Application | ||
| Name=Wine Desktop | ||
| Comment=Graphical desktop for Wine | ||
| Icon=wine | ||
| box86 Exec=/usr/local/bin/wine explorer /desktop=shell,1280x720 explorer.exe | ||
| Categories=Game; | ||
| Terminal=false | ||
| EOF | ||
|
|
||
| mkdir "${user_home}/wine/" | ||
| mkdir "${user_home}/wine/lib/" | ||
| # cp libwine.so ${user_home}/wine/lib/ | ||
| # cp libwine.so.1 ${user_home}/wine/lib/ | ||
| cd "${user_home}/wine/" || exit | ||
| latest_version=$(curl -s https://api.github.com/repos/Kron4ek/Wine-Builds/releases/latest | jq -r .tag_name) | ||
| curl -L -o "wine-latest-x86.tar.xz" "https://github.com/Kron4ek/Wine-Builds/releases/download/$latest_version/wine-$latest_version-x86.tar.xz" | ||
| xz -d wine-latest-x86.tar.xz | ||
| tar -xf wine-latest-x86.tar | ||
| cd "wine-$latest_version-x86/" || exit | ||
| cp -R ./* "${user_home}/wine" | ||
| # ln -s "${user_home}/wine/bin/wine" /usr/local/bin/wine | ||
| # ln -s "${user_home}/wine/bin/winecfg" /usr/local/bin/winecfg | ||
| # ln -s "${user_home}/wine/bin/wineserver" /usr/local/bin/wineserver | ||
| # #try to chown using either sudo_user or pkexec_uid | ||
| chown -R "${SUDO_USER:-${PKEXEC_UID}}" "${user_home}/wine" | ||
| echo "Run wine winecfg to let wine configure itself" | ||
| } | ||
|
|
||
| # install_wine64() { | ||
| # __parameter_count_check 0 "$@" | ||
| # local -r user_home="$(get_user_home)" | ||
| # rm -r ~/.wine/ | ||
| # rm -r ~/wine/ | ||
| # cd ~ | ||
| # wget https://github.com/Kron4ek/Wine-Builds/releases/download/8.16/wine-8.16-amd64.tar.xz | ||
| # mkdir ~/wine | ||
| # cd ~/wine | ||
| # xz -d ../wine-8.16-amd64.tar.xz | ||
| # tar -xvf ../wine-8.16-amd64.tar | ||
| # rm /usr/local/bin/wine /usr/local/bin/wineboot /usr/local/bin/winecfg /usr/local/bin/wineserver /usr/local/bin/wine64 | ||
| # cd wine-8.16-amd64/ | ||
| # ln -s ~/wine/wine-8.16-amd64/bin/wine /usr/local/bin/wine | ||
| # ln -s ~/wine/wine-8.16-amd64/bin/wine64 /usr/local/bin/wine64 | ||
| # ln -s ~/wine/wine-8.16-amd64/bin/wineserver /usr/local/bin/wineserver | ||
| # ln -s ~/wine/wine-8.16-amd64/bin/winecfg /usr/local/bin/winecfg | ||
| # ln -s ~/wine/wine-8.16-amd64/bin/wineboot /usr/local/bin/wineboot | ||
| # cd ~ | ||
| # rm wine-8.16-amd64.tar.xz | ||
| # } | ||
|
|
||
|
|
||
| install_steam() { | ||
| __parameter_count_check 0 "$@" | ||
| local -r user_home="$(get_user_home)" | ||
| install_box86 | ||
| install_box64 | ||
| install_winex86 | ||
| # install_wine64 | ||
| # create necessary directories | ||
| mkdir -p "${user_home}/steam" | ||
| mkdir -p "${user_home}/steam/tmp" | ||
| cd "${user_home}/steam/tmp" || exit | ||
|
|
||
| # download latest deb and unpack | ||
| wget https://cdn.cloudflare.steamstatic.com/client/installer/steam.deb | ||
| ar x steam.deb | ||
| tar xf data.tar.xz | ||
|
|
||
| # remove deb archives, not needed anymore | ||
| rm ./*.tar.xz ./steam.deb | ||
|
|
||
| # move deb contents to steam folder | ||
| mv ./usr/* ../ | ||
| cd ../ && rm -rf ./tmp/ | ||
|
|
||
| # create run script | ||
| echo '#!/bin/bash | ||
| export STEAMOS=1 | ||
| export STEAM_RUNTIME=1 | ||
| export DBUS_FATAL_WARNINGS=0 | ||
| ~/steam/bin/steam $@' > steam | ||
|
|
||
| # make script executable and move | ||
| chmod +x steam | ||
| mv steam /usr/local/bin/ | ||
| apt install -y libc6:armhf libsdl2-2.0-0:armhf libsdl2-image-2.0-0:armhf libsdl2-mixer-2.0-0:armhf libsdl2-ttf-2.0-0:armhf libopenal1:armhf libpng16-16:armhf libfontconfig1:armhf libxcomposite1:armhf libbz2-1.0:armhf libxtst6:armhf libsm6:armhf libice6:armhf libxinerama1:armhf libxdamage1:armhf libibus-1.0-5 libdrm2:armhf libgbm1:armhf | ||
|
|
||
| } | ||
|
|
||
| uninstall_steam() { | ||
| local -r user_home="$(get_user_home)" | ||
|
|
||
| # Remove Box64 | ||
| rm /etc/apt/sources.list.d/box64.list | ||
| rm /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg | ||
| apt-get purge -y box64-rk3588 | ||
RadxaPanda marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| # Remove Box86 | ||
| rm /etc/apt/sources.list.d/box86.list | ||
| rm /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg | ||
| apt-get purge -y box86 | ||
|
|
||
| # Remove Wine related files and directories | ||
| rm -rf "${user_home}/.wine" "${user_home}/wine" | ||
| rm -f /usr/local/bin/wine /usr/local/bin/wineserver /usr/local/bin/winetricks | ||
| rm -f "${user_home}/.local/share/applications/wine-config.desktop" | ||
| rm -f "${user_home}/.local/share/applications/wine-desktop.desktop" | ||
|
|
||
| # Remove Steam related files and directories | ||
| rm -rf "${user_home}/steam" | ||
| rm -f /usr/local/bin/steam | ||
|
|
||
| # Remove additional packages installed for Steam | ||
| apt-get purge -y libc6:armhf libsdl2-2.0-0:armhf libsdl2-image-2.0-0:armhf \ | ||
| libsdl2-mixer-2.0-0:armhf libsdl2-ttf-2.0-0:armhf libopenal1:armhf \ | ||
| libpng16-16:armhf libfontconfig1:armhf libxcomposite1:armhf \ | ||
| libbz2-1.0:armhf libxtst6:armhf libsm6:armhf libice6:armhf \ | ||
| libxinerama1:armhf libxdamage1:armhf libgbm1:armhf libdrm2:armhf | ||
|
|
||
|
|
||
| # Remove Box86 architecture | ||
| dpkg --remove-architecture armhf | ||
RadxaPanda marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| # Update apt repositories and clean up | ||
| apt-get update -y | ||
| apt-get autoremove -y | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # shellcheck shell=bash | ||
|
|
||
| __task_steam_uninstall() { | ||
| if yesno "Are you sure to uninstall Steam?" | ||
| then | ||
| if uninstall_steam | ||
| then | ||
| msgbox "Steam was successfully uninstalled." | ||
| else | ||
| msgbox "Failed to uninstall steam." "$RTUI_PALETTE_ERROR" | ||
| fi | ||
| fi | ||
| } | ||
|
|
||
| __task_steam_install() { | ||
| if yesno "Are you sure you want to install Steam?" | ||
| then | ||
| install_steam | ||
| fi | ||
| } | ||
|
|
||
| __task_steam() { | ||
| menu_init | ||
| # "$(get_user_home)/steam" exists | ||
| if [[ -d "$(get_user_home)/steam" ]] | ||
| then | ||
| menu_add __task_steam_uninstall "Uninstall Steam" | ||
| else | ||
| menu_add __task_steam_install "Install Steam" | ||
| fi | ||
| menu_show "Please select an option below:" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.