-
Notifications
You must be signed in to change notification settings - Fork 13
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
base: main
Are you sure you want to change the base?
Changes from 15 commits
6774ce0
f5dfb9e
728f67f
828adcd
521b7e0
ba18f2e
617307f
70c0c5b
64fa98d
861365d
0836e12
2377b9a
94d9721
e754cf0
a264dfe
2fc4ce1
e9c9610
b95ed9a
46f30b5
5a4a751
c17f096
e9f9456
428b93a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,187 @@ | ||
| # shellcheck shell=bash | ||
| get_user_home() { | ||
| getent passwd "$(logname)" | cut -d: -f6 | ||
| } | ||
|
|
||
| install_box64() { | ||
| curl -Ls https://ryanfortner.github.io/box64-debs/box64.list > /etc/apt/sources.list.d/box64.list | ||
| curl -Ls https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor --batch --yes -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg | ||
| apt-get update -y && apt-get install -y box64-rk3588 | ||
| } | ||
|
|
||
| install_box86() { | ||
| curl -Ls https://itai-nelken.github.io/weekly-box86-debs/debian/box86.list > /etc/apt/sources.list.d/box86.list | ||
| curl -Ls https://itai-nelken.github.io/weekly-box86-debs/debian/KEY.gpg | gpg --dearmor --batch --yes -o /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg | ||
| apt-get update -y && apt-get install -y box86 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can be listed in Depends of the repackaged steam. |
||
| } | ||
|
|
||
| # 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 | ||
|
RadxaYuntian marked this conversation as resolved.
|
||
| 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 | ||
| sudo -u "$(logname)" mkdir -p "${user_home}/.local/share/applications/" | ||
| cat <<EOF | sudo -u "$(logname)" tee "${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 | sudo -u "$(logname)" tee "${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 | ||
|
|
||
| sudo -u "$(logname)" mkdir -p "${user_home}/wine/lib/" | ||
| # cp libwine.so ${user_home}/wine/lib/ | ||
| # cp libwine.so.1 ${user_home}/wine/lib/ | ||
| local wine_pkg | ||
| wine_pkg="$(sudo -u "$(logname)" mktemp -d)" | ||
| pushd "$wine_pkg" || return 1 | ||
| latest_version="$(basename "$(curl -ILs -o /dev/null -w "%{url_effective}" https://github.com/Kron4ek/Wine-Builds/releases/latest)")" | ||
| curl -Lso "wine-$latest_version-x86.tar.xz" "https://github.com/Kron4ek/Wine-Builds/releases/download/$latest_version/wine-$latest_version-x86.tar.xz" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make a wine package and install under /usr/lib/x86_64-linux-gnu as well |
||
| sudo -u "$(logname)" tar xf "wine-$latest_version-x86.tar.xz" | ||
| popd || return 1 | ||
| sudo -u "$(logname)" cp -R "$wine_pkg/wine-$latest_version-x86"/* "${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 | ||
| rm -rf "$wine_pkg" | ||
| 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)" | ||
| dpkg --add-architecture armhf | ||
| install_box86 | ||
| install_box64 | ||
| install_winex86 | ||
| # install_wine64 | ||
| # create necessary directories | ||
| local steam_dir="${user_home}/steam" temp_dir | ||
| temp_dir="$(mktemp -d)" | ||
|
|
||
| rm -rf "$steam_dir" | ||
| mkdir -p "$steam_dir" | ||
| pushd "$temp_dir" || return 1 | ||
|
|
||
| # download latest deb and unpack | ||
| wget https://cdn.cloudflare.steamstatic.com/client/installer/steam.deb | ||
| ar x steam.deb | ||
| tar xf data.tar.xz | ||
|
|
||
| # move deb contents to steam folder | ||
| mv ./usr/* "$steam_dir" | ||
| popd || return 1 | ||
| rm -rf "$temp_dir" | ||
|
Comment on lines
+125
to
+132
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Those can be the content of the repackaged steam. Can we still install steam under say /usr/lib/x86_64-linux-gnu?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Definitely can but then ull need to rebuild once in a while I think but it should be fine |
||
|
|
||
| # create run script | ||
| echo '#!/bin/bash | ||
| export STEAMOS=1 | ||
| export STEAM_RUNTIME=1 | ||
| export DBUS_FATAL_WARNINGS=0 | ||
| ~/steam/bin/steam $@' > /usr/local/bin/steam | ||
|
|
||
| # make script executable | ||
| chmod +x /usr/local/bin/steam | ||
| apt-get 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 libdrm2:armhf libgbm1:armhf libibus-1.0-5 | ||
|
|
||
| } | ||
|
|
||
| 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 remove -y box64-rk3588 | ||
|
|
||
| # Remove Box86 | ||
| rm /etc/apt/sources.list.d/box86.list | ||
| rm /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg | ||
| apt-get remove -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 remove -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 armhf architecture | ||
| if ! dpkg --remove-architecture armhf; then | ||
| echo "Failed to remove the armhf architecture. There might be some packages that are still using it." | ||
| fi | ||
|
|
||
| # Update apt repositories and clean up | ||
| apt-get update -y | ||
| apt-get remove -y | ||
| } | ||
| 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:" | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be listed in Depends of the repackaged steam.