update linux dep install

This commit is contained in:
Agel committed 2026-03-17 12:07:44 +00:00
1 parent 6f419425c2
commit 5598224141
3 files changed
+46 -42

No files matched your search

+4 -1
View File
@@ -8,7 +8,10 @@
"Bash(ctest:*)", "Bash(ctest:*)",
"Bash(*cmake.exe*)", "Bash(*cmake.exe*)",
"Bash(*ninja.exe*)", "Bash(*ninja.exe*)",
"Bash(*ctest.exe*)" "Bash(*ctest.exe*)",
"Bash(qmake6 --version)",
"Bash(pkg-config --modversion Qt6Core)",
"Bash(dpkg -l)"
] ]
} }
} }
+15 -16
View File
@@ -6,7 +6,7 @@ A cross-platform desktop book/document reader built with Qt6/C++. Reimplementati
## Prerequisites ## Prerequisites
- **Qt 6.4+** (6.4 minimum for QtPdf; 6.5+ recommended) - **Qt 6.10.x** (installed via `aqtinstall` to `/opt/qt`; Ubuntu apt only ships 6.4 which is too old)
- **CMake 3.16+** - **CMake 3.16+**
- **C++17 compiler** — GCC 10+ or Clang 12+ on Linux; MinGW-w64 (GCC) via MSYS2 on Windows - **C++17 compiler** — GCC 10+ or Clang 12+ on Linux; MinGW-w64 (GCC) via MSYS2 on Windows
@@ -18,24 +18,17 @@ A cross-platform desktop book/document reader built with Qt6/C++. Reimplementati
sudo scripts/install-deps-ubuntu.sh sudo scripts/install-deps-ubuntu.sh
``` ```
The script installs the following package groups: The script installs Qt 6.10.1 via `aqtinstall` to `/opt/qt/6.10.1/gcc_64`, plus the following apt packages:
| Group | Packages | Required? | | Group | Packages | Required? |
|---|---|---| |---|---|---|
| Qt6 core | `qt6-base-dev`, `qt6-declarative-dev`, `qt6-tools-dev` | Required | | Build tools | `build-essential`, `cmake`, `ninja-build`, `git` | Required |
| Qt6 extras | `libqt6svg6-dev`, `qt6-shader-baker` | Required | | Qt compile deps | `libgl1-mesa-dev`, `libxkbcommon-dev` | Required |
| Qt6 PDF | `libqt6pdf6-dev` | Optional (PDF support) |
| Encoding | `libuchardet-dev` | Required (TXT encoding detection) | | Encoding | `libuchardet-dev` | Required (TXT encoding detection) |
| Archive | `libquazip-qt6-dev`, `libminizip-dev` | Required (EPUB/ZIP) | | Archive | `libminizip-dev` | Required (EPUB/ZIP) |
| DjVu | `libdjvulibre-dev` | Optional (DjVu support) | | DjVu | `libdjvulibre-dev` | Optional (DjVu support) |
| DOC | `libwpd-dev` | Optional (legacy .doc support) | | DOC | `libwpd-dev` | Optional (legacy .doc support) |
After the script runs it prints a CMake verify step — run it to confirm Qt6 is found:
```bash
cmake --find-package -DNAME=Qt6 -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=EXIST
```
### Windows ### Windows
All Windows dependencies — Qt 6, MinGW-w64, CMake, Ninja, and all third-party libraries — are installed through **MSYS2**, a Linux-like environment for Windows with a proper package manager (`pacman`). This ensures everything is compiled with the same GCC toolchain with no ABI mismatches. All Windows dependencies — Qt 6, MinGW-w64, CMake, Ninja, and all third-party libraries — are installed through **MSYS2**, a Linux-like environment for Windows with a proper package manager (`pacman`). This ensures everything is compiled with the same GCC toolchain with no ABI mismatches.
@@ -107,17 +100,23 @@ cd asteria-qt
## Building ## Building
All build commands run in the **MSYS2 MINGW64** shell on Windows, or a regular terminal on Linux. No extra CMake flags are needed on Windows — MSYS2 installs everything to a standard prefix that CMake finds automatically. All build commands run in the **MSYS2 MINGW64** shell on Windows, or a regular terminal on Linux.
On Linux, pass `-DCMAKE_PREFIX_PATH=/opt/qt/6.10.1/gcc_64` so CMake finds the aqt-installed Qt. On Windows, MSYS2 installs everything to a standard prefix that CMake finds automatically.
### Command Line ### Command Line
```bash ```bash
# Debug build # Debug build (Linux)
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=/opt/qt/6.10.1/gcc_64
cmake --build build --parallel
# Debug build (Windows — no prefix needed)
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug
cmake --build build --parallel cmake --build build --parallel
# Release build # Release build (Linux)
cmake -B build-release -G Ninja -DCMAKE_BUILD_TYPE=Release cmake -B build-release -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/opt/qt/6.10.1/gcc_64
cmake --build build-release --parallel cmake --build build-release --parallel
# Run tests # Run tests
+27 -25
View File
@@ -1,6 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Install all development dependencies for asteria-qt on Ubuntu/Debian. # Install all development dependencies for asteria-qt on Ubuntu/Debian.
# Tested on Ubuntu 24.04. Run with sudo or as root. # Tested on Ubuntu 24.04. Run with sudo or as root.
# Qt 6.10.x is installed via aqtinstall to /opt/qt — the Ubuntu apt repo only
# ships Qt 6.4, which is too old (qt_policy QTP0004 requires Qt 6.8+).
set -euo pipefail set -euo pipefail
@@ -13,33 +15,18 @@ apt-get install -y \
ninja-build \ ninja-build \
git git
# ── Qt 6 core development ────────────────────────────────────────────────────── # ── OpenGL and XKB headers (required by Qt at compile time) ───────────────────
# qt6-base-dev : Core, Gui, Widgets, Network, SQL, ...
# qt6-declarative-* : QML / Qt Quick
# qt6-tools-* : CMake find_package integration, lupdate, lrelease
# qt6-shadertools : Required by Qt Quick renderer
# qt6-svg-dev : SVG icon support
apt-get install -y \ apt-get install -y \
qt6-base-dev \ libgl1-mesa-dev \
qt6-base-dev-tools \ libxkbcommon-dev
qt6-declarative-dev \
qt6-declarative-dev-tools \
qt6-tools-dev \
qt6-tools-dev-tools \
qt6-shadertools-dev \
qt6-svg-dev
# ── Qt 6 PDF (for PDF format support) ─────────────────────────────────────────
apt-get install -y qt6-pdf-dev
# ── Encoding detection ───────────────────────────────────────────────────────── # ── Encoding detection ─────────────────────────────────────────────────────────
apt-get install -y libuchardet-dev apt-get install -y libuchardet-dev
# ── ZIP extraction (EPUB, DOCX, ODT) ────────────────────────────────────────── # ── ZIP extraction (EPUB, DOCX, ODT) ──────────────────────────────────────────
# QuaZip is the Qt-idiomatic wrapper; minizip is the underlying C lib. # minizip is the underlying C lib; QuaZip will be built from source against the
apt-get install -y \ # aqt Qt when EPUB support is added.
libquazip1-qt6-dev \ apt-get install -y libminizip-dev
libminizip-dev
# ── DjVu support ─────────────────────────────────────────────────────────────── # ── DjVu support ───────────────────────────────────────────────────────────────
apt-get install -y libdjvulibre-dev apt-get install -y libdjvulibre-dev
@@ -47,9 +34,24 @@ apt-get install -y libdjvulibre-dev
# ── Legacy .doc support (libwpd) ─────────────────────────────────────────────── # ── Legacy .doc support (libwpd) ───────────────────────────────────────────────
apt-get install -y libwpd-dev apt-get install -y libwpd-dev
# ── Qt 6.10.1 via aqtinstall ──────────────────────────────────────────────────
# We use a temporary venv so aqtinstall doesn't pollute the system Python env.
apt-get install -y python3-venv
echo "" echo ""
echo "All dependencies installed. Qt6 version:" echo "Installing Qt 6.10.1 via aqtinstall → /opt/qt ..."
dpkg -l qt6-base-dev | awk '/^ii/{print $3}' python3 -m venv /tmp/aqt-venv
/tmp/aqt-venv/bin/pip install --quiet aqtinstall
/tmp/aqt-venv/bin/aqt install-qt linux desktop 6.10.1 linux_gcc_64 \
--outputdir /opt/qt \
--log /tmp/aqt-install.log
rm -rf /tmp/aqt-venv /tmp/aqt-install.log
echo "" echo ""
echo "Verify CMake can find Qt6:" echo "All dependencies installed."
echo " cmake -B /tmp/qt6-test -DCMAKE_PREFIX_PATH=/usr/lib/x86_64-linux-gnu/cmake" echo ""
echo "Qt 6.10.1 is at /opt/qt/6.10.1/gcc_64"
echo ""
echo "Build with:"
echo " cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=/opt/qt/6.10.1/gcc_64"
echo " cmake --build build --parallel"