91e75e620b
CI: cua-driver distro-compat matrix / debian:12 (glibc 2.36) (push) Has been cancelled
CI: SPDX Headers / Check SPDX headers (warn-only) (push) Has been cancelled
CD: Docs MCP Server / build (linux/amd64) (push) Has been cancelled
CD: Docs MCP Server / build (linux/arm64) (push) Has been cancelled
CD: Docs MCP Server / merge (push) Has been cancelled
CI: cua-driver distro-compat matrix / Resolve release version (push) Has been cancelled
CI: cua-driver distro-compat matrix / fedora:41 (glibc 2.40) (push) Has been cancelled
CI: cua-driver distro-compat matrix / rockylinux:9 (glibc 2.34) (push) Has been cancelled
CI: cua-driver distro-compat matrix / ubuntu:22.04 (glibc 2.35) (push) Has been cancelled
CI: cua-driver distro-compat matrix / ubuntu:24.04 (glibc 2.39) (push) Has been cancelled
CI: cua-driver distro-compat matrix / Distro compat summary (push) Has been cancelled
CI: Rust Linux unit / Rust Linux unit and compile (push) Has been cancelled
CI: Rust Windows unit / Rust Windows unit and compile (push) Has been cancelled
CI: Nix Linux Rust source / Nix / compositor build (push) Has been cancelled
CI: Nix Linux Rust source / Nix / driver package (push) Has been cancelled
CI: Nix Linux Rust source / Nix / Rust unit tests (push) Has been cancelled
71 lines
2.3 KiB
Bash
Executable File
71 lines
2.3 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
# Get the directory where this script is located
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
|
|
# Navigate to the lume root directory (two levels up from scripts/build/)
|
|
LUME_DIR="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
|
|
|
cd "$LUME_DIR"
|
|
|
|
swift build -c release --product lume
|
|
|
|
# Assemble .app bundle
|
|
APP_BUNDLE=".release/lume.app"
|
|
mkdir -p "$APP_BUNDLE/Contents/MacOS"
|
|
|
|
cp -f .build/release/lume "$APP_BUNDLE/Contents/MacOS/lume"
|
|
|
|
# Copy resource bundle to Contents/Resources/.
|
|
# It CANNOT go in Contents/MacOS/ (breaks codesign: "bundle format unrecognized")
|
|
# and CANNOT go at the .app root (breaks codesign: "unsealed contents").
|
|
# The Swift code uses Bundle.lumeResources which checks resourceURL first.
|
|
mkdir -p "$APP_BUNDLE/Contents/Resources"
|
|
if [ -d ".build/release/lume_lume.bundle" ]; then
|
|
cp -rf .build/release/lume_lume.bundle "$APP_BUNDLE/Contents/Resources/"
|
|
fi
|
|
|
|
# Stamp Info.plist with version from VERSION file
|
|
VERSION=$(cat VERSION 2>/dev/null || echo "0.0.0")
|
|
sed "s/__VERSION__/$VERSION/g" "./resources/Info.plist" > "$APP_BUNDLE/Contents/Info.plist"
|
|
|
|
# Embed provisioning profile if available
|
|
if [ -f "./resources/embedded.provisionprofile" ]; then
|
|
cp "./resources/embedded.provisionprofile" "$APP_BUNDLE/Contents/embedded.provisionprofile"
|
|
fi
|
|
|
|
# Ad-hoc sign the bundle
|
|
codesign --force --entitlements ./resources/lume.entitlements --sign - "$APP_BUNDLE/Contents/MacOS/lume"
|
|
codesign --force --sign - "$APP_BUNDLE"
|
|
|
|
# Create wrapper script
|
|
mkdir -p .release
|
|
cat > .release/lume <<'WRAPPER_EOF'
|
|
#!/bin/sh
|
|
exec "$(dirname "$0")/lume.app/Contents/MacOS/lume" "$@"
|
|
WRAPPER_EOF
|
|
chmod +x .release/lume
|
|
|
|
# Install to user-local bin directory (standard location)
|
|
USER_BIN="$HOME/.local/bin"
|
|
APP_INSTALL_DIR="$HOME/.local/share/lume"
|
|
|
|
mkdir -p "$USER_BIN"
|
|
mkdir -p "$APP_INSTALL_DIR"
|
|
|
|
# Install .app bundle
|
|
rm -rf "$APP_INSTALL_DIR/lume.app"
|
|
cp -R ".release/lume.app" "$APP_INSTALL_DIR/"
|
|
|
|
# Create wrapper script in bin directory
|
|
cat > "$USER_BIN/lume" <<WRAPPER_EOF
|
|
#!/bin/sh
|
|
exec "$APP_INSTALL_DIR/lume.app/Contents/MacOS/lume" "\$@"
|
|
WRAPPER_EOF
|
|
chmod +x "$USER_BIN/lume"
|
|
|
|
# Advise user to add to PATH if not present
|
|
if ! echo "$PATH" | grep -q "$USER_BIN"; then
|
|
echo "[lume build] Note: $USER_BIN is not in your PATH. Add 'export PATH=\"$USER_BIN:\$PATH\"' to your shell profile."
|
|
fi
|