qtdeclarative: use Python instead of sed for CMakeLists patch

This commit is contained in:
2026-06-20 16:17:07 +03:00
parent cc8932922f
commit 2e8144835f
+11 -2
View File
@@ -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