61 lines
1.7 KiB
Bash
61 lines
1.7 KiB
Bash
#!/bin/bash
|
|
# Piano Highlight Generator - Build Script for Linux/macOS
|
|
# Prerequisites: Python 3.10+, FFmpeg (in PATH)
|
|
|
|
set -e
|
|
|
|
echo "================================================"
|
|
echo " Piano Highlight Generator - Nuitka Build"
|
|
echo "================================================"
|
|
echo ""
|
|
|
|
# Check Python version
|
|
echo "Checking Python version..."
|
|
python3 --version || { echo "ERROR: Python not found. Please install Python 3.10 or higher."; exit 1; }
|
|
|
|
# Check FFmpeg
|
|
echo ""
|
|
echo "Checking FFmpeg..."
|
|
if ! command -v ffmpeg &> /dev/null; then
|
|
echo "WARNING: FFmpeg not found in PATH. The built executable will require FFmpeg."
|
|
echo "Please install FFmpeg: sudo apt install ffmpeg (Ubuntu/Debian) or brew install ffmpeg (macOS)"
|
|
echo ""
|
|
fi
|
|
|
|
# Create dist directory if not exists
|
|
mkdir -p dist
|
|
|
|
# Install build dependencies
|
|
echo ""
|
|
echo "Installing build dependencies..."
|
|
pip3 install nuitka pandas
|
|
|
|
# Build
|
|
echo ""
|
|
echo "Starting Nuitka compilation..."
|
|
echo "This may take several minutes on first run..."
|
|
echo ""
|
|
|
|
python3 -m nuitka \
|
|
--standalone \
|
|
--onefile \
|
|
--output-dir=dist \
|
|
--output-name=PianoHighlightGenerator \
|
|
--enable-plugin=pyside6 \
|
|
--include-data-files=src/core/prompts=prompts \
|
|
--python-version=3.10 \
|
|
src/main.py
|
|
|
|
echo ""
|
|
echo "================================================"
|
|
echo " Build complete!"
|
|
echo "================================================"
|
|
echo ""
|
|
echo "Output: dist/PianoHighlightGenerator.bin"
|
|
echo ""
|
|
echo "NOTE: FFmpeg must be in PATH for the executable to work."
|
|
echo ""
|
|
echo "To run FFmpeg from a specific location, either:"
|
|
echo " 1. Add FFmpeg to your PATH"
|
|
echo " 2. Place FFmpeg binary in the same directory as the executable"
|
|
echo "" |