commit: 2f280a59b1dbd4ce4dda3631a6824332fb814303 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> AuthorDate: Sun Dec 15 12:36:28 2024 +0000 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> CommitDate: Sun Dec 15 12:42:08 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2f280a59
kde-apps/marble: Fix build with USE="-kde" See also: https://invent.kde.org/education/marble/-/merge_requests/148 https://invent.kde.org/education/marble/-/merge_requests/149 Closes: https://bugs.gentoo.org/946470 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> ...-cmake-behaim-marble-maps-kf6-conditional.patch | 29 +++++++ .../marble-24.12.0-cmake-drop-qt_policy.patch | 69 ++++++++++++++++ kde-apps/marble/marble-24.12.0-r1.ebuild | 96 ++++++++++++++++++++++ 3 files changed, 194 insertions(+) diff --git a/kde-apps/marble/files/marble-24.12.0-cmake-behaim-marble-maps-kf6-conditional.patch b/kde-apps/marble/files/marble-24.12.0-cmake-behaim-marble-maps-kf6-conditional.patch new file mode 100644 index 000000000000..3db739a8c82b --- /dev/null +++ b/kde-apps/marble/files/marble-24.12.0-cmake-behaim-marble-maps-kf6-conditional.patch @@ -0,0 +1,29 @@ +From 5a6bf3c71cd017f3e43a74d9ac39efa3921c6d99 Mon Sep 17 00:00:00 2001 +From: Joshua Goins <[email protected]> +Date: Sat, 14 Dec 2024 20:18:24 -0500 +Subject: [PATCH] Don't build behaim or marble-maps targets in non-KF builds + +These depend on KDE frameworks, so don't try to build them when don't +have them. +--- + src/apps/CMakeLists.txt | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/apps/CMakeLists.txt b/src/apps/CMakeLists.txt +index 6f9dc25420..013cd3c52f 100644 +--- a/src/apps/CMakeLists.txt ++++ b/src/apps/CMakeLists.txt +@@ -11,6 +11,8 @@ if(BUILD_MARBLE_APPS) + endif() + endif() + +- add_subdirectory(behaim) +- add_subdirectory(marble-maps) ++ if (TARGET KF6::Config AND TARGET KF6::I18n AND TARGET KF6::CoreAddons) ++ add_subdirectory(behaim) ++ add_subdirectory(marble-maps) ++ endif() + endif() +-- +GitLab + diff --git a/kde-apps/marble/files/marble-24.12.0-cmake-drop-qt_policy.patch b/kde-apps/marble/files/marble-24.12.0-cmake-drop-qt_policy.patch new file mode 100644 index 000000000000..71f721043c4d --- /dev/null +++ b/kde-apps/marble/files/marble-24.12.0-cmake-drop-qt_policy.patch @@ -0,0 +1,69 @@ +From 98d2d37dcec8ec8b5b7f4c24c85120ed9468a33a Mon Sep 17 00:00:00 2001 +From: Joshua Goins <[email protected]> +Date: Sat, 14 Dec 2024 20:08:44 -0500 +Subject: [PATCH] Remove usage of some Qt CMake usage with ECMQmlModule + +We use this, so we don't need to set qt_policy ourselves or +ecm_add_qml_module. Also fixes non-KF6 builds. +--- + CMakeLists.txt | 2 -- + examples/cpp/marbleQuick2/CMakeLists.txt | 2 +- + src/apps/behaim/CMakeLists.txt | 2 +- + src/apps/marble-maps/CMakeLists.txt | 2 +- + 4 files changed, 3 insertions(+), 5 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0681500d06..f708cacd52 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -110,8 +110,6 @@ set_package_properties(KF6 PROPERTIES + TYPE RECOMMENDED + ) + +-qt_policy(SET QTP0001 NEW) +- + find_package(Protobuf) + set_package_properties(Protobuf PROPERTIES TYPE OPTIONAL PURPOSE "Parsing of OSM PBF files.") + +diff --git a/examples/cpp/marbleQuick2/CMakeLists.txt b/examples/cpp/marbleQuick2/CMakeLists.txt +index c9c3809e85..493684f409 100644 +--- a/examples/cpp/marbleQuick2/CMakeLists.txt ++++ b/examples/cpp/marbleQuick2/CMakeLists.txt +@@ -5,7 +5,7 @@ add_executable(marbleQuick2 main.cpp) + + target_link_libraries(marbleQuick2 PUBLIC Qt::Quick Qt::Widgets) + +-qt_add_qml_module(marbleQuick2 ++ecm_add_qml_module(marbleQuick2 + URI org.kde.marble.quick + QML_FILES + Main.qml +diff --git a/src/apps/behaim/CMakeLists.txt b/src/apps/behaim/CMakeLists.txt +index 8011e0bc52..13219b663a 100644 +--- a/src/apps/behaim/CMakeLists.txt ++++ b/src/apps/behaim/CMakeLists.txt +@@ -19,7 +19,7 @@ if(NOT MARBLE_NO_WEBKITWIDGETS) + add_definitions(-DMARBLE_WEBKITWIDGETS=1) + endif() + +-qt_add_qml_module(marble-behaim ++ecm_add_qml_module(marble-behaim + URI org.kde.marble.behaim + QML_FILES + MainScreen.qml +diff --git a/src/apps/marble-maps/CMakeLists.txt b/src/apps/marble-maps/CMakeLists.txt +index 39f9940322..79a4897304 100644 +--- a/src/apps/marble-maps/CMakeLists.txt ++++ b/src/apps/marble-maps/CMakeLists.txt +@@ -22,7 +22,7 @@ if(NOT ANDROID) + target_link_libraries(marble-maps PUBLIC KF6::Crash) + endif() + +-qt_add_qml_module(marble-maps ++ecm_add_qml_module(marble-maps + URI org.kde.marble.maps + QML_FILES + MainScreen.qml +-- +GitLab + diff --git a/kde-apps/marble/marble-24.12.0-r1.ebuild b/kde-apps/marble/marble-24.12.0-r1.ebuild new file mode 100644 index 000000000000..28c09b6f130a --- /dev/null +++ b/kde-apps/marble/marble-24.12.0-r1.ebuild @@ -0,0 +1,96 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +ECM_HANDBOOK="optional" # see src/apps/marble-kde/CMakeLists.txt +ECM_TEST="true" +KFMIN=6.5.0 +QTMIN=6.7.2 +inherit ecm gear.kde.org + +DESCRIPTION="Virtual Globe and World Atlas to learn more about Earth" +HOMEPAGE="https://marble.kde.org/" + +LICENSE="GPL-2" # TODO: CHECK +SLOT="6/$(ver_cut 1-2)" +KEYWORDS="~amd64 ~arm64 ~riscv ~x86" +IUSE="aprs +dbus designer +geolocation gps +kde +pbf phonon shapefile +webengine" + +# bug 588320 +RESTRICT="test" + +# FIXME (new package): libwlocate, WLAN-based geolocation +DEPEND=" + >=dev-qt/qt5compat-${QTMIN}:6 + >=dev-qt/qtbase-${QTMIN}:6[concurrent,dbus?,gui,network,sql,widgets,xml] + >=dev-qt/qtdeclarative-${QTMIN}:6 + >=dev-qt/qtsvg-${QTMIN}:6 + sys-libs/zlib + aprs? ( >=dev-qt/qtserialport-${QTMIN}:6 ) + designer? ( >=dev-qt/qttools-${QTMIN}:6[designer] ) + geolocation? ( >=dev-qt/qtpositioning-${QTMIN}:6 ) + gps? ( sci-geosciences/gpsd:= ) + kde? ( + >=kde-frameworks/kconfig-${KFMIN}:6 + >=kde-frameworks/kconfigwidgets-${KFMIN}:6 + >=kde-frameworks/kcoreaddons-${KFMIN}:6 + >=kde-frameworks/kcrash-${KFMIN}:6 + >=kde-frameworks/ki18n-${KFMIN}:6 + >=kde-frameworks/kio-${KFMIN}:6 + >=kde-frameworks/kparts-${KFMIN}:6 + >=kde-frameworks/krunner-${KFMIN}:6 + ) + pbf? ( dev-libs/protobuf:= ) + phonon? ( >=media-libs/phonon-4.12.0[qt6(+)] ) + shapefile? ( sci-libs/shapelib:= ) + webengine? ( + >=dev-qt/qtwebchannel-${QTMIN}:6 + >=dev-qt/qtwebengine-${QTMIN}:6[widgets] + ) +" +RDEPEND="${DEPEND} + kde? ( + dev-libs/kirigami-addons:6 + >=dev-qt/qt5compat-${QTMIN}:6[qml] + >=kde-frameworks/kirigami-${KFMIN}:6 + ) +" +BDEPEND=" + >=dev-qt/qttools-${QTMIN}:6[linguist] + aprs? ( dev-lang/perl ) +" + +PATCHES=( # bug 946470 + "${FILESDIR}/${P}-cmake-drop-qt_policy.patch" + "${FILESDIR}/${P}-cmake-behaim-marble-maps-kf6-conditional.patch" +) + +src_prepare() { + ecm_src_prepare + + rm -r src/3rdparty/zlib || die "Failed to remove bundled libs" +} + +src_configure() { + local mycmakeargs=( + $(cmake_use_find_package aprs Perl) + $(cmake_use_find_package geolocation Qt6Positioning) + -DBUILD_WITH_DBUS=$(usex dbus) + -DWITH_DESIGNER_PLUGIN=$(usex designer) + -DWITH_libgps=$(usex gps) + $(cmake_use_find_package pbf Protobuf) + -DWITH_Phonon4Qt6=$(usex phonon) + -DWITH_libshp=$(usex shapefile) + $(cmake_use_find_package webengine Qt6WebEngineWidgets) + -DWITH_libwlocate=OFF + # bug 608890 + -DKDE_INSTALL_CONFDIR="/etc/xdg" + ) + # KF6KIO: src/thumbnailer/CMakeLists.txt + # KF6Runner: src/plasmarunner/CMakeLists.txt + for x in CoreAddons I18n Config Crash KIO Parts Runner; do + mycmakeargs+=( $(cmake_use_find_package kde KF6${x}) ) + done + ecm_src_configure +}
