Create MacOS bundle (#701)

* Create MacOS bundle

* more

* more

* more

* Update framework link search path in build.rs

* Update framework link search path in build.rs

* Remove MoltenVK linking from build.rs

Removed MoltenVK framework linking from build script.

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more

* more
This commit is contained in:
Logan McNaughton
2026-04-01 12:35:46 -06:00
committed by GitHub
parent de0db4b46d
commit 973f4bb28d
4 changed files with 22 additions and 9 deletions
+6 -5
View File
@@ -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
+7
View File
@@ -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"]
+1 -4
View File
@@ -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");
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
</dict>
</plist>