-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathbuild_workstation_mac.sh
More file actions
53 lines (40 loc) · 1.64 KB
/
build_workstation_mac.sh
File metadata and controls
53 lines (40 loc) · 1.64 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
#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "$0")" && pwd)"
# -----------------------
# Trainer: deps + build
# -----------------------
cd "$ROOT/trainer"
source env/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install pyinstaller
python src/build/run_pyinstaller_trainer.py
deactivate
# -----------------------
# Painter: deps + build
# -----------------------
cd "$ROOT/painter"
source env/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install pyinstaller
python src/build/run_pyinstaller_workstation.py
deactivate
# -----------------------
# Bundle trainer into app
# -----------------------
APP="$ROOT/painter/dist/RootPainter.app"
APP_MACOS="$APP/Contents/MacOS"
# Sanity checks (fail fast, no mystery)
test -d "$APP" || { echo "ERROR: app not found at: $APP"; exit 1; }
test -d "$ROOT/trainer/src/dist/RootPainterTrainer" || { echo "ERROR: trainer onedir not found at: $ROOT/trainer/src/dist/RootPainterTrainer"; exit 1; }
test -f "$ROOT/trainer/src/dist/RootPainterTrainer/RootPainterTrainer" || { echo "ERROR: trainer executable missing inside onedir folder"; exit 1; }
# Ensure we don't accidentally launch a stale single-file helper
rm -f "$APP_MACOS/RootPainterTrainer"
# Copy the full onedir folder into the app as a bundle folder
rm -rf "$APP_MACOS/RootPainterTrainerBundle"
cp -R "$ROOT/trainer/src/dist/RootPainterTrainer" "$APP_MACOS/RootPainterTrainerBundle"
# Make sure main trainer binary is executable
chmod +x "$APP_MACOS/RootPainterTrainerBundle/RootPainterTrainer"
echo "OK: built workstation app at: $APP"