Skip to content

Commit a58a7e0

Browse files
committed
feat: unify DTK5 and DTK6
Build DTK5 and DTK6 packages from dtkcore. Log: unify DTK5 and DTK6 Influence: None Signed-off-by: Yixue Wang <[email protected]>
1 parent ae08901 commit a58a7e0

32 files changed

+231
-125
lines changed

CMakeLists.txt

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
cmake_minimum_required (VERSION 3.13)
22

3-
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" DTK_FILE_VERSION)
4-
string(STRIP "${DTK_FILE_VERSION}" DTK_FILE_VERSION)
5-
set(DTK_VERSION "${DTK_FILE_VERSION}" CACHE STRING "DTK version")
3+
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" FILE_VERSION)
4+
string(STRIP "${FILE_VERSION}" FILE_VERSION)
65

76
project (DtkCore
8-
VERSION ${DTK_VERSION}
7+
VERSION ${FILE_VERSION}
98
DESCRIPTION "DTK Core module"
109
HOMEPAGE_URL "https://github.com/linuxdeepin/dtkcore"
1110
LANGUAGES CXX C
@@ -18,13 +17,19 @@ endif ()
1817
include(GNUInstallDirs)
1918
include(CMakePackageConfigHelpers)
2019

21-
if("${PROJECT_VERSION_MAJOR}" STREQUAL "5")
22-
set(QT_VERSION_MAJOR "5")
23-
elseif("${PROJECT_VERSION_MAJOR}" STREQUAL "6")
24-
set(QT_VERSION_MAJOR "6")
25-
set(DTK_VERSION_MAJOR "6")
20+
option(DTK5 "Build DTK5." ON)
21+
if(DTK5)
22+
set(DTK_VERSION_MAJOR "5")
23+
set(DTK_NAME_SUFFIX "") # Empty name suffix for DTK5 products.
2624
else()
27-
message(SEND_ERROR "not support Prject Version ${PROJECT_VERSION}.")
25+
set(DTK_VERSION_MAJOR "6")
26+
set(DTK_NAME_SUFFIX "6")
2827
endif()
2928

29+
set(DTK_VERSION_MINOR ${PROJECT_VERSION_MINOR})
30+
set(DTK_VERSION_PATCH ${PROJECT_VERSION_PATCH})
31+
set(DTK_VERSION "${DTK_VERSION_MAJOR}.${DTK_VERSION_MINOR}.${DTK_VERSION_PATCH}")
32+
# Officially, DTK5 uses QT5, DTK6 uses QT6
33+
set(QT_VERSION_MAJOR ${DTK_VERSION_MAJOR})
34+
3035
include(dtkcore.cmake)

archlinux/PKGBUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ build() {
3030
-DCMAKE_INSTALL_PREFIX=/usr \
3131
-DCMAKE_BUILD_TYPE=Release \
3232
-DD_DSG_APP_DATA_FALLBACK=/var/dsg/appdata \
33-
-DBUILD_WITH_SYSTEMD=ON
33+
-DDTK5=ON
3434
ninja
3535
}
3636

cmake/DtkCMake/DtkCMakeConfig.cmake.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ endfunction()
66
add_definitions(-DQ_HOST_NAME=\"${CMAKE_HOST_SYSTEM_PROCESSOR}\")
77
addDefinitions(Q_HOST_${CMAKE_HOST_SYSTEM_PROCESSOR})
88

9-
find_package(Dtk@DTK_VERSION_MAJOR@Core REQUIRED)
9+
find_package(Dtk@DTK_NAME_SUFFIX@Core REQUIRED)
1010

1111
set(DEEPIN_OS_RELEASE_TOOL_PATH ${DtkCore_TOOL_DIRS})
1212
set(DEEPIN_OS_RELEASE_TOOL ${DEEPIN_OS_RELEASE_TOOL_PATH}/deepin-os-release)
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
include(CMakeFindDependencyMacro)
2-
find_dependency(Dtk@DTK_VERSION_MAJOR@Core REQUIRED)
2+
find_dependency(Dtk@DTK_NAME_SUFFIX@Core REQUIRED)
33

44
set (DTK_SETTINGS_TOOLS_EXECUTABLE ${DtkCore_TOOL_DIRS}/dtk-settings)
55

66
if (EXISTS ${DTK_SETTINGS_TOOLS_EXECUTABLE})
77
set(DTK_SETTINGS_TOOLS_FOUND TRUE)
88
endif ()
99

10-
include("${CMAKE_CURRENT_LIST_DIR}/Dtk@DTK_VERSION_MAJOR@SettingsToolsMacros.cmake")
11-
include("${CMAKE_CURRENT_LIST_DIR}/Dtk@DTK_VERSION_MAJOR@ToolsTargets.cmake")
10+
include("${CMAKE_CURRENT_LIST_DIR}/Dtk@DTK_NAME_SUFFIX@SettingsToolsMacros.cmake")
11+
include("${CMAKE_CURRENT_LIST_DIR}/Dtk@DTK_NAME_SUFFIX@ToolsTargets.cmake")
1212
include("${CMAKE_CURRENT_LIST_DIR}/DtkDBusMacros.cmake")
1313
include("${CMAKE_CURRENT_LIST_DIR}/DtkDConfigMacros.cmake")
1414

15-
get_target_property(DTK_XML2CPP Dtk@DTK_VERSION_MAJOR@::Xml2Cpp LOCATION)
16-
get_target_property(DTK_DCONFIG2CPP Dtk@DTK_VERSION_MAJOR@::DConfig2Cpp LOCATION)
15+
get_target_property(DTK_XML2CPP Dtk@DTK_NAME_SUFFIX@::Xml2Cpp LOCATION)
16+
get_target_property(DTK_DCONFIG2CPP Dtk@DTK_NAME_SUFFIX@::DConfig2Cpp LOCATION)

debian/control

Lines changed: 67 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,92 @@
11
Source: dtkcore
22
Section: libdevel
33
Priority: optional
4-
Maintainer: Deepin Packages Builder <[email protected]>
5-
Build-Depends: debhelper-compat ( =12), pkg-config,
6-
qttools5-dev-tools, qttools5-dev, qtbase5-private-dev, doxygen,
7-
libgsettings-qt-dev, libgtest-dev, libdtkcommon-dev, cmake,
8-
libuchardet-dev, libicu-dev, libdtklog-dev, libdbus-1-dev
4+
Maintainer: Shanshan Ye <[email protected]>
5+
Build-Depends: debhelper-compat ( =12),
6+
pkg-config,
7+
libgtest-dev,
8+
libdtkcommon-dev,
9+
libicu-dev,
10+
libuchardet-dev,
11+
libdbus-1-dev,
12+
qttools5-dev-tools,
13+
qttools5-dev,
14+
libgsettings-qt-dev,
15+
libdtklog-dev,
16+
doxygen,
17+
qtbase5-private-dev,
18+
qt6-base-dev-tools,
19+
qt6-base-dev,
20+
qt6-base-private-dev,
21+
libdtk6log-dev,
22+
qt6-tools-dev,
23+
cmake
924
Standards-Version: 3.9.8
1025

26+
Package: libdtk6core
27+
Architecture: any
28+
Depends: ${shlibs:Depends}, ${misc:Depends}, lshw
29+
Multi-Arch: same
30+
Build-Profiles: <!nodtk6>
31+
Description: Development ToolKit Core Library (DTK6 with Qt6)
32+
DTK Core is the base library of deepin Qt/C++ applications.
33+
.
34+
This package contains the shared libraries for DTK6 applications.
35+
36+
Package: libdtk6core-bin
37+
Architecture: any
38+
Depends: ${shlibs:Depends}, ${misc:Depends},
39+
libdtk6core( =${binary:Version})
40+
Build-Profiles: <!nodtk6>
41+
Description: Development ToolKit Core Utilities (DTK6 with Qt6)
42+
DTK Core is the base library of deepin Qt/C++ applications.
43+
.
44+
This package contains the utilities of DTK6 Core.
45+
46+
Package: libdtk6core-dev
47+
Architecture: any
48+
Depends: libdtk6core( =${binary:Version}),
49+
libdtkcommon-dev(>=5.6.16), libdtk6log-dev
50+
Build-Profiles: <!nodtk6>
51+
Description: Development ToolKit Core Devel Library (DTK6 with Qt6)
52+
DTK Core is the base library of deepin Qt/C++ applications.
53+
.
54+
This package contains the header files and development library symbolic links of DTK6 Core.
55+
1156
Package: libdtkcore5
1257
Architecture: any
1358
Depends: ${shlibs:Depends}, ${misc:Depends}, lshw
1459
Multi-Arch: same
15-
Description: Deepin Tool Kit Core library
16-
DtkCore is base library of Deepin Qt/C++ applications.
60+
Build-Profiles: <!nodtk5>
61+
Description: Development ToolKit Core Library (DTK5 with Qt5)
62+
DTK Core is the base library of deepin Qt/C++ applications.
1763
.
18-
This package contains the shared libraries.
64+
This package contains the shared libraries for DTK5 applications.
1965

2066
Package: libdtkcore5-bin
2167
Architecture: any
2268
Depends: ${shlibs:Depends}, ${misc:Depends},
2369
libdtkcore5( =${binary:Version})
24-
Description: Deepin Tool Kit Core Utilities
25-
DtkCore is base devel library of Deepin Qt/C++ applications.
70+
Build-Profiles: <!nodtk5>
71+
Description: Development ToolKit Core Utilities (DTK5 with Qt5)
72+
DTK Core is the base library of deepin Qt/C++ applications.
2673
.
27-
This package contains the utilities of DtkCore
74+
This package contains the utilities of DTK5 Core.
2875

2976
Package: libdtkcore-dev
3077
Architecture: any
31-
Depends: ${shlibs:Depends}, ${misc:Depends}, libdtkcore5( =${binary:Version}),
78+
Depends: libdtkcore5( =${binary:Version}),
3279
libdtkcommon-dev(>=5.6.16), libdtklog-dev
33-
Description: Deepin Tool Kit Core Devel library
34-
DtkCore is base devel library of Deepin Qt/C++ applications.
80+
Build-Profiles: <!nodtk5>
81+
Description: Development ToolKit Core Devel Library (DTK5 with Qt5)
82+
DTK Core is the base library of deepin Qt/C++ applications.
3583
.
36-
This package contains the header files and static libraries of DtkCore
84+
This package contains the header files and development library symbolic links of DTK5 Core.
3785

3886
Package: libdtkcore-doc
3987
Architecture: any
40-
Description: Deepin Tool Kit Core (document)
41-
DtkCore is base devel library of Deepin Qt/C++ applications.
88+
Build-Profiles: <!nodtk5 !nodoc>
89+
Description: Development ToolKit Core Documentation
90+
DTK Core is the base library of deepin Qt/C++ applications.
4291
.
43-
This package contains the doc files of DtkCore
92+
This package contains the doc files of DtkCore.

debian/libdtk6core-bin.install

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
usr/libexec/dtk6/DCore/bin/*

debian/libdtk6core-dev.install

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
usr/lib/*/libdtk6core.so
2+
usr/include/dtk6/*
3+
usr/lib/*/pkgconfig/dtk6core.pc
4+
usr/lib/*/cmake/Dtk6*/*
5+
usr/lib/*/qt6/*

debian/libdtk6core.install

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
usr/lib/*/libdtk6core.so.*

debian/libdtkcore-dev.install

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
usr/lib/*/lib*.so
2-
usr/include
3-
usr/lib/*/pkgconfig/*.pc
4-
usr/lib/*/cmake/*/*.cmake
1+
usr/lib/*/libdtkcore.so
2+
usr/include/dtk5/*
3+
usr/lib/*/pkgconfig/dtkcore.pc
4+
usr/lib/*/cmake/DtkCMake/*
5+
usr/lib/*/cmake/DtkTools/*
6+
usr/lib/*/cmake/DtkDConfig/*
7+
usr/lib/*/cmake/DtkCore/*
58
usr/lib/*/qt5/*

debian/libdtkcore5-bin.install

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
usr/*/*/DCore/bin/*
1+
usr/libexec/dtk5/DCore/bin/*

0 commit comments

Comments
 (0)