#!/bin/bash # Build script for Linux with CUDA support (falls back to CPU if no GPU) echo "Building Local Transcription for Linux..." echo "=========================================" echo "" echo "This build includes CUDA support and works on both GPU and CPU systems." echo "" # Clean previous builds echo "Cleaning previous builds..." rm -rf build dist # Sync dependencies (uses PyTorch CUDA from pyproject.toml) echo "Installing dependencies with CUDA support..." uv sync # Build with PyInstaller # Note: enum34 is excluded in local-transcription.spec echo "Running PyInstaller..." uv run pyinstaller local-transcription.spec # Check if build succeeded if [ -d "dist/LocalTranscription" ]; then echo "" echo "✓ Build successful!" echo "Executable location: dist/LocalTranscription/LocalTranscription" echo "" echo "CUDA Support: YES (automatically falls back to CPU if no GPU detected)" echo "" echo "To run the application:" echo " cd dist/LocalTranscription" echo " ./LocalTranscription" echo "" echo "To create a distributable package:" echo " cd dist" echo " tar -czf LocalTranscription-Linux.tar.gz LocalTranscription/" else echo "" echo "✗ Build failed!" exit 1 fi