mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-27 15:17:38 +00:00
Fix Xcode build scripts for Bun -> SEA transition.
This commit is contained in:
parent
5ede1a50e0
commit
5d932d7c3d
3 changed files with 27 additions and 37 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Build and copy Bun executable and native modules to the app bundle
|
# Build and copy Node.js SEA executable and native modules to the app bundle
|
||||||
# ARM64 only - VibeTunnel requires Apple Silicon
|
# ARM64 only - VibeTunnel requires Apple Silicon
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
@ -29,7 +29,7 @@ else
|
||||||
DEST_RESOURCES="$1"
|
DEST_RESOURCES="$1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "${GREEN}Building and copying Bun executable (ARM64 only)...${NC}"
|
echo -e "${GREEN}Building and copying Node.js SEA executable (ARM64 only)...${NC}"
|
||||||
|
|
||||||
# Change to web directory
|
# Change to web directory
|
||||||
cd "$WEB_DIR"
|
cd "$WEB_DIR"
|
||||||
|
|
@ -56,24 +56,18 @@ if [ ! -d "$NATIVE_DIR" ] || [ ! -f "$NATIVE_DIR/vibetunnel" ]; then
|
||||||
chmod +x "$NATIVE_DIR/vibetunnel"
|
chmod +x "$NATIVE_DIR/vibetunnel"
|
||||||
chmod +x "$NATIVE_DIR/spawn-helper"
|
chmod +x "$NATIVE_DIR/spawn-helper"
|
||||||
else
|
else
|
||||||
# Try to build if Bun is available
|
# Try to build with Node.js
|
||||||
echo -e "${YELLOW}Prebuilt binaries not found. Attempting to build...${NC}"
|
echo -e "${YELLOW}Prebuilt binaries not found. Attempting to build...${NC}"
|
||||||
|
|
||||||
# Check if build-native.js exists
|
# Check if build-native.js exists
|
||||||
if [ -f "build-native.js" ]; then
|
if [ -f "build-native.js" ]; then
|
||||||
# Try different ways to run bun
|
# Use Node.js to build
|
||||||
if command -v bun &> /dev/null; then
|
if command -v node &> /dev/null; then
|
||||||
echo "Using bun to build..."
|
echo "Using Node.js to build SEA executable..."
|
||||||
bun build-native.js
|
|
||||||
elif command -v npx &> /dev/null; then
|
|
||||||
echo "Bun not found, using npx bun to build..."
|
|
||||||
npx -y bun build-native.js
|
|
||||||
elif command -v node &> /dev/null; then
|
|
||||||
echo "Using node to build (fallback)..."
|
|
||||||
node build-native.js
|
node build-native.js
|
||||||
else
|
else
|
||||||
echo -e "${RED}Error: No JavaScript runtime found (bun, npx, or node).${NC}"
|
echo -e "${RED}Error: Node.js not found.${NC}"
|
||||||
echo -e "${RED}Please ensure prebuilt binaries are available in:${NC}"
|
echo -e "${RED}Please install Node.js 20+ or ensure prebuilt binaries are available in:${NC}"
|
||||||
echo -e "${RED} $PREBUILTS_DIR/arm64/${NC}"
|
echo -e "${RED} $PREBUILTS_DIR/arm64/${NC}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
@ -86,12 +80,12 @@ fi
|
||||||
|
|
||||||
# Verify native files exist
|
# Verify native files exist
|
||||||
if [ ! -f "$NATIVE_DIR/vibetunnel" ]; then
|
if [ ! -f "$NATIVE_DIR/vibetunnel" ]; then
|
||||||
echo -e "${RED}Error: Bun executable not found at $NATIVE_DIR/vibetunnel${NC}"
|
echo -e "${RED}Error: Executable not found at $NATIVE_DIR/vibetunnel${NC}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Copy Bun executable
|
# Copy executable
|
||||||
echo "Copying Bun executable to app bundle..."
|
echo "Copying executable to app bundle..."
|
||||||
cp "$NATIVE_DIR/vibetunnel" "$DEST_RESOURCES/"
|
cp "$NATIVE_DIR/vibetunnel" "$DEST_RESOURCES/"
|
||||||
chmod +x "$DEST_RESOURCES/vibetunnel"
|
chmod +x "$DEST_RESOURCES/vibetunnel"
|
||||||
|
|
||||||
|
|
@ -113,7 +107,7 @@ else
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "${GREEN}✓ Bun executable and native modules copied successfully${NC}"
|
echo -e "${GREEN}✓ Executable and native modules copied successfully${NC}"
|
||||||
|
|
||||||
# Verify the files
|
# Verify the files
|
||||||
echo "Verifying copied files:"
|
echo "Verifying copied files:"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copy Bun executable and native modules to the app bundle
|
# Copy executable and native modules to the app bundle
|
||||||
#
|
#
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
@ -26,7 +26,7 @@ fi
|
||||||
|
|
||||||
DEST_RESOURCES="$1"
|
DEST_RESOURCES="$1"
|
||||||
|
|
||||||
echo -e "${GREEN}Copying Bun executable and native modules...${NC}"
|
echo -e "${GREEN}Copying executable and native modules...${NC}"
|
||||||
|
|
||||||
# Check if native directory exists
|
# Check if native directory exists
|
||||||
if [ ! -d "$NATIVE_DIR" ]; then
|
if [ ! -d "$NATIVE_DIR" ]; then
|
||||||
|
|
@ -35,14 +35,14 @@ if [ ! -d "$NATIVE_DIR" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if Bun executable exists
|
# Check if executable exists
|
||||||
if [ ! -f "$NATIVE_DIR/vibetunnel" ]; then
|
if [ ! -f "$NATIVE_DIR/vibetunnel" ]; then
|
||||||
echo -e "${YELLOW}Warning: Bun executable not found at $NATIVE_DIR/vibetunnel${NC}"
|
echo -e "${YELLOW}Warning: Executable not found at $NATIVE_DIR/vibetunnel${NC}"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Copy Bun executable
|
# Copy executable
|
||||||
echo "Copying Bun executable..."
|
echo "Copying executable..."
|
||||||
cp "$NATIVE_DIR/vibetunnel" "$DEST_RESOURCES/"
|
cp "$NATIVE_DIR/vibetunnel" "$DEST_RESOURCES/"
|
||||||
chmod +x "$DEST_RESOURCES/vibetunnel"
|
chmod +x "$DEST_RESOURCES/vibetunnel"
|
||||||
|
|
||||||
|
|
@ -58,7 +58,7 @@ if [ -f "$NATIVE_DIR/spawn-helper" ]; then
|
||||||
chmod +x "$DEST_RESOURCES/spawn-helper"
|
chmod +x "$DEST_RESOURCES/spawn-helper"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "${GREEN}✓ Bun executable and native modules copied successfully${NC}"
|
echo -e "${GREEN}✓ Executable and native modules copied successfully${NC}"
|
||||||
|
|
||||||
# Verify the files
|
# Verify the files
|
||||||
echo "Verifying copied files:"
|
echo "Verifying copied files:"
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Setup pre-built Bun binaries for universal app support
|
# Setup pre-built binaries for universal app support
|
||||||
#
|
#
|
||||||
# This script copies the current architecture's Bun binaries to the prebuilts directory
|
# This script copies the current architecture's binaries to the prebuilts directory
|
||||||
# and can also download pre-built binaries for other architectures if needed.
|
# and can also download pre-built binaries for other architectures if needed.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
@ -30,27 +30,23 @@ if [ "$CURRENT_ARCH" != "arm64" ]; then
|
||||||
fi
|
fi
|
||||||
ARCH_DIR="arm64"
|
ARCH_DIR="arm64"
|
||||||
|
|
||||||
echo -e "${BLUE}Setting up Bun prebuilt binaries...${NC}"
|
echo -e "${BLUE}Setting up prebuilt binaries...${NC}"
|
||||||
echo "Current architecture: $CURRENT_ARCH"
|
echo "Current architecture: $CURRENT_ARCH"
|
||||||
|
|
||||||
# Function to build and copy binaries for current architecture
|
# Function to build and copy binaries for current architecture
|
||||||
build_current_arch() {
|
build_current_arch() {
|
||||||
echo -e "${YELLOW}Building Bun binaries for $CURRENT_ARCH...${NC}"
|
echo -e "${YELLOW}Building binaries for $CURRENT_ARCH...${NC}"
|
||||||
|
|
||||||
cd "$WEB_DIR"
|
cd "$WEB_DIR"
|
||||||
|
|
||||||
# Build if native directory doesn't exist
|
# Build if native directory doesn't exist
|
||||||
if [ ! -f "native/vibetunnel" ]; then
|
if [ ! -f "native/vibetunnel" ]; then
|
||||||
echo "Building Bun executable..."
|
echo "Building executable..."
|
||||||
if command -v bun &> /dev/null; then
|
if command -v node &> /dev/null; then
|
||||||
bun build-native.js
|
|
||||||
elif command -v npx &> /dev/null; then
|
|
||||||
echo "Using npx bun..."
|
|
||||||
npx -y bun build-native.js
|
|
||||||
elif command -v node &> /dev/null; then
|
|
||||||
node build-native.js
|
node build-native.js
|
||||||
else
|
else
|
||||||
echo -e "${RED}Error: No JavaScript runtime found (bun, npx, or node).${NC}"
|
echo -e "${RED}Error: Node.js not found.${NC}"
|
||||||
|
echo -e "${RED}Please install Node.js 20+ to build the executable.${NC}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue