From 25cc416d5dae9c0c12184f692cbeae320ce7b452 Mon Sep 17 00:00:00 2001 From: yeshanshan Date: Wed, 21 Jan 2026 11:40:57 +0800 Subject: [PATCH] refactor: unify dtk5 and dtk6 version handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed version mapping logic for DTK5 and DTK6 as part of unified build transformation. The changes include: 1. Removed DTK5_VERSION, DTK6_VERSION, and DTK5_MAJOR_MINOR variable definitions 2. Removed VERSION, PACK_VER, and BUILD_VER variable definitions 3. Removed -DBUILD_VERSION and -DDTK_VERSION CMake arguments from both DTK5 and DTK6 build configurations 4. Removed override_dh_makeshlibs target that used version-specific dependency specifications This refactoring is necessary because dtk5 and dtk6 now share the same version numbers, eliminating the need for separate version mapping logic. The unified build approach simplifies the build system and reduces maintenance complexity. Influence: 1. Verify that both DTK5 and DTK6 packages build successfully without version mapping 2. Test that the resulting packages have correct version numbers 3. Check that shared library dependencies are properly handled without version-specific overrides 4. Validate that Build-Profiles (nodtk5, nodtk6, nodoc) still work correctly 5. Test package installation and runtime functionality refactor: 统一dtk5和dtk6版本处理逻辑 作为统一构建改造的一部分,移除了DTK5和DTK6的版本映射逻辑。具体变更包括: 1. 移除了DTK5_VERSION、DTK6_VERSION和DTK5_MAJOR_MINOR变量定义 2. 移除了VERSION、PACK_VER和BUILD_VER变量定义 3. 从DTK5和DTK6构建配置中移除了-DBUILD_VERSION和-DDTK_VERSION CMake参数 4. 移除了使用版本特定依赖规范的override_dh_makeshlibs目标 此次重构是必要的,因为dtk5和dtk6现在使用相同的版本号,不再需要单独的版本 映射逻辑。统一构建方法简化了构建系统并降低了维护复杂度。 Influence: 1. 验证DTK5和DTK6包在没有版本映射的情况下能否成功构建 2. 测试生成的包是否具有正确的版本号 3. 检查共享库依赖关系在没有版本特定覆盖的情况下是否正确处理 4. 验证Build-Profiles(nodtk5、nodtk6、nodoc)是否仍能正常工作 5. 测试软件包安装和运行时功能 --- debian/rules | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/debian/rules b/debian/rules index 347f0dee..d9412ebd 100755 --- a/debian/rules +++ b/debian/rules @@ -11,11 +11,6 @@ export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z # reproducible 编译参数 DEB_CMAKE_EXTRA_FLAGS += -DCMAKE_SKIP_BUILD_RPATH=ON -# 版本映射:x.y.z -> 5.y.z 和 6.y.z -DTK5_VERSION := $(shell echo $(DEB_VERSION_UPSTREAM) | sed -E 's/^[0-9]+(\.|[^0-9]|$$)/5\1/') -DTK6_VERSION := $(shell echo $(DEB_VERSION_UPSTREAM) | sed -E 's/^[0-9]+(\.|[^0-9]|$$)/6\1/') -DTK5_MAJOR_MINOR := $(shell echo $(DTK5_VERSION) | cut -d '.' -f 1,2) - # Build-Profiles 控制 BUILD_DOCS := $(if $(filter nodoc,$(DEB_BUILD_PROFILES)),OFF,ON) BUILD_DTK5 := $(if $(filter nodtk5,$(DEB_BUILD_PROFILES)),OFF,ON) @@ -23,11 +18,6 @@ BUILD_DTK6 := $(if $(filter nodtk6,$(DEB_BUILD_PROFILES)),OFF,ON) DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) -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 -BUILD_VER = $(shell echo $(VERSION) | awk -F'[+_~-]' '{print $$2}' | sed 's/[^0-9]//g' | awk '{print int($$1)}') - %: dh $@ @@ -38,8 +28,6 @@ ifeq ($(BUILD_DTK5),ON) $(DEB_CMAKE_EXTRA_FLAGS) \ -DBUILD_TESTING=OFF \ -DBUILD_DOCS=$(BUILD_DOCS) \ - -DBUILD_VERSION=$(BUILD_VER) \ - -DDTK_VERSION=$(PACK_VER) \ -DDTK5=ON endif ifeq ($(BUILD_DTK6),ON) @@ -48,8 +36,6 @@ ifeq ($(BUILD_DTK6),ON) $(DEB_CMAKE_EXTRA_FLAGS) \ -DBUILD_TESTING=OFF \ -DBUILD_DOCS=$(BUILD_DOCS) \ - -DBUILD_VERSION=$(BUILD_VER) \ - -DDTK_VERSION=$(PACK_VER) \ -DDTK5=OFF endif @@ -69,14 +55,6 @@ ifeq ($(BUILD_DTK6),ON) dh_auto_install --builddirectory=build6 endif -override_dh_makeshlibs: -ifeq ($(BUILD_DTK5),ON) - dh_makeshlibs -V "libdtkdeclarative5 (>= $(DTK5_MAJOR_MINOR))" -plibdtkdeclarative5 -endif -ifeq ($(BUILD_DTK6),ON) - dh_makeshlibs -V "libdtk6declarative (>= $(DTK6_VERSION))" -plibdtk6declarative -endif - override_dh_auto_test: ifeq ($(BUILD_DTK5),ON) QT_SELECT=qt5 dh_auto_test --builddirectory=build5