citra/dist/appimage/package-appimage-arm64.sh

84 lines
3.6 KiB
Bash
Raw Normal View History

# Prepare AppDir
mv ./linux-arm64-appimage/AppDir.7z ./AppDir.7z
7z x AppDir.7z
mv ./AppDir/usr/local/* ./AppDir/usr
rm -rf ./AppDir/usr/local
sed -e s/PrefersNonDefaultGPU=true//g -i ./AppDir/usr/share/applications/citra-qt.desktop
# Seperate AppDir for all Citra executables
cp -r AppDir AppDir-qt
cp -r AppDir AppDir-room
rm -vf AppDir/usr/bin/citra-qt AppDir/usr/bin/citra-room
rm -vf AppDir-room/usr/bin/citra AppDir-room/usr/bin/citra-qt
rm -vf AppDir-qt/usr/bin/citra AppDir-qt/usr/bin/citra-room
mv ./AppDir/usr/share/applications/citra-qt.desktop ./AppDir/usr/share/applications/citra.desktop
mv ./AppDir-room/usr/share/applications/citra-qt.desktop ./AppDir-room/usr/share/applications/citra-room.desktop
# Download appimagetool, needed to build an AppImage
wget https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage
# Set executable bit
chmod a+x appimagetool-x86_64.AppImage
# Workaround for https://github.com/AppImage/AppImageKit/issues/828
export APPIMAGE_EXTRACT_AND_RUN=1
# Deploy Citra's needed dependencies
DEPLOY_QT=0 ./dist/appimage/deploy-linux.sh AppDir/usr/bin/citra AppDir
DEPLOY_QT=0 ./dist/appimage/deploy-linux.sh AppDir-room/usr/bin/citra-room AppDir-room
DEPLOY_QT=1 ./dist/appimage/deploy-linux.sh AppDir-qt/usr/bin/citra-qt AppDir-qt
mkdir AppDir/apprun-hooks
mkdir -p AppDir/usr/optional
mkdir -p AppDir/usr/optional/libstdc++
mkdir -p AppDir/usr/optional/libgcc_s
mkdir AppDir-room/apprun-hooks
mkdir -p AppDir-room/usr/optional
mkdir -p AppDir-room/usr/optional/libstdc++
mkdir -p AppDir-room/usr/optional/libgcc_s
mkdir AppDir-qt/apprun-hooks
mkdir -p AppDir-qt/usr/optional
mkdir -p AppDir-qt/usr/optional/libstdc++
mkdir -p AppDir-qt/usr/optional/libgcc_s
cp ./dist/appimage/AppRun.sh AppDir/AppRun
cp ./dist/appimage/AppRun.wrapped.sh AppDir/AppRun.wrapped
cp ./dist/appimage/AppRun-hook.sh AppDir/apprun-hooks/AppRun-hook
cp ./dist/appimage/exec-aarch64.so AppDir/usr/optional/exec.so
cp --dereference /usr/lib/aarch64-linux-gnu/libstdc++.so.6 AppDir/usr/optional/libstdc++/libstdc++.so.6
cp --dereference /lib/aarch64-linux-gnu/libgcc_s.so.1 AppDir/usr/optional/libgcc_s/libgcc_s.so.1
cp ./dist/appimage/AppRun.sh AppDir-room/AppRun
cp ./dist/appimage/AppRun.wrapped.sh AppDir-room/AppRun.wrapped
cp ./dist/appimage/AppRun-hook.sh AppDir-room/apprun-hooks/AppRun-hook
cp ./dist/appimage/exec-aarch64.so AppDir-room/usr/optional/exec.so
cp --dereference /usr/lib/aarch64-linux-gnu/libstdc++.so.6 AppDir-room/usr/optional/libstdc++/libstdc++.so.6
cp --dereference /lib/aarch64-linux-gnu/libgcc_s.so.1 AppDir-room/usr/optional/libgcc_s/libgcc_s.so.1
cp ./dist/appimage/AppRun.sh AppDir-qt/AppRun
cp ./dist/appimage/AppRun.wrapped.sh AppDir-qt/AppRun.wrapped
cp ./dist/appimage/AppRun-hook.sh AppDir-qt/apprun-hooks/AppRun-hook
cp ./dist/appimage/exec-aarch64.so AppDir-qt/usr/optional/exec.so
cp --dereference /usr/lib/aarch64-linux-gnu/libstdc++.so.6 AppDir-qt/usr/optional/libstdc++/libstdc++.so.6
cp --dereference /lib/aarch64-linux-gnu/libgcc_s.so.1 AppDir-qt/usr/optional/libgcc_s/libgcc_s.so.1
# Build an AppImage
ARCH=aarch64 ./appimagetool-x86_64.AppImage AppDir citra.AppImage
ARCH=aarch64 ./appimagetool-x86_64.AppImage AppDir-room citra-room.AppImage
ARCH=aarch64 ./appimagetool-x86_64.AppImage AppDir-qt citra-qt.AppImage
mkdir -p ./build/bundle
mv citra.AppImage ./build/bundle
mv citra-room.AppImage ./build/bundle
mv citra-qt.AppImage ./build/bundle
mkdir ./build/bundle/dist
cp ./dist/icon.png ./build/bundle/dist/citra.png
cp ./license.txt ./build/bundle
cp ./README.md ./build/bundle
cp -r ./dist/scripting ./build/bundle/scripting