File size: 1,369 Bytes
395651c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash

# MathSolver v3.1 Setup Script for macOS

echo "πŸš€ Starting Environment Setup..."

# 1. System Dependencies (Homebrew)
if command -v brew >/dev/null 2>&1; then
    echo "πŸ“¦ Installing system dependencies via Homebrew..."
    brew install pango pkg-config glib librsvg
else
    echo "⚠️ Homebrew not found. Please install it first: https://brew.sh/"
    exit 1
fi

# 2. Python SSL Certificates
PYTHON_VERSION=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
CERT_FILE="/Applications/Python ${PYTHON_VERSION}/Install Certificates.command"

if [ -f "$CERT_FILE" ]; then
    echo "πŸ” Installing Python SSL certificates..."
    sh "$CERT_FILE"
else
    echo "ℹ️ SSL certificate installer not found at $CERT_FILE. Skipping..."
fi

# 3. Virtual Environment
echo "🐍 Setting up Python Virtual Environment..."
cd backend
python3 -m venv venv
source venv/bin/activate

# 4. Pip packages
echo "πŸ“¦ Installing Python packages..."
pip install --upgrade pip
pip install -r requirements.txt

# 5. Fix ManimPango (Crucial for macOS arm64)
echo "πŸ› οΈ Rebuilding ManimPango from source to ensure library linking..."
pip install --no-cache-dir --force-reinstall --no-binary manimpango manimpango

echo "βœ… Setup Complete!"
echo "To start the backend, run: source venv/bin/activate && uvicorn app.main:app --reload"