# sonnet 6.27.0 — KDE Frameworks 6 (Capa 2 tier-3, ADR 0011). Corrector ortográfico. Patrón KF6: dynamic,
# wrapper zig que filtra -Wl,--fatal-warnings, CMAKE_PREFIX_PATH=/usr, ECM + qttools + dbus.
# Qt6 Core+Widgets+Quick (SONNET_USE_QML=ON por defecto → qtdeclarative). SIN deps KF6, sin X11.
# Backends de diccionario (ASPELL/HSPELL/HUNSPELL/VOIKKO) son TODOS opcionales (find_package sin REQUIRED):
# construye SIN diccionarios instalados. Ningún blocker externo.
name    = "sonnet"
version = "6.27.0"

[source]
tarball = "https://download.kde.org/stable/frameworks/6.27/sonnet-6.27.0.tar.xz"
sha256  = "f8dcbba58d3479dfa4922146270f6ecb7ce0d987d82edc59b0c7c27ff965f65a"

[build]
compiler = "zig-cc"
target   = "x86_64-linux-musl"
link     = "dynamic"
flags    = []

[build.phases]
configure = '''
ZW="$PWD/.zwrap"; mkdir -p "$ZW"
cat > "$ZW/cc"  <<'W'
#!/bin/sh
a=""; for x in "$@"; do [ "$x" = "-Wl,--fatal-warnings" ] && continue; a="$a $x"; done
exec /opt/zig/zig cc -mcpu=baseline $a
W
cat > "$ZW/cxx" <<'W'
#!/bin/sh
a=""; for x in "$@"; do [ "$x" = "-Wl,--fatal-warnings" ] && continue; a="$a $x"; done
exec /opt/zig/zig c++ -mcpu=baseline $a
W
chmod +x "$ZW/cc" "$ZW/cxx"
cmake -B build -G Ninja -Wno-dev \
  -DCMAKE_C_COMPILER="$ZW/cc" -DCMAKE_CXX_COMPILER="$ZW/cxx" -DCMAKE_ASM_COMPILER="$ZW/cc" \
  -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_PREFIX_PATH=/usr \
  -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF \
  -DBUILD_TESTING=OFF -DBUILD_PYTHON_BINDINGS=OFF -DSONNET_NO_BACKENDS=ON -DBUILD_DESIGNERPLUGIN=OFF
'''
compile = "cmake --build build"
install = "DESTDIR=/out cmake --install build"

[deps]
build = ["cmake", "samurai", "python3", "pkgconf", "qtbase", "dbus", "extra-cmake-modules", "qttools", "mesa", "libdrm", "libxkbcommon", "wayland", "qtdeclarative"]
