# kholidays 6.27.0 — KDE Frameworks 6 (cálculo de festivos/feriados, KF6::Holidays). Blocker de knighttime
# (find_package(KF6 ... Holidays)), que es blocker de kwin. Campaña KDE (ADR 0011). Patrón KF6: dynamic,
# wrapper zig que filtra -Wl,--fatal-warnings, ECM + qttools.
# CMakeLists: find_package(Qt6 Core Qml REQUIRED) + FLEX + BISON (>=3.3.2) REQUIRED (parser de reglas de
# festivos). NO usa ki18n (sólo ecm_install_po_files_as_qm vía lrelease de qttools).
name    = "kholidays"
version = "6.27.0"

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

[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
'''
compile = "cmake --build build"
install = "DESTDIR=/out cmake --install build"

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