build and instruction fixes

This commit is contained in:
Agel committed 2026-03-20 08:32:22 +01:00
1 parent f328e7dab0
commit 85e530e312
3 files changed
+99 -2

No files matched your search

+52 -2
View File
@@ -37,8 +37,6 @@ Full target format list (derived from actual library inventory):
## Build & Install
See [README.md](README.md) for setup instructions, dependency installation, and IDE-specific build guides.
### Windows Build Environment
The toolchain is at `C:\msys64\mingw64\bin\`. Call binaries directly with full paths, but prepend `/c/msys64/mingw64/bin` to `PATH` so the compiler and its runtime DLLs are resolvable:
@@ -62,6 +60,58 @@ PATH="/c/msys64/mingw64/bin:$PATH" "C:/msys64/mingw64/bin/ctest.exe" --test-dir
Use Unix-style paths (`/c/msys64/...`) for `PATH` assignments — Windows-style paths are not recognised by the shell.
### Linux Build Environment
Base: **Ubuntu 24.04**. Ubuntu apt only ships Qt 6.4, which is too old; Qt 6.10.1 is installed via `aqtinstall`.
Run `scripts/install-deps-ubuntu.sh` to install all system packages and Qt, then:
```bash
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_PREFIX_PATH=/opt/qt/6.10.1/gcc_64
ninja -C build
ctest --test-dir build --output-on-failure
```
System packages installed by the script:
| Package | Purpose |
|---|---|
| `build-essential` | GCC/G++ compiler |
| `cmake`, `ninja-build` | Build system |
| `git` | Version control |
| `libgl1-mesa-dev` | OpenGL headers (Qt) |
| `libxkbcommon-dev` | XKB headers (Qt) |
| `libuchardet-dev` | Encoding detection (TXT reader) |
| `libminizip-dev` | ZIP/EPUB extraction |
| `libdjvulibre-dev` | DjVu format |
| `libwpd-dev` | Legacy .doc format |
| `python3-venv` | For aqtinstall |
### CI Build Environment
GitLab CI (`.gitlab-ci.yml`), stages: `build` → `package` → `wiki`.
The CI Docker image is built from `docker/Dockerfile.build` (Ubuntu 24.04 base) and contains:
- Native Linux toolchain + Qt 6.10.1 at `$QT_LINUX_DIR` (`/opt/qt/6.10.1/gcc_64`)
- MinGW-w64 cross-compilation toolchain + Qt 6.10.1 for Windows at `$QT_WINDOWS_DIR` (`/opt/qt/6.10.1/mingw_64`)
- Cross-compiled Windows sysroot at `$MINGW_SYSROOT` (`/opt/mingw-sysroot`) with libiconv and uchardet
- AppImage packaging tools (linuxdeploy, appimagetool)
Windows builds are cross-compiled from Linux using `scripts/mingw-w64-toolchain.cmake`.
#### Adding a new C/C++ dependency
When `CMakeLists.txt` gains a new `find_package` or `pkg_check_modules` dependency, update **all** of the following:
| File | What to add |
|---|---|
| `scripts/install-deps-ubuntu.sh` | `apt` package for Linux host builds |
| `scripts/install-deps-windows.sh` | `pacman` package for Windows host builds |
| `docker/Dockerfile.build` | `apt` package for CI Linux build; cross-compiled lib for CI Windows cross-build if needed |
## Test-Driven Development
**All new backend logic must be test-driven.** Follow the red-green-refactor cycle strictly: