Skip to content

feat: merge qt5/qt6 dual build packaging - #149

Open
18202781743 wants to merge 2 commits into
masterfrom
feat/qt5-qt6-dual-build-packaging
Open

feat: merge qt5/qt6 dual build packaging#149
18202781743 wants to merge 2 commits into
masterfrom
feat/qt5-qt6-dual-build-packaging

Conversation

@18202781743

@18202781743 18202781743 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

背景

dtk6systemsettings 仓库已归档,需要在 dtksystemsettings 一个仓库中同时打出 Qt5 和 Qt6 两个版本的包,用 CMake option 控制,参照 dtkcore 仓库的做法。

关联 issue: DDE-191

改动内容(11 个已有文件修改 + 2 个新增文件)

CMake 改造

  • CMakeLists.txt:将旧的 PROJECT_VERSION_MAJOR 判断块替换为 option(DTK5 "Build DTK5." ON),引入 DTK_VERSION/DTK_VERSION_MAJOR/DTK_VERSION_MINOR/DTK_VERSION_PATCH 变量体系。DTK5=ON 构建 Qt5(VERSION_SUFFIX 为空,DTK_VERSION=5.0.21),DTK5=OFF 构建 Qt6(VERSION_SUFFIX=6DTK_VERSION=6.0.21)。
  • src/CMakeLists.txt:库 VERSION ${DTK_VERSION} / SOVERSION ${DTK_VERSION_MAJOR}target_compile_definitions 改为 VERSION=${DTK_VERSION}
  • docs/CMakeLists.txtDOXYGEN_PROJECT_NUMBER ${DTK_VERSION}

模板文件

  • misc/dtksystemsettings.pc.inVersion: @DTK_VERSION@
  • misc/qt_lib_dtksystemsettings.pri.in@CMAKE_PROJECT_VERSION@@DTK_VERSION@@PROJECT_VERSION_MAJOR@@DTK_VERSION_MAJOR@@PROJECT_VERSION_MINOR@@DTK_VERSION_MINOR@@PROJECT_VERSION_PATCH@@DTK_VERSION_PATCH@

版本文件

  • VERSION5.6.206.0.21

Debian 打包

  • debian/control:Source 段 Build-Depends 按 <!nodtk5>/<!nodtk6> build profile 拆分;新增 4 个二进制包(libdtksystemsettings5libdtksystemsettings-devlibdtk6systemsettingslibdtk6systemsettings-dev),均带 Build-Profiles
  • debian/rules:双构建目录 build5/build6,通过 DEB_BUILD_PROFILESnodtk5/nodtk6)控制 DTK5=ON/OFF
  • debian/changelog:新增 dtksystemsettings (6.0.21) unstable; urgency=medium 条目。
  • debian/libdtksystemsettings5.installusr/lib/*/libdtksystemsettings.so.*
  • debian/libdtksystemsettings-dev.install:精确路径(libdtksystemsettings.sousr/include/dtk5/*dtksystemsettings.pccmake/DtkSystemSettings/*qt5/doc/*.qchqt5/*
  • debian/libdtk6systemsettings.install(新增):usr/lib/*/libdtk6systemsettings.so.*
  • debian/libdtk6systemsettings-dev.install(新增):精确路径(libdtk6systemsettings.sousr/include/dtk6/*dtk6systemsettings.pccmake/Dtk6SystemSettings/*qt6/doc/*.qchqt6/*

版本号策略

项目
源码包版本(changelog)/ VERSION 文件 6.0.21
Qt5 库 VERSION/SOVERSION(DTK5=ON) 5.0.21 / 5
Qt6 库 VERSION/SOVERSION(DTK5=OFF) 6.0.21 / 6
Qt5 运行时包名 libdtksystemsettings5
Qt6 运行时包名 libdtk6systemsettings

与 issue 描述的一处差异说明

Qt5 dev 包 install 文件中 cmake 配置目录使用 DtkSystemSettings 而非 issue 描述中的 Dtk5SystemSettings。原因是 DTK5=ONVERSION_SUFFIX 为空,CMake 变量 DtkSystemSettings = Dtk${VERSION_SUFFIX}SystemSettings = "DtkSystemSettings",实际安装路径就是 cmake/DtkSystemSettings/。若写成 Dtk5SystemSettings 则无法匹配到任何已安装文件,dev 包会缺失 cmake 配置。此处按实际 CMake 行为修正(Qt6 侧 Dtk6SystemSettings 与描述一致)。

验证场景

改造后需分别验证以下三种构建场景:

  • nodtk6(仅 Qt5)
  • nodtk5(仅 Qt6)
  • 无 profile(双版本)

本 PR 不自行合并,待人工审核。

Summary by Sourcery

Enable building and packaging both Qt5 and Qt6 variants of DtkSystemSettings from one repository.

New Features:

  • Add CMake-controlled Qt5 and Qt6 build support from a single source repository.
  • Produce separate Debian runtime and development packages for Qt5 and Qt6 variants.

Enhancements:

  • Align library, pkg-config, Qt integration, and documentation versions with the selected DTK major version.
  • Support independent, combined, or profile-controlled Debian builds for the two Qt variants.

Chores:

  • Update the project release version to 6.0.21.

Implement Qt5/Qt6 dual-version debian packaging for dtksystemsettings,
mirroring the dtkcore approach:

- CMakeLists.txt: replace PROJECT_VERSION_MAJOR judgment with
  option(DTK5) (default ON); introduce DTK_VERSION/DTK_VERSION_MAJOR/
  DTK_VERSION_MINOR/DTK_VERSION_PATCH variables. DTK5=ON builds Qt5
  (VERSION_SUFFIX empty, DTK_VERSION=5.0.21), DTK5=OFF builds Qt6
  (VERSION_SUFFIX=6, DTK_VERSION=6.0.21).
- src/CMakeLists.txt: library VERSION/SOVERSION and compile definition
  use DTK_VERSION/DTK_VERSION_MAJOR instead of CMAKE_PROJECT_VERSION.
- docs/CMakeLists.txt: DOXYGEN_PROJECT_NUMBER uses DTK_VERSION.
- misc/dtksystemsettings.pc.in: Version: @DTK_VERSION@.
- misc/qt_lib_dtksystemsettings.pri.in: use DTK_VERSION* variables.
- VERSION: 5.6.20 -> 6.0.21.
- debian/control: Build-Depends split by <!nodtk5>/<!nodtk6> build
  profiles; add 4 binary packages (libdtksystemsettings5,
  libdtksystemsettings-dev, libdtk6systemsettings,
  libdtk6systemsettings-dev) with Build-Profiles.
- debian/rules: dual build directories (build5/build6) controlled by
  DEB_BUILD_PROFILES (nodtk5/nodtk6).
- debian install files: precise per-version paths; add
  libdtk6systemsettings.install and libdtk6systemsettings-dev.install.
  Qt5 cmake config dir is DtkSystemSettings (VERSION_SUFFIX empty),
  Qt6 is Dtk6SystemSettings.
- debian/changelog: add 6.0.21 entry.
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743

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

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown

TAG Bot

TAG: 6.6.21
EXISTED: no
DISTRIBUTION: unstable

@github-actions

Copy link
Copy Markdown

CLA Assistant Lite bot:

如果你是以企业贡献者的身份进行提交,请联系我们签署企业贡献者许可协议
If you submit as corporate contributor, please contact us to sign our Corporate Contributor License Agreement

感谢您的提交,我们非常感谢。 像许多开源项目一样,在接受您的贡献之前,我们要求您签署我们的个人贡献者许可协议。 您只需发布与以下格式相同的评论即可签署个人贡献者许可协议
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Individual Contributor License Agreement before we can accept your contribution. You can sign the Individual Contributor License Agreement by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA.

Deepin Packages Builder seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request

@sourcery-ai

sourcery-ai Bot commented Aug 28, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The PR consolidates Qt5 and Qt6 packaging into one project by selecting the build variant through DTK5, propagating variant-specific version and installation metadata through CMake, and adding Debian profile-controlled single- or dual-build packaging with separate runtime and development packages.

Flow diagram for DTK5-controlled Qt5 and Qt6 builds

flowchart LR
    A[DTK5 option] -->|ON| B[Qt5 build]
    A -->|OFF| C[Qt6 build]
    B --> D[DTK_VERSION 5.0.21]
    C --> E[DTK_VERSION 6.0.21]
    D --> F[Qt5 library and install metadata]
    E --> G[Qt6 library and install metadata]
Loading

File-Level Changes

Change Details Files
Replace project-version-driven Qt selection with an explicit DTK5 CMake option and derive DTK-specific version metadata for both builds.
  • Select Qt5 or Qt6 with DTK5 and set the corresponding suffix and version components.
  • Use the selected DTK version for library VERSION/SOVERSION, compile-time VERSION, generated documentation, pkg-config metadata, and Qt module metadata.
CMakeLists.txt
src/CMakeLists.txt
docs/CMakeLists.txt
misc/dtksystemsettings.pc.in
misc/qt_lib_dtksystemsettings.pri.in
Add Debian packaging support for independently building and installing Qt5 and Qt6 variants.
  • Split build dependencies and binary packages using nodtk5 and nodtk6 build profiles.
  • Build into separate directories with DTK5 enabled or disabled, while supporting a no-profile dual build.
  • Add distinct runtime and development install manifests for both ABI variants, including their headers, metadata, CMake files, and documentation.
debian/control
debian/rules
debian/libdtksystemsettings5.install
debian/libdtksystemsettings-dev.install
debian/libdtk6systemsettings.install
debian/libdtk6systemsettings-dev.install
Align the source and Debian package release metadata with the new dual-build versioning scheme.
  • Set the source release to 6.0.21.
  • Record the new release in the Debian changelog.
VERSION
debian/changelog

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

🤖 AI 代码审查报告

总体评分: 100 分 (通过阈值: 70分)

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 总体评分 100 分,大于 70 分通过阈值,代码质量符合要求。本次 PR 实现 Qt5/Qt6 双版本 debian 打包,构建系统重构清晰规范,无安全漏洞。

🔍 详细分析

1. 语法逻辑 ✅

评价: 优秀 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: CMake 构建逻辑正确:option(DTK5) 方案清晰,DTK_VERSION 变量推导正确(DTK5=ON 时 DTK_VERSION=5.6.21,DTK5=OFF 时 DTK_VERSION=6.6.21)。debian/rules 双构建目录逻辑正确,Build-Profile 条件判断准确。debian/changelog 版本格式符合规范。


2. 代码质量 ✅

评价: 优秀 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: 代码结构清晰,遵循 dtkcore 双版本打包模式。debian install 文件从通配符(lib*.so)改为精确路径(libdtksystemsettings.so),提升了打包准确性。debian/control 中修复了 Depends 字段缺少空格的问题。构建依赖按 Build-Profile 正确拆分。


3. 代码性能 ✅

评价: 优秀 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: 构建系统变更,对运行时性能无影响。双构建目录(build5/build6)方案正确,避免构建干扰。CMake 版本变量一次计算多次复用,效率合理。


4. 代码安全 🔒

评价: 优秀 ✅ 通过

🔐 发现 0 个安全漏洞

安全漏洞详情:
✅ 未发现安全漏洞

建议: 构建打包配置文件无安全风险:无硬编码密钥、无命令注入风险、无用户输入处理、无路径遍历风险。debian/rules 使用标准 debhelper 命令,Makefile 函数安全。


💡 改进建议代码示例

# 本次变更为构建打包配置,代码质量优秀,无需修复示例
# CMakeLists.txt 中的 DTK5 option 方案参考:
option(DTK5 "Build DTK5." ON)
if(DTK5)
    set(DTK_VERSION_MAJOR "5")
    set(QT_VERSION_MAJOR "5")
    set(VERSION_SUFFIX "")
else()
    set(DTK_VERSION_MAJOR "6")
    set(QT_VERSION_MAJOR "6")
    set(VERSION_SUFFIX "6")
endif()

本报告由 AI 代码审查工具自动生成

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.

2 participants