kde/syntaxhighlighting: fix TOML escaping for Python heredoc
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
# Perl dependency skipped via cmake patch (PHP syntax definitions pre-generated).
|
||||
# Required by konsole for syntax highlighting.
|
||||
[source]
|
||||
tar = "https://download.kde.org/stable/frameworks/6.24/syntax-highlighting-6.24.0.tar.xz"
|
||||
blake3 = "6f56e2d37b75c78331c8a21a4f25c2f8ee91c571433810d6580aec6458252f1d"
|
||||
tar = "https://download.kde.org/stable/frameworks/6.26/syntax-highlighting-6.26.0.tar.xz"
|
||||
blake3 = "f6d0a7a50c82939052ddcb1b6332d51cac0aebdc9232523397b532006c305435"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
@@ -33,8 +33,37 @@ sed -i 's/find_package(Qt6 ${REQUIRED_QT_VERSION} NO_MODULE REQUIRED COMPONENTS
|
||||
sed -i 's/find_package(Qt6 ${REQUIRED_QT_VERSION} NO_MODULE QUIET OPTIONAL_COMPONENTS PrintSupport Widgets Quick)/find_package(Qt6 ${REQUIRED_QT_VERSION} NO_MODULE QUIET OPTIONAL_COMPONENTS PrintSupport Widgets)/' \
|
||||
"${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true
|
||||
|
||||
# Red Bear fix: drop the indexer's local operator""_sv that collides with Qt's.
|
||||
INDEXER_CPP="${COOKBOOK_SOURCE}/src/indexer/katehighlightingindexer.cpp"
|
||||
if [ -f "${INDEXER_CPP}" ]; then
|
||||
cat > /tmp/redbear-shdrop.py <<'PYEOF'
|
||||
import pathlib, sys
|
||||
p = pathlib.Path(sys.argv[1])
|
||||
s = p.read_text()
|
||||
old_lines = [
|
||||
"using namespace Qt::Literals::StringLiterals;",
|
||||
"",
|
||||
"static constexpr QStringView operator\\\"\\\"_sv(const char16_t *s, std::size_t n)",
|
||||
"{",
|
||||
" return QStringView(s, s + n);",
|
||||
"}",
|
||||
"",
|
||||
]
|
||||
new_lines = [
|
||||
"using namespace Qt::Literals::StringLiterals;",
|
||||
"",
|
||||
]
|
||||
old = "\\n".join(old_lines) + "\\n"
|
||||
new = "\\n".join(new_lines)
|
||||
if old in s:
|
||||
p.write_text(s.replace(old, new, 1))
|
||||
PYEOF
|
||||
python3 /tmp/redbear-shdrop.py "${INDEXER_CPP}"
|
||||
fi
|
||||
|
||||
ECM_DIR="${COOKBOOK_SYSROOT}/usr/share/ECM/cmake"
|
||||
HOST_INDEXER_DIR="${COOKBOOK_RECIPE}/target/host-indexer"
|
||||
rm -rf "${HOST_INDEXER_DIR}"
|
||||
mkdir -p "${HOST_INDEXER_DIR}"
|
||||
cd "${HOST_INDEXER_DIR}"
|
||||
|
||||
@@ -45,10 +74,9 @@ cmake "${COOKBOOK_SOURCE}" \
|
||||
-DBUILD_QCH=OFF \
|
||||
-DKSYNTAXHIGHLIGHTING_USE_GUI=OFF \
|
||||
-DECM_DIR="${ECM_DIR}" \
|
||||
-Wno-dev 2>/dev/null || true
|
||||
-Wno-dev
|
||||
|
||||
make -j"${COOKBOOK_MAKE_JOBS}" katehighlightingindexer 2>/dev/null || \
|
||||
make -C src/indexer -j"${COOKBOOK_MAKE_JOBS}" 2>/dev/null || true
|
||||
make -j"${COOKBOOK_MAKE_JOBS}" katehighlightingindexer || make -C src/indexer -j"${COOKBOOK_MAKE_JOBS}"
|
||||
|
||||
cd "${COOKBOOK_BUILD}"
|
||||
sed -i 's/find_package(Qt6 ${REQUIRED_QT_VERSION} NO_MODULE REQUIRED COMPONENTS Core Network Test)/find_package(Qt6 ${REQUIRED_QT_VERSION} NO_MODULE REQUIRED COMPONENTS Core Network)/' \
|
||||
|
||||
Reference in New Issue
Block a user