Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ MAJOR_VERSION := $(shell if [ -f $(OS_VERSION_FILE) ]; then \
# 版本判断: MajorVersion > 20 使用 Qt6, 否则使用 Qt5
USE_QT6 := $(shell if [ "$(MAJOR_VERSION)" -gt 20 ] 2>/dev/null; then echo yes; else echo no; fi)

# MajorVersion 为 99 时(/etc/os-version 不存在),检查 Qt6 是否实际安装
ifeq ($(MAJOR_VERSION),99)
HAS_QT6 := $(shell pkg-config --exists Qt6Core 2>/dev/null && echo yes || echo no)
ifeq ($(HAS_QT6),yes)
USE_QT6 := yes
else
USE_QT6 := no
endif
endif

# 设置 QT_SELECT 环境变量
ifeq ($(USE_QT6),yes)
export QT_SELECT=6
Expand All @@ -34,6 +44,7 @@ $(shell sed -e 's/@QT_SUFFIX@/$(QT_SUFFIX)/g' \
override_dh_auto_configure:
@echo "======= [debian/rules] 打包诊断信息 ======="
@echo " MAJOR_VERSION = $(MAJOR_VERSION)"
@echo " HAS_QT6 = $(HAS_QT6) (pkg-config Qt6Core)"
@echo " USE_QT6 = $(USE_QT6)"
@echo " QT_SUFFIX = $(QT_SUFFIX)"
@echo " QT_SELECT = $$QT_SELECT"
Expand Down
Loading