[neon/kde/kwayland-integration/Neon/unstable] debian/patches: carry dual build patch for the moment

Carlos De Maine null at kde.org
Fri Sep 1 09:04:22 BST 2023


Git commit 9b2f82fd09e4dbc5fb4713aebb741651af369835 by Carlos De Maine.
Committed on 01/09/2023 at 10:04.
Pushed by carlosdem into branch 'Neon/unstable'.

carry dual build patch for the moment

A  +118  -0    debian/patches/001_dual_build
A  +1    -0    debian/patches/series

https://invent.kde.org/neon/kde/kwayland-integration/-/commit/9b2f82fd09e4dbc5fb4713aebb741651af369835

diff --git a/debian/patches/001_dual_build b/debian/patches/001_dual_build
new file mode 100644
index 0000000..0cd71d0
--- /dev/null
+++ b/debian/patches/001_dual_build
@@ -0,0 +1,118 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 9b8ba6a301503a31e9a2c991ad36dee8406eb777..8bbe8768be24bb5598f23ee651b342bf8375db30 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -19,29 +19,27 @@ find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} )
+ 
+ include(FeatureSummary)
+-include(KDEInstallDirs)
+-include(KDECMakeSettings)
++
+ include(KDECompilerSettings NO_POLICY_SCOPE)
+ include(ECMQtDeclareLoggingCategory)
+ include(KDEClangFormat)
+ include(KDEGitCommitHooks)
+ include(ECMDeprecationSettings)
+ 
+-find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
+-    Core
+-    Widgets
+-    WaylandClient
+-)
++set(QT_NO_CREATE_VERSIONLESS_TARGETS ON)
++set(QT_NO_CREATE_VERSIONLESS_FUNCTIONS ON)
+ 
+-# required frameworks
+-find_package(KF${QT_MAJOR_VERSION} ${KF_MIN_VERSION} REQUIRED COMPONENTS
+-    WindowSystem
+-    Wayland
+-)
++option(BUILD_QT5 "Build for Qt5" ON)
++option(BUILD_QT6 "Build for Qt6" ON)
+ 
+-if (QT_MAJOR_VERSION EQUAL "5")
+-    find_package(QtWaylandScanner REQUIRED)
+-    find_package(Qt5XkbCommonSupport REQUIRED) # Needed by Qt5::WaylandClientPrivate
++
++# For KDE CI only. As the current infrastructure doesn't allow us to set CMAKE options per build variant
++if ($ENV{CI_JOB_NAME_SLUG} MATCHES "qt5")
++    set(BUILD_QT5 ON)
++    set(BUILD_QT6 OFF)
++elseif($ENV{CI_JOB_NAME_SLUG} MATCHES "qt6")
++    set(BUILD_QT5 OFF)
++    set(BUILD_QT6 ON)
+ endif()
+ 
+ find_package(WaylandProtocols 1.21 REQUIRED)
+@@ -53,7 +51,44 @@ ecm_set_disabled_deprecation_versions(QT 5.15.2
+     KF 5.101
+ )
+ 
+-add_subdirectory(src)
++set(KDE_SKIP_TEST_SETTINGS ON)
++
++function(buildsrc QT_MAJOR_VERSION)
++    include(KDEInstallDirs${QT_MAJOR_VERSION})
++    include(KDECMakeSettings)
++    find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
++        Core
++        Widgets
++        WaylandClient
++    )
++    # https://bugreports.qt.io/browse/QTBUG-114706
++    add_library(Qt::Core ALIAS Qt${QT_MAJOR_VERSION}::Core)
++    add_library(Qt::CorePrivate ALIAS Qt${QT_MAJOR_VERSION}::CorePrivate)
++    add_library(Qt::Gui ALIAS Qt${QT_MAJOR_VERSION}::Gui)
++    add_library(Qt::GuiPrivate ALIAS Qt${QT_MAJOR_VERSION}::GuiPrivate)
++
++    # required frameworks
++    find_package(KF${QT_MAJOR_VERSION} ${KF_MIN_VERSION} REQUIRED COMPONENTS
++        WindowSystem
++        Wayland
++    )
++
++    if (QT_MAJOR_VERSION EQUAL "5")
++        find_package(QtWaylandScanner ${QT_MIN_VERSION} REQUIRED)
++        find_package(Qt5XkbCommonSupport REQUIRED) # Needed by Qt5::WaylandClientPrivate
++    endif()
++    add_subdirectory(src src${QT_MAJOR_VERSION})
++endfunction()
++
++if (${BUILD_QT5})
++    unset(QUERY_EXECUTABLE CACHE)
++    buildsrc(5)
++endif()
++if (${BUILD_QT6})
++    unset(QUERY_EXECUTABLE CACHE)
++    buildsrc(6)
++endif()
++
+ 
+ # add clang-format target for all our real source files
+ file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
+diff --git a/src/windowsystem/CMakeLists.txt b/src/windowsystem/CMakeLists.txt
+index accee434e56f5d2f263016ce16bd8cced118244f..d6f3b4b814f58b7d304c86b68034f05d5a5749e9 100644
+--- a/src/windowsystem/CMakeLists.txt
++++ b/src/windowsystem/CMakeLists.txt
+@@ -57,16 +57,16 @@ pkg_check_modules(XKBCommon REQUIRED IMPORTED_TARGET xkbcommon)
+ target_link_libraries(KF${QT_MAJOR_VERSION}WindowSystemKWaylandPlugin
+     KF${QT_MAJOR_VERSION}::WindowSystem
+     KF${QT_MAJOR_VERSION}::WaylandClient
+-    Qt::Widgets
++    Qt${QT_MAJOR_VERSION}::Widgets
+     Wayland::Client
+-    Qt::WaylandClient
+-    Qt::WaylandClientPrivate
++    Qt${QT_MAJOR_VERSION}::WaylandClient
++    Qt${QT_MAJOR_VERSION}::WaylandClientPrivate
+     PkgConfig::XKBCommon
+ )
+ 
+ if (QT_MAJOR_VERSION EQUAL "5")
+     target_link_libraries(KF${QT_MAJOR_VERSION}WindowSystemKWaylandPlugin
+-        Qt::XkbCommonSupportPrivate
++        Qt5::XkbCommonSupportPrivate
+     )
+ endif()
+ 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..89d793d
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+001_dual_build
\ No newline at end of file


More information about the Neon-commits mailing list