From bc84d88b5fa4163866a390672fb329efb3df859c Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Mon, 16 Dec 2024 23:24:17 -0500 Subject: [PATCH] Oh right, Apple Silicon --- build.Dockerfile | 5 +++++ scripts/do-release.sh | 16 ++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/build.Dockerfile b/build.Dockerfile index b707acf..8ec0fc7 100644 --- a/build.Dockerfile +++ b/build.Dockerfile @@ -6,6 +6,7 @@ FROM crazymax/osxcross:latest-ubuntu AS osxcross FROM rust:latest RUN rustup target add x86_64-pc-windows-msvc && \ rustup target add x86_64-apple-darwin && \ + rustup target add aarch64-apple-darwin && \ apt-get update && \ apt-get install -y clang lld libc6-dev libasound2-dev libudev-dev genisoimage && \ cargo install cargo-bundle xwin @@ -16,8 +17,12 @@ ENV PATH="/osxcross/bin:$PATH" \ CC="clang" CXX="clang++" AR="llvm-ar-14" \ CC_x86_64-apple-darwin="o64-clang" \ CXX_x86_64-apple-darwin="o64-clang++" \ + CC_aarch64-apple-darwin="oa64-clang" \ + CXX_aarch64-apple-darwin="o6a4-clang++" \ CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_LINKER="lld-link" \ CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER="o64-clang" \ CARGO_TARGET_X86_64_APPLE_DARWIN_AR="llvm-ar-14" \ + CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER="oa64-clang" \ + CARGO_TARGET_AARCH64_APPLE_DARWIN_AR="llvm-ar-14" \ RUSTFLAGS="-Lnative=/xwin/crt/lib/x86_64 -Lnative=/xwin/sdk/lib/um/x86_64 -Lnative=/xwin/sdk/lib/ucrt/x86_64" \ MACOSX_DEPLOYMENT_TARGET="14.5" diff --git a/scripts/do-release.sh b/scripts/do-release.sh index c57b219..02f5121 100755 --- a/scripts/do-release.sh +++ b/scripts/do-release.sh @@ -19,13 +19,21 @@ cp target/x86_64-pc-windows-msvc/release/lemur.exe output cargo bundle --release --target x86_64-pc-windows-msvc --format msi cp target/x86_64-pc-windows-msvc/release/bundle/msi/Lemur.msi output -# Build for MacOS +# Build for MacOS Intel cargo build --release --target x86_64-apple-darwin -cp target/x86_64-apple-darwin/release/lemur output/lemur-osx +cp target/x86_64-apple-darwin/release/lemur output/lemur-osx-intel -# Bundle for MacOS +# Bundle for MacOS Intel cargo bundle --release --target x86_64-apple-darwin --format osx -genisoimage -V lemur -D -R -apple -no-pad -o output/Lemur.dmg target/x86_64-apple-darwin/release/bundle/osx +genisoimage -V lemur -D -R -apple -no-pad -o output/Lemur-Intel.dmg target/x86_64-apple-darwin/release/bundle/osx + +# Build for MacOS Apple Silicon +cargo build --release --target aarch64-apple-darwin +cp target/aarch64-apple-darwin/release/lemur output/lemur-osx-apple-silicon + +# Bundle for MacOS Apple Silicon +cargo bundle --release --target aarch64-apple-darwin --format osx +genisoimage -V lemur -D -R -apple -no-pad -o output/Lemur-Apple-Silicon.dmg target/aarch64-apple-darwin/release/bundle/osx # Clean up after ourselves cargo clean \ No newline at end of file