b2446d9a by 柴进

:wastebasket:️ 删除冗余的 build_mac.sh,保留 build_mac_universal.sh

build_mac_universal.sh 是严格超集:自动检测架构、自动安装依赖、错误处理更完善。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f43f58e4
1 #!/bin/bash
2 # macOS Build Script for Gemini Image Generator
3
4 echo "================================"
5 echo "Building Gemini Image Generator"
6 echo "================================"
7
8 # Check if virtual environment exists
9 if [ ! -d ".venv" ]; then
10 echo "Creating virtual environment..."
11 /opt/homebrew/bin/python3.11 -m venv .venv
12 fi
13
14 # Activate virtual environment
15 echo "Activating virtual environment..."
16 source .venv/bin/activate
17
18 # Install dependencies
19 echo "Installing dependencies..."
20 pip install --upgrade pip
21 pip install -r requirements.txt
22
23 # Clean previous builds
24 echo "Cleaning previous builds..."
25 rm -rf build dist *.spec
26
27 # Build executable
28 echo "Building executable..."
29 pyinstaller --name="ZB100ImageGenerator" \
30 --onedir \
31 --windowed \
32 --add-data "config.json:." \
33 --icon=zb100_mac.icns \
34 image_generator.py
35
36 # Check if build was successful
37 if [ -f "dist/ZB100ImageGenerator.app/Contents/MacOS/ZB100ImageGenerator" ] || [ -f "dist/ZB100ImageGenerator" ]; then
38 echo "================================"
39 echo "Build successful!"
40 echo "Application: dist/ZB100ImageGenerator.app (or dist/ZB100ImageGenerator)"
41 echo "================================"
42 else
43 echo "================================"
44 echo "Build failed!"
45 echo "================================"
46 fi