41 lines
1.1 KiB
Bash
Executable File
41 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
# Build Rectify as a standalone executable using PyInstaller.
|
|
#
|
|
# Usage:
|
|
# ./build.sh # Build for the current platform
|
|
# ./build.sh --onedir # Build as a directory (faster startup, for development)
|
|
#
|
|
# Prerequisites:
|
|
# pip install pyinstaller
|
|
#
|
|
# Output:
|
|
# dist/rectify (Linux/macOS executable)
|
|
# dist/rectify.exe (Windows executable)
|
|
# dist/Rectify.app (macOS app bundle, macOS only)
|
|
|
|
set -e
|
|
|
|
# Ensure PyInstaller is installed
|
|
if ! command -v pyinstaller &> /dev/null; then
|
|
echo "Installing PyInstaller..."
|
|
pip install pyinstaller
|
|
fi
|
|
|
|
# Build
|
|
if [ "$1" = "--onedir" ]; then
|
|
echo "Building (one-directory mode for development)..."
|
|
pyinstaller --noconfirm --onedir --console=false \
|
|
--name rectify \
|
|
--hidden-import PySide6.QtWidgets \
|
|
--hidden-import PySide6.QtGui \
|
|
--hidden-import PySide6.QtCore \
|
|
rectify/__main__.py
|
|
else
|
|
echo "Building (single-file mode for distribution)..."
|
|
pyinstaller --noconfirm rectify.spec
|
|
fi
|
|
|
|
echo ""
|
|
echo "Build complete. Output in dist/"
|
|
ls -lh dist/rectify* 2>/dev/null || true
|