Files
volvodisplay/build.sh

38 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# Source virtual environment if it exists
if [ -d ".venv" ]; then
source .venv/bin/activate
elif [ -d "venv" ]; then
source venv/bin/activate
fi
# Install dependencies if not already installed
pip install -r requirements.txt
# Run PyInstaller
# --name: Name of the binary
# --onefile: Create a single executable file
# --windowed: No console window (useful for GUI apps)
# --add-data: Include main.qml in the binary
# --clean: Clean cache
# --noconfirm: overwrite existing build directory
echo "Building volvo_display binary..."
pyinstaller --name "volvodisplay" \
--onefile \
--windowed \
--clean \
--noconfirm \
--add-data "main.qml:." \
--add-data "TemperatureGauge.qml:." \
--exclude-module PySide6.QtWebEngineQuick \
--exclude-module PySide6.QtWebEngineCore \
--exclude-module PySide6.QtQuick3DSpatialAudio \
main.py
echo "Build complete. Binary is in 'dist/volvodisplay'"
cp config.json dist/
echo "Copied config.json to 'dist/'"