fix: qtdeclarative metatypes resolution via extended dep sysroot symlinks
The Qt6SvgTargets.cmake config contains absolute paths to qtsvg's own sysroot/metatypes/ for INTERFACE_SOURCES. When the cookbook cleans qtsvg's sysroot between recipe builds, these paths dangle and cause CMake Generate to fail. Extend redbear_qt_ensure_dep_sysroots to create symlinks for ALL Qt directories (metatypes, plugins, mkspecs, modules, qml) — not just include and lib. Add the call to qtdeclarative's recipe (was missing).
This commit is contained in:
@@ -22,7 +22,7 @@ HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build"
|
||||
DECL_HOST="${COOKBOOK_ROOT}/build/qt-declarative-host"
|
||||
HOST_QTSVG_BUILD="${COOKBOOK_ROOT}/build/qtsvg-host-build"
|
||||
source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh"
|
||||
source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh"
|
||||
redbear_qt_ensure_dep_sysroots "${COOKBOOK_ROOT}" "${COOKBOOK_SYSROOT}"
|
||||
|
||||
# ============================================================
|
||||
# Step 0: Build host qtsvg into the shared host prefix.
|
||||
|
||||
@@ -146,23 +146,26 @@ redbear_qt_ensure_dep_sysroots() {
|
||||
local cmake_dir="${sysroot}/usr/lib/cmake"
|
||||
[ -d "${cmake_dir}" ] || cmake_dir="${sysroot}/lib/cmake"
|
||||
[ -d "${cmake_dir}" ] || return 0
|
||||
# Qt cmake macros record absolute sysroot paths during build. When the
|
||||
# cookbook rebuilds a later recipe, the earlier recipe's sysroot may have
|
||||
# been cleaned, leaving dangling references. We recreate each missing
|
||||
# directory as a symlink to the dependency's own stage.
|
||||
grep -roh "${cookbook_root}/local/recipes/[^ \";]*target/x86_64-unknown-redox/sysroot" "${cmake_dir}" 2>/dev/null | sort -u | while read -r dep_sysroot; do
|
||||
local dep_include="${dep_sysroot}/include/QtQml"
|
||||
if [ ! -d "${dep_include}" ]; then
|
||||
if [ -L "${dep_sysroot}/include" ] || [ -e "${dep_sysroot}/include" ]; then
|
||||
rm -rf "${dep_sysroot}/include"
|
||||
local dep_target_dir dep_stage_usr
|
||||
dep_target_dir=$(dirname "${dep_sysroot}")
|
||||
dep_stage_usr="${dep_target_dir}/stage/usr"
|
||||
[ -d "${dep_stage_usr}" ] || continue
|
||||
for qt_dir in include lib metatypes plugins mkspecs modules qml; do
|
||||
if [ -d "${dep_sysroot}/${qt_dir}" ] && [ ! -L "${dep_sysroot}/${qt_dir}" ]; then
|
||||
continue
|
||||
fi
|
||||
if [ -L "${dep_sysroot}/lib" ] || [ -e "${dep_sysroot}/lib" ]; then
|
||||
rm -rf "${dep_sysroot}/lib"
|
||||
if [ -L "${dep_sysroot}/${qt_dir}" ] || [ -e "${dep_sysroot}/${qt_dir}" ]; then
|
||||
rm -f "${dep_sysroot}/${qt_dir}"
|
||||
fi
|
||||
local dep_target_dir dep_stage_usr
|
||||
dep_target_dir=$(dirname "${dep_sysroot}")
|
||||
dep_stage_usr="${dep_target_dir}/stage/usr"
|
||||
if [ -d "${dep_stage_usr}/include" ]; then
|
||||
if [ -d "${dep_stage_usr}/${qt_dir}" ]; then
|
||||
mkdir -p "${dep_sysroot}"
|
||||
ln -sf "${dep_stage_usr}/include" "${dep_sysroot}/include"
|
||||
ln -sf "${dep_stage_usr}/lib" "${dep_sysroot}/lib"
|
||||
ln -sf "${dep_stage_usr}/${qt_dir}" "${dep_sysroot}/${qt_dir}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user