Merge bundle-daemon: package spaceshd in the macOS app

This commit is contained in:
2026-06-15 11:39:03 +07:00
3 changed files with 25 additions and 2 deletions
+3
View File
@@ -3,3 +3,6 @@
node_modules/
app/dist/
.DS_Store
# Generated daemon sidecar for DMG bundling (make dmg)
app/src-tauri/bin/
+16 -2
View File
@@ -5,6 +5,9 @@ APP_DIR := app
TAURI_TARGET := universal-apple-darwin
DMG_DIR := $(APP_DIR)/src-tauri/target/$(TAURI_TARGET)/release/bundle/dmg
NATIVE_DMG_DIR := $(APP_DIR)/src-tauri/target/release/bundle/dmg
NATIVE_TRIPLE := $(shell rustc -vV 2>/dev/null | awk '/^host:/{print $$2}')
SIDECAR_DIR := $(APP_DIR)/src-tauri/bin
BUNDLE_CONFIG := src-tauri/tauri.bundle.conf.json
APP_VERSION := $(shell node -p "require('./$(APP_DIR)/src-tauri/tauri.conf.json').version" 2>/dev/null || echo 0.0.0)
LANDING_IMAGE := spacesh-landing
@@ -32,12 +35,23 @@ targets: ## add rust targets for the universal build
.PHONY: dmg
dmg: targets ## build the universal (Intel + Apple Silicon) .dmg — UNSIGNED
cd $(APP_DIR) && npm run tauri build -- --target $(TAURI_TARGET)
# Build the daemon for both arches and lipo into a universal sidecar so it
# ships inside spacesh.app/Contents/MacOS/spaceshd (else the GUI is offline).
cargo build --release -p spaceshd --target aarch64-apple-darwin
cargo build --release -p spaceshd --target x86_64-apple-darwin
mkdir -p $(SIDECAR_DIR)
lipo -create -output $(SIDECAR_DIR)/spaceshd-universal-apple-darwin \
target/aarch64-apple-darwin/release/spaceshd \
target/x86_64-apple-darwin/release/spaceshd
cd $(APP_DIR) && npm run tauri build -- --target $(TAURI_TARGET) --config $(BUNDLE_CONFIG)
@echo "$(DMG_DIR)" && ls -lh $(DMG_DIR)/*.dmg
.PHONY: dmg-native
dmg-native: ## build a .dmg for the current arch only (faster)
cd $(APP_DIR) && npm run tauri build
cargo build --release -p spaceshd
mkdir -p $(SIDECAR_DIR)
cp target/release/spaceshd $(SIDECAR_DIR)/spaceshd-$(NATIVE_TRIPLE)
cd $(APP_DIR) && npm run tauri build -- --config $(BUNDLE_CONFIG)
@ls -lh $(NATIVE_DMG_DIR)/*.dmg
.PHONY: dev
+6
View File
@@ -0,0 +1,6 @@
{
"$schema": "https://schema.tauri.app/config/2",
"bundle": {
"externalBin": ["bin/spaceshd"]
}
}