#!/bin/bash # GWEncoder v3.0 Build Script # This script builds the unified GWEncoder tool set -e echo "🚀 Building GWEncoder v3.0 - Unified Video Encoding Tool" echo "========================================================" # Check if Go is installed if ! command -v go &> /dev/null; then echo "❌ Go is not installed or not in PATH" echo "Please install Go first:" echo " Ubuntu/Debian: sudo apt install golang-go" echo " CentOS/RHEL: sudo yum install golang" echo " macOS: brew install go" exit 1 fi echo "✅ Go found: $(go version)" # Build the shared utilities package echo "" echo "📦 Building shared utilities package (gwutils)..." cd gwutils go mod tidy go build echo "✅ gwutils package built successfully" # Build the unified encoder echo "" echo "🎬 Building unified GWEncoder binary..." cd ../gwencoder go mod tidy go build -o gwencoder main.go # Make executable chmod +x gwencoder echo "✅ GWEncoder binary built successfully" echo "" echo "🎉 Build complete!" echo "" echo "Usage examples:" echo " ./gwencoder --fast # Fast AV1 encoding" echo " ./gwencoder --web # Web-optimized encoding" echo " ./gwencoder --quick # Quick encoding" echo " ./gwencoder --tiny # Tiny file encoding" echo " ./gwencoder --full # Full interactive mode" echo " ./gwencoder --help # Show help" echo " ./gwencoder --info # Show system info" echo "" echo "Binary location: $(pwd)/gwencoder"