-
-
Notifications
You must be signed in to change notification settings - Fork 257
Expand file tree
/
Copy pathinstall-arm.sh
More file actions
executable file
·147 lines (115 loc) · 5.26 KB
/
Copy pathinstall-arm.sh
File metadata and controls
executable file
·147 lines (115 loc) · 5.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#!/usr/bin/env bash
DEBIAN_DEPS=(jq zenity flatpak unzip bash libfuse2 git rsync whiptail python libsdl2-2.0-0)
ARCH_DEPS=(steam jq zenity flatpak unzip bash fuse2 git rsync libnewt python sdl2)
FEDORA_DEPS=(jq zenity flatpak unzip bash fuse git rsync newt python lsb_release fuse-libs SDL2)
SUSE_DEPS=(steam jq zenity flatpak unzip bash libfuse2 git rsync whiptail python libSDL2-2_0-0)
VOID_DEPS=(steam jq zenity flatpak unzip bash fuse git rsync newt python SDL2)
GENTOO_DEPS=(app-misc/jq gnome-extra/zenity sys-apps/flatpak app-arch/unzip app-shells/bash sys-fs/fuse:0 dev-vcs/git net-misc/rsync dev-libs/newt dev-lang/python app-text/xmlstarlet media-libs/libsdl2)
CPU_ARCH="x86"
if [ "$(uname -m)" = "aarch64" ] || [ "$(uname -m)" = "arm64" ]; then
CPU_ARCH="arm"
fi
OS_NAME=$(cat /etc/hostname)
if [ "$OS_NAME" = "playnix" ]; then
linuxID="PlaynixOS"
else
linuxID=$(lsb_release -si)
fi
sandbox=""
if [ "$linuxID" = "Ubuntu" ]; then
sandbox="--no-sandbox"
fi
clear
if [ "$linuxID" == "SteamOS" ] || [ "$linuxID" == "PlaynixOS" ]; then
echo "Installing EmuDeck"
else
zenityAvailable=$(command -v zenity &> /dev/null && echo true)
if [[ $zenityAvailable = true ]];then
read -r PASSWD <<< "$(zenity --password --title="Password Entry" --text="Enter you user sudo password to install required depencies" 2>/dev/null)"
echo "$PASSWD" | sudo -v -S
ans=$?
if [[ $ans == 1 ]]; then
#incorrect password
read -r PASSWD <<< "$(zenity --password --title="Password Entry" --text="Password was incorrect. Try again. (Did you remember to set a password for linux before running this?)" 2>/dev/null)"
echo "$PASSWD" | sudo -v -S
ans=$?
if [[ $ans == 1 ]]; then
text="$(printf "<b>Password not accepted.</b>\n Expert mode tools which require a password will not work. Disabling them.")"
zenity --error \
--title="EmuDeck" \
--width=400 \
--text="${text}" 2>/dev/null
setSetting doInstallPowertools false
setSetting doInstallGyro false
fi
fi
fi
SCRIPT_DIR=$( cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
function log_err {
echo "$@" >&2
}
function script_failure {
log_err "An error occurred:$([ -z "$1" ] && " on line $1" || "(unknown)")."
log_err "Installation failed!"
exit
}
#trap 'script_failure $LINENO' ERR
echo "Installing EmuDeck dependencies..."
if command -v apt-get >/dev/null; then
echo "Installing packages with apt..."
sudo killall apt apt-get
sudo apt-get -y update
sudo apt-get -y install "${DEBIAN_DEPS[@]}"
elif command -v pacman >/dev/null; then
echo "Installing packages with pacman..."
sudo pacman --noconfirm -Syu
sudo pacman --noconfirm -S "${ARCH_DEPS[@]}"
elif command -v rpm-ostree >/dev/null; then
echo "Installing packages with rpm-ostree..."
sudo rpm-ostree install "${FEDORA_DEPS[@]}"
elif command -v dnf >/dev/null; then
echo "Installing packages with dnf..."
sudo dnf -y upgrade
sudo dnf -y install "${FEDORA_DEPS[@]}"
elif command -v zypper >/dev/null; then
echo "Installing packages with zypper..."
sudo zypper --non-interactive up
sudo zypper --non-interactive install "${SUSE_DEPS[@]}"
elif command -v xbps-install >/dev/null; then
echo "Installing packages with xbps..."
sudo xbps-install -Syu
sudo xbps-install -Sy "${VOID_DEPS[@]}"
elif command -v emerge >/dev/null; then
echo "Installing packages with emerge..."
sudo emerge --sync
sudo emerge -n "${GENTOO_DEPS[@]}"
else
log_err "Your Linux distro $linuxID is not supported by this script. We invite to open a PR or help us with adding your OS to this script. https://github.com/dragoonDorise/EmuDeck/issues"
exit 1
fi
# this could be replaced to immediately start the EmuDeck setup script
echo "All prerequisite packages have been installed. EmuDeck will be installed now!"
fi
set -eo pipefail
report_error() {
FAILURE="$(caller): ${BASH_COMMAND}"
echo "Something went wrong!"
echo "Error at ${FAILURE}"
}
trap report_error ERR
EMUDECK_GITHUB_URL="https://api.github.com/repos/EmuDeck/emudeck-electron/releases/latest"
#EMUDECK_URL="$(curl -s ${EMUDECK_GITHUB_URL} | grep -E 'browser_download_url.*AppImage' | cut -d '"' -f 4)"
EMUDECK_URL="https://github.com/EmuDeck/emudeck-electron/releases/download/v2.6.1/EmuDeck-2.6.1-arm64.AppImage"
#Armada fixes
if [ ! -e /usr/lib64/libz.so ]; then
mkdir -p "$HOME/.local/lib"
if [ ! -e "$HOME/.local/lib/libz.so" ]; then
ln -s /usr/lib64/libz.so.1 "$HOME/.local/lib/libz.so"
fi
export LD_LIBRARY_PATH="$HOME/.local/lib:$LD_LIBRARY_PATH"
fi
mkdir -p ~/Applications
curl -L "${EMUDECK_URL}" -o ~/Applications/EmuDeck.AppImage 2>&1 | stdbuf -oL tr '\r' '\n' | sed -u 's/^ *\([0-9][0-9]*\).*\( [0-9].*$\)/\1\n#Download Speed\:\2/' | zenity --progress --title "Downloading EmuDeck" --width 600 --auto-close --no-cancel 2>/dev/null
chmod +x ~/Applications/EmuDeck.AppImage
~/Applications/EmuDeck.AppImage $sandbox
exit