diff --git a/.ci/linux-arm64.sh b/.ci/linux-arm64.sh new file mode 100755 index 000000000..c348a21be --- /dev/null +++ b/.ci/linux-arm64.sh @@ -0,0 +1,21 @@ +#!/bin/sh -ex + +mkdir build && cd build + cmake .. -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc-11 \ + -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++-11 \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DENABLE_ASM=OFF \ + -DENABLE_QT_TRANSLATION=ON \ + -DCITRA_ENABLE_COMPATIBILITY_REPORTING=ON \ + -DCITRA_ENABLE_BUNDLE_TARGET=OFF \ + -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \ + -DUSE_DISCORD_PRESENCE=ON +ninja + +DESTDIR="$PWD/AppDir" ninja install +7z a AppDir.7z AppDir +mkdir bundle +mv AppDir.7z ./bundle diff --git a/.ci/linux.sh b/.ci/linux.sh index 1cb66c942..dff7f5531 100755 --- a/.ci/linux.sh +++ b/.ci/linux.sh @@ -1,28 +1,5 @@ #!/bin/sh -ex -if [ "$TARGET" = "arm64-appimage" ]; then -mkdir build && cd build -CC=aarch64-linux-gnu-gcc-11 CXX=aarch64-linux-gnu-g++-11 cmake .. -G Ninja \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_C_COMPILER_LAUNCHER=ccache \ - -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ - -DENABLE_ASM=OFF \ - -DENABLE_QT_TRANSLATION=ON \ - -DCITRA_ENABLE_COMPATIBILITY_REPORTING=ON \ - -DCITRA_ENABLE_BUNDLE_TARGET=OFF \ - -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \ - -DUSE_DISCORD_PRESENCE=ON -ninja - -DESTDIR="$PWD/AppDir" ninja install -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 -7z a AppDir.7z AppDir -mkdir bundle -mv AppDir.7z ./bundle -else - mkdir build && cd build cmake .. -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ @@ -34,11 +11,10 @@ cmake .. -G Ninja \ -DUSE_DISCORD_PRESENCE=ON ninja - if [ "$TARGET" = "appimage" ]; then +if [ "$TARGET" = "appimage" ]; then ninja bundle - fi +fi ccache -s ctest -VV -C Release -fi diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 270540de1..caf2278db 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - target: ["appimage", "arm64-appimage", "fresh"] + target: ["appimage", "fresh"] container: image: citraemu/build-environments:linux-${{ matrix.target }} options: -u 1001 @@ -47,15 +47,6 @@ jobs: ${{ runner.os }}-${{ matrix.target }}- - name: Build run: ./.ci/linux.sh - - name: Prepare outputs for caching - run: mv ./build/bundle $OS-$TARGET - if: ${{ matrix.target == 'arm64-appimage' }} - - name: Cache outputs for ARM64 AppImage packaging - uses: actions/cache/save@v3 - if: ${{ matrix.target == 'arm64-appimage' }} - with: - path: ${{ env.OS }}-${{ env.TARGET }} - key: ${{ runner.os }}-${{ matrix.target }}-${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt }} - name: Pack run: ./.ci/pack.sh if: ${{ matrix.target == 'appimage' }} @@ -65,12 +56,46 @@ jobs: with: name: ${{ env.OS }}-${{ env.TARGET }} path: artifacts/ + linux-arm64: + runs-on: ubuntu-latest + strategy: + matrix: + target: ["arm64-appimage"] + container: + image: citraemu/build-environments:linux-${{ matrix.target }} + options: -u 1001 + env: + CCACHE_DIR: ${{ github.workspace }}/.ccache + OS: linux + TARGET: ${{ matrix.target }} + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - name: Set up cache + uses: actions/cache@v3 + with: + path: ${{ env.CCACHE_DIR }} + key: ${{ runner.os }}-${{ matrix.target }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-${{ matrix.target }}- + - name: Build + run: ./.ci/linux-arm64.sh + - name: Prepare outputs for caching + run: mv ./build/bundle $OS-$TARGET + if: ${{ matrix.target == 'arm64-appimage' }} + - name: Cache outputs for ARM64 AppImage packaging + uses: actions/cache/save@v3 + if: ${{ matrix.target == 'arm64-appimage' }} + with: + path: ${{ env.OS }}-${{ env.TARGET }} + key: ${{ runner.os }}-${{ matrix.target }}-${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt }} linux-arm64-appimage: runs-on: ubuntu-20.04 strategy: matrix: target: ["arm64-appimage"] - needs: linux + needs: linux-arm64 env: CCACHE_DIR: ${{ github.workspace }}/.ccache OS: linux diff --git a/dist/appimage/AppRun.wrapped.sh b/dist/appimage/AppRun.wrapped.sh index 6d72fa1de..82b03c790 100755 --- a/dist/appimage/AppRun.wrapped.sh +++ b/dist/appimage/AppRun.wrapped.sh @@ -37,7 +37,4 @@ if [ -n "$cxxpath" ] || [ -n "$gccpath" ]; then fi fi -#echo ">>>>> $LD_LIBRARY_PATH" -#echo ">>>>> $LD_PRELOAD" - exec "$binary" "$@" diff --git a/dist/appimage/package-appimage-arm64.sh b/dist/appimage/package-appimage-arm64.sh index bcb51ee09..6f7717de0 100755 --- a/dist/appimage/package-appimage-arm64.sh +++ b/dist/appimage/package-appimage-arm64.sh @@ -1,5 +1,9 @@ +# 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