From 60862397e9fe350fcea6be12c20416c0c06cefd3 Mon Sep 17 00:00:00 2001 From: TGP17 Date: Sat, 7 Sep 2024 01:44:57 +0200 Subject: [PATCH 1/5] Add script to build an AppImage --- BuildLinuxAppImage.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 BuildLinuxAppImage.sh diff --git a/BuildLinuxAppImage.sh b/BuildLinuxAppImage.sh new file mode 100755 index 0000000000..67fd2b1b6d --- /dev/null +++ b/BuildLinuxAppImage.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# Environment variables +export ARCH=x86_64 +export APPIMAGE_EXTRACT_AND_RUN=1 +export QMAKE=/usr/lib/qt6/bin/qmake + +# Prepare the AppDir +DESTDIR=./AppDir ninja install +mkdir -p ./AppDir/usr/Source/Core +cp -r ./Source/Core/DolphinQt ./AppDir/usr/Source/Core +rm -rf ./AppDir/usr/Source/Core/DolphinQt/CMakeFiles +rm -rf ./AppDir/usr/Source/Core/DolphinQt/dolphin-emu_autogen +rm ./AppDir/usr/Source/Core/DolphinQt/cmake_install.cmake +mv ./AppDir/usr/share/dolphin-emu/sys ./AppDir/usr/bin/Sys +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 -O linuxdeploy-x86_64.AppImage https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage +wget -O linuxdeploy-plugin-qt-x86_64.AppImage https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage +wget -O linuxdeploy-plugin-checkrt-x86_64.sh https://github.com/linuxdeploy/linuxdeploy-plugin-checkrt/releases/download/continuous/linuxdeploy-plugin-checkrt-x86_64.sh +wget -O appimagetool-x86_64.AppImage https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.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 + +# Build the AppImage +./linuxdeploy-x86_64.AppImage \ + --appdir AppDir \ + --plugin qt \ + --plugin checkrt + +echo 'env QT_QPA_PLATFORM=xcb' >> ./AppDir/apprun-hooks/linuxdeploy-plugin-qt-hook.sh + +./appimagetool-x86_64.AppImage ./AppDir From 887adda8c40bcf44e305681c6628fd871467e5e7 Mon Sep 17 00:00:00 2001 From: GT190 Date: Sat, 7 Sep 2024 16:36:01 +0200 Subject: [PATCH 2/5] Remove unused binaries with BuildLinuxAppImage.sh This saves around 16MB from the AppImage. --- BuildLinuxAppImage.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BuildLinuxAppImage.sh b/BuildLinuxAppImage.sh index 67fd2b1b6d..dde8c612a2 100755 --- a/BuildLinuxAppImage.sh +++ b/BuildLinuxAppImage.sh @@ -12,6 +12,8 @@ cp -r ./Source/Core/DolphinQt ./AppDir/usr/Source/Core rm -rf ./AppDir/usr/Source/Core/DolphinQt/CMakeFiles rm -rf ./AppDir/usr/Source/Core/DolphinQt/dolphin-emu_autogen rm ./AppDir/usr/Source/Core/DolphinQt/cmake_install.cmake +rm ./AppDir/usr/bin/dolphin-emu-nogui +rm ./AppDir/usr/bin/dolphin-tool mv ./AppDir/usr/share/dolphin-emu/sys ./AppDir/usr/bin/Sys 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 From f2ffd95e49ce4900163e4d6fdd15f1b184591e3f Mon Sep 17 00:00:00 2001 From: GT190 Date: Sat, 21 Sep 2024 00:05:25 +0200 Subject: [PATCH 3/5] properly set the environmental variable in apprun-hook --- BuildLinuxAppImage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BuildLinuxAppImage.sh b/BuildLinuxAppImage.sh index dde8c612a2..1b8db577f0 100755 --- a/BuildLinuxAppImage.sh +++ b/BuildLinuxAppImage.sh @@ -36,6 +36,6 @@ chmod a+x appimagetool-x86_64.AppImage --plugin qt \ --plugin checkrt -echo 'env QT_QPA_PLATFORM=xcb' >> ./AppDir/apprun-hooks/linuxdeploy-plugin-qt-hook.sh +echo 'export QT_QPA_PLATFORM=xcb' >> ./AppDir/apprun-hooks/linuxdeploy-plugin-qt-hook.sh ./appimagetool-x86_64.AppImage ./AppDir From d55d844edadfbf4333853b70d36b2e7e854e6e1b Mon Sep 17 00:00:00 2001 From: GT190 Date: Sun, 22 Sep 2024 05:14:09 +0200 Subject: [PATCH 4/5] use timestamping when downloading appimage packaging tools --- BuildLinuxAppImage.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/BuildLinuxAppImage.sh b/BuildLinuxAppImage.sh index 1b8db577f0..89a73addf2 100755 --- a/BuildLinuxAppImage.sh +++ b/BuildLinuxAppImage.sh @@ -19,10 +19,10 @@ 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 -O linuxdeploy-x86_64.AppImage https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -wget -O linuxdeploy-plugin-qt-x86_64.AppImage https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage -wget -O linuxdeploy-plugin-checkrt-x86_64.sh https://github.com/linuxdeploy/linuxdeploy-plugin-checkrt/releases/download/continuous/linuxdeploy-plugin-checkrt-x86_64.sh -wget -O appimagetool-x86_64.AppImage https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.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 chmod a+x linuxdeploy-x86_64.AppImage From 13c81e423ec9e39dd79770d628eb1f76bd8f3add Mon Sep 17 00:00:00 2001 From: GT190 Date: Tue, 12 Nov 2024 01:14:53 +0100 Subject: [PATCH 5/5] 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