From e0c83c0969331140ee976724dc8f7b9b905d0759 Mon Sep 17 00:00:00 2001 From: xiepengfei Date: Fri, 16 Oct 2026 22:09:17 +0800 Subject: [PATCH] fix: sync CMake version to 6.6.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Root cause: project() VERSION and APP_VERSION defaults were never-updated "1.0.0" placeholders, and the linglong build invoked plain cmake with no version flags, so the About dialog showed "1.0.0" for installed packages 2. Fix: make project(VERSION) and the submodule APP_VERSION defaults read the injectable VERSION variable, and bridge the changelog version into the linglong build via -DVERSION (same as deepin-editor's linglong.yaml) 3. Impact: About dialog shows the release version on the deb and linglong build paths Log: Fix About dialog showing version 1.0.0 instead of 6.6.2 fix: 同步 CMake 版本号至 6.6.2 1. 根因:project() VERSION 与子模块 APP_VERSION 默认值是从未更新的 "1.0.0" 占位符,且玲珑构建以裸 cmake 调用不传版本参数,导致安装后 "关于"对话框显示 "1.0.0" 2. 方案:project(VERSION) 与子模块 APP_VERSION 默认值改为读取可注入 的 VERSION 变量;linglong.yaml 参照 deepin-editor 以 -DVERSION 传入 changelog 版本 3. 影响:deb 与玲珑构建路径的"关于"对话框均显示发版版本 Log: 修复"关于"对话框显示版本号 1.0.0 而非 6.6.2 的问题 PMS: BUG-378351 --- CMakeLists.txt | 2 +- batch-print/CMakeLists.txt | 2 +- linglong.yaml | 4 +++- reader/CMakeLists.txt | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 25087b613..5efd5f2d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.13) # 项目基本信息 project(deepin-reader - VERSION 1.0.0 + VERSION ${VERSION} DESCRIPTION "Deepin Document Viewer" LANGUAGES CXX C ) diff --git a/batch-print/CMakeLists.txt b/batch-print/CMakeLists.txt index 33d919451..ca321439c 100644 --- a/batch-print/CMakeLists.txt +++ b/batch-print/CMakeLists.txt @@ -77,7 +77,7 @@ target_include_directories(batchprint-convert PUBLIC target_compile_definitions(batchprint-convert PRIVATE INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}" INSTALL_LIBDIR="${CMAKE_INSTALL_LIBDIR}" - APP_VERSION="1.0.0" + APP_VERSION="${VERSION}" ) target_link_libraries(batchprint-convert PUBLIC diff --git a/linglong.yaml b/linglong.yaml index 6eb1e935d..eeed0bd82 100644 --- a/linglong.yaml +++ b/linglong.yaml @@ -73,6 +73,7 @@ build: | # pkg-config 探测的第三方 -dev 库由 buildext.apt.build_depends 安装到 /usr; # 显式补充 PKG_CONFIG_PATH,确保 /usr 与 $PREFIX 下的 .pc 无论环境默认值如何均可见。 export PKG_CONFIG_PATH="${PREFIX}/lib/${TRIPLET}/pkgconfig:/usr/lib/${TRIPLET}/pkgconfig:/usr/share/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" + VERSION=$(head -1 debian/changelog | awk -F'[()]' '{print $2}') rm -rf build && mkdir -p build && cd build cmake .. \ -DCMAKE_BUILD_TYPE=Release \ @@ -81,7 +82,8 @@ build: | -DCMAKE_PREFIX_PATH="${PREFIX};/runtime" \ -DROFD_ROOT=${PREFIX} \ -DCMAKE_EXE_LINKER_FLAGS="-Wl,-rpath-link,${PREFIX}/lib/${TRIPLET}:/runtime/lib/${TRIPLET}:/runtime/lib" \ - -DCMAKE_SHARED_LINKER_FLAGS="-Wl,-rpath-link,${PREFIX}/lib/${TRIPLET}:/runtime/lib/${TRIPLET}:/runtime/lib" + -DCMAKE_SHARED_LINKER_FLAGS="-Wl,-rpath-link,${PREFIX}/lib/${TRIPLET}:/runtime/lib/${TRIPLET}:/runtime/lib" \ + -DVERSION=${VERSION} make -j$(nproc) make install > ../install.log 2>&1 diff --git a/reader/CMakeLists.txt b/reader/CMakeLists.txt index b918d89cd..5fca11a34 100644 --- a/reader/CMakeLists.txt +++ b/reader/CMakeLists.txt @@ -109,7 +109,7 @@ if(NOT QT_VERSION_MAJOR MATCHES 6) endif() if (NOT APP_VERSION) - set(APP_VERSION "1.0.0") + set(APP_VERSION "${VERSION}") endif() # 定义安装前缀