update build scripts

This commit is contained in:
Peter Steinberger 2025-06-21 16:07:20 +02:00
parent f3dbfab510
commit 382f108f72
4 changed files with 120 additions and 31 deletions

View file

@ -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 <<EOF
tell application "Finder"
tell disk "$DMG_VOLUME_NAME"
open
-- Get the window
set current view of container window to icon view
set toolbar visible of container window to false
set statusbar visible of container window to false
-- Set window bounds (centered, 500x320)
set the bounds of container window to {400, 100, 900, 420}
-- Configure icon view options
set viewOptions to the icon view options of container window
set arrangement of viewOptions to not arranged
set icon size of viewOptions to 128
-- Set background
set background picture of viewOptions to file ".background:background.png"
-- Set text color to white
set text size of viewOptions to 12
set label position of viewOptions to bottom
-- Position items
set position of item "VibeTunnel.app" of container window to {125, 160}
set position of item "Applications" of container window to {375, 160}
-- Set extended attributes for better appearance
set shows item info of viewOptions to false
set shows icon preview of viewOptions to true
-- Update without registering applications
update without registering applications
delay 2
-- Close and reopen to ensure settings stick
close
open
delay 1
end tell
end tell
EOF
# Give Finder time to update
sleep 3
# Force close Finder window to ensure settings are saved
osascript -e 'tell application "Finder" to close every window'
# Unmount with retry
echo "Unmounting DMG..."
for i in {1..5}; do
if hdiutil detach "$MOUNT_POINT" -quiet 2>/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 ==="

View file

@ -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"
ls -lh "$PREBUILTS_DIR"/arm64/vibetunnel 2>/dev/null && echo " ✓ arm64 Bun binary downloaded" || echo " ✗ arm64 Bun binary missing"

View file

@ -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

View file

@ -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."
echo -e "\n${BLUE}Note:${NC} VibeTunnel requires Apple Silicon (M1/M2/M3) Macs."