-
-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
馃憣 IMPROVE: Update script & binary. aarch64 support
- Loading branch information
1 parent
fe91bab
commit 3f4d237
Showing
2 changed files
with
88 additions
and
58 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -1,96 +1,126 @@ | ||
#!/bin/bash | ||
# | ||
# Description : Dolphin emulator 4.0 (Wii & Gamecube) thks to Kreal (krishenriksen.dk) | ||
# Description : Dolphin emulator | ||
# Author : Jose Cerrejon Gonzalez (ulysess@gmail_dot._com) | ||
# Version : 1.0.1 (17/Aug/20) | ||
# Version : 1.1.0 (25/Jan/24) | ||
# Tested : Raspberry Pi 5 | ||
# | ||
# Help : https://github.com/dolphin-emu/dolphin/wiki/Building-for-Linux | ||
# | ||
# shellcheck source=../helper.sh | ||
. ./scripts/helper.sh || . ./helper.sh || wget -q 'https://github.com/jmcerrejon/PiKISS/raw/master/scripts/helper.sh' | ||
clear | ||
check_board || { echo "Missing file helper.sh. I've tried to download it for you. Try to run the script again." && exit 1; } | ||
|
||
BINARY_PATH="https://misapuntesde.com/rpi_share/dolphin_rpi_experimental.tar.xz" | ||
CURRENT_PATH="${PWD}" | ||
readonly BINARY_PATH="https://misapuntesde.com/rpi_share/dolphin_rpi_experimental.tar.xz" | ||
readonly BINARY_64_PATH="https://misapuntesde.com/rpi_share/dolphin-5.0-20978-aarch64.tar.gz" | ||
readonly PACKAGES=(libqt6widgets6) | ||
readonly PACKAGES_DEV=(ffmpeg libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libevdev-dev libusb-1.0-0-dev libxrandr-dev libxi-dev libpangocairo-1.0-0 qt6-base-private-dev libqt6svg6-dev libbluetooth-dev libasound2-dev libpulse-dev libgl1-mesa-dev libcurl4-openssl-dev libudev-dev libsystemd-dev gettext libsdl2-dev libfmt-dev) | ||
readonly SOURCE_PATH="https://github.com/dolphin-emu/dolphin" | ||
readonly CURRENT_PATH="${PWD}" | ||
EXEC_PATH="$HOME/games/dolphin/dolphin-emu" | ||
ICON_PATH="$HOME/games/dolphin/Data/dolphin-emu.svg" | ||
|
||
runme() { | ||
if [ ! -f /usr/local/bin/dolphin-emu ]; then | ||
echo -e "\nFile does not exist.\n路 Something is wrong.\n路 Try to install again." | ||
exit_message | ||
fi | ||
read -p "Press [ENTER] to run the emulator..." | ||
/usr/local/bin/dolphin-emu | ||
exit_message | ||
read -p "Press [ENTER] to run the emulator..." | ||
${EXEC_PATH} | ||
exit_message | ||
} | ||
|
||
remove_files() { | ||
sudo rm -rf /usr/local/bin/dolphin-emu /usr/local/lib/libpolarssl.a "$HOME"/.dolphin-emu /usr/local/share/dolphin-emu /usr/local/share/pixmaps ~/.local/share/applications/dolphin.desktop | ||
sudo rm -rf /usr/local/bin/dolphin-emu /usr/local/lib/libpolarssl.a "$HOME"/.dolphin-emu /usr/local/share/dolphin-emu /usr/local/share/pixmaps ~/.local/share/applications/dolphin.desktop | ||
rm -rf "$HOME/games/dolphin" "$HOME/.dolphin-emu" "$HOME/.local/share/applications/dolphin.desktop" | ||
} | ||
|
||
uninstall() { | ||
read -p "Do you want to uninstall Dolphin (y/N)? " response | ||
if [[ $response =~ [Yy] ]]; then | ||
remove_files | ||
if [[ -f /usr/local/bin/dolphin-emu ]]; then | ||
echo -e "I hate when this happens. I could not find the directory, Try to uninstall manually. Apologies." | ||
exit_message | ||
fi | ||
echo -e "\nSuccessfully uninstalled." | ||
exit_message | ||
fi | ||
exit_message | ||
read -p "Do you want to uninstall Dolphin (y/N)? " response | ||
if [[ $response =~ [Yy] ]]; then | ||
remove_files | ||
if [[ -f /usr/local/bin/dolphin-emu || -f $HOME/games/dolphin ]]; then | ||
echo -e "I hate when this happens. I could not find the directory, Try to uninstall manually. Apologies." | ||
exit_message | ||
fi | ||
echo -e "\nSuccessfully uninstalled." | ||
exit_message | ||
fi | ||
exit_message | ||
} | ||
|
||
if [[ -f /usr/local/bin/dolphin-emu ]]; then | ||
echo -e "Dolphin already installed.\n" | ||
uninstall | ||
if [[ -f /usr/local/bin/dolphin-emu || -f $HOME/games/dolphin ]]; then | ||
echo -e "Dolphin already installed.\n" | ||
uninstall | ||
fi | ||
|
||
generate_icon() { | ||
echo -e "\nGenerating icon..." | ||
cp -f "$CURRENT_PATH"/res/dolphin.png /usr/local/share/dolphin-emu/dolphin.png | ||
if [[ ! -e ~/.local/share/applications/dolphin.desktop ]]; then | ||
cat <<EOF >~/.local/share/applications/dolphin.desktop | ||
if ! is_kernel_64_bits; then | ||
cp -f "$CURRENT_PATH"/res/dolphin.png /usr/local/share/dolphin-emu/dolphin.png | ||
EXEC_PATH="/usr/local/bin/dolphin-emu" | ||
ICON_PATH="/usr/local/share/dolphin-emu/dolphin.png" | ||
fi | ||
echo -e "\nGenerating icon..." | ||
if [[ ! -e ~/.local/share/applications/dolphin.desktop ]]; then | ||
cat <<EOF >~/.local/share/applications/dolphin.desktop | ||
[Desktop Entry] | ||
Name=Dolphin (Wii/Gamecube) | ||
Exec=/usr/local/bin/dolphin-emu | ||
Icon=/usr/local/share/dolphin-emu/dolphin.png | ||
Exec=${EXEC_PATH} | ||
Icon=${ICON_PATH} | ||
Type=Application | ||
Comment=Dolphin is a Wii & Gamecube emulator. This release corresponds to release 4.0 | ||
Categories=Game;ActionGame; | ||
EOF | ||
fi | ||
fi | ||
} | ||
|
||
download_binaries() { | ||
echo -e "\nInstalling binary files..." | ||
download_and_extract "$BINARY_PATH" /tmp | ||
move_files | ||
echo -e "\nInstalling binary files..." | ||
if is_kernel_64_bits; then | ||
download_and_extract "$BINARY_64_PATH" "$HOME/games" | ||
else | ||
download_and_extract "$BINARY_PATH" /tmp | ||
move_files | ||
fi | ||
} | ||
|
||
move_files() { | ||
# Move to correspondent directory | ||
sudo mv -n /tmp/Dolphin/usr/local/bin/dolphin-emu /usr/local/bin/ | ||
sudo mv -n /tmp/Dolphin/usr/local/lib/libpolarssl.a /usr/local/lib/ | ||
sudo mv -n /tmp/Dolphin/usr/local/share/dolphin-emu /usr/local/share/ | ||
sudo mv -n /tmp/Dolphin/usr/local/share/locale /usr/local/share/ | ||
sudo mv -n /tmp/Dolphin/usr/local/share/pixmaps /usr/local/share/ | ||
mv -f /tmp/Dolphin/.dolphin-emu "$HOME"/.dolphin-emu | ||
rm -rf /tmp/Dolphin | ||
# Move to correspondent directory | ||
sudo mv -n /tmp/Dolphin/usr/local/bin/dolphin-emu /usr/local/bin/ | ||
sudo mv -n /tmp/Dolphin/usr/local/lib/libpolarssl.a /usr/local/lib/ | ||
sudo mv -n /tmp/Dolphin/usr/local/share/dolphin-emu /usr/local/share/ | ||
sudo mv -n /tmp/Dolphin/usr/local/share/locale /usr/local/share/ | ||
sudo mv -n /tmp/Dolphin/usr/local/share/pixmaps /usr/local/share/ | ||
mv -f /tmp/Dolphin/.dolphin-emu "$HOME"/.dolphin-emu | ||
rm -rf /tmp/Dolphin | ||
} | ||
|
||
compile() { | ||
install_packages_if_missing "${PACKAGES_DEV[@]}" | ||
echo "Compiling, please wait..." | ||
make -p "$HOME"/sc && cd "$_" || exit 1 | ||
git clone "$SOURCE_PATH" && cd dolphin || exit 1 | ||
git submodule update --init --recursive Externals/mGBA Externals/spirv_cross Externals/zlib-ng Externals/libspng Externals/VulkanMemoryAllocator Externals/cubeb Externals/implot Externals/gtest Externals/rcheevos Externals/fmt Externals/lz4 Externals/xxhash Externals/enet | ||
git pull --recurse-submodules | ||
sed -i 's/option(option(ENABLE_GENERIC "Enables generic build that should run on any little-endian host" OFF)/option(ENABLE_GENERIC "Enables generic build that should run on any little-endian host" ON)/' CMakeLists.txt | ||
mkdir build && cd "$_" || exit 1 | ||
cmake .. -DLINUX_LOCAL_DEV=true | ||
make_with_all_cores | ||
echo -e "\nDone!. Check the code at $HOME/sc/dolphin/build." | ||
} | ||
|
||
install() { | ||
echo -e "\n\nInstalling, please wait..." | ||
download_binaries | ||
generate_icon | ||
echo | ||
echo -e "Done!. You can play typing /usr/local/bin/dolphin-emu or opening the Menu > Games > Dolphin (Wii/Gamecube)." | ||
runme | ||
install_packages_if_missing "${PACKAGES[@]}" | ||
download_binaries | ||
generate_icon | ||
echo | ||
echo -e "Done!. You can play typing ${EXEC_PATH} or opening the Menu > Games > Dolphin (Wii/Gamecube).\n" | ||
runme | ||
} | ||
|
||
echo "Install Dolphin emulator 4.0 - Wii & Gamecube (EXPERIMENTAL)" | ||
echo "============================================================" | ||
echo | ||
echo " 路 Compiled version thanks to Kreal - krishenriksen.dk" | ||
echo " 路 It's not the latest version. Developers stopped supporting 32-bit beyond 4.0." | ||
echo | ||
install_script_message | ||
echo " | ||
Install Dolphin emulator - Wii & Gamecube | ||
========================================= | ||
路 Dolphin is not supported on Linux ARM devices. It was compiled by myself using generic build, so It's experimental. | ||
" | ||
|
||
install |