diff --git a/mac/scripts/create-dmg.sh b/mac/scripts/create-dmg.sh index 14da1101..c425f2d3 100755 --- a/mac/scripts/create-dmg.sh +++ b/mac/scripts/create-dmg.sh @@ -66,16 +66,107 @@ cp -R "$APP_PATH" "$DMG_TEMP/" # Create symbolic link to Applications folder ln -s /Applications "$DMG_TEMP/Applications" -# Create DMG +# Create initial DMG as read-write +DMG_RW_PATH="${DMG_PATH%.dmg}-rw.dmg" hdiutil create \ -volname "$DMG_VOLUME_NAME" \ -srcfolder "$DMG_TEMP" \ -ov \ - -format UDZO \ - "$DMG_PATH" + -format UDRW \ + -size 200m \ + "$DMG_RW_PATH" + +# Clean up temp folder +rm -rf "$DMG_TEMP" + +echo "Applying custom styling to DMG..." + +# Mount the DMG +MOUNT_POINT="/Volumes/$DMG_VOLUME_NAME" +hdiutil attach "$DMG_RW_PATH" -mountpoint "$MOUNT_POINT" -nobrowse + + +# Copy background image +mkdir -p "$MOUNT_POINT/.background" +cp "$PROJECT_DIR/assets/dmg-background-small.png" "$MOUNT_POINT/.background/background.png" + +# Set custom volume icon +if [[ -f "$PROJECT_DIR/assets/appicon-512.png" ]]; then + # Convert PNG to ICNS for volume icon + sips -s format icns "$PROJECT_DIR/assets/appicon-512.png" --out "$MOUNT_POINT/.VolumeIcon.icns" >/dev/null 2>&1 + SetFile -a C "$MOUNT_POINT" 2>/dev/null || true +fi + +# Apply window styling with AppleScript +osascript </dev/null; then + break + fi + echo " Retry $i/5..." + sleep 2 +done + +# Convert to compressed read-only DMG +echo "Converting to final DMG format..." +hdiutil convert "$DMG_RW_PATH" -format ULMO -o "$DMG_PATH" -ov # Clean up -rm -rf "$DMG_TEMP" +rm -f "$DMG_RW_PATH" # === EXTENSIVE ENVIRONMENT DEBUGGING === echo "=== Environment Debug Information ===" diff --git a/mac/scripts/download-bun-binaries.sh b/mac/scripts/download-bun-binaries.sh index b4e6bfcb..d7c96b95 100755 --- a/mac/scripts/download-bun-binaries.sh +++ b/mac/scripts/download-bun-binaries.sh @@ -1,7 +1,7 @@ #!/bin/bash # -# Download pre-built Bun binaries for both architectures -# This allows building universal support without needing both Mac types +# Download pre-built Bun binaries for ARM64 +# VibeTunnel only supports Apple Silicon Macs # set -euo pipefail @@ -21,11 +21,11 @@ PREBUILTS_DIR="$MAC_DIR/Resources/BunPrebuilts" # Bun version - update this as needed BUN_VERSION="1.1.18" -echo -e "${BLUE}Downloading Bun binaries for both architectures...${NC}" +echo -e "${BLUE}Downloading Bun binaries for ARM64...${NC}" echo "Bun version: $BUN_VERSION" -# Create directories -mkdir -p "$PREBUILTS_DIR"/{arm64,x86_64} +# Create directory +mkdir -p "$PREBUILTS_DIR"/arm64 # Function to download and extract Bun download_bun() { @@ -74,13 +74,11 @@ download_bun() { return 0 } -# Download both architectures +# Download ARM64 only download_bun "arm64" "aarch64" || echo -e "${YELLOW}Warning: Failed to download arm64 Bun${NC}" -download_bun "x86_64" "x64" || echo -e "${YELLOW}Warning: Failed to download x86_64 Bun${NC}" -echo -e "\n${BLUE}Note: You still need the native modules (pty.node and spawn-helper) for each architecture.${NC}" -echo "These must be built on the respective architecture." +echo -e "\n${BLUE}Note: You still need the native modules (pty.node and spawn-helper).${NC}" +echo "These must be built on Apple Silicon." echo "" echo "Current status:" -ls -lh "$PREBUILTS_DIR"/arm64/vibetunnel 2>/dev/null && echo " ✓ arm64 Bun binary downloaded" || echo " ✗ arm64 Bun binary missing" -ls -lh "$PREBUILTS_DIR"/x86_64/vibetunnel 2>/dev/null && echo " ✓ x86_64 Bun binary downloaded" || echo " ✗ x86_64 Bun binary missing" \ No newline at end of file +ls -lh "$PREBUILTS_DIR"/arm64/vibetunnel 2>/dev/null && echo " ✓ arm64 Bun binary downloaded" || echo " ✗ arm64 Bun binary missing" \ No newline at end of file diff --git a/mac/scripts/release.sh b/mac/scripts/release.sh index 65c8c8cb..6847d6b6 100755 --- a/mac/scripts/release.sh +++ b/mac/scripts/release.sh @@ -327,9 +327,9 @@ else export IS_PRERELEASE_BUILD=NO fi -# Build universal binary +# Build ARM64 binary echo "" -echo "🔨 Building universal binary (arm64 + x86_64)..." +echo "🔨 Building ARM64 binary..." "$SCRIPT_DIR/build.sh" --configuration Release # Verify build @@ -346,14 +346,15 @@ if [[ "$BUILT_VERSION" != "$BUILD_NUMBER" ]]; then exit 1 fi -# Verify it's a universal binary +# Verify it's an ARM64 binary APP_BINARY="$APP_PATH/Contents/MacOS/VibeTunnel" if [[ -f "$APP_BINARY" ]]; then ARCH_INFO=$(lipo -info "$APP_BINARY" 2>/dev/null || echo "") - if [[ "$ARCH_INFO" == *"x86_64"* ]] && [[ "$ARCH_INFO" == *"arm64"* ]]; then - echo "✅ Universal binary created (arm64 + x86_64)" + if [[ "$ARCH_INFO" == *"arm64"* ]]; then + echo "✅ ARM64 binary created" else - echo -e "${YELLOW}⚠️ Warning: Binary may not be universal: $ARCH_INFO${NC}" + echo -e "${RED}❌ Error: Binary is not ARM64: $ARCH_INFO${NC}" + exit 1 fi fi diff --git a/mac/scripts/setup-bun-prebuilts.sh b/mac/scripts/setup-bun-prebuilts.sh index d5182d12..eaea6415 100755 --- a/mac/scripts/setup-bun-prebuilts.sh +++ b/mac/scripts/setup-bun-prebuilts.sh @@ -22,13 +22,13 @@ MAC_DIR="$SCRIPT_DIR/.." WEB_DIR="$PROJECT_ROOT/web" PREBUILTS_DIR="$MAC_DIR/Resources/BunPrebuilts" -# Get current architecture +# VibeTunnel only supports ARM64 CURRENT_ARCH=$(uname -m) -if [ "$CURRENT_ARCH" = "x86_64" ]; then - ARCH_DIR="x86_64" -else - ARCH_DIR="arm64" +if [ "$CURRENT_ARCH" != "arm64" ]; then + echo -e "${RED}Error: VibeTunnel requires Apple Silicon (ARM64)${NC}" + exit 1 fi +ARCH_DIR="arm64" echo -e "${BLUE}Setting up Bun prebuilt binaries...${NC}" echo "Current architecture: $CURRENT_ARCH" @@ -72,7 +72,7 @@ build_current_arch() { check_status() { echo -e "\n${BLUE}Prebuilt binaries status:${NC}" - for arch in arm64 x86_64; do + for arch in arm64; do echo -n " $arch: " if [ -f "$PREBUILTS_DIR/$arch/vibetunnel" ] && \ [ -f "$PREBUILTS_DIR/$arch/pty.node" ] && \ @@ -100,8 +100,8 @@ case "${1:-build}" in ;; clean) echo -e "${YELLOW}Cleaning prebuilt binaries...${NC}" - rm -rf "$PREBUILTS_DIR"/{arm64,x86_64} - mkdir -p "$PREBUILTS_DIR"/{arm64,x86_64} + rm -rf "$PREBUILTS_DIR"/arm64 + mkdir -p "$PREBUILTS_DIR"/arm64 echo -e "${GREEN}✓ Cleaned${NC}" ;; *) @@ -113,5 +113,4 @@ case "${1:-build}" in ;; esac -echo -e "\n${BLUE}Note:${NC} To support both architectures, run this script on both" -echo " an Intel Mac and an Apple Silicon Mac, then commit the results." \ No newline at end of file +echo -e "\n${BLUE}Note:${NC} VibeTunnel requires Apple Silicon (M1/M2/M3) Macs." \ No newline at end of file