feat(misc): add make task to build universal mac bundle
This commit is contained in:
parent
c8887fdee0
commit
de8879e03c
|
@ -7,7 +7,7 @@ RELEASE = false
|
|||
NO_X11 = false
|
||||
NO_MODULO = false
|
||||
EXEC_PATH = "target/debug/espanso"
|
||||
BUILD_ARCH = "x86_64" # TODO: do something with this
|
||||
BUILD_ARCH = "current"
|
||||
|
||||
[env.release]
|
||||
DEBUG = false
|
||||
|
@ -48,10 +48,31 @@ dependencies = ["build-windows-portable", "build-windows-installer"]
|
|||
|
||||
# macOS
|
||||
|
||||
[tasks.build-macos-arm-binary]
|
||||
env = { "BUILD_ARCH" = "aarch64-apple-darwin" }
|
||||
run_task = [
|
||||
{ name = "build-binary" }
|
||||
]
|
||||
|
||||
[tasks.build-macos-x86-binary]
|
||||
env = { "BUILD_ARCH" = "x86_64-apple-darwin" }
|
||||
run_task = [
|
||||
{ name = "build-binary" }
|
||||
]
|
||||
|
||||
[tasks.build-universal-binary]
|
||||
script = { file = "scripts/join_universal_binary.sh"}
|
||||
dependencies=["build-macos-arm-binary", "build-macos-x86-binary"]
|
||||
|
||||
[tasks.create-bundle]
|
||||
script = { file = "scripts/create_bundle.sh" }
|
||||
dependencies=["build-binary"]
|
||||
|
||||
[tasks.create-universal-bundle]
|
||||
env = { "EXEC_PATH" = "target/universal/espanso" }
|
||||
script = { file = "scripts/create_bundle.sh" }
|
||||
dependencies=["build-universal-binary"]
|
||||
|
||||
[tasks.run-bundle]
|
||||
command="target/mac/Espanso.app/Contents/MacOS/espanso"
|
||||
args=["${@}"]
|
||||
|
|
|
@ -37,6 +37,12 @@ fn main() {
|
|||
args.push("--release");
|
||||
}
|
||||
|
||||
let override_target_arch = envmnt::get_or("BUILD_ARCH", "current");
|
||||
if override_target_arch != "current" {
|
||||
args.push("--target");
|
||||
args.push(&override_target_arch);
|
||||
}
|
||||
|
||||
args.push("--manifest-path");
|
||||
args.push("espanso/Cargo.toml");
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
set -e
|
||||
|
||||
TARGET_DIR=target/mac/Espanso.app
|
||||
|
||||
rm -Rf $TARGET_DIR
|
||||
|
|
9
scripts/join_universal_binary.sh
Normal file
9
scripts/join_universal_binary.sh
Normal file
|
@ -0,0 +1,9 @@
|
|||
set -e
|
||||
|
||||
TARGET_DIR=target/universal
|
||||
|
||||
rm -Rf $TARGET_DIR
|
||||
|
||||
mkdir -p $TARGET_DIR
|
||||
|
||||
lipo -create -output "$TARGET_DIR/espanso" ./target/x86_64-apple-darwin/release/espanso ./target/aarch64-apple-darwin/release/espanso
|
Loading…
Reference in New Issue
Block a user