3 BUILD
Gemini CLI edited this page 2026-03-15 14:37:09 -04:00

Building VideoTools

VideoTools uses a universal build script that automatically detects your platform and builds accordingly.


Quick Start (All Platforms)

./scripts/linux/build.sh

That's it! The script will:

  • Detect your platform (Linux/macOS/Windows)
  • Build the appropriate executable
  • On Windows: Offer to download FFmpeg automatically

Build artifacts and metadata:

  • Output packages are written to dist/<os>/<channel>/.
  • The build script writes build.json alongside the zip artifact.
  • Set VT_BUILD_CHANNEL=stable to produce stable artifacts; default is dev.
  • Stable builds are pushed to GitHub via the github remote (SSH).

Platform-Specific Details

Linux

Prerequisites:

  • Go 1.21+
  • FFmpeg (system package)
  • CGO build dependencies

Install FFmpeg:

# Fedora/RHEL
sudo dnf install ffmpeg

# Ubuntu/Debian
sudo apt install ffmpeg

# Arch Linux
sudo pacman -S ffmpeg

Build:

./scripts/linux/build.sh

Output: VideoTools (native executable)

Run:

./VideoTools

macOS

Prerequisites:

  • Go 1.21+
  • FFmpeg (via Homebrew)
  • Xcode Command Line Tools

Install FFmpeg:

brew install ffmpeg

Build:

./scripts/linux/build.sh

Output: VideoTools (native executable)

Run:

./VideoTools

Windows

Prerequisites:

  • Go 1.21+
  • MinGW-w64 (for CGO)
  • Git Bash or similar (to run shell scripts)

Build:

./scripts/linux/build.sh

The script will:

  1. Build VideoTools.exe
  2. Prompt to download FFmpeg automatically
  3. Create a zip package and build.json in dist/windows/<channel>/

Output: VideoTools.exe (Windows GUI executable) Package: dist/windows/<channel>/vX.Y.Z-<git>_win.zip + build.json

Run:

  • Double-click VideoTools.exe in the project root
  • Or: ./VideoTools.exe from Git Bash

Automatic FFmpeg Setup:

# The build script will offer this automatically, or run manually:
./scripts/windows/support/setup-windows.bat

# Or in PowerShell:
.\scripts\windows\support\setup-windows.ps1 -Portable

Advanced: Manual Platform-Specific Builds

Linux/macOS Native Build

./scripts/linux/build-linux.sh

Windows Cross-Compile (from Linux)

# Install MinGW first
sudo dnf install mingw64-gcc mingw64-winpthreads-static  # Fedora
# OR
sudo apt install gcc-mingw-w64  # Ubuntu/Debian

# Cross-compile
./scripts/windows/build-windows.sh

# Output: dist/windows/<channel>/vX.Y.Z-<git>_win.zip (with FFmpeg bundled)

Build Options

Clean Build

# The build script automatically cleans cache
./scripts/linux/build.sh

Debug Build

# Standard build includes debug info by default
CGO_ENABLED=1 go build -o VideoTools

# Run with debug logging
./VideoTools -debug

Release Build (Smaller Binary)

# Strip debug symbols
go build -ldflags="-s -w" -o VideoTools

Troubleshooting

"go: command not found"

Install Go 1.21+ from https://go.dev/dl/

"CGO_ENABLED must be set"

CGO is required for Fyne (GUI framework):

export CGO_ENABLED=1
./scripts/linux/build.sh

"ffmpeg not found" (Linux/macOS)

Install FFmpeg using your package manager (see above).

Windows: "x86_64-w64-mingw32-gcc not found"

Install MinGW-w64:

macOS: "ld: library not found"

Install Xcode Command Line Tools:

xcode-select --install

Build Artifacts

After building, you'll find:

Linux/macOS:

VideoTools/
└── VideoTools          # Native executable

Windows:

VideoTools/
├── VideoTools.exe      # Main executable
└── dist/
    └── windows/
        └── dev/
            ├── vX.Y.Z-<git>_win.zip
            └── build.json

Development Builds

For faster iteration during development:

# Quick build (no cleaning)
go build -o VideoTools

# Run directly
./VideoTools

# With debug output
./VideoTools -debug

CI/CD

The build scripts are designed to work in CI/CD environments:

# Example GitHub Actions
- name: Build VideoTools
  run: ./scripts/linux/build.sh

For more details, see:

  • QUICKSTART.md - Simple setup guide
  • WINDOWS_SETUP.md - Windows-specific instructions
  • docs/WINDOWS_COMPATIBILITY.md - Cross-platform implementation details