|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# Environment variables |
| 4 | +if [ "$(uname -m)" = "x86_64" ]; |
| 5 | +then |
| 6 | + export ARCH=x86_64 |
| 7 | + echo "CPU architecture detected as x86_64." |
| 8 | + |
| 9 | +elif [ "$(uname -m)" = "aarch64" ]; |
| 10 | +then |
| 11 | + export ARCH=aarch64 |
| 12 | + echo "CPU architecture detected as aarch64." |
| 13 | + |
| 14 | +else |
| 15 | + echo "CPU architecture not supported or detected." |
| 16 | + exit 1 |
| 17 | +fi |
| 18 | + |
| 19 | +export APPIMAGE_EXTRACT_AND_RUN=1 |
| 20 | +export QMAKE=$(which qmake6) |
| 21 | + |
| 22 | +# Prepare the AppDir |
| 23 | +DESTDIR=./AppDir ninja install |
| 24 | +mkdir -p ./AppDir/usr/Source/Core |
| 25 | +cp -r ./Source/Core/DolphinQt ./AppDir/usr/Source/Core |
| 26 | +rm -rf ./AppDir/usr/Source/Core/DolphinQt/CMakeFiles |
| 27 | +rm -rf ./AppDir/usr/Source/Core/DolphinQt/dolphin-emu_autogen |
| 28 | +rm ./AppDir/usr/Source/Core/DolphinQt/cmake_install.cmake |
| 29 | +rm ./AppDir/usr/bin/dolphin-emu-nogui |
| 30 | +rm ./AppDir/usr/bin/dolphin-tool |
| 31 | +mv ./AppDir/usr/share/dolphin-emu/sys ./AppDir/usr/bin/Sys |
| 32 | +rm -rf ./AppDir/usr/share/dolphin-emu |
| 33 | +sed -i 's/env QT_QPA_PLATFORM=xcb dolphin-emu/dolphin-emu/g' ./AppDir/usr/share/applications/dolphin-emu.desktop |
| 34 | + |
| 35 | +# Prepare Tools for building the AppImage |
| 36 | +wget -N https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${ARCH}.AppImage |
| 37 | +wget -N https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-${ARCH}.AppImage |
| 38 | +wget -N https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-${ARCH}.AppImage |
| 39 | + |
| 40 | + |
| 41 | +chmod a+x linuxdeploy-${ARCH}.AppImage |
| 42 | +chmod a+x linuxdeploy-plugin-qt-${ARCH}.AppImage |
| 43 | +chmod a+x appimagetool-${ARCH}.AppImage |
| 44 | + |
| 45 | +# Build the AppImage |
| 46 | +./linuxdeploy-${ARCH}.AppImage \ |
| 47 | + --appdir AppDir \ |
| 48 | + --plugin qt |
| 49 | + |
| 50 | +echo 'env QT_QPA_PLATFORM=xcb' >> ./AppDir/apprun-hooks/linuxdeploy-plugin-qt-hook.sh |
| 51 | + |
| 52 | +./appimagetool-${ARCH}.AppImage ./AppDir |
0 commit comments