Skip to content

chore: Adjusted build and packaging strategy#22

Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
wangrong1069:pr1125
Nov 26, 2025
Merged

chore: Adjusted build and packaging strategy#22
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
wangrong1069:pr1125

Conversation

@wangrong1069
Copy link
Contributor

  • Prefers Qt6 for building and packaging; both Qt5 and Qt6 are no longer supported simultaneously.
  • Uses the same package name when building based on Qt5 and Qt6.

- Prefers Qt6 for building and packaging; both Qt5 and Qt6 are no longer supported simultaneously.
- Uses the same package name when building based on Qt5 and Qt6.
@deepin-ci-robot
Copy link

deepin pr auto review

我来分析一下这个 Git diff 的变更:

  1. CMakeLists.txt 变更分析:
  • 移除了 Qt5 和 Qt6 版本库的分别构建逻辑
  • 简化为只构建一个版本,优先使用 Qt6,否则使用 Qt5
  • 统一使用 PROJECT_NAME 作为目标名称

优点:

  • 简化了构建配置
  • 减少了重复代码
  • 统一了库的命名

潜在问题:

  • 失去了同时支持 Qt5 和 Qt6 的灵活性
  • 如果系统同时安装了 Qt5 和 Qt6,将只构建 Qt6 版本
  1. debian/control 变更分析:
  • 将 Qt5 和 Qt6 的依赖改为可选项(使用 | 操作符)
  • 移除了 Qt5 专用的包(libdeepin-pdfium5 和 libdeepin-pdfium5-dev)
  • 简化了包描述,移除了版本特定信息

优点:

  • 简化了包结构
  • 减少了维护成本
  • 更灵活的依赖处理
  1. 头文件变更(dpdfglobal.h):
  • 添加了 Qt 版本检查条件编译
  • 仅在 Qt6 或更高版本时包含 QRecursiveMutex

优点:

  • 提高了代码的兼容性
  • 避免了在 Qt5 下的编译问题

改进建议:

  1. 版本兼容性:
# 建议添加版本检查
if(Qt6_FOUND)
    if(Qt6_VERSION VERSION_LESS "6.2.0")
        message(WARNING "Qt6 version < 6.2.0 may have compatibility issues")
    endif()
    set(QT_DESIRED_VERSION 6)
else()
    if(Qt5_VERSION VERSION_LESS "5.12.0")
        message(WARNING "Qt5 version < 5.12.0 may have compatibility issues")
    endif()
    set(QT_DESIRED_VERSION 5)
endif()
  1. 错误处理:
# 添加错误检查
if(NOT Qt6_FOUND AND NOT Qt5_FOUND)
    message(FATAL_ERROR "Neither Qt5 nor Qt6 found")
endif()
  1. 包描述改进:
    在 debian/control 中,建议更准确地描述包的用途:
Description: PDF processing library for Deepin Desktop Environment
 A library that provides PDF parsing, editing and display capabilities.
 Compatible with both Qt5 and Qt6.
  1. 文档更新:
    建议在项目文档中明确说明:
  • Qt 版本的优先级选择
  • 最低支持的 Qt 版本要求
  • 不同 Qt 版本下的功能差异
  1. 测试建议:
  • 添加针对 Qt5 和 Qt6 的自动化测试
  • 确保在两个版本下的功能一致性
  • 验证向后兼容性

这些变更整体上是合理的,简化了项目结构,但需要注意保持足够的灵活性和兼容性。建议在实施这些更改后,进行充分的测试,确保在不同环境下的正常工作。

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lzwind, wangrong1069

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wangrong1069
Copy link
Contributor Author

构建失败源于打包时设置的版本号异常
Uploading Screenshot_select-area_20251126091013.png…

@wangrong1069
Copy link
Contributor Author

/forcemerge

@deepin-bot
Copy link

deepin-bot bot commented Nov 26, 2025

This pr force merged! (status: unstable)

@deepin-bot deepin-bot bot merged commit 35d807b into linuxdeepin:master Nov 26, 2025
15 of 17 checks passed
@wangrong1069 wangrong1069 deleted the pr1125 branch November 26, 2025 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants