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