-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wpewebkit: Enable QtWPE build support for Qt6
Refactor Qt configurations into separate files to accommodate Qt5 and Qt6 based on BBFILE_COLLECTIONS. Signed-off-by: LI Qingwu <[email protected]>
- Loading branch information
Showing
6 changed files
with
149 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
# We cannot inherit cmake_qt5 because it will unconditionally add packages | ||
# to DEPENDS which cannot be removed later depending on the options chosen | ||
# with PACKAGECONFIG. Instead, copy the set of options defined in it, in turn | ||
# built upon qmake5_paths (which only defines things, without adding to the | ||
# dependencies), and add those options along the rest needed for the "qtwpe" | ||
# option ourselves. | ||
|
||
inherit qmake5_paths | ||
|
||
CMAKE_QT_OECONF = "\ | ||
-DOE_QMAKE_PATH_PREFIX=${OE_QMAKE_PATH_PREFIX} \ | ||
-DOE_QMAKE_PATH_HEADERS=${OE_QMAKE_PATH_HEADERS} \ | ||
-DOE_QMAKE_PATH_LIBS=${OE_QMAKE_PATH_LIBS} \ | ||
-DOE_QMAKE_PATH_ARCHDATA=${OE_QMAKE_PATH_ARCHDATA} \ | ||
-DOE_QMAKE_PATH_DATA=${OE_QMAKE_PATH_DATA} \ | ||
-DOE_QMAKE_PATH_BINS=${OE_QMAKE_PATH_BINS} \ | ||
-DOE_QMAKE_PATH_LIBEXECS=${OE_QMAKE_PATH_LIBEXECS} \ | ||
-DOE_QMAKE_PATH_PLUGINS=${OE_QMAKE_PATH_PLUGINS} \ | ||
-DOE_QMAKE_PATH_QML=${OE_QMAKE_PATH_QML} \ | ||
-DOE_QMAKE_PATH_TRANSLATIONS=${OE_QMAKE_PATH_TRANSLATIONS} \ | ||
-DOE_QMAKE_PATH_DOCS=${OE_QMAKE_PATH_DOCS} \ | ||
-DOE_QMAKE_PATH_SETTINGS=${OE_QMAKE_PATH_SETTINGS} \ | ||
-DOE_QMAKE_PATH_EXAMPLES=${OE_QMAKE_PATH_EXAMPLES} \ | ||
-DOE_QMAKE_PATH_TESTS=${OE_QMAKE_PATH_TESTS} \ | ||
-DOE_QMAKE_PATH_HOST_PREFIX=${OE_QMAKE_PATH_HOST_PREFIX} \ | ||
-DOE_QMAKE_PATH_HOST_BINS=${OE_QMAKE_PATH_HOST_BINS} \ | ||
-DOE_QMAKE_PATH_HOST_DATA=${OE_QMAKE_PATH_HOST_DATA} \ | ||
-DOE_QMAKE_PATH_HOST_LIBS=${OE_QMAKE_PATH_HOST_LIBS} \ | ||
-DOE_QMAKE_PATH_EXTERNAL_HOST_BINS=${OE_QMAKE_PATH_EXTERNAL_HOST_BINS} \ | ||
-DOE_QMAKE_PATH_QT_HEADERS=${OE_QMAKE_PATH_QT_HEADERS} \ | ||
-DOE_QMAKE_PATH_QT_ARCHDATA=${OE_QMAKE_PATH_QT_ARCHDATA} \ | ||
-DOE_QMAKE_PATH_QT_DATA=${OE_QMAKE_PATH_QT_DATA} \ | ||
-DOE_QMAKE_PATH_QT_BINS=${OE_QMAKE_PATH_QT_BINS} \ | ||
-DOE_QMAKE_PATH_QT_TRANSLATIONS=${OE_QMAKE_PATH_QT_TRANSLATIONS} \ | ||
-DOE_QMAKE_PATH_QT_DOCS=${OE_QMAKE_PATH_QT_DOCS} \ | ||
-DOE_QMAKE_PATH_QT_SETTINGS=${OE_QMAKE_PATH_QT_SETTINGS} \ | ||
-DOE_QMAKE_PATH_QT_EXAMPLES=${OE_QMAKE_PATH_QT_EXAMPLES} \ | ||
-DOE_QMAKE_PATH_QT_TESTS=${OE_QMAKE_PATH_QT_TESTS} \ | ||
" | ||
|
||
QT_BUILD_DEPS = "qtquickcontrols2" | ||
|
||
FILES:${PN}-qtwpe-qml-plugin += "${libdir}/qt5/qml/org/wpewebkit/qtwpe/*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
inherit qt6-cmake | ||
|
||
CMAKE_QT_OECONF = "\ | ||
-DUSE_QT6=ON \ | ||
-DENABLE_WPE_PLATFORM=ON \ | ||
" | ||
|
||
QT_BUILD_DEPS = "qtdeclarative-native wayland-native wayland-protocols wpebackend-fdo" | ||
|
||
# Relocate the plugin to the default QML directory for accessibility. | ||
do_install:append() { | ||
if [ -d ${D}${libdir}/qt6/qml/org/wpewebkit ]; then | ||
install -d ${D}${libdir}/qml/org/ | ||
mv ${D}${libdir}/qt6/qml/org/wpewebkit ${D}${libdir}/qml/org/ | ||
rm -rf ${D}${libdir}/qt6 | ||
fi | ||
} | ||
|
||
|
||
FILES:${PN}-qtwpe-qml-plugin += "${libdir}/qml/org/wpewebkit/qtwpe/*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...owser/wpewebkit/wpewebkit/0003-WPE-Platform-fix-wpe_toplevel_qtquick-has-not-been-d.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
From 955cfdd91676f35635e6a55da513f64b7c5555c9 Mon Sep 17 00:00:00 2001 | ||
From: LI Qingwu <[email protected]> | ||
Date: Mon, 30 Sep 2024 11:54:19 +0800 | ||
Subject: [PATCH 3/4] WPE Platform: fix wpe_toplevel_qtquick has not been | ||
declared | ||
|
||
Fix the following compile failed issue for Qt6: | ||
|
||
Source/WebKit/UIProcess/API/wpe/qt6/WPEToplevelQtQuick.cpp:35:46: | ||
error: 'wpe_toplevel_qtquick' has not been declared | ||
|
||
Upstream-Status: Submitted [https://github.com/WebKit/WebKit/pull/34441] | ||
|
||
Signed-off-by: LI Qingwu <[email protected]> | ||
--- | ||
Source/WebKit/UIProcess/API/wpe/qt6/WPEToplevelQtQuick.cpp | 2 ++ | ||
1 file changed, 2 insertions(+) | ||
|
||
diff --git a/Source/WebKit/UIProcess/API/wpe/qt6/WPEToplevelQtQuick.cpp b/Source/WebKit/UIProcess/API/wpe/qt6/WPEToplevelQtQuick.cpp | ||
index ff6daf3e9a28..966734abefc4 100644 | ||
--- a/Source/WebKit/UIProcess/API/wpe/qt6/WPEToplevelQtQuick.cpp | ||
+++ b/Source/WebKit/UIProcess/API/wpe/qt6/WPEToplevelQtQuick.cpp | ||
@@ -26,6 +26,8 @@ | ||
#include "config.h" | ||
#include "WPEToplevelQtQuick.h" | ||
|
||
+#include <wtf/glib/WTFGType.h> | ||
+ | ||
/** | ||
* WPEToplevelQtQuick: | ||
* | ||
-- | ||
2.34.1 | ||
|
45 changes: 45 additions & 0 deletions
45
...owser/wpewebkit/wpewebkit/0004-WPE-Platform-fix-wpe_view_resize-was-not-declared-is.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
From 044b55556675b0f8737c0ab1fb2ec139dcdc69af Mon Sep 17 00:00:00 2001 | ||
From: LI Qingwu <[email protected]> | ||
Date: Thu, 10 Oct 2024 12:56:58 +0800 | ||
Subject: [PATCH 4/4] WPE Platform: fix wpe_view_resize was not declared issue | ||
|
||
fix Source/WebKit/UIProcess/API/wpe/qt6/WPEQtView.cpp:87:5: | ||
error: 'wpe_view_resize' was not declared in this scope; | ||
did you mean 'wpe_view_resized'? | ||
|
||
Upstream-Status: Submitted [https://github.com/WebKit/WebKit/pull/34441] | ||
|
||
Signed-off-by: LI Qingwu <[email protected]> | ||
--- | ||
Source/WebKit/UIProcess/API/wpe/qt6/WPEQtView.cpp | 8 ++++++-- | ||
1 file changed, 6 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/Source/WebKit/UIProcess/API/wpe/qt6/WPEQtView.cpp b/Source/WebKit/UIProcess/API/wpe/qt6/WPEQtView.cpp | ||
index 5ff20ab8c2b8..d0d5509c1582 100644 | ||
--- a/Source/WebKit/UIProcess/API/wpe/qt6/WPEQtView.cpp | ||
+++ b/Source/WebKit/UIProcess/API/wpe/qt6/WPEQtView.cpp | ||
@@ -84,7 +84,9 @@ void WPEQtView::geometryChange(const QRectF& newGeometry, const QRectF&) | ||
return; | ||
|
||
auto* wpeView = webkit_web_view_get_wpe_view(d->m_webView.get()); | ||
- wpe_view_resize(wpeView, d->m_size.width(), d->m_size.height()); | ||
+ if (auto* wpeToplevel = wpe_view_get_toplevel(wpeView)) | ||
+ wpe_toplevel_resize(wpeToplevel, d->m_size.width(), d->m_size.height()); | ||
+ | ||
} | ||
|
||
void WPEQtView::configureWindow() | ||
@@ -119,7 +121,9 @@ void WPEQtView::createWebView() | ||
"settings", settings.get(), nullptr))); | ||
|
||
auto* wpeView = webkit_web_view_get_wpe_view(d->m_webView.get()); | ||
- wpe_view_resize(wpeView, d->m_size.width(), d->m_size.height()); | ||
+ if (auto* wpeToplevel = wpe_view_get_toplevel(wpeView)) | ||
+ wpe_toplevel_resize(wpeToplevel, d->m_size.width(), d->m_size.height()); | ||
+ | ||
wpe_view_map(wpeView); // FIXME: unmap when appropriate and implement can_be_mapped if needed. | ||
|
||
if (!wpe_view_qtquick_initialize_rendering(WPE_VIEW_QTQUICK(wpeView), this, &error.outPtr())) { | ||
-- | ||
2.34.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters