build: add Linux AppImage packaging
- Add reproducible linuxdeploy/appimagetool packaging script\n- Bundle Qt runtime, xcb/Wayland plugins, SQLite, TLS, and fcitx5 plugin\n- Add desktop icon, metadata, and direct-run AppImage\n- Fix release-mode scheduler warning and document Linux packaging
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
# 阶段 4.3 验证报告:Linux AppImage 打包
|
||||
|
||||
> 日期:2026-10-26
|
||||
> 环境:Ubuntu 24.04 / Qt 6.6.3 / linuxdeploy 2025-10 / appimagetool 2023
|
||||
|
||||
## 1. 本次交付
|
||||
|
||||
新增 Linux AppImage 打包:
|
||||
|
||||
- `scripts/package-linux-appimage.sh`
|
||||
- `packaging/linux/Schedule.desktop`
|
||||
- `packaging/linux/schedule.svg` + `schedule.png`
|
||||
- `packaging/linux/com.misaki.Schedule.appdata.xml`
|
||||
|
||||
产物:
|
||||
|
||||
```text
|
||||
dist/AI-Schedule-0.1.0-x86_64.AppImage
|
||||
大小:约 34 MB
|
||||
SHA-256:2314cec2b9f09aaf9a69d4cf8725e6d68058f383bd9c0a6d419658ee51bdc9bb
|
||||
```
|
||||
|
||||
脚本会:
|
||||
|
||||
1. 使用 `linux-gcc-release` preset,并强制 `CMAKE_BUILD_TYPE=Release`;
|
||||
2. 安装到临时 AppDir;
|
||||
3. 部署 Qt 库、平台插件、SQLite 驱动、TLS、图标主题和 fcitx5 输入法插件;
|
||||
4. 打包 Qt6XcbQpa / Qt6OpenGL / Wayland 客户端等平台插件依赖;
|
||||
5. 使用 `linuxdeploy` 收集系统依赖,`appimagetool` 生成 AppImage;
|
||||
6. 首次运行时自动下载 linuxdeploy/appimagetool 到用户缓存,也可用 `TOOLS_DIR` 指定现成工具目录。
|
||||
|
||||
## 2. 验证
|
||||
|
||||
```bash
|
||||
./scripts/package-linux-appimage.sh
|
||||
./dist/AI-Schedule-0.1.0-x86_64.AppImage --appimage-version
|
||||
```
|
||||
|
||||
| 项目 | 结果 |
|
||||
|---|---|
|
||||
| AppImage 构建 | 成功,约 34 MB |
|
||||
| `--appimage-version` | 正常输出 |
|
||||
| Xvfb/X11 启动 | 成功运行至超时退出(exit 124),无缺失库/插件错误 |
|
||||
| offscreen 启动 | 成功创建临时配置与 SQLite 数据库 |
|
||||
| 内置 Qt | WebSockets / DBus / SQL / Widgets 等已部署 |
|
||||
| 内置插件 | platforms(xcb/wayland/offscreen)、imageformats、sqldrivers(sqlite)、platforminputcontexts(含 fcitx5) |
|
||||
|
||||
构建日志见 [`appimage-build-phase-4-3.txt`](appimage-build-phase-4-3.txt),校验值见 [`appimage-sha256.txt`](appimage-sha256.txt),桌面回归测试见 [`ctest-phase-4-3.txt`](ctest-phase-4-3.txt)。
|
||||
|
||||
## 3. 使用
|
||||
|
||||
```bash
|
||||
chmod +x dist/AI-Schedule-0.1.0-x86_64.AppImage
|
||||
./dist/AI-Schedule-0.1.0-x86_64.AppImage
|
||||
```
|
||||
|
||||
文件管理器通常可直接双击运行。
|
||||
|
||||
- 如果系统没有 FUSE:
|
||||
```bash
|
||||
./dist/AI-Schedule-0.1.0-x86_64.AppImage --appimage-extract-and-run
|
||||
```
|
||||
或 `APPIMAGE_EXTRACT_AND_RUN=1 ./...AppImage`
|
||||
- 配置与数据库仍保存在用户目录,不由 AppImage 内部保存;与普通安装版共享同一设备 ID/配置。
|
||||
- 通过 `QT_ROOT` 指定 Qt 安装路径;通过 `TOOLS_DIR` 复用已下载的 linuxdeploy/appimagetool。
|
||||
|
||||
## 4. 已知限制
|
||||
|
||||
1. AppImage 在 Ubuntu 24.04 上构建,较旧的发行版可能缺少更新的 glibc 而无法运行。
|
||||
2. 直接运行需要 FUSE;无 FUSE 环境使用 `--appimage-extract-and-run`。
|
||||
3. 首次打包需要联网下载 linuxdeploy/appimagetool;离线环境可预先放入 `TOOLS_DIR`。
|
||||
4. AppImage 未提交到 git(`dist/` 已忽略),当前产物在本地 `dist/` 目录。
|
||||
5. 未做代码签名/AppImage 更新元数据;系统级通知仍依赖桌面通知服务。
|
||||
Reference in New Issue
Block a user