qt: dual-stage plugins to <stage>/plugins (qtwayland/qtsvg/qtdeclarative)
Qt cmake plugin targets resolve each plugin .so via <sysroot>/plugins (the _IMPORT_PREFIX is computed from the cmake files under <sysroot>/lib/cmake, i.e. the sysroot root, not <sysroot>/usr), but cmake --install --prefix .../usr puts plugins at usr/plugins. qtbase already works around this by staging plugins to BOTH usr/plugins and plugins (recipe.toml ~L739); qtwayland/qtsvg/qtdeclarative did not, so their plugins (wayland decorations, svg imageformats/iconengines, qmltooling) were unreachable at <sysroot>/plugins and any Qt6Gui/Qt6Qml consumer failed: imported target references "<sysroot>/plugins/.../foo.so" but this file does not exist. This blocked kf6-kwindowsystem (sddm dep) on the Adwaita decoration plugin. Add a shared redbear_qt_dual_stage_plugins helper and call it after install in all three. (Note qml already resolves via the qml symlink since qtbase does not dual-stage qml, so <sysroot>/qml is a symlink not a real dir.)
This commit is contained in:
@@ -24,6 +24,23 @@ redbear_qt_link_plugins_dir() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Qt's generated cmake plugin targets resolve each plugin .so via
|
||||
# <sysroot>/plugins (the _IMPORT_PREFIX is computed from the cmake files under
|
||||
# <sysroot>/lib/cmake, i.e. the sysroot root, NOT <sysroot>/usr). But
|
||||
# `cmake --install --prefix .../usr` puts plugins at usr/plugins. qtbase works
|
||||
# around this by staging plugins to BOTH usr/plugins and plugins; any Qt module
|
||||
# that ships plugins (qtwayland decorations, qtsvg imageformats, qtdeclarative
|
||||
# qmltooling, ...) must do the same or a consumer's find_package fails: imported
|
||||
# target references "<sysroot>/plugins/.../foo.so" but this file does not exist.
|
||||
# Call this after `cmake --install` with the stage root ($COOKBOOK_STAGE).
|
||||
redbear_qt_dual_stage_plugins() {
|
||||
local stage="$1"
|
||||
if [ -d "${stage}/usr/plugins" ]; then
|
||||
mkdir -p "${stage}/plugins"
|
||||
cp -a "${stage}/usr/plugins/." "${stage}/plugins/" 2>/dev/null || true
|
||||
fi
|
||||
}
|
||||
|
||||
redbear_qt_prepare_common_sysroot() {
|
||||
local sysroot="$1"
|
||||
redbear_qt_link_sysroot_dirs "$sysroot" plugins mkspecs metatypes modules qml
|
||||
|
||||
Reference in New Issue
Block a user