From 2e8144835fa152c47b123283703f927feb570dbe Mon Sep 17 00:00:00 2001 From: vasilito Date: Sat, 20 Jun 2026 16:17:07 +0300 Subject: [PATCH] qtdeclarative: use Python instead of sed for CMakeLists patch --- local/recipes/qt/qtdeclarative/recipe.toml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/local/recipes/qt/qtdeclarative/recipe.toml b/local/recipes/qt/qtdeclarative/recipe.toml index f5eeef4cb9..64fd38b37f 100644 --- a/local/recipes/qt/qtdeclarative/recipe.toml +++ b/local/recipes/qt/qtdeclarative/recipe.toml @@ -131,8 +131,17 @@ rm -f CMakeCache.txt rm -rf CMakeFiles # Fix: qt_internal_add_resource creates empty targets in cross-compilation -# We patch the qmltyperegistrar CMakeLists to avoid this issue -sed -i 's/qt_internal_add_resource(QmlTypeRegistrarPrivate "jsRootMetaTypes"/qt_internal_add_resource(QmlTypeRegistrarPrivate "jsRootMetaTypes"\n OPTIONS\n --no-compress/' "${COOKBOOK_SOURCE}/src/qmltyperegistrar/CMakeLists.txt" +# We patch the qmltyperegistrar CMakeLists to add OPTIONS --no-compress +python - <<'PY' +import os +from pathlib import Path +path = Path(os.environ["COOKBOOK_SOURCE"]) / "src/qmltyperegistrar/CMakeLists.txt" +text = path.read_text() +old = 'qt_internal_add_resource(QmlTypeRegistrarPrivate "jsRootMetaTypes"' +new = 'qt_internal_add_resource(QmlTypeRegistrarPrivate "jsRootMetaTypes"\n OPTIONS\n --no-compress' +text = text.replace(old, new) +path.write_text(text) +PY redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules