Skip to content

Latest commit

 

History

History
193 lines (146 loc) · 7.47 KB

File metadata and controls

193 lines (146 loc) · 7.47 KB

General Development Notes

Prerequisites:

  • Qt 6.8+ or 5.15.
  • C++ development environment that support CMake and/or xmake. Recommended:
    • Visual Studio Code -- better performance, better AI integration.
    • Qt Creator -- Built-in UI designer, debugger integration with Qt.
      • lupdate: Add an external tool in “Edit > Preferences > Environment > External Tools” – Executable: cmake; Arguments: --build . --target update_translations; Working directory: Choose global variable ActiveProject:BuildConfig:Path.

Windows

Library + Toolchain \ Target x86 x64 ARM64
Windows NT 5.x + MinGW Lite ✔️ ✔️
Qt.io + MSVC ✔️ ✔️
VCPKG + MSVC ✔️ ✔️ ✔️

Windows NT 5.x Qt Library with MinGW Lite Toolchain

The scripts build-xp.sh are alike build-mingw.sh, but the toolchain is provided by Qt library.

Prerequisites for native build:

  1. Windows 10 x64 or later.
  2. Install MSYS2.

For native build, launch MSYS2 environment, run:

./packages/mingw/build-xp.sh -p 32-msvcrt

These scripts accepts the same arguments as build-mingw.sh, plus:

  • -p|--profile <profile>: (REQUIRED) the profile of MinGW Lite as well as Qt library. Available profiles are 64-ucrt, 64-msvcrt, 32-ucrt, 32-msvcrt.

MSVC Toolchain

Prerequisites:

  1. Windows 10 x64 or later, or Windows 11 ARM64.
  2. Install Visual Studio 2022 or 2026 (at least “build tools” and “Windows SDK”).
  3. Install Qt 6.8+ or 5.15 via Qt.io installer, aqtinstall, or vcpkg.
    • Required components: base, svg, tools, translations.
  4. PowerShell (Core, not “Windows PowerShell”).

To build:

  1. Start Visual Studio develop environment.
  2. For vcpkg, set toolchain file (required) and target triplet (if you want non-default one):
    $env:CMAKE_TOOLCHAIN_FILE = "$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
    $env:VCPKG_TARGET_TRIPLET = "x64-windows"
  3. Run build script:
    ./packages/msvc/build.ps1 -QtDir C:/Qt/6.8.3/msvc2022_64
    
    # vcpkg (-QtDir is optional; it enables windeployqt)
    ./packages/msvc/build.ps1 -QtDir "$env:VCPKG_ROOT/installed/$env:VCPKG_TARGET_TRIPLET/tools/Qt6"

Arguments:

  • -c|-Clean: clean directories before building.
  • -QtDir <dir>: Qt library directory.

Linux

See also more build instructions for freedesktop.org-conforming (XDG) desktop systems.

Package Manager for Rolling Distributions

Currently available for Alpine Linux (edge), Arch Linux, Debian (unstable), Fedora, openSUSE Tumbleweed, and Ubuntu (devel).

  1. Setup build environment (documentation for Alpine, Arch, Debian family, RPM).
    • For Debian family:
      sudo apt install --no-install-recommends build-essential debhelper devscripts equivs
  2. Call build script:
    • Alpine Linux: ./packages/alpine/buildapk.sh
    • Arch Linux: ./packages/archlinux/buildpkg.sh
    • Debian family: ./packages/debian/builddeb.sh
    • Fedora: ./packages/fedora/buildrpm.sh
    • openSUSE: ./packages/opensuse/buildrpm.sh
  3. Install the package:
    • Alpine Linux: ~/packages/unsupported/$(uname -m)/redpanda-cpp-git-*.apk
    • Arch Linux: /tmp/redpanda-cpp-git/redpanda-cpp-git-*.pkg.tar.zst
    • Debian family: /tmp/redpanda-cpp_*.deb
    • Fedora, openSUSE: ~/rpmbuild/RPMS/$(uname -m)/redpanda-cpp-git-*.rpm
  4. Run Red Panda C++:
    RedPandaIDE

Note that these scripts check out HEAD of the repo, so any changes should be committed before building.

Alternatively, build in container (rootless Podman preferred; Docker may break file permissions):

podman run --rm -v $PWD:/mnt -w /mnt <image> ./packages/<distro>/01-in-docker.sh

# Arch Linux for example
podman run --rm -v $PWD:/mnt -w /mnt docker.io/archlinux:latest ./packages/archlinux/01-in-docker.sh

The package will be placed in dist/.

Static Binary for Almost All Linux Desktop Distributions

Package format: AppImage, Debian (.deb), tarball (.tar.gz).

podman run --rm -v $PWD:/mnt -w /mnt ghcr.io/redpanda-cpp/appimage-builder-x86_64:20260127.0 ./packages/linux/01-in-docker.sh

The packages will be placed in dist/.

The scripts to create the build environment are available in redpanda-cpp/appimage-builder. Available architectures: x86_64, x86_64.v3, aarch64, riscv64, loong64, i686.