From 13c81e423ec9e39dd79770d628eb1f76bd8f3add Mon Sep 17 00:00:00 2001 From: GT190 Date: Tue, 12 Nov 2024 01:14:53 +0100 Subject: [PATCH] add CPU architecture detection and remove linuxdeploy-checkrt-plugin --- BuildLinuxAppImage.sh | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/BuildLinuxAppImage.sh b/BuildLinuxAppImage.sh index 89a73addf2..c7c3e7bf49 100755 --- a/BuildLinuxAppImage.sh +++ b/BuildLinuxAppImage.sh @@ -1,7 +1,21 @@ #!/bin/bash # Environment variables -export ARCH=x86_64 +if [ "$(uname -m)" = "x86_64" ]; +then + export ARCH=x86_64 + echo "CPU architecture detected as x86_64." + +elif [ "$(uname -m)" = "aarch64" ]; +then + export ARCH=aarch64 + echo "CPU architecture detected as aarch64." + +else + echo "CPU architecture not supported or detected." + exit 1 +fi + export APPIMAGE_EXTRACT_AND_RUN=1 export QMAKE=/usr/lib/qt6/bin/qmake @@ -19,23 +33,20 @@ rm -rf ./AppDir/usr/share/dolphin-emu sed -i 's/env QT_QPA_PLATFORM=xcb dolphin-emu/dolphin-emu/g' ./AppDir/usr/share/applications/dolphin-emu.desktop # Prepare Tools for building the AppImage -wget -N https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -wget -N https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage -wget -N https://github.com/linuxdeploy/linuxdeploy-plugin-checkrt/releases/download/continuous/linuxdeploy-plugin-checkrt-x86_64.sh -wget -N https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage +wget -N https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${ARCH}.AppImage +wget -N https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-${ARCH}.AppImage +wget -N https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-${ARCH}.AppImage -chmod a+x linuxdeploy-x86_64.AppImage -chmod a+x linuxdeploy-plugin-qt-x86_64.AppImage -chmod a+x linuxdeploy-plugin-checkrt-x86_64.sh -chmod a+x appimagetool-x86_64.AppImage +chmod a+x linuxdeploy-${ARCH}.AppImage +chmod a+x linuxdeploy-plugin-qt-${ARCH}.AppImage +chmod a+x appimagetool-${ARCH}.AppImage # Build the AppImage -./linuxdeploy-x86_64.AppImage \ +./linuxdeploy-${ARCH}.AppImage \ --appdir AppDir \ - --plugin qt \ - --plugin checkrt + --plugin qt -echo 'export QT_QPA_PLATFORM=xcb' >> ./AppDir/apprun-hooks/linuxdeploy-plugin-qt-hook.sh +echo 'env QT_QPA_PLATFORM=xcb' >> ./AppDir/apprun-hooks/linuxdeploy-plugin-qt-hook.sh -./appimagetool-x86_64.AppImage ./AppDir +./appimagetool-${ARCH}.AppImage ./AppDir