Skip to content

Conversation

@18202781743
Copy link
Contributor

  1. Replaced version-based detection with explicit DTK5/DTK6 build option
  2. Added DTK5 option (default ON) to control which version to build
  3. Modified CMake configuration to handle both DTK5 and DTK6 builds
  4. Updated Debian packaging to support both DTK5 and DTK6 packages
  5. Added separate build directories and profiles for DTK5/DTK6
  6. Updated library naming conventions with proper suffixes
  7. Modified installation paths to include version-specific directories
  8. Updated pkg-config and CMake configuration files for both versions
  9. Ensured proper Qt version selection based on DTK version

Log: Added support for building both DTK5 and DTK6 versions from same
codebase

Influence:

  1. Test building with DTK5=ON (default) to ensure DTK5 compatibility
  2. Test building with DTK5=OFF to verify DTK6 support
  3. Verify Debian package generation for both DTK5 and DTK6 variants
  4. Test installation paths for both versions (dtk5/ vs dtk6/
    directories)
  5. Verify pkg-config files work correctly for both versions
  6. Test CMake find_package for both Dtk5Widget and Dtk6Widget
  7. Ensure examples and plugins build correctly with both versions
  8. Verify translation files are installed to correct locations

refactor: 统一DTK5和DTK6构建系统

  1. 将基于版本的检测替换为明确的DTK5/DTK6构建选项
  2. 添加DTK5选项(默认开启)控制构建哪个版本
  3. 修改CMake配置以处理DTK5和DTK6构建
  4. 更新Debian打包以支持DTK5和DTK6包
  5. 为DTK5/DTK6添加独立的构建目录和配置文件
  6. 更新库命名规范,添加适当的后缀
  7. 修改安装路径以包含版本特定的目录
  8. 更新pkg-config和CMake配置文件以支持两个版本
  9. 确保根据DTK版本正确选择Qt版本

Log: 新增从同一代码库构建DTK5和DTK6版本的支持

Influence:

  1. 测试使用DTK5=ON(默认)构建,确保DTK5兼容性
  2. 测试使用DTK5=OFF构建,验证DTK6支持
  3. 验证Debian包生成,确保DTK5和DTK6变体都能正确打包
  4. 测试两个版本的安装路径(dtk5/与dtk6/目录)
  5. 验证pkg-config文件在两个版本中都能正常工作
  6. 测试CMake find_package对Dtk5Widget和Dtk6Widget的支持
  7. 确保示例和插件在两个版本中都能正确构建
  8. 验证翻译文件安装到正确的位置

@github-actions
Copy link
Contributor

  • 检测到debian目录文件有变更: debian/libdtk6widget-bin.install,debian/libdtk6widget-dev.install,debian/libdtk6widget.install,debian/control,debian/libdtkwidget-dev.install,debian/libdtkwidget5-bin.install,debian/libdtkwidget5.install,debian/libdtkwidget5.install.amd64,debian/libdtkwidget5.install.i386,debian/rules

  • 检测到敏感词export变动

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

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

Source-pull-request: linuxdeepin/dtkwidget#716
@github-actions
Copy link
Contributor

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

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

Source-pull-request: linuxdeepin/dtkwidget#716
@github-actions
Copy link
Contributor

  • 检测到debian目录文件有变更: debian/libdtk6widget-bin.install,debian/libdtk6widget-dev.install,debian/libdtk6widget-doc.install,debian/libdtk6widget.install,debian/control,debian/libdtkwidget-dev.install,debian/libdtkwidget5-bin.install,debian/libdtkwidget5.install,debian/libdtkwidget5.install.amd64,debian/libdtkwidget5.install.i386,debian/rules

  • 检测到敏感词export变动

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

@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

  • 检测到debian目录文件有变更: debian/libdtk6widget-bin.install,debian/libdtk6widget-dev.install,debian/libdtk6widget-doc.install,debian/libdtk6widget.install,debian/control,debian/libdtkwidget-dev.install,debian/libdtkwidget5-bin.install,debian/libdtkwidget5.install,debian/libdtkwidget5.install.amd64,debian/libdtkwidget5.install.i386,debian/rules

  • 检测到敏感词export变动

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

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

Source-pull-request: linuxdeepin/dtkwidget#716
@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

  • 检测到debian目录文件有变更: debian/dtk6widget-examples.install,debian/libdtk6widget-bin.install,debian/libdtk6widget-dev.install,debian/libdtk6widget-doc.install,debian/libdtk6widget.install,debian/control,debian/dtkwidget5-examples.install,debian/libdtkwidget-dev.install,debian/libdtkwidget5-bin.install,debian/libdtkwidget5.install,debian/libdtkwidget5.install.amd64,debian/libdtkwidget5.install.i386,debian/rules

  • 检测到敏感词export变动

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

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

Source-pull-request: linuxdeepin/dtkwidget#716
@github-actions
Copy link
Contributor

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

deepin-ci-robot added a commit to linuxdeepin/dtk6widget that referenced this pull request Dec 31, 2025
Synchronize source files from linuxdeepin/dtkwidget.

Source-pull-request: linuxdeepin/dtkwidget#716
@github-actions
Copy link
Contributor

  • 检测到debian目录文件有变更: debian/dtk6widget-examples.install,debian/libdtk6widget-bin.install,debian/libdtk6widget-dev.install,debian/libdtk6widget-doc.install,debian/libdtk6widget.install,debian/control,debian/dtkwidget5-examples.install,debian/libdtkwidget-dev.install,debian/libdtkwidget5-bin.install,debian/libdtkwidget5.install,debian/libdtkwidget5.install.amd64,debian/libdtkwidget5.install.i386,debian/rules

  • 检测到敏感词export变动

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

@github-actions
Copy link
Contributor

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

@deepin-ci-robot
Copy link
Contributor

deepin pr auto review

我来对这段代码变更进行审查:

  1. 语法逻辑:
  • 代码变更整体上语法正确,CMakeLists.txt的改动符合CMake语法规范
  • 版本控制逻辑清晰,通过DTK5/DTK6选项区分不同版本
  • debian/control文件格式正确,依赖关系明确
  1. 代码质量:
  • 引入了版本控制选项(DTK5/DTK6),提高了代码的可维护性
  • 统一了命名规范,如LIB_NAME替代LIBNAME
  • 改进了版本处理逻辑,使用更清晰的版本号映射
  1. 代码性能:
  • 没有明显的性能问题
  • 使用了CMAKE_SKIP_BUILD_RPATH=ON等优化选项
  • 合理使用了编译器优化标志
  1. 代码安全:
  • 添加了安全编译参数,如hardening=+all
  • 使用了适当的链接器标志(-Wl,--as-needed等)
  • 改进了地址检查,仅在Debug模式下启用-fsanitize=address

改进建议:

  1. CMakeLists.txt中:
# 建议添加版本检查
if(NOT (DTK5 OR DTK6))
    message(FATAL_ERROR "Either DTK5 or DTK6 must be enabled")
endif()

# 建议明确指定C++标准
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
  1. debian/rules中:
# 建议添加并行编译支持
%:
	dh $@ --parallel

# 建议添加更严格的编译器警告
export DEB_CXXFLAGS_MAINT_APPEND += -Wextra -Wpedantic
  1. 安全性方面:
# 建议添加更多安全编译选项
if(CMAKE_BUILD_TYPE STREQUAL "Release")
    target_compile_options(${LIB_NAME} PRIVATE
        -fstack-protector-strong
        -D_FORTIFY_SOURCE=2
    )
endif()
  1. 版本控制:
# 建议添加更严格的版本检查
if(NOT PROJECT_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+$")
    message(FATAL_ERROR "Invalid version format")
endif()
  1. 依赖管理:
# 建议使用更严格的依赖检查
find_package(Qt${QT_VERSION_MAJOR} ${QT_MIN_VERSION} REQUIRED COMPONENTS ...)

这些改进将有助于:

  1. 提高代码的健壮性
  2. 增强安全性
  3. 改善编译性能
  4. 使版本控制更加严格
  5. 优化依赖管理

总的来说,这次代码变更质量较高,主要改进了版本控制和构建系统的组织,但还可以在安全性、依赖管理和版本检查方面进一步加强。

mhduiy
mhduiy previously approved these changes Dec 31, 2025
1. Replaced version-based detection with explicit DTK5/DTK6 build option
2. Added DTK5 option (default ON) to control which version to build
3. Modified CMake configuration to handle both DTK5 and DTK6 builds
4. Updated Debian packaging to support both DTK5 and DTK6 packages
5. Added separate build directories and profiles for DTK5/DTK6
6. Updated library naming conventions with proper suffixes
7. Modified installation paths to include version-specific directories
8. Updated pkg-config and CMake configuration files for both versions
9. Ensured proper Qt version selection based on DTK version

Log: Added support for building both DTK5 and DTK6 versions from same
codebase

Influence:
1. Test building with DTK5=ON (default) to ensure DTK5 compatibility
2. Test building with DTK5=OFF to verify DTK6 support
3. Verify Debian package generation for both DTK5 and DTK6 variants
4. Test installation paths for both versions (dtk5/ vs dtk6/
directories)
5. Verify pkg-config files work correctly for both versions
6. Test CMake find_package for both Dtk5Widget and Dtk6Widget
7. Ensure examples and plugins build correctly with both versions
8. Verify translation files are installed to correct locations

refactor: 统一DTK5和DTK6构建系统

1. 将基于版本的检测替换为明确的DTK5/DTK6构建选项
2. 添加DTK5选项(默认开启)控制构建哪个版本
3. 修改CMake配置以处理DTK5和DTK6构建
4. 更新Debian打包以支持DTK5和DTK6包
5. 为DTK5/DTK6添加独立的构建目录和配置文件
6. 更新库命名规范,添加适当的后缀
7. 修改安装路径以包含版本特定的目录
8. 更新pkg-config和CMake配置文件以支持两个版本
9. 确保根据DTK版本正确选择Qt版本

Log: 新增从同一代码库构建DTK5和DTK6版本的支持

Influence:
1. 测试使用DTK5=ON(默认)构建,确保DTK5兼容性
2. 测试使用DTK5=OFF构建,验证DTK6支持
3. 验证Debian包生成,确保DTK5和DTK6变体都能正确打包
4. 测试两个版本的安装路径(dtk5/与dtk6/目录)
5. 验证pkg-config文件在两个版本中都能正常工作
6. 测试CMake find_package对Dtk5Widget和Dtk6Widget的支持
7. 确保示例和插件在两个版本中都能正确构建
8. 验证翻译文件安装到正确的位置
@deepin-ci-robot
Copy link
Contributor

[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

deepin-ci-robot added a commit to linuxdeepin/dtk6widget that referenced this pull request Dec 31, 2025
Synchronize source files from linuxdeepin/dtkwidget.

Source-pull-request: linuxdeepin/dtkwidget#716
@github-actions
Copy link
Contributor

  • 检测到debian目录文件有变更: debian/dtk6widget-examples.install,debian/libdtk6widget-bin.install,debian/libdtk6widget-dev.install,debian/libdtk6widget-doc.install,debian/libdtk6widget.install,debian/control,debian/dtkwidget5-examples.install,debian/libdtkwidget-dev.install,debian/libdtkwidget5-bin.install,debian/libdtkwidget5.install,debian/libdtkwidget5.install.amd64,debian/libdtkwidget5.install.i386,debian/rules

  • 检测到敏感词export变动

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

@deepin-ci-robot
Copy link
Contributor

[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
Copy link
Contributor

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

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