diff --git a/.github/workflows/experimental.yml b/.github/workflows/experimental.yml index ae68047..6c0f32d 100644 --- a/.github/workflows/experimental.yml +++ b/.github/workflows/experimental.yml @@ -24,6 +24,12 @@ jobs: runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v4 + with: + submodules: true + + - name: build GoldMapper + shell: bash + run: pnpm goldmapper - name: install dependencies (ubuntu only) if: matrix.platform == 'ubuntu-22.04' diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9a371e5..b0f062f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -37,6 +37,12 @@ jobs: runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v4 + with: + submodules: true + + - name: build GoldMapper + shell: bash + run: pnpm goldmapper - name: install dependencies (ubuntu only) if: matrix.platform == 'ubuntu-22.04' diff --git a/.gitignore b/.gitignore index 7ab7f97..1697782 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,10 @@ Thumbs.db /emerald-repo /ignore/* +# GoldMapper binaries (generated by pnpm goldmapper) +/src-tauri/resources/GoldMapperLib.dll +/src-tauri/resources/GoldMapperLauncher.exe + # Android bundled runtime assets (too large for GitHub; must be present in the working tree) /src-tauri/gen/android/app/src/main/assets/imagefs.tar.zst /src-tauri/gen/android/app/src/main/assets/proton-*.tar.zst diff --git a/GoldMapper b/GoldMapper new file mode 160000 index 0000000..b0157f9 --- /dev/null +++ b/GoldMapper @@ -0,0 +1 @@ +Subproject commit b0157f9d312ce4d8d54dd38f1a89b38a3bf9d7b1 diff --git a/package.json b/package.json index 3d2974b..fcaa3fc 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "tauri:build": "tauri build && pnpm run post-build:macos", "post-build:macos": "bash src-tauri/scripts/post-build-macos.sh", "android:assets": "node scripts/download-android-assets.mjs", - "flatpak": "flatpak-builder --user --install-deps-from=flathub --repo=emerald-repo --force-clean build-flatpak flatpak/io.github.Emerald_Legacy_Launcher.Emerald_Legacy_Launcher.yml && flatpak build-bundle emerald-repo emerald.flatpak io.github.Emerald_Legacy_Launcher.Emerald_Legacy_Launcher" + "flatpak": "flatpak-builder --user --install-deps-from=flathub --repo=emerald-repo --force-clean build-flatpak flatpak/io.github.Emerald_Legacy_Launcher.Emerald_Legacy_Launcher.yml && flatpak build-bundle emerald-repo emerald.flatpak io.github.Emerald_Legacy_Launcher.Emerald_Legacy_Launcher", + "goldmapper": "bash scripts/build-goldmapper.sh" }, "dependencies": { "@tauri-apps/api": "^2", diff --git a/scripts/build-goldmapper.sh b/scripts/build-goldmapper.sh new file mode 100755 index 0000000..2c06c04 --- /dev/null +++ b/scripts/build-goldmapper.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" +GOLDMAPPER_DIR="$ROOT_DIR/GoldMapper" +BUILD_DIR="$GOLDMAPPER_DIR/build" +RESOURCES_DIR="$ROOT_DIR/src-tauri/resources" + +if ! command -v xwin &> /dev/null; then + echo "Installing xwin..." + cargo install xwin +fi + +if [ ! -d "$HOME/.cache/xwin/splat" ]; then + echo "Downloading Windows SDK and CRT..." + xwin --accept-license 16299.309000601.3633040603 splat --output "$HOME/.cache/xwin/splat" +fi + +if [ ! -f "$GOLDMAPPER_DIR/third_party/minhook/include/MinHook.h" ]; then + echo "Initializing minhook submodule..." + git -C "$GOLDMAPPER_DIR" submodule update --init --recursive +fi + +echo "Configuring GoldMapper..." +cmake -B "$BUILD_DIR" \ + -DCMAKE_TOOLCHAIN_FILE="$GOLDMAPPER_DIR/toolchain-xwin.cmake" \ + -DCMAKE_BUILD_TYPE=Release \ + "$GOLDMAPPER_DIR" + +echo "Building GoldMapper..." +cmake --build "$BUILD_DIR" --config Release + +echo "Copying binaries to resources..." +mkdir -p "$RESOURCES_DIR" +cp "$BUILD_DIR/GoldMapperLib.dll" "$RESOURCES_DIR/" +cp "$BUILD_DIR/GoldMapperLauncher.exe" "$RESOURCES_DIR/" + +echo "GoldMapper build complete." diff --git a/src-tauri/resources/GoldMapperLauncher.e b/src-tauri/resources/GoldMapperLauncher.e new file mode 100644 index 0000000..e69de29 diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 5a75eb9..15c32ba 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -58,7 +58,7 @@ "bundleMediaFramework": true } }, - "resources": ["resources/DLC"], + "resources": ["resources/DLC", "resources/GoldMapperLib.dll", "resources/GoldMapperLauncher.exe"], "icon": [ "icons/32x32.png", "icons/64x64.png",