diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 009151e2..8c0bdd58 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -157,10 +157,12 @@ jobs: force-url: https://github.com/llvm/llvm-project/releases/download/llvmorg-${{ env.LLVM_VERSION }}/LLVM-${{ env.LLVM_VERSION }}-macOS-${{ matrix.llvm }}.tar.xz - name: Build run: | + cargo install cargo-bundle brew install molten-vk - cargo build --release -v --target=${{ matrix.target }} - mkdir output - cp target/${{ matrix.target }}/release/gopher64 output/gopher64-${{ matrix.arch }} + cargo bundle --release --target=${{ matrix.target }} --format osx + install_name_tool -change /opt/homebrew/opt/freetype/lib/libfreetype.6.dylib \ + @executable_path/../Frameworks/libfreetype.6.dylib target/${{ matrix.target }}/release/bundle/osx/Gopher64.app/Contents/MacOS/gopher64 + codesign -f --entitlements data/entitlements.plist --timestamp --options runtime -s - target/${{ matrix.target }}/release/bundle/osx/Gopher64.app env: NETPLAY_ID: ${{ secrets.NETPLAY_ID }} MACOSX_DEPLOYMENT_TARGET: "26.0" @@ -168,5 +170,4 @@ jobs: uses: actions/upload-artifact@v7 with: name: gopher64-${{ matrix.arch }} - path: output/gopher64-${{ matrix.arch }} - archive: false + path: target/${{ matrix.target }}/release/bundle/osx diff --git a/Cargo.toml b/Cargo.toml index dad7c638..38a275e0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,3 +52,10 @@ inherits = "release" debug = true strip = false panic = "unwind" + +[package.metadata.bundle] +name = "Gopher64" +identifier = "io.github.gopher64.gopher64" +category = "public.app-category.games" +icon = ["data/icon/gopher64_128x128.png","data/icon/gopher64_256x256.png","data/icon/gopher64_512x512.png"] +osx_frameworks = ["/opt/homebrew/opt/molten-vk/lib/libMoltenVK.dylib","/opt/homebrew/opt/freetype/lib/libfreetype.6.dylib"] diff --git a/build.rs b/build.rs index da36ac3f..ea98211f 100644 --- a/build.rs +++ b/build.rs @@ -93,7 +93,7 @@ fn main() { .unwrap(); } else if os == "macos" { println!("cargo:rustc-link-search=native=/opt/homebrew/opt/freetype/lib"); - println!("cargo:rustc-link-lib=static=freetype"); + println!("cargo:rustc-link-lib=dylib=freetype"); let output = std::process::Command::new("clang") .args(["--print-runtime-dir"]) @@ -104,9 +104,6 @@ fn main() { println!("cargo:rustc-link-search=native={}", runtime_dir); println!("cargo:rustc-link-lib=static=clang_rt.osx"); - - println!("cargo:rustc-link-search=native=/opt/homebrew/opt/molten-vk/lib"); - println!("cargo:rustc-link-lib=static=MoltenVK"); } volk_build.flag("-flto=thin"); diff --git a/data/entitlements.plist b/data/entitlements.plist new file mode 100644 index 00000000..8cc185af --- /dev/null +++ b/data/entitlements.plist @@ -0,0 +1,8 @@ + + + + + com.apple.security.cs.disable-library-validation + + +