From 79794bac7fa847fad32734d07240fffaaa167f3f Mon Sep 17 00:00:00 2001 From: yeshanshan Date: Wed, 12 Nov 2025 13:36:04 +0800 Subject: [PATCH 1/2] feat: add reproducible build parameters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Added CMAKE_SKIP_BUILD_RPATH=ON flag to enable reproducible builds 2. This flag prevents embedding build machine specific paths in binaries 3. Modified dh_auto_configure to include DEB_CMAKE_EXTRA_FLAGS 4. Ensures consistent binary output across different build environments Influence: 1. Test building the package on different machines to verify reproducibility 2. Compare binary checksums from different build environments 3. Verify that RPATH is not embedded in the compiled binaries 4. Test package installation and functionality after the change 5. Ensure build process completes successfully with the new flag feat: 添加可重复编译参数 1. 添加 CMAKE_SKIP_BUILD_RPATH=ON 标志以启用可重复构建 2. 该标志防止在二进制文件中嵌入特定于构建机器的路径 3. 修改 dh_auto_configure 以包含 DEB_CMAKE_EXTRA_FLAGS 4. 确保在不同构建环境中获得一致的二进制输出 Influence: 1. 在不同机器上测试软件包构建以验证可重复性 2. 比较来自不同构建环境的二进制校验和 3. 验证编译后的二进制文件中未嵌入 RPATH 4. 测试更改后的软件包安装和功能 5. 确保构建过程使用新标志后能成功完成 --- debian/rules | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 759787c45..7cf1f90c6 100755 --- a/debian/rules +++ b/debian/rules @@ -8,6 +8,9 @@ export DEB_CFLAGS_MAINT_APPEND = -Wall export DEB_CXXFLAGS_MAINT_APPEND = -Wall export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wl,-E +# reproducible编译参数 +DEB_CMAKE_EXTRA_FLAGS += -DCMAKE_SKIP_BUILD_RPATH=ON + VERSION = $(DEB_VERSION_UPSTREAM) PACK_VER = $(shell echo $(VERSION) | awk -F'[+_~-]' '{print $$1}') # Fix: invalid digit "8" in octal constant. e.g. u008 ==> 008 ==> 8 @@ -17,4 +20,4 @@ BUILD_VER = $(shell echo $(VERSION) | awk -F'[+_~-]' '{print $$2}' | sed 's/[^0- dh $@ override_dh_auto_configure: - dh_auto_configure -- -DDS_VERSION=${PACK_VER} + dh_auto_configure -- $(DEB_CMAKE_EXTRA_FLAGS) -DDS_VERSION=${PACK_VER} From f1b77419a49699dbb93df5d2eb435b770390698f Mon Sep 17 00:00:00 2001 From: yeshanshan Date: Wed, 12 Nov 2025 18:05:28 +0800 Subject: [PATCH 2/2] fix: optimize plugin installation to avoid redundant files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed the CMake installation directives for dock, notification center, and notification plugin modules to use FILES_MATCHING with specific patterns instead of installing entire directories. This prevents redundant files from being installed during repeated builds, which was causing compilation issues. The modification specifies that only QML-related files (qmldir, *.qmltypes, *.qml, *.js) should be installed from the build directories, rather than copying all files. This resolves the problem where unnecessary files were being repeatedly installed, leading to compilation conflicts and build inconsistencies. Influence: 1. Verify that dock panel still loads and functions correctly 2. Test notification center display and interaction 3. Check notification plugin behavior 4. Ensure all QML components are properly installed and accessible 5. Test repeated builds to confirm no installation conflicts occur fix: 优化插件安装以避免冗余文件 修改了dock、通知中心和通知插件模块的CMake安装指令,使用FILES_MATCHING和 特定模式替代安装整个目录。这防止了在重复构建期间安装冗余文件,该问题曾导 致编译问题。 此修改指定仅应从构建目录安装QML相关文件(qmldir、*.qmltypes、*.qml、 *.js),而不是复制所有文件。这解决了因重复安装不必要文件而导致的编译冲突 和构建不一致问题。 Influence: 1. 验证dock面板仍能正确加载和运行 2. 测试通知中心的显示和交互 3. 检查通知插件行为 4. 确保所有QML组件正确安装并可访问 5. 测试重复构建以确认没有安装冲突发生 --- panels/dock/CMakeLists.txt | 5 ++++- panels/dock/tray/CMakeLists.txt | 4 ++++ panels/dock/tray/quickpanel/CMakeLists.txt | 5 +++++ panels/notification/center/CMakeLists.txt | 4 +++- panels/notification/plugin/CMakeLists.txt | 4 +++- 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/panels/dock/CMakeLists.txt b/panels/dock/CMakeLists.txt index 725b01f5f..3909c5f73 100644 --- a/panels/dock/CMakeLists.txt +++ b/panels/dock/CMakeLists.txt @@ -161,7 +161,10 @@ target_include_directories(dock-plugin ) install(TARGETS dock-plugin DESTINATION "${QML_INSTALL_DIR}/org/deepin/ds/dock/") -install(DIRECTORY "${PROJECT_BINARY_DIR}/plugins/org/deepin/ds/dock/" DESTINATION "${QML_INSTALL_DIR}/org/deepin/ds/dock/") +install(DIRECTORY ${PROJECT_BINARY_DIR}/plugins/org/deepin/ds/dock/ DESTINATION ${QML_INSTALL_DIR}/org/deepin/ds/dock/ + FILES_MATCHING PATTERN "qmldir" PATTERN "*.qmltypes" PATTERN "*.qml" PATTERN "*.js" +) + dtk_add_config_meta_files(APPID org.deepin.ds.dock FILES dconfig/org.deepin.ds.dock.json) # compat dtk_add_config_meta_files(APPID org.deepin.ds.dock FILES dconfig/org.deepin.ds.dock.tray.json) # compat dtk_add_config_meta_files(APPID org.deepin.dde.shell FILES dconfig/org.deepin.ds.dock.json) diff --git a/panels/dock/tray/CMakeLists.txt b/panels/dock/tray/CMakeLists.txt index 97032f74c..9710ace45 100644 --- a/panels/dock/tray/CMakeLists.txt +++ b/panels/dock/tray/CMakeLists.txt @@ -56,5 +56,9 @@ target_link_libraries(trayitem PRIVATE dde-shell-frame ) +install(TARGETS dock-tray DESTINATION "${QML_INSTALL_DIR}/org/deepin/ds/dock/tray/") +install(DIRECTORY ${PROJECT_BINARY_DIR}/plugins/org/deepin/ds/dock/tray/ DESTINATION ${QML_INSTALL_DIR}/org/deepin/ds/dock/tray/ + FILES_MATCHING PATTERN "qmldir" PATTERN "*.qmltypes" PATTERN "*.qml" PATTERN "*.js" +) ds_install_package(PACKAGE org.deepin.ds.dock.tray TARGET trayitem) ds_handle_package_translation(PACKAGE org.deepin.ds.dock.tray) diff --git a/panels/dock/tray/quickpanel/CMakeLists.txt b/panels/dock/tray/quickpanel/CMakeLists.txt index d292cb81a..ef2440601 100644 --- a/panels/dock/tray/quickpanel/CMakeLists.txt +++ b/panels/dock/tray/quickpanel/CMakeLists.txt @@ -25,3 +25,8 @@ qt_add_qml_module(tray-quickpanel target_link_libraries(tray-quickpanel PRIVATE Dtk${DTK_VERSION_MAJOR}::Core ) + +install(TARGETS tray-quickpanel DESTINATION "${QML_INSTALL_DIR}/org/deepin/ds/dock/tray/quickpanel/") +install(DIRECTORY ${PROJECT_BINARY_DIR}/plugins/org/deepin/ds/dock/tray/quickpanel/ DESTINATION ${QML_INSTALL_DIR}/org/deepin/ds/dock/tray/quickpanel/ + FILES_MATCHING PATTERN "qmldir" PATTERN "*.qmltypes" PATTERN "*.qml" PATTERN "*.js" +) diff --git a/panels/notification/center/CMakeLists.txt b/panels/notification/center/CMakeLists.txt index b0a17b12f..01e76a3c2 100644 --- a/panels/notification/center/CMakeLists.txt +++ b/panels/notification/center/CMakeLists.txt @@ -59,7 +59,9 @@ target_link_libraries(notificationcenterpanel ) install(TARGETS notificationcenterpanelplugin DESTINATION "${QML_INSTALL_DIR}/org/deepin/ds/notificationcenter/") -install(DIRECTORY "${PROJECT_BINARY_DIR}/plugins/org/deepin/ds/notificationcenter/" DESTINATION "${QML_INSTALL_DIR}/org/deepin/ds/notificationcenter/") +install(DIRECTORY ${PROJECT_BINARY_DIR}/plugins/org/deepin/ds/notificationcenter/ DESTINATION ${QML_INSTALL_DIR}/org/deepin/ds/notificationcenter/ + FILES_MATCHING PATTERN "qmldir" PATTERN "*.qmltypes" PATTERN "*.qml" PATTERN "*.js" +) ds_install_package(PACKAGE org.deepin.ds.notificationcenter TARGET notificationcenterpanel) ds_handle_package_translation(PACKAGE org.deepin.ds.notificationcenter) diff --git a/panels/notification/plugin/CMakeLists.txt b/panels/notification/plugin/CMakeLists.txt index 79025890c..ab0476b0b 100644 --- a/panels/notification/plugin/CMakeLists.txt +++ b/panels/notification/plugin/CMakeLists.txt @@ -24,4 +24,6 @@ qt_add_qml_module(notificationplugin ) install(TARGETS notificationplugin DESTINATION "${QML_INSTALL_DIR}/org/deepin/ds/notification/") -install(DIRECTORY "${PROJECT_BINARY_DIR}/plugins/org/deepin/ds/notification/" DESTINATION "${QML_INSTALL_DIR}/org/deepin/ds/notification/") +install(DIRECTORY ${PROJECT_BINARY_DIR}/plugins/org/deepin/ds/notification/ DESTINATION ${QML_INSTALL_DIR}/org/deepin/ds/notification/ + FILES_MATCHING PATTERN "qmldir" PATTERN "*.qmltypes" PATTERN "*.qml" PATTERN "*.js" +)