kf6-kio: durable Redox build fixes as recipe seds (survive restore-sources)
redbear-ci / check (push) Waiting to run

kf6-kio re-cooked (fingerprint invalidated by the cookbook_configure change) and
surfaced three issues; fix them as build-time seds so restore-sources.sh cannot
revert them (a cached source snapshot kept reverting in-tree source edits):
- previewjob.cpp: a prior port replaced the pristine '#include <KConfigGroup>'
  with an unterminated '#if defined(Q_OS_UNIX) && ... && !defined(Q_OS_REDOX)'
  (also dropping the include) -> 'unterminated #if'. Restore the include.
- hostinfo.cpp: drop <arpa/nameser.h> + <resolv.h> (BIND resolver headers absent
  on relibc); the only symbol used, _PATH_RESCONF, has a /etc/resolv.conf fallback.
- CMakeLists.txt: drop Qt6::Test from the REQUIRED components (autotests-only,
  gated on BUILD_TESTING, and Qt6Test is not built for the cross target).
This commit is contained in:
2026-08-02 05:54:25 +03:00
parent 2622b426af
commit 90a0f0a005
+17
View File
@@ -165,6 +165,23 @@ if start != -1 and end != -1 and start < end:
askuser.write_text(text)
PY
# --- Redox source fixes (applied at build time so restore-sources.sh cannot
# --- revert them) ---
# previewjob.cpp: a prior port left an unterminated `#if defined(Q_OS_UNIX) &&
# ... && !defined(Q_OS_REDOX)` in place of the pristine `#include <KConfigGroup>`
# (the edit also dropped that include), giving "unterminated #if". Restore it.
sed -i 's|^#if defined(Q_OS_UNIX) && !defined(Q_OS_ANDROID) && !defined(Q_OS_HAIKU) && !defined(Q_OS_REDOX)$|#include <KConfigGroup>|' \
"${COOKBOOK_SOURCE}/src/gui/previewjob.cpp" 2>/dev/null || true
# hostinfo.cpp: relibc has no BIND resolver headers; only _PATH_RESCONF is used
# and it has a "/etc/resolv.conf" fallback, so drop the includes (redox target).
sed -i '/#include <arpa\\/nameser.h>/d; /#include <resolv.h>/d' \
"${COOKBOOK_SOURCE}/src/core/hostinfo.cpp" 2>/dev/null || true
# Qt6::Test is autotests-only (BUILD_TESTING) and not built for the cross target.
sed -i 's|CONFIG REQUIRED Widgets Network Concurrent Xml Test)|CONFIG REQUIRED Widgets Network Concurrent Xml)|' \
"${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true
rm -f CMakeCache.txt
rm -rf CMakeFiles