-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocal_build.sh
More file actions
executable file
·117 lines (98 loc) · 3.36 KB
/
local_build.sh
File metadata and controls
executable file
·117 lines (98 loc) · 3.36 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/bin/bash
# ---------------------------------------------------------------------------
# so-vits-svc-fork-osx - Local Build Script
# Replicates the GitHub Actions build process for local testing
# ---------------------------------------------------------------------------
set -e # Exit on error
echo "=========================================="
echo "so-vits-svc-fork-osx - Local Build"
echo "=========================================="
echo ""
# This script mirrors .github/workflows/build-macos-release.yml
# for local testing without needing to push to GitHub
cd "$(dirname "$0")"
# Check Python 3.11 (same as GitHub Actions)
if ! command -v python3.11 &> /dev/null && ! python3 --version 2>&1 | grep -q "3.11"; then
echo "ERROR: Python 3.11 not found"
echo "GitHub Actions uses Python 3.11. Please install it for consistent builds."
exit 1
fi
PYTHON="python3"
if command -v python3.11 &> /dev/null; then
PYTHON="python3.11"
fi
echo "Using Python: $($PYTHON --version)"
echo ""
# Install Python dependencies
echo "Installing Python dependencies..."
$PYTHON -m pip install --upgrade pip
pip install -r requirements_macos.txt
# Install the package itself
pip install -e .
echo ""
# Generate app icon
echo "Generating app icon..."
chmod +x build/macos/generate_icon.sh
./build/macos/generate_icon.sh
echo ""
# Check build/macos assets (same checks as GitHub Actions)
echo "Checking build assets..."
if [ ! -f "build/macos/SoVitsSVC-OSX.icns" ]; then
echo "ERROR: build/macos/SoVitsSVC-OSX.icns not found after generation."
exit 1
fi
if [ ! -f "build/macos/codesign.sh" ]; then
echo "ERROR: build/macos/codesign.sh not found."
exit 1
fi
if [ ! -f ".github/DMG_README.txt" ]; then
echo "ERROR: .github/DMG_README.txt not found."
exit 1
fi
echo "✓ All build assets present"
echo ""
# Clean previous PyInstaller outputs
echo "Cleaning previous builds..."
rm -rf dist/SoVitsSVC-OSX.app build/SoVitsSVC-OSX
# Build with PyInstaller
echo "Building with PyInstaller..."
$PYTHON -m PyInstaller SoVitsSVC-OSX.spec --clean --noconfirm
echo ""
# Verify executable and set permissions
echo "Verifying executable and setting permissions..."
if [ -f "dist/SoVitsSVC-OSX.app/Contents/MacOS/SoVitsSVC-OSX_bin" ]; then
chmod +x dist/SoVitsSVC-OSX.app/Contents/MacOS/SoVitsSVC-OSX_bin
echo "✓ Executable verified and permissions set"
else
echo "ERROR: Executable 'SoVitsSVC-OSX_bin' not found!"
exit 1
fi
# Code sign the app bundle
echo ""
echo "Code signing app bundle..."
chmod +x build/macos/codesign.sh
MACOS_SIGNING_IDENTITY="-" ./build/macos/codesign.sh dist/SoVitsSVC-OSX.app
echo ""
echo "=========================================="
echo "✓ Build Complete!"
echo "=========================================="
echo ""
echo "App: dist/SoVitsSVC-OSX.app"
echo ""
echo "To test:"
echo " open dist/SoVitsSVC-OSX.app"
echo ""
echo "To test MPS GPU acceleration:"
echo " python build/macos/test_mps.py"
echo ""
echo "If blocked by Gatekeeper:"
echo " xattr -cr dist/SoVitsSVC-OSX.app"
echo " (then right-click → Open)"
echo ""
echo "To create DMG (optional):"
echo " mkdir -p dmg_temp"
echo " cp -R dist/SoVitsSVC-OSX.app dmg_temp/"
echo " ln -s /Applications dmg_temp/Applications"
echo " cp .github/DMG_README.txt dmg_temp/README.txt"
echo " hdiutil create -volname 'so-vits-svc OSX' -srcfolder dmg_temp -ov -format UDZO SoVitsSVC-OSX-macOS.dmg"
echo ""