From 3f4d237de31aeaf8fd3c95e9c383ae00a0505a9b Mon Sep 17 00:00:00 2001 From: jmcerrejon Date: Thu, 25 Jan 2024 11:24:49 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=8C=20IMPROVE:=20Update=20script=20&?= =?UTF-8?q?=20binary.=20aarch64=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- piKiss.sh | 4 +- scripts/emus/dolphin.sh | 142 ++++++++++++++++++++++++---------------- 2 files changed, 88 insertions(+), 58 deletions(-) diff --git a/piKiss.sh b/piKiss.sh index ab227cc5..b55cf93a 100755 --- a/piKiss.sh +++ b/piKiss.sh @@ -235,7 +235,7 @@ smGames() { smEmulators() { if is_userspace_64_bits; then - show_dialog_only_32_bits "Amiga, Box86/64, Flycast, DOSBox, Mame, mGBA, PS1, PS2, RetroArch, Redream, ScummVM, VICE" + show_dialog_only_32_bits "Amiga, Box86/64, Dolphin, Flycast, DOSBox, Mame, mGBA, PS1, PS2, RetroArch, Redream, ScummVM, VICE" fi cmd=(dialog --clear --backtitle "$TITLE" --title "[ Emulators ]" --menu "Select emulator from the list:" "$wHEIGHT" "$wWIDTH" "$wHEIGHT") @@ -244,7 +244,7 @@ smEmulators() { Amiga "Amiberry is the best Amiga emulator" Amstrad "Amstrad CPC with Caprice32" Box86-64 "Let's you run x86/64 Linux programs on non-x86/64 Linux" - Dolphin "Dolphin is a Wii & Gamecube emulator (EXPERIMENTAL)" + Dolphin "Dolphin is a Wii & Gamecube emulator" DOSBox "DOSBox-X is a DOS emulator with GUI" Flycast "Sega Dreamcast,Naomi,Naomi 2 and Atomiswave emu" Gba "Gameboy Advance (mgba)" diff --git a/scripts/emus/dolphin.sh b/scripts/emus/dolphin.sh index 0bad5466..78d5d093 100755 --- a/scripts/emus/dolphin.sh +++ b/scripts/emus/dolphin.sh @@ -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 <~/.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 <~/.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