Compiling Instructions and Dependencies

BASIC256 builds with CMake against Qt6 (minimum Qt 6.2, the release that
introduced the current QtMultimedia/QAudioSink API this project uses; CI
builds and tests against Qt 6.11.1). Qt5 is no longer supported.

The authoritative, continuously-tested build steps for every platform live
in .github/scripts/ (build_Windows.ps1, build_Linux_x86.sh,
build_Linux_RPi_Trixie.sh, build_macos.sh) and .github/workflows/build.yml --
if these instructions and those scripts ever disagree, trust the scripts.

Required Qt6 components: Core, Gui, Widgets, Sql, PrintSupport, SerialPort,
Multimedia, TextToSpeech, LinguistTools, Network.

###########################################################
ALL PLATFORMS - generic CMake build
###########################################################

Once Qt6 (with the components above), a C++17 compiler, CMake >= 3.21, and
flex/bison are available:

  cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="<path to your Qt6 install>"
  cmake --build build --config Release

The resulting binary is build/basic256 (build/basic256.app on macOS,
build\Release\basic256.exe on Windows).

###########################################################
WINDOWS
###########################################################

Dependencies:
* Visual Studio 2022 (MSVC toolchain)
* winflexbison3 (flex/bison for Windows) -- e.g. "choco install winflexbison3"
* Qt6 6.11.1, MSVC 2022 64-bit kit, with the Multimedia/SerialPort/Speech
  addon modules. CI installs it with aqtinstall (see build_Windows.ps1 for
  a caveat: aqtinstall's latest PyPI release can't parse Qt's Windows
  repo layout for 6.11+, so CI installs aqtinstall from a specific
  upstream commit until a release contains the fix):
      pip install aqtinstall
      aqt install-qt windows desktop 6.11.1 win64_msvc2022_64 -m qtmultimedia qtserialport qtspeech

Build:
  cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="<qt-install>\6.11.1\msvc2022_64"
  cmake --build build --config Release

To build the Windows installer, see BASIC256.nsi (NSIS >= 3.0) --
.github/scripts/build_installer_Windows.ps1 shows the full invocation,
including the packaging step (.github/scripts/package_Windows.ps1) that
must run first to stage the Qt runtime via windeployqt.

###########################################################
LINUX (Ubuntu/Debian-based)
###########################################################

Dependencies (see .github/scripts/build_Linux_x86.sh for the exact,
CI-verified apt package list): build-essential, cmake, flex, bison,
libgl1-mesa-dev, libx11-dev and friends (libxext/libxrender/libxi-dev,
libxkbcommon-x11-0, libxcb-cursor0 + the libxcb-icccm4/image0/keysyms1/
randr0/render-util0/shape0/xinerama0/xkb1 runtime set Qt's xcb platform
plugin needs), libcups2-dev (Qt PrintSupport), libpulse-dev,
libpipewire-0.3-dev, libspeechd-dev + speech-dispatcher + libespeak-ng-dev
(TextToSpeech), and libgstreamer1.0-dev + the gstreamer1.0-plugins-* set
(Multimedia).

Distributions whose packaged Qt6 is incomplete or too old (e.g. Ubuntu
22.04 "jammy", which has no Qt6TextToSpeech package at all) should install
Qt6 via aqtinstall instead of apt, exactly as build_Linux_x86.sh does:
      pip install aqtinstall
      aqt install-qt linux desktop 6.11.1 linux_gcc_64 -m qtmultimedia qtserialport qtspeech

Distributions with a complete, current Qt6 in their own repos (e.g. Debian
Trixie) can just install it directly -- see build_Linux_RPi_Trixie.sh:
      sudo apt install qt6-base-dev qt6-base-dev-tools qt6-tools-dev \
        qt6-tools-dev-tools qt6-l10n-tools qt6-multimedia-dev \
        qt6-serialport-dev qt6-speech-dev qt6-declarative-dev

(qt6-declarative-dev is required even though this project has no QML of its
own -- Qt6TextToSpeech's own CMake package depends on Qt6QmlIntegration.)

Build:
  cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="<path to Qt6, if not found automatically>"
  cmake --build build -j"$(nproc)"

###########################################################
RASPBERRY PI / LINUX ARM64
###########################################################

See COMPILING_RaspberryPI.txt.

###########################################################
MACOS
###########################################################

Dependencies:
* Xcode command line tools
* Qt6 via Homebrew's unversioned "qt" formula (this is Qt6 -- Homebrew no
  longer offers a qt@5):
      brew install qt

Build:
  cmake -B build -S . -DCMAKE_PREFIX_PATH=/opt/homebrew/opt/qt \
        -DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_BUILD_TYPE=Release
  cmake --build build --config Release

  Produces build/basic256.app. See .github/scripts/package_macos.sh for how
  CI turns that into a signed, distributable .zip (macdeployqt + codesign).
