diff --git a/local/recipes/kde/kf6-attica/recipe.toml b/local/recipes/kde/kf6-attica/recipe.toml index 10a0a60f..024b0106 100644 --- a/local/recipes/kde/kf6-attica/recipe.toml +++ b/local/recipes/kde/kf6-attica/recipe.toml @@ -17,12 +17,9 @@ script = """ DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done +redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules sed -i "s/^ecm_install_po_files_as_qm/#ecm_install_po_files_as_qm/" \ "${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true diff --git a/local/recipes/kde/kf6-extra-cmake-modules/recipe.toml b/local/recipes/kde/kf6-extra-cmake-modules/recipe.toml index a7b0e71d..5d84edf1 100644 --- a/local/recipes/kde/kf6-extra-cmake-modules/recipe.toml +++ b/local/recipes/kde/kf6-extra-cmake-modules/recipe.toml @@ -5,12 +5,9 @@ script = """ DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done +redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules rm -f CMakeCache.txt rm -rf CMakeFiles diff --git a/local/recipes/kde/kf6-kauth/recipe.toml b/local/recipes/kde/kf6-kauth/recipe.toml index a35a60bb..401dbfbb 100644 --- a/local/recipes/kde/kf6-kauth/recipe.toml +++ b/local/recipes/kde/kf6-kauth/recipe.toml @@ -13,12 +13,9 @@ script = """ DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done +redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules sed -i "s/^ecm_install_po_files_as_qm/#ecm_install_po_files_as_qm/" \ "${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true diff --git a/local/recipes/kde/kf6-kbookmarks/recipe.toml b/local/recipes/kde/kf6-kbookmarks/recipe.toml index 2519207b..07039e92 100644 --- a/local/recipes/kde/kf6-kbookmarks/recipe.toml +++ b/local/recipes/kde/kf6-kbookmarks/recipe.toml @@ -16,12 +16,9 @@ script = """ DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done +redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules find "${COOKBOOK_SYSROOT}/lib/cmake" -name 'Qt6SvgConfig.cmake' -exec sed -i \ 's|PACKAGE_PREFIX_DIR "/usr"|PACKAGE_PREFIX_DIR "${COOKBOOK_SYSROOT}"|g' {} + 2>/dev/null || true @@ -61,4 +58,4 @@ for lib in "${COOKBOOK_STAGE}/usr/lib/"libKF6*.so.*; do [ -f "${lib}" ] || continue patchelf --remove-rpath "${lib}" 2>/dev/null || true done -""" \ No newline at end of file +""" diff --git a/local/recipes/kde/kf6-kcodecs/recipe.toml b/local/recipes/kde/kf6-kcodecs/recipe.toml index 83da5ce9..17e191a1 100644 --- a/local/recipes/kde/kf6-kcodecs/recipe.toml +++ b/local/recipes/kde/kf6-kcodecs/recipe.toml @@ -13,12 +13,9 @@ script = """ DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done +redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules sed -i "s/^ecm_install_po_files_as_qm/#ecm_install_po_files_as_qm/" \ "${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true diff --git a/local/recipes/kde/kf6-kcolorscheme/recipe.toml b/local/recipes/kde/kf6-kcolorscheme/recipe.toml index 8cf5ac6e..e604e535 100644 --- a/local/recipes/kde/kf6-kcolorscheme/recipe.toml +++ b/local/recipes/kde/kf6-kcolorscheme/recipe.toml @@ -16,12 +16,9 @@ script = """ DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done +redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules sed -i "s/^ecm_install_po_files_as_qm/#ecm_install_po_files_as_qm/" \ "${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true diff --git a/local/recipes/kde/kf6-kcompletion/recipe.toml b/local/recipes/kde/kf6-kcompletion/recipe.toml index 5e3236f2..25dceab3 100644 --- a/local/recipes/kde/kf6-kcompletion/recipe.toml +++ b/local/recipes/kde/kf6-kcompletion/recipe.toml @@ -16,12 +16,9 @@ script = """ DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done +redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules sed -i "s/^ecm_install_po_files_as_qm/#ecm_install_po_files_as_qm/" \ "${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true diff --git a/local/recipes/kde/kf6-kconfig/recipe.toml b/local/recipes/kde/kf6-kconfig/recipe.toml index e40ed582..e2d7d04a 100644 --- a/local/recipes/kde/kf6-kconfig/recipe.toml +++ b/local/recipes/kde/kf6-kconfig/recipe.toml @@ -13,12 +13,9 @@ script = """ DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done +redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules sed -i "s/^ecm_install_po_files_as_qm/#ecm_install_po_files_as_qm/" \ "${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true diff --git a/local/recipes/kde/kf6-kconfigwidgets/recipe.toml b/local/recipes/kde/kf6-kconfigwidgets/recipe.toml index 468f83a0..0810a9dd 100644 --- a/local/recipes/kde/kf6-kconfigwidgets/recipe.toml +++ b/local/recipes/kde/kf6-kconfigwidgets/recipe.toml @@ -19,13 +19,11 @@ dependencies = [ script = """ DYNAMIC_INIT +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" + HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done +redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules sed -i "s/^ecm_install_po_files_as_qm/#ecm_install_po_files_as_qm/" \ "${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true diff --git a/local/recipes/kde/kf6-kcoreaddons/recipe.toml b/local/recipes/kde/kf6-kcoreaddons/recipe.toml index 67a01595..d7e90735 100644 --- a/local/recipes/kde/kf6-kcoreaddons/recipe.toml +++ b/local/recipes/kde/kf6-kcoreaddons/recipe.toml @@ -9,12 +9,9 @@ script = """ DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done +redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules rm -f CMakeCache.txt rm -rf CMakeFiles diff --git a/local/recipes/kde/kf6-kcrash/recipe.toml b/local/recipes/kde/kf6-kcrash/recipe.toml index 1b50ecdd..6f5b7c26 100644 --- a/local/recipes/kde/kf6-kcrash/recipe.toml +++ b/local/recipes/kde/kf6-kcrash/recipe.toml @@ -13,6 +13,7 @@ script = ''' DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" STUB_OPENGL_DIR="${COOKBOOK_SYSROOT}/lib/cmake/Qt6OpenGL" mkdir -p "${STUB_OPENGL_DIR}" @@ -25,15 +26,7 @@ set(PACKAGE_VERSION "6.6.0") set(PACKAGE_VERSION_COMPATIBLE TRUE) OPENGLEOF -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done - -if [ -d "${COOKBOOK_SYSROOT}/usr/plugins" ] && [ ! -e "${COOKBOOK_SYSROOT}/plugins" ]; then - ln -s "usr/plugins" "${COOKBOOK_SYSROOT}/plugins" -fi +redbear_qt_prepare_common_sysroot "${COOKBOOK_SYSROOT}" sed -i "s/^ecm_install_po_files_as_qm/#ecm_install_po_files_as_qm/" "${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true sed -i "s/^ki18n_install(po)/#ki18n_install(po)/" "${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true diff --git a/local/recipes/kde/kf6-kdbusaddons/recipe.toml b/local/recipes/kde/kf6-kdbusaddons/recipe.toml index 062570e1..4b95a933 100644 --- a/local/recipes/kde/kf6-kdbusaddons/recipe.toml +++ b/local/recipes/kde/kf6-kdbusaddons/recipe.toml @@ -12,12 +12,9 @@ script = """ DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done +redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules for tool in qdbuscpp2xml qdbusxml2cpp; do if [ -f "${HOST_BUILD}/libexec/$tool" ] && [ ! -e "${HOST_BUILD}/bin/$tool" ]; then diff --git a/local/recipes/kde/kf6-kded6/recipe.toml b/local/recipes/kde/kf6-kded6/recipe.toml index bfcb7790..2fb1fc28 100644 --- a/local/recipes/kde/kf6-kded6/recipe.toml +++ b/local/recipes/kde/kf6-kded6/recipe.toml @@ -16,16 +16,9 @@ script = """ DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done - -if [ -d "${COOKBOOK_SYSROOT}/usr/plugins" ] && [ ! -e "${COOKBOOK_SYSROOT}/plugins" ]; then - ln -s "usr/plugins" "${COOKBOOK_SYSROOT}/plugins" -fi +redbear_qt_prepare_common_sysroot "${COOKBOOK_SYSROOT}" sed -i "s/^ecm_install_po_files_as_qm/#ecm_install_po_files_as_qm/" \ "${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true diff --git a/local/recipes/kde/kf6-kglobalaccel/recipe.toml b/local/recipes/kde/kf6-kglobalaccel/recipe.toml index 43aa5c96..533eda4c 100644 --- a/local/recipes/kde/kf6-kglobalaccel/recipe.toml +++ b/local/recipes/kde/kf6-kglobalaccel/recipe.toml @@ -15,17 +15,11 @@ dependencies = [ script = """ DYNAMIC_INIT +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" + HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done - -if [ -d "${COOKBOOK_SYSROOT}/usr/plugins" ] && [ ! -e "${COOKBOOK_SYSROOT}/plugins" ]; then - ln -s "usr/plugins" "${COOKBOOK_SYSROOT}/plugins" -fi +redbear_qt_prepare_common_sysroot "${COOKBOOK_SYSROOT}" sed -i "s/^ecm_install_po_files_as_qm/#ecm_install_po_files_as_qm/" \ "${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true diff --git a/local/recipes/kde/kf6-kguiaddons/recipe.toml b/local/recipes/kde/kf6-kguiaddons/recipe.toml index 9791abf3..8df81b25 100644 --- a/local/recipes/kde/kf6-kguiaddons/recipe.toml +++ b/local/recipes/kde/kf6-kguiaddons/recipe.toml @@ -12,12 +12,9 @@ script = """ DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done +redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules sed -i "s/^ecm_install_po_files_as_qm/#ecm_install_po_files_as_qm/" \ "${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true diff --git a/local/recipes/kde/kf6-ki18n/recipe.toml b/local/recipes/kde/kf6-ki18n/recipe.toml index afa6c66b..e9663e09 100644 --- a/local/recipes/kde/kf6-ki18n/recipe.toml +++ b/local/recipes/kde/kf6-ki18n/recipe.toml @@ -13,12 +13,9 @@ script = """ DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done +redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules sed -i "s/^ecm_install_po_files_as_qm/#ecm_install_po_files_as_qm/" \ "${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true diff --git a/local/recipes/kde/kf6-kiconthemes/recipe.toml b/local/recipes/kde/kf6-kiconthemes/recipe.toml index 23707a11..b473004c 100644 --- a/local/recipes/kde/kf6-kiconthemes/recipe.toml +++ b/local/recipes/kde/kf6-kiconthemes/recipe.toml @@ -21,12 +21,9 @@ script = """ DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done +redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules sed -i "s/^ecm_install_po_files_as_qm/#ecm_install_po_files_as_qm/" \ "${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true diff --git a/local/recipes/kde/kf6-kitemmodels/recipe.toml b/local/recipes/kde/kf6-kitemmodels/recipe.toml index 0967de58..8ed6cd64 100644 --- a/local/recipes/kde/kf6-kitemmodels/recipe.toml +++ b/local/recipes/kde/kf6-kitemmodels/recipe.toml @@ -14,12 +14,9 @@ script = """ DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done +redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules sed -i "s/^ecm_install_po_files_as_qm/#ecm_install_po_files_as_qm/" \ "${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true diff --git a/local/recipes/kde/kf6-kitemviews/recipe.toml b/local/recipes/kde/kf6-kitemviews/recipe.toml index 5809cc3e..5727a688 100644 --- a/local/recipes/kde/kf6-kitemviews/recipe.toml +++ b/local/recipes/kde/kf6-kitemviews/recipe.toml @@ -14,12 +14,9 @@ script = """ DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done +redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules sed -i "s/^ecm_install_po_files_as_qm/#ecm_install_po_files_as_qm/" \ "${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true diff --git a/local/recipes/kde/kf6-kjobwidgets/recipe.toml b/local/recipes/kde/kf6-kjobwidgets/recipe.toml index 9b1931fa..7060956b 100644 --- a/local/recipes/kde/kf6-kjobwidgets/recipe.toml +++ b/local/recipes/kde/kf6-kjobwidgets/recipe.toml @@ -16,12 +16,9 @@ script = """ DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done +redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules sed -i "s/^ecm_install_po_files_as_qm/#ecm_install_po_files_as_qm/" \ "${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true diff --git a/local/recipes/kde/kf6-knewstuff/recipe.toml b/local/recipes/kde/kf6-knewstuff/recipe.toml index 6452b436..99cd2779 100644 --- a/local/recipes/kde/kf6-knewstuff/recipe.toml +++ b/local/recipes/kde/kf6-knewstuff/recipe.toml @@ -14,12 +14,9 @@ script = """ DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done +redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules sed -i 's/^include(ECMQmlModule)/# include(ECMQmlModule) # disabled for Redox core-only build/' \ "${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true diff --git a/local/recipes/kde/kf6-knotifications/recipe.toml b/local/recipes/kde/kf6-knotifications/recipe.toml index a3d5d215..303f1c5c 100644 --- a/local/recipes/kde/kf6-knotifications/recipe.toml +++ b/local/recipes/kde/kf6-knotifications/recipe.toml @@ -17,12 +17,9 @@ DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" QDBUSXML2CPP="${HOST_BUILD}/bin/qdbusxml2cpp" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done +redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules sed -i "s/^ecm_install_po_files_as_qm/#ecm_install_po_files_as_qm/" \ "${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true diff --git a/local/recipes/kde/kf6-kpackage/recipe.toml b/local/recipes/kde/kf6-kpackage/recipe.toml index 9639cf72..0e52f02a 100644 --- a/local/recipes/kde/kf6-kpackage/recipe.toml +++ b/local/recipes/kde/kf6-kpackage/recipe.toml @@ -17,12 +17,9 @@ script = """ DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done +redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules sed -i "s/^ecm_install_po_files_as_qm/#ecm_install_po_files_as_qm/" \ "${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true diff --git a/local/recipes/kde/kf6-kservice/recipe.toml b/local/recipes/kde/kf6-kservice/recipe.toml index ca0899e5..08d6a011 100644 --- a/local/recipes/kde/kf6-kservice/recipe.toml +++ b/local/recipes/kde/kf6-kservice/recipe.toml @@ -16,12 +16,9 @@ script = """ DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done +redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules sed -i "s/^ecm_install_po_files_as_qm/#ecm_install_po_files_as_qm/" \ "${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true diff --git a/local/recipes/kde/kf6-ktextwidgets/recipe.toml b/local/recipes/kde/kf6-ktextwidgets/recipe.toml index 9305c614..809ec184 100644 --- a/local/recipes/kde/kf6-ktextwidgets/recipe.toml +++ b/local/recipes/kde/kf6-ktextwidgets/recipe.toml @@ -20,12 +20,9 @@ script = """ DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done +redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules sed -i "s/^ecm_install_po_files_as_qm/#ecm_install_po_files_as_qm/" \ "${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true diff --git a/local/recipes/kde/kf6-kwayland/recipe.toml b/local/recipes/kde/kf6-kwayland/recipe.toml index 37bf8f0c..dcc8b609 100644 --- a/local/recipes/kde/kf6-kwayland/recipe.toml +++ b/local/recipes/kde/kf6-kwayland/recipe.toml @@ -16,12 +16,9 @@ script = """ DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done +redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules if [ ! -e "${COOKBOOK_SYSROOT}/bin/wayland-scanner" ] || [ -f "${COOKBOOK_SYSROOT}/bin/wayland-scanner" ]; then mkdir -p "${COOKBOOK_SYSROOT}/bin" diff --git a/local/recipes/kde/kf6-solid/recipe.toml b/local/recipes/kde/kf6-solid/recipe.toml index f7677dae..55554cc0 100644 --- a/local/recipes/kde/kf6-solid/recipe.toml +++ b/local/recipes/kde/kf6-solid/recipe.toml @@ -14,13 +14,10 @@ script = """ DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" export LDFLAGS="${LDFLAGS} -Wl,--copy-dt-needed-entries -lc" -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done +redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules sed -i "s/^ecm_install_po_files_as_qm/#ecm_install_po_files_as_qm/" \ "${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true diff --git a/local/recipes/kde/kglobalacceld/recipe.toml b/local/recipes/kde/kglobalacceld/recipe.toml index 519cc61b..b1dd9fb8 100644 --- a/local/recipes/kde/kglobalacceld/recipe.toml +++ b/local/recipes/kde/kglobalacceld/recipe.toml @@ -20,16 +20,9 @@ script = """ DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done - -if [ -d "${COOKBOOK_SYSROOT}/usr/plugins" ] && [ ! -e "${COOKBOOK_SYSROOT}/plugins" ]; then - ln -s "usr/plugins" "${COOKBOOK_SYSROOT}/plugins" -fi +redbear_qt_prepare_common_sysroot "${COOKBOOK_SYSROOT}" sed -i "s/^ecm_install_po_files_as_qm/#ecm_install_po_files_as_qm/" \ "${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true diff --git a/local/scripts/lib/qt-sysroot.sh b/local/scripts/lib/qt-sysroot.sh new file mode 100644 index 00000000..9e0aca63 --- /dev/null +++ b/local/scripts/lib/qt-sysroot.sh @@ -0,0 +1,129 @@ +#!/usr/bin/env bash + +redbear_qt_link_sysroot_dir() { + local sysroot="$1" + local dir_name="$2" + if [ -d "${sysroot}/usr/${dir_name}" ] && [ ! -e "${sysroot}/${dir_name}" ]; then + ln -s "usr/${dir_name}" "${sysroot}/${dir_name}" + fi +} + +redbear_qt_link_sysroot_dirs() { + local sysroot="$1" + shift + local dir_name + for dir_name in "$@"; do + redbear_qt_link_sysroot_dir "$sysroot" "$dir_name" + done +} + +redbear_qt_link_plugins_dir() { + local sysroot="$1" + if [ -d "${sysroot}/usr/plugins" ] && [ ! -e "${sysroot}/plugins" ]; then + ln -s "usr/plugins" "${sysroot}/plugins" + fi +} + +redbear_qt_prepare_common_sysroot() { + local sysroot="$1" + redbear_qt_link_sysroot_dirs "$sysroot" plugins mkspecs metatypes modules + redbear_qt_link_plugins_dir "$sysroot" +} + +redbear_qt_reset_cmake_cache_dir() { + rm -f CMakeCache.txt + if [ -d CMakeFiles ]; then + python3 - <<'PY' +from pathlib import Path +import os +import shutil + +path = Path("CMakeFiles") +for node in path.rglob('*'): + try: + os.chmod(node, 0o700) + except OSError: + pass +shutil.rmtree(path, ignore_errors=False) +PY + fi +} + +redbear_qt_rewrite_stage_build_paths() { + local stage_usr="$1" + local build_dir="$2" + find "${stage_usr}/lib/cmake" -name '*.cmake' -exec sed -i \ + "s|${build_dir}|/usr|g" {} + 2>/dev/null || true +} + +redbear_qt_copy_common_stage_to_sysroot() { + local stage_usr="$1" + local sysroot="$2" + mkdir -p "${sysroot}/include" "${sysroot}/lib" + cp -a "${stage_usr}/include/"* "${sysroot}/include/" 2>/dev/null || true + cp -a "${stage_usr}/lib/libQt6"* "${sysroot}/lib/" 2>/dev/null || true +} + +redbear_qt_copy_stage_cmake_subdir_to_sysroot() { + local stage_usr="$1" + local sysroot="$2" + local subdir="$3" + mkdir -p "${sysroot}/lib/cmake/${subdir}" + cp -a "${stage_usr}/lib/cmake/${subdir}/"* "${sysroot}/lib/cmake/${subdir}/" 2>/dev/null || true +} + +redbear_qt_rewrite_stage_include_paths() { + local stage_cmake_dir="$1" + local sysroot="$2" + find "${stage_cmake_dir}" -name '*.cmake' -exec sed -i \ + "s|/usr/include|${sysroot}/include|g" {} + 2>/dev/null || true +} + +redbear_qt_rewrite_stage_lib_paths() { + local stage_cmake_dir="$1" + local sysroot="$2" + find "${stage_cmake_dir}" -name '*.cmake' -exec sed -i \ + "s|/usr/lib|${sysroot}/lib|g" {} + 2>/dev/null || true +} + +redbear_qt_rewrite_stage_source_metatype_paths() { + local stage_cmake_dir="$1" + local sysroot="$2" + local source_root="$3" + find "${stage_cmake_dir}" -name '*.cmake' -exec sed -i \ + "s|/usr/src|${source_root}/src|g" {} + 2>/dev/null || true + find "${stage_cmake_dir}" -name '*.cmake' -exec sed -i \ + "s|${source_root}/src/.*/meta_types/|${sysroot}/metatypes/|g" {} + 2>/dev/null || true +} + +redbear_qt_rewrite_usr_src_metatype_paths() { + local stage_cmake_dir="$1" + local sysroot="$2" + find "${stage_cmake_dir}" -name '*.cmake' -exec sed -i \ + "s|/usr/src/.*/meta_types/|${sysroot}/metatypes/|g" {} + 2>/dev/null || true +} + +redbear_qt_rewrite_stage_path_literal() { + local stage_cmake_dir="$1" + local from_path="$2" + local to_path="$3" + find "${stage_cmake_dir}" -name '*.cmake' -exec sed -i \ + "s|${from_path}|${to_path}|g" {} + 2>/dev/null || true +} + +redbear_qt_copy_stage_qt6_cmake_to_sysroot() { + local stage_usr="$1" + local sysroot="$2" + mkdir -p "${sysroot}/lib/cmake" + cp -a "${stage_usr}/lib/cmake/Qt6"* "${sysroot}/lib/cmake/" 2>/dev/null || true +} + +redbear_qt_copy_optional_stage_dir_to_sysroot() { + local stage_usr="$1" + local sysroot="$2" + local dir_name="$3" + if [ -d "${stage_usr}/${dir_name}" ]; then + mkdir -p "${sysroot}/${dir_name}" + cp -a "${stage_usr}/${dir_name}/"* "${sysroot}/${dir_name}/" 2>/dev/null || true + fi +} diff --git a/recipes/wip/qt/qtquick3d/recipe.toml b/recipes/wip/qt/qtquick3d/recipe.toml index 679dead0..27ab3b52 100644 --- a/recipes/wip/qt/qtquick3d/recipe.toml +++ b/recipes/wip/qt/qtquick3d/recipe.toml @@ -17,14 +17,9 @@ DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" QUICK3D_HOST="${COOKBOOK_ROOT}/build/qt-quick3d-host" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" -# Sysroot path fix: the cookbook only symlinks sysroot/{bin,include,lib,share} -> usr/ -# but Qt6 cmake targets reference ${_IMPORT_PREFIX}/{plugins,mkspecs,metatypes,modules}. -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done +redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules if [ ! -d "${COOKBOOK_SYSROOT}/lib/cmake/Qt6Quick" ] \ && [ ! -d "${COOKBOOK_SYSROOT}/usr/lib/cmake/Qt6Quick" ]; then @@ -157,38 +152,17 @@ if [ -d "${COOKBOOK_STAGE}/usr/qml" ]; then fi BUILD_DIR="${COOKBOOK_BUILD}" -if [ -d "${COOKBOOK_STAGE}/usr/lib/cmake" ]; then - find "${COOKBOOK_STAGE}/usr/lib/cmake" -name '*.cmake' -exec sed -i \ - "s|${BUILD_DIR}|/usr|g" {} + 2>/dev/null || true -fi - +STAGE_USR="${COOKBOOK_STAGE}/usr" +STAGE_CMAKE_DIR="${STAGE_USR}/lib/cmake" SYSROOT="${COOKBOOK_SYSROOT}" -if [ -d "${COOKBOOK_STAGE}/usr/lib/cmake" ]; then - find "${COOKBOOK_STAGE}/usr/lib/cmake" -name '*.cmake' -exec sed -i \ - "s|/usr/include|${SYSROOT}/include|g" {} + 2>/dev/null || true - find "${COOKBOOK_STAGE}/usr/lib/cmake" -name '*.cmake' -exec sed -i \ - "s|${COOKBOOK_SOURCE}/src/.*/meta_types/|${SYSROOT}/metatypes/|g" {} + 2>/dev/null || true -fi -if [ -d "${COOKBOOK_STAGE}/usr/include" ]; then - mkdir -p "${SYSROOT}/include" - cp -a "${COOKBOOK_STAGE}/usr/include/"* "${SYSROOT}/include/" 2>/dev/null || true -fi -if [ -d "${COOKBOOK_STAGE}/usr/lib/cmake" ]; then - mkdir -p "${SYSROOT}/lib/cmake" - cp -a "${COOKBOOK_STAGE}/usr/lib/cmake/Qt6"* "${SYSROOT}/lib/cmake/" 2>/dev/null || true -fi -mkdir -p "${SYSROOT}/lib" -cp -a "${COOKBOOK_STAGE}/usr/lib/libQt6"* "${SYSROOT}/lib/" 2>/dev/null || true -if [ -d "${COOKBOOK_STAGE}/usr/metatypes" ]; then - mkdir -p "${SYSROOT}/metatypes" - cp -a "${COOKBOOK_STAGE}/usr/metatypes/"* "${SYSROOT}/metatypes/" 2>/dev/null || true -fi -if [ -d "${COOKBOOK_STAGE}/usr/plugins" ]; then - mkdir -p "${SYSROOT}/plugins" - cp -a "${COOKBOOK_STAGE}/usr/plugins/"* "${SYSROOT}/plugins/" 2>/dev/null || true -fi -if [ -d "${COOKBOOK_STAGE}/usr/qml" ]; then - mkdir -p "${SYSROOT}/qml" - cp -a "${COOKBOOK_STAGE}/usr/qml/"* "${SYSROOT}/qml/" 2>/dev/null || true +if [ -d "${STAGE_CMAKE_DIR}" ]; then + redbear_qt_rewrite_stage_build_paths "${STAGE_USR}" "${BUILD_DIR}" + redbear_qt_rewrite_stage_include_paths "${STAGE_CMAKE_DIR}" "${SYSROOT}" + redbear_qt_rewrite_stage_source_metatype_paths "${STAGE_CMAKE_DIR}" "${SYSROOT}" "${COOKBOOK_SOURCE}" + redbear_qt_copy_stage_qt6_cmake_to_sysroot "${STAGE_USR}" "${SYSROOT}" fi +redbear_qt_copy_common_stage_to_sysroot "${STAGE_USR}" "${SYSROOT}" +redbear_qt_copy_optional_stage_dir_to_sysroot "${STAGE_USR}" "${SYSROOT}" metatypes +redbear_qt_copy_optional_stage_dir_to_sysroot "${STAGE_USR}" "${SYSROOT}" plugins +redbear_qt_copy_optional_stage_dir_to_sysroot "${STAGE_USR}" "${SYSROOT}" qml """ diff --git a/recipes/wip/qt/qtscxml/recipe.toml b/recipes/wip/qt/qtscxml/recipe.toml index bb97d05e..d2a4354f 100644 --- a/recipes/wip/qt/qtscxml/recipe.toml +++ b/recipes/wip/qt/qtscxml/recipe.toml @@ -13,14 +13,9 @@ DYNAMIC_INIT HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" SCXML_HOST="${COOKBOOK_ROOT}/build/qt-scxml-host" +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" -# Sysroot path fix: the cookbook only symlinks sysroot/{bin,include,lib,share} → usr/ -# but Qt6 cmake targets reference ${_IMPORT_PREFIX}/{plugins,mkspecs,metatypes,modules}. -for qtdir in plugins mkspecs metatypes modules; do - if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then - ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}" - fi -done +redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules if [ ! -d "${HOST_BUILD}/lib/cmake/Qt6ScxmlTools" ]; then rm -rf "${SCXML_HOST}" @@ -140,32 +135,15 @@ if [ -d "${COOKBOOK_STAGE}/usr/libexec" ]; then fi BUILD_DIR="${COOKBOOK_BUILD}" -if [ -d "${COOKBOOK_STAGE}/usr/lib/cmake" ]; then - find "${COOKBOOK_STAGE}/usr/lib/cmake" -name '*.cmake' -exec sed -i \ - "s|${BUILD_DIR}|/usr|g" {} + 2>/dev/null || true -fi - +STAGE_USR="${COOKBOOK_STAGE}/usr" +STAGE_CMAKE_DIR="${STAGE_USR}/lib/cmake" SYSROOT="${COOKBOOK_SYSROOT}" -if [ -d "${COOKBOOK_STAGE}/usr/lib/cmake" ]; then - find "${COOKBOOK_STAGE}/usr/lib/cmake" -name '*.cmake' -exec sed -i \ - "s|/usr/include|${SYSROOT}/include|g" {} + 2>/dev/null || true -fi -if [ -d "${COOKBOOK_STAGE}/usr/include" ]; then - mkdir -p "${SYSROOT}/include" - cp -a "${COOKBOOK_STAGE}/usr/include/"* "${SYSROOT}/include/" 2>/dev/null || true -fi -if [ -d "${COOKBOOK_STAGE}/usr/lib/cmake" ]; then - mkdir -p "${SYSROOT}/lib/cmake" - cp -a "${COOKBOOK_STAGE}/usr/lib/cmake/Qt6"* "${SYSROOT}/lib/cmake/" 2>/dev/null || true -fi -mkdir -p "${SYSROOT}/lib" -cp -a "${COOKBOOK_STAGE}/usr/lib/libQt6"* "${SYSROOT}/lib/" 2>/dev/null || true -if [ -d "${COOKBOOK_STAGE}/usr/plugins" ]; then - mkdir -p "${SYSROOT}/plugins" - cp -a "${COOKBOOK_STAGE}/usr/plugins/"* "${SYSROOT}/plugins/" 2>/dev/null || true -fi -if [ -d "${COOKBOOK_STAGE}/usr/qml" ]; then - mkdir -p "${SYSROOT}/qml" - cp -a "${COOKBOOK_STAGE}/usr/qml/"* "${SYSROOT}/qml/" 2>/dev/null || true +if [ -d "${STAGE_CMAKE_DIR}" ]; then + redbear_qt_rewrite_stage_build_paths "${STAGE_USR}" "${BUILD_DIR}" + redbear_qt_rewrite_stage_include_paths "${STAGE_CMAKE_DIR}" "${SYSROOT}" + redbear_qt_copy_stage_qt6_cmake_to_sysroot "${STAGE_USR}" "${SYSROOT}" fi +redbear_qt_copy_common_stage_to_sysroot "${STAGE_USR}" "${SYSROOT}" +redbear_qt_copy_optional_stage_dir_to_sysroot "${STAGE_USR}" "${SYSROOT}" plugins +redbear_qt_copy_optional_stage_dir_to_sysroot "${STAGE_USR}" "${SYSROOT}" qml """ diff --git a/recipes/wip/qt/qtwayland/recipe.toml b/recipes/wip/qt/qtwayland/recipe.toml index 026ad0d4..6270322d 100644 --- a/recipes/wip/qt/qtwayland/recipe.toml +++ b/recipes/wip/qt/qtwayland/recipe.toml @@ -13,6 +13,8 @@ dependencies = [ script = """ DYNAMIC_INIT +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" + export LDFLAGS="${LDFLAGS} -lffi" HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" @@ -64,12 +66,7 @@ FilesAnalyzed: false SBOMEOF fi -# Create sysroot symlink for Qt cmake modules (if not already present) -for d in plugins mkspecs metatypes modules; do - if [ ! -e "${COOKBOOK_SYSROOT}/${d}" ] && [ -d "${COOKBOOK_SYSROOT}/usr/${d}" ]; then - ln -sf "usr/${d}" "${COOKBOOK_SYSROOT}/${d}" - fi -done +redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules cmake "${COOKBOOK_SOURCE}" \ -DCMAKE_TOOLCHAIN_FILE="${COOKBOOK_ROOT}/local/recipes/qt/redox-toolchain.cmake" \ diff --git a/recipes/wip/qt/qtwebchannel/recipe.toml b/recipes/wip/qt/qtwebchannel/recipe.toml index 6a1cda72..4353c664 100644 --- a/recipes/wip/qt/qtwebchannel/recipe.toml +++ b/recipes/wip/qt/qtwebchannel/recipe.toml @@ -13,6 +13,8 @@ dependencies = [ script = """ DYNAMIC_INIT +source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh" + HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" # Sysroot path fix: the cookbook only symlinks sysroot/{bin,include,lib,share} -> usr/ @@ -79,32 +81,15 @@ if [ -d "${COOKBOOK_STAGE}/usr/plugins" ]; then fi BUILD_DIR="${COOKBOOK_BUILD}" -if [ -d "${COOKBOOK_STAGE}/usr/lib/cmake" ]; then - find "${COOKBOOK_STAGE}/usr/lib/cmake" -name '*.cmake' -exec sed -i \ - "s|${BUILD_DIR}|/usr|g" {} + 2>/dev/null || true -fi - +STAGE_USR="${COOKBOOK_STAGE}/usr" +STAGE_CMAKE_DIR="${STAGE_USR}/lib/cmake" SYSROOT="${COOKBOOK_SYSROOT}" -if [ -d "${COOKBOOK_STAGE}/usr/lib/cmake" ]; then - find "${COOKBOOK_STAGE}/usr/lib/cmake" -name '*.cmake' -exec sed -i \ - "s|/usr/include|${SYSROOT}/include|g" {} + 2>/dev/null || true -fi -if [ -d "${COOKBOOK_STAGE}/usr/include" ]; then - mkdir -p "${SYSROOT}/include" - cp -a "${COOKBOOK_STAGE}/usr/include/"* "${SYSROOT}/include/" 2>/dev/null || true -fi -if [ -d "${COOKBOOK_STAGE}/usr/lib/cmake" ]; then - mkdir -p "${SYSROOT}/lib/cmake" - cp -a "${COOKBOOK_STAGE}/usr/lib/cmake/Qt6"* "${SYSROOT}/lib/cmake/" 2>/dev/null || true -fi -mkdir -p "${SYSROOT}/lib" -cp -a "${COOKBOOK_STAGE}/usr/lib/libQt6"* "${SYSROOT}/lib/" 2>/dev/null || true -if [ -d "${COOKBOOK_STAGE}/usr/plugins" ]; then - mkdir -p "${SYSROOT}/plugins" - cp -a "${COOKBOOK_STAGE}/usr/plugins/"* "${SYSROOT}/plugins/" 2>/dev/null || true -fi -if [ -d "${COOKBOOK_STAGE}/usr/qml" ]; then - mkdir -p "${SYSROOT}/qml" - cp -a "${COOKBOOK_STAGE}/usr/qml/"* "${SYSROOT}/qml/" 2>/dev/null || true +if [ -d "${STAGE_CMAKE_DIR}" ]; then + redbear_qt_rewrite_stage_build_paths "${STAGE_USR}" "${BUILD_DIR}" + redbear_qt_rewrite_stage_include_paths "${STAGE_CMAKE_DIR}" "${SYSROOT}" + redbear_qt_copy_stage_qt6_cmake_to_sysroot "${STAGE_USR}" "${SYSROOT}" fi +redbear_qt_copy_common_stage_to_sysroot "${STAGE_USR}" "${SYSROOT}" +redbear_qt_copy_optional_stage_dir_to_sysroot "${STAGE_USR}" "${SYSROOT}" plugins +redbear_qt_copy_optional_stage_dir_to_sysroot "${STAGE_USR}" "${SYSROOT}" qml """