Skip to content

Conversation

@18202781743
Copy link
Contributor

  1. Added DTK5 build option to CMakeLists.txt to support both DTK5 (Qt5)
    and DTK6 (Qt6) builds
  2. Modified CMake configuration to use DTK_VERSION_MAJOR and
    DTK_NAME_SUFFIX variables for version-specific naming
  3. Updated Debian packaging to support separate DTK5 and DTK6 packages
    with proper build profiles
  4. Enhanced debian/rules to handle parallel builds for both DTK versions
    with separate build directories
  5. Modified all CMake configuration files to use DTK_NAME_SUFFIX instead
    of DTK_VERSION_MAJOR for naming consistency
  6. Updated include paths, library names, and configuration files to
    support both DTK5 and DTK6 variants
  7. Added new Debian package files for DTK6: libdtk6gui, libdtk6gui-bin,
    and libdtk6gui-dev
  8. Modified Arch Linux PKGBUILD to explicitly enable DTK5 build option

Log: Added support for building both DTK5 (Qt5) and DTK6 (Qt6) versions
of DTK GUI library

Influence:

  1. Test building both DTK5 and DTK6 versions using CMake with -DDTK5=ON/
    OFF
  2. Verify Debian package builds with different build profiles (nodtk5,
    nodtk6)
  3. Check that DTK5 packages install to dtk5/ directories and DTK6 to
    dtk6/ directories
  4. Test that examples and tools build correctly for both versions
  5. Verify library naming: libdtkgui.so.5* for DTK5 and libdtk6gui.so.6*
    for DTK6
  6. Test CMake configuration files for both versions work correctly
  7. Verify pkg-config files are generated with correct names and
    dependencies

feat: 添加DTK5和DTK6统一构建系统

  1. 在CMakeLists.txt中添加DTK5构建选项,支持同时构建DTK5(Qt5)和
    DTK6(Qt6)版本
  2. 修改CMake配置,使用DTK_VERSION_MAJOR和DTK_NAME_SUFFIX变量进行版本特定
    的命名
  3. 更新Debian打包配置,支持独立的DTK5和DTK6软件包,并设置正确的构建配置
    文件
  4. 增强debian/rules文件,支持为两个DTK版本使用独立的构建目录进行并行构建
  5. 修改所有CMake配置文件,使用DTK_NAME_SUFFIX代替DTK_VERSION_MAJOR以确保
    命名一致性
  6. 更新包含路径、库名称和配置文件以支持DTK5和DTK6变体
  7. 为DTK6添加新的Debian软件包文件:libdtk6gui、libdtk6gui-bin和
    libdtk6gui-dev
  8. 修改Arch Linux PKGBUILD以显式启用DTK5构建选项

Log: 新增支持构建DTK GUI库的DTK5(Qt5)和DTK6(Qt6)版本

Influence:

  1. 测试使用CMake构建DTK5和DTK6版本,使用-DDTK5=ON/OFF参数
  2. 验证使用不同构建配置文件(nodtk5、nodtk6)的Debian软件包构建
  3. 检查DTK5软件包是否安装到dtk5/目录,DTK6安装到dtk6/目录
  4. 测试示例程序和应用工具是否正确构建两个版本
  5. 验证库命名:DTK5为libdtkgui.so.5*,DTK6为libdtk6gui.so.6*
  6. 测试两个版本的CMake配置文件是否正确工作
  7. 验证pkg-config文件是否生成正确的名称和依赖关系

deepin-ci-robot added a commit to linuxdeepin/dtk6gui that referenced this pull request Dec 29, 2025
Synchronize source files from linuxdeepin/dtkgui.

Source-pull-request: linuxdeepin/dtkgui#358
@github-actions
Copy link
Contributor

  • 检测到debian目录文件有变更: debian/libdtk6gui-bin.install,debian/libdtk6gui-dev.install,debian/libdtk6gui.install,debian/control,debian/libdtkgui-dev.install,debian/libdtkgui5-bin.install,debian/libdtkgui5.install,debian/rules

  • 检测到敏感词export变动

详情
    {
    "export": {
        "debian/rules": {
            "a": [
                "export QT_SELECT = qt5"
            ]
        }
    }
}

@github-actions
Copy link
Contributor

  • 敏感词检查失败, 检测到3个文件存在敏感词
详情
{
    "CMakeLists.txt": [
        {
            "line": "  HOMEPAGE_URL \"https://github.com/linuxdeepin/dtkgui\"",
            "line_number": 9,
            "rule": "S35",
            "reason": "Url link | 4393cea435"
        }
    ],
    "archlinux/PKGBUILD": [
        {
            "line": "url=\"https://github.com/linuxdeepin/dtkgui\"",
            "line_number": 10,
            "rule": "S35",
            "reason": "Url link | 4393cea435"
        }
    ],
    "docs/CMakeLists.txt": [
        {
            "line": "execute_process(COMMAND git clone https://github.com/linuxdeepin/doxygen-theme.git --depth=1",
            "line_number": 48,
            "rule": "S35",
            "reason": "Url link | d2deace9b0"
        }
    ]
}

deepin-ci-robot added a commit to linuxdeepin/dtk6gui that referenced this pull request Dec 30, 2025
Synchronize source files from linuxdeepin/dtkgui.

Source-pull-request: linuxdeepin/dtkgui#358
@github-actions
Copy link
Contributor

  • 检测到debian目录文件有变更: debian/libdtk6gui-bin.install,debian/libdtk6gui-dev.install,debian/libdtk6gui-doc.install,debian/libdtk6gui.install,debian/control,debian/libdtkgui-dev.install,debian/libdtkgui5-bin.install,debian/libdtkgui5.install,debian/rules

  • 检测到敏感词export变动

详情
    {
    "export": {
        "debian/rules": {
            "a": [
                "export QT_SELECT = qt5"
            ]
        }
    }
}

@github-actions
Copy link
Contributor

  • 敏感词检查失败, 检测到3个文件存在敏感词
详情
{
    "CMakeLists.txt": [
        {
            "line": "  HOMEPAGE_URL \"https://github.com/linuxdeepin/dtkgui\"",
            "line_number": 9,
            "rule": "S35",
            "reason": "Url link | 4393cea435"
        }
    ],
    "archlinux/PKGBUILD": [
        {
            "line": "url=\"https://github.com/linuxdeepin/dtkgui\"",
            "line_number": 10,
            "rule": "S35",
            "reason": "Url link | 4393cea435"
        }
    ],
    "docs/CMakeLists.txt": [
        {
            "line": "execute_process(COMMAND git clone https://github.com/linuxdeepin/doxygen-theme.git --depth=1",
            "line_number": 48,
            "rule": "S35",
            "reason": "Url link | d2deace9b0"
        }
    ]
}

deepin-ci-robot added a commit to linuxdeepin/dtk6gui that referenced this pull request Dec 30, 2025
Synchronize source files from linuxdeepin/dtkgui.

Source-pull-request: linuxdeepin/dtkgui#358
@github-actions
Copy link
Contributor

  • 检测到debian目录文件有变更: debian/libdtk6gui-bin.install,debian/libdtk6gui-dev.install,debian/libdtk6gui-doc.install,debian/libdtk6gui.install,debian/control,debian/libdtkgui-dev.install,debian/libdtkgui5-bin.install,debian/libdtkgui5.install,debian/rules

  • 检测到敏感词export变动

详情
    {
    "export": {
        "debian/rules": {
            "a": [
                "export QT_SELECT = qt5"
            ]
        }
    }
}

@github-actions
Copy link
Contributor

  • 敏感词检查失败, 检测到3个文件存在敏感词
详情
{
    "CMakeLists.txt": [
        {
            "line": "  HOMEPAGE_URL \"https://github.com/linuxdeepin/dtkgui\"",
            "line_number": 9,
            "rule": "S35",
            "reason": "Url link | 4393cea435"
        }
    ],
    "archlinux/PKGBUILD": [
        {
            "line": "url=\"https://github.com/linuxdeepin/dtkgui\"",
            "line_number": 10,
            "rule": "S35",
            "reason": "Url link | 4393cea435"
        }
    ],
    "docs/CMakeLists.txt": [
        {
            "line": "execute_process(COMMAND git clone https://github.com/linuxdeepin/doxygen-theme.git --depth=1",
            "line_number": 48,
            "rule": "S35",
            "reason": "Url link | d2deace9b0"
        }
    ]
}

@18202781743 18202781743 requested a review from asterwyx December 30, 2025 12:04
mhduiy
mhduiy previously approved these changes Dec 31, 2025
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_BUILD_TYPE=Release \
Copy link
Contributor

Choose a reason for hiding this comment

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

这个地方,根据晏然的说法,在archlinux上打包,CMAKE_BUILD_TYPE应该指定为None。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

默认应该就是None吧,

1. Added DTK5 build option to CMakeLists.txt to support both DTK5 (Qt5)
and DTK6 (Qt6) builds
2. Modified CMake configuration to use DTK_VERSION_MAJOR and
DTK_NAME_SUFFIX variables for version-specific naming
3. Updated Debian packaging to support separate DTK5 and DTK6 packages
with proper build profiles
4. Enhanced debian/rules to handle parallel builds for both DTK versions
with separate build directories
5. Modified all CMake configuration files to use DTK_NAME_SUFFIX instead
of DTK_VERSION_MAJOR for naming consistency
6. Updated include paths, library names, and configuration files to
support both DTK5 and DTK6 variants
7. Added new Debian package files for DTK6: libdtk6gui, libdtk6gui-bin,
and libdtk6gui-dev
8. Modified Arch Linux PKGBUILD to explicitly enable DTK5 build option

Log: Added support for building both DTK5 (Qt5) and DTK6 (Qt6) versions
of DTK GUI library

Influence:
1. Test building both DTK5 and DTK6 versions using CMake with -DDTK5=ON/
OFF
2. Verify Debian package builds with different build profiles (nodtk5,
nodtk6)
3. Check that DTK5 packages install to dtk5/ directories and DTK6 to
dtk6/ directories
4. Test that examples and tools build correctly for both versions
5. Verify library naming: libdtkgui.so.5* for DTK5 and libdtk6gui.so.6*
for DTK6
6. Test CMake configuration files for both versions work correctly
7. Verify pkg-config files are generated with correct names and
dependencies

feat: 添加DTK5和DTK6统一构建系统

1. 在CMakeLists.txt中添加DTK5构建选项,支持同时构建DTK5(Qt5)和
DTK6(Qt6)版本
2. 修改CMake配置,使用DTK_VERSION_MAJOR和DTK_NAME_SUFFIX变量进行版本特定
的命名
3. 更新Debian打包配置,支持独立的DTK5和DTK6软件包,并设置正确的构建配置
文件
4. 增强debian/rules文件,支持为两个DTK版本使用独立的构建目录进行并行构建
5. 修改所有CMake配置文件,使用DTK_NAME_SUFFIX代替DTK_VERSION_MAJOR以确保
命名一致性
6. 更新包含路径、库名称和配置文件以支持DTK5和DTK6变体
7. 为DTK6添加新的Debian软件包文件:libdtk6gui、libdtk6gui-bin和
libdtk6gui-dev
8. 修改Arch Linux PKGBUILD以显式启用DTK5构建选项

Log: 新增支持构建DTK GUI库的DTK5(Qt5)和DTK6(Qt6)版本

Influence:
1. 测试使用CMake构建DTK5和DTK6版本,使用-DDTK5=ON/OFF参数
2. 验证使用不同构建配置文件(nodtk5、nodtk6)的Debian软件包构建
3. 检查DTK5软件包是否安装到dtk5/目录,DTK6安装到dtk6/目录
4. 测试示例程序和应用工具是否正确构建两个版本
5. 验证库命名:DTK5为libdtkgui.so.5*,DTK6为libdtk6gui.so.6*
6. 测试两个版本的CMake配置文件是否正确工作
7. 验证pkg-config文件是否生成正确的名称和依赖关系
deepin-ci-robot added a commit to linuxdeepin/dtk6gui that referenced this pull request Dec 31, 2025
Synchronize source files from linuxdeepin/dtkgui.

Source-pull-request: linuxdeepin/dtkgui#358
@github-actions
Copy link
Contributor

  • 检测到debian目录文件有变更: debian/libdtk6gui-bin.install,debian/libdtk6gui-dev.install,debian/libdtk6gui-doc.install,debian/libdtk6gui.install,debian/control,debian/libdtkgui-dev.install,debian/libdtkgui5-bin.install,debian/libdtkgui5.install,debian/rules

  • 检测到敏感词export变动

详情
    {
    "export": {
        "debian/rules": {
            "a": [
                "export QT_SELECT = qt5"
            ]
        }
    }
}

@github-actions
Copy link
Contributor

  • 敏感词检查失败, 检测到3个文件存在敏感词
详情
{
    "CMakeLists.txt": [
        {
            "line": "  HOMEPAGE_URL \"https://github.com/linuxdeepin/dtkgui\"",
            "line_number": 9,
            "rule": "S35",
            "reason": "Url link | 4393cea435"
        }
    ],
    "archlinux/PKGBUILD": [
        {
            "line": "url=\"https://github.com/linuxdeepin/dtkgui\"",
            "line_number": 10,
            "rule": "S35",
            "reason": "Url link | 4393cea435"
        }
    ],
    "docs/CMakeLists.txt": [
        {
            "line": "execute_process(COMMAND git clone https://github.com/linuxdeepin/doxygen-theme.git --depth=1",
            "line_number": 48,
            "rule": "S35",
            "reason": "Url link | d2deace9b0"
        }
    ]
}

@deepin-ci-robot
Copy link
Contributor

deepin pr auto review

我来对这个git diff进行代码审查。主要关注语法逻辑、代码质量、性能和安全等方面。

  1. 版本管理改进:
# 旧版本
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" DTK_FILE_VERSION)
string(STRIP "${DTK_FILE_VERSION}" DTK_FILE_VERSION)
set(DTK_VERSION "${DTK_FILE_VERSION}" CACHE STRING "define project version")

# 新版本
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" FILE_VERSION)
string(STRIP "${FILE_VERSION}" FILE_VERSION)

改进:变量命名更清晰,去掉了冗余的CACHE标记。

  1. DTK版本控制逻辑改进:
# 旧版本
if("${PROJECT_VERSION_MAJOR}" STREQUAL "5")
    set(QT_VERSION_MAJOR "5")
elseif("${PROJECT_VERSION_MAJOR}" STREQUAL "6")
    set(QT_VERSION_MAJOR "6")
    set(DTK_VERSION_MAJOR "6")
else()
    message(SEND_ERROR "not support Prject Version ${PROJECT_VERSION}.")
endif()

# 新版本
option(DTK5 "Build DTK5." ON)
if(DTK5)
    set(DTK_VERSION_MAJOR "5")
    set(DTK_NAME_SUFFIX "")
else()
    set(DTK_VERSION_MAJOR "6")
    set(DTK_NAME_SUFFIX "6")
endif()

改进:

  • 使用option提供更灵活的构建选项
  • 添加了DTK_NAME_SUFFIX变量,使命名更规范
  • 去掉了版本字符串比较,改用option控制更可靠
  1. 版本号处理改进:
set(DTK_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(DTK_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(DTK_VERSION "${DTK_VERSION_MAJOR}.${DTK_VERSION_MINOR}.${DTK_VERSION_PATCH}")

改进:将版本号拆分处理,更灵活且易于维护。

  1. 安全性改进:
# tests/CMakeLists.txt
# 旧版本
target_compile_options(${BIN_NAME} PRIVATE -fno-access-control -fsanitize=address)
target_link_options(${BIN_NAME} PRIVATE -fsanitize=address)

# 新版本
target_compile_options(${BIN_NAME} PRIVATE -fno-access-control)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
    target_compile_options(${BIN_NAME} PRIVATE -fsanitize=address)
    target_link_options(${BIN_NAME} PRIVATE -fsanitize=address)
endif()

改进:将sanitizer选项限制在Debug构建中,避免在Release版本中引入不必要的性能开销。

  1. 包管理改进:
  • 新增了DTK6相关的包配置文件
  • 使用Build-Profiles控制不同版本的构建
  • 包依赖关系更清晰,使用了<!nodtk5>和<!nodtk6>标记
  1. 工具命名规范化:
# 旧版本
set(TARGET ${BIN_NAME}${DTK_VERSION_MAJOR})

# 新版本
set(TARGET ${BIN_NAME}${DTK_NAME_SUFFIX})

改进:使用DTK_NAME_SUFFIX替代直接使用版本号,命名更规范。

建议:

  1. 考虑添加版本号验证逻辑,确保VERSION文件中的版本号格式正确
  2. 可以考虑添加更多的编译选项控制,比如是否启用特定的功能模块
  3. 建议在CMakeLists.txt中添加更多的注释,说明各个配置选项的作用
  4. 可以考虑添加版本兼容性检查,确保依赖库的版本匹配

这些改动整体上是积极的,提高了代码的可维护性和灵活性,同时保持了向后兼容性。新的构建系统更清晰地支持DTK5和DTK6的并行构建。

@deepin-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, asterwyx

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

@18202781743 18202781743 merged commit 6fb258e into linuxdeepin:master Jan 6, 2026
21 of 23 checks passed
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.

4 participants