VERY experimental Nintendo Switch 2 emulator
C++
actions: Linux & Source builds (#26)
swurl52d851500c9e
diff --git a/.ci/android.sh b/.ci/android.shindex db3dac4196..79b1bc6732 100755--- a/.ci/android.sh+++ b/.ci/android.sh@@ -2,18 +2,16 @@export NDK_CCACHE=$(which ccache)-if [ ! -z "${ANDROID_KEYSTORE_B64}" ]; then- export ANDROID_KEYSTORE_FILE="${GITHUB_WORKSPACE}/ks.jks"- base64 --decode <<< "${ANDROID_KEYSTORE_B64}" > "${ANDROID_KEYSTORE_FILE}"-fi+# keystore & pass are stored locally+export ANDROID_KEYSTORE_FILE=~/android.keystore+export ANDROID_KEYSTORE_PASS=`cat ~/android.pass`+export ANDROID_KEY_ALIAS=`cat ~/android.alias`+export ANDROID_HOME=/opt/android-sdk/cd src/androidchmod +x ./gradlew+./gradlew assembleRelease./gradlew bundleReleaseccache -s -v--if [ ! -z "${ANDROID_KEYSTORE_B64}" ]; then- rm "${ANDROID_KEYSTORE_FILE}"-fidiff --git a/.ci/linux.sh b/.ci/linux.shindex 9318c3e111..4953270c66 100755--- a/.ci/linux.sh+++ b/.ci/linux.sh@@ -22,8 +22,9 @@ cmake .. -G Ninja \-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \-DENABLE_QT_TRANSLATION=ON \-DUSE_DISCORD_PRESENCE=ON \- -DYUZU_USE_BUNDLED_VCPKG=ON \+ -DUSE_CCACHE=ON \"${EXTRA_CMAKE_FLAGS[@]}"+ninja -j4if [ -d "bin/Release" ]; thenstrip -s bin/Release/*@@ -37,4 +38,4 @@ elseccache -s -vfi-ctest -VV -C Release+#ctest -VV -C Releasediff --git a/.ci/package-appimage.sh b/.ci/package-appimage.shindex d876d2f5b0..b2b9464fcc 100755--- a/.ci/package-appimage.sh+++ b/.ci/package-appimage.sh@@ -31,27 +31,27 @@ cp README.md "$DIR_NAME/" || echo "README.md not found"create_appimage() {local binary_name="$1"local display_name="$2"- local needs_qt="$3"+ local needs_qt="$3"local app_dir="build/AppDir-${binary_name}"local appimage_output="${binary_name}.AppImage"-+echo "Creating AppImage for ${binary_name}..."-+mkdir -p "${app_dir}/usr/bin"mkdir -p "${app_dir}/usr/lib"mkdir -p "${app_dir}/usr/share/applications"mkdir -p "${app_dir}/usr/share/icons/hicolor/scalable/apps"mkdir -p "${app_dir}/usr/optional/libstdc++"mkdir -p "${app_dir}/usr/optional/libgcc_s"-+if [ -d "build/bin/Release" ]; thencp "build/bin/Release/${binary_name}" "${app_dir}/usr/bin/" || echo "${binary_name} not found for AppDir"elsecp "build/bin/${binary_name}" "${app_dir}/usr/bin/" || echo "${binary_name} not found for AppDir"fi-+strip -s "${app_dir}/usr/bin/${binary_name}"-+cat > "${app_dir}/org.yuzu_emu.${binary_name}.desktop" << EOL[Desktop Entry]Type=Application@@ -60,18 +60,18 @@ Icon=org.yuzu_emu.${binary_name}Exec=${binary_name}Categories=Game;Emulator;EOL-+cp "${app_dir}/org.yuzu_emu.${binary_name}.desktop" "${app_dir}/usr/share/applications/"-+cp "dist/eden.svg" "${app_dir}/org.yuzu_emu.${binary_name}.svg"cp "dist/eden.svg" "${app_dir}/usr/share/icons/hicolor/scalable/apps/org.yuzu_emu.${binary_name}.svg"-+cd buildwget -nc https://raw.githubusercontent.com/eden-emulator/ext-linux-bin/main/appimage/deploy-linux.sh || echo "Failed to download deploy script"wget -nc https://raw.githubusercontent.com/eden-emulator/AppImageKit-checkrt/old/AppRun.sh || echo "Failed to download AppRun script"wget -nc https://github.com/eden-emulator/ext-linux-bin/raw/main/appimage/exec-x86_64.so || echo "Failed to download exec wrapper"chmod +x deploy-linux.sh-+cd ..if [ "$needs_qt" = "true" ]; thenecho "Deploying with Qt dependencies for ${binary_name}..."@@ -80,41 +80,41 @@ EOLecho "Deploying without Qt dependencies for ${binary_name}..."build/deploy-linux.sh "${app_dir}/usr/bin/${binary_name}" "${app_dir}"fi-+cp --dereference /usr/lib/x86_64-linux-gnu/libstdc++.so.6 "${app_dir}/usr/optional/libstdc++/libstdc++.so.6" || truecp --dereference /lib/x86_64-linux-gnu/libgcc_s.so.1 "${app_dir}/usr/optional/libgcc_s/libgcc_s.so.1" || true-+cp build/exec-x86_64.so "${app_dir}/usr/optional/exec.so" || truecp build/AppRun.sh "${app_dir}/AppRun"chmod +x "${app_dir}/AppRun"-+find "${app_dir}" -type f -regex '.*libwayland-client\.so.*' -delete -print || true-+cd build-+if [ ! -f "appimagetool-x86_64.AppImage" ]; thenwget -nc https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImagechmod +x appimagetool-x86_64.AppImagefi-+if ! ./appimagetool-x86_64.AppImage --version; thenecho "FUSE not available, using extract and run mode"export APPIMAGE_EXTRACT_AND_RUN=1fi-+echo "Generating AppImage: ${appimage_output}"./appimagetool-x86_64.AppImage "AppDir-${binary_name}" "${appimage_output}" || echo "AppImage generation failed for ${binary_name}"-+cp "${appimage_output}" "../${DIR_NAME}/" || echo "AppImage not copied to DIR_NAME for ${binary_name}"cp "${appimage_output}" "../${ARTIFACTS_DIR}/" || echo "AppImage not copied to artifacts for ${binary_name}"cd ..}-create_appimage "eden" "Eden" "true"-create_appimage "eden-cli" "Eden-CLI" "false"-create_appimage "eden-room" "Eden-Room" "false"+create_appimage "eden" "Eden" "true"+create_appimage "eden-cli" "Eden-CLI" "false"+create_appimage "eden-room" "Eden-Room" "false"tar $COMPRESSION_FLAGS "$ARCHIVE_NAME" "$DIR_NAME"mv "$ARCHIVE_NAME" "${ARTIFACTS_DIR}/"-ls -la "${ARTIFACTS_DIR}/"\ No newline at end of file+ls -la "${ARTIFACTS_DIR}/"diff --git a/.ci/source.sh b/.ci/source.shindex 1928d7df99..cbdacd1cd7 100755--- a/.ci/source.sh+++ b/.ci/source.sh@@ -1,5 +1,8 @@#!/bin/bash -ex+# git-archive-all+export PATH="$PATH:/home/$USER/.local/bin"+GITDATE="`git show -s --date=short --format='%ad' | sed 's/-//g'`"GITREV="`git show -s --format='%h'`"REV_NAME="eden-unified-source-${GITDATE}-${GITREV}"@@ -8,11 +11,10 @@ COMPAT_LIST='dist/compatibility_list/compatibility_list.json'mkdir artifacts-pip3 install git-archive-alltouch "${COMPAT_LIST}"git describe --abbrev=0 --always HEAD > GIT-COMMITgit describe --tags HEAD > GIT-TAG || echo 'unknown' > GIT-TAG-git archive-all --include "${COMPAT_LIST}" --include GIT-COMMIT --include GIT-TAG --force-submodules artifacts/"${REV_NAME}.tar"+git-archive-all --include "${COMPAT_LIST}" --include GIT-COMMIT --include GIT-TAG --force-submodules artifacts/"${REV_NAME}.tar"cd artifacts/xz -T0 -9 "${REV_NAME}.tar"diff --git a/.github/workflows/build.yml b/.github/workflows/build.ymlindex 378c09927d..3b3b7e4250 100644--- a/.github/workflows/build.yml+++ b/.github/workflows/build.yml@@ -1,3 +1,6 @@+# TODO: This document needs to be formatted,+# appimage should use linuxdeploy probably+# some stuff needs cleaned up etcname: eden-buildon:@@ -20,7 +23,7 @@ jobs:- name: Uploaduses: forgejo/upload-artifact@v4with:- name: source+ name: source.zippath: artifacts/windows:runs-on: windows-latest@@ -31,7 +34,7 @@ jobs:run:shell: ${{ (matrix.target == 'msys2' && 'msys2') || 'bash' }} {0}env:- CCACHE_DIR: ${{ github.workspace }}/.ccache+ CCACHE_DIR: ${{ runner.workspace }}/.cache/.ccacheCCACHE_COMPILERCHECK: contentCCACHE_SLOPPINESS: time_macrosOS: windows@@ -40,14 +43,9 @@ jobs:- uses: actions/checkout@v4with:submodules: recursive- fetch-depth: 0- - name: Set up ccache- uses: actions/cache@v4- with:- path: ${{ env.CCACHE_DIR }}- key: ${{ runner.os }}-${{ matrix.target }}-ccache-${{ github.sha }}- restore-keys: |- ${{ runner.os }}-${{ matrix.target }}-ccache-+ fetch-depth: 1+ fetch-tags: true+- name: Set up vcpkg cacheuses: actions/cache@v4with:@@ -58,6 +56,7 @@ jobs:key: ${{ runner.os }}-${{ matrix.target }}-vcpkg-${{ hashFiles('**/CMakeLists.txt', '**/vcpkg.json') }}-${{ github.run_id }}restore-keys: |${{ runner.os }}-${{ matrix.target }}-vcpkg-+- name: Set up MSVCuses: ilammy/msvc-dev-cmd@v1if: ${{ matrix.target == 'msvc' }}@@ -143,12 +142,12 @@ jobs:if: steps.build.outcome == 'success'uses: forgejo/upload-artifact@v4with:- name: ${{ matrix.target }}+ name: ${{ matrix.target }}.zippath: artifacts/*linux:runs-on: linuxenv:- CCACHE_DIR: ${{ github.workspace }}/.ccache+ CCACHE_DIR: /home/runner/.cache/ccacheCCACHE_COMPILERCHECK: contentCCACHE_SLOPPINESS: time_macrosOS: linux@@ -157,25 +156,8 @@ jobs:- uses: actions/checkout@v4with:submodules: recursive- fetch-depth: 0- - name: Set up cache- uses: actions/cache@v4- with:- path: ${{ env.CCACHE_DIR }}- key: ${{ runner.os }}-fresh-${{ github.sha }}- restore-keys: |- ${{ runner.os }}-fresh--- - name: Set up vcpkg cache- uses: actions/cache@v4- with:- path: |- ${{ github.workspace }}/build/vcpkg_installed- ${{ github.workspace }}/build/externals- ${{ github.workspace }}/.vcpkg- key: ${{ runner.os }}-fresh-vcpkg-${{ hashFiles('**/CMakeLists.txt', '**/vcpkg.json') }}-${{ github.run_id }}- restore-keys: |- ${{ runner.os }}-fresh-vcpkg-+ fetch-depth: 1+ fetch-tags: true- name: Buildrun: ./.ci/linux.sh@@ -187,47 +169,41 @@ jobs:- name: Upload Linux artifactsuses: forgejo/upload-artifact@v4with:- name: linux+ name: linux.zippath: artifacts/*+android:runs-on: android+env:- CCACHE_DIR: ${{ github.workspace }}/.ccache+ CCACHE_DIR: /home/runner/.cache/ccacheCCACHE_COMPILERCHECK: contentCCACHE_SLOPPINESS: time_macrosOS: androidTARGET: universal+steps:- uses: actions/checkout@v4with:submodules: recursive- fetch-depth: 0- - name: Set up cache- uses: actions/cache@v4- with:- path: |- ~/.gradle/caches- ~/.gradle/wrapper- ${{ env.CCACHE_DIR }}- key: ${{ runner.os }}-android-${{ github.sha }}- restore-keys: |- ${{ runner.os }}-android-+ fetch-depth: 1+ fetch-tags: true+- name: Set tag namerun: |if [[ "$GITHUB_REF_TYPE" == "tag" ]]; thenecho "GIT_TAG_NAME=$GITHUB_REF_NAME" >> $GITHUB_ENVfiecho $GIT_TAG_NAME+- name: Depsrun: |sudo apt-get update -ysudo apt-get install ccache glslang-dev glslang-tools apksigner -y+- name: Buildrun: JAVA_HOME=$JAVA_HOME_21_X64 ./.ci/android.sh- env:- ANDROID_KEYSTORE_B64: ${{ secrets.ANDROID_KEYSTORE_B64 }}- ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}- ANDROID_KEYSTORE_PASS: ${{ secrets.ANDROID_KEYSTORE_PASS }}+- name: Package Android artifactsrun: |GITDATE="$(git show -s --date=short --format='%ad' | sed 's/-//g')"@@ -251,5 +227,5 @@ jobs:- name: Upload Android artifactsuses: forgejo/upload-artifact@v4with:- name: android+ name: android.zippath: artifacts/*diff --git a/.github/workflows/license-header.yml b/.github/workflows/license-header.ymlindex 843b7c833d..bc4d1d6023 100644--- a/.github/workflows/license-header.yml+++ b/.github/workflows/license-header.yml@@ -6,7 +6,7 @@ on:jobs:license-header:- runs-on: ubuntu-latest+ runs-on: linuxcontainer:image: opensauce04/lime3ds-build:latestoptions: -u 1001diff --git a/CMakeLists.txt b/CMakeLists.txtindex 68ad8d7772..b88ab64e53 100644--- a/CMakeLists.txt+++ b/CMakeLists.txt@@ -299,7 +299,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)# Enforce the search mode of non-required packages for better and shorter failure messagesfind_package(enet 1.3 MODULE)-find_package(fmt 11 REQUIRED)+find_package(fmt 10 REQUIRED)find_package(LLVM 17.0.2 MODULE COMPONENTS Demangle)find_package(lz4 REQUIRED)find_package(nlohmann_json 3.8 REQUIRED)diff --git a/dist/org.yuzu_emu.yuzu.desktop b/dist/org.yuzu_emu.yuzu.desktopindex 8b6b347b1a..4a102995ec 100644--- a/dist/org.yuzu_emu.yuzu.desktop+++ b/dist/org.yuzu_emu.yuzu.desktop@@ -4,13 +4,13 @@[Desktop Entry]Version=1.0Type=Application-Name=yuzu+Name=edenGenericName=Switch EmulatorComment=Nintendo Switch video game console emulator-Icon=org.yuzu_emu.yuzu+Icon=org.yuzu_emu.edenTryExec=edenExec=eden %fCategories=Game;Emulator;Qt;MimeType=application/x-nx-nro;application/x-nx-nso;application/x-nx-nsp;application/x-nx-xci;Keywords=Nintendo;Switch;-StartupWMClass=yuzu+StartupWMClass=eden