# knighttime 6.7.2 — helpers de KDE Plasma para el ciclo día/noche (KF6::KNightTime). Blocker directo de kwin
# (find_package(KNightTime REQUIRED)). Campaña KDE (ADR 0011). Patrón KF6: dynamic, wrapper zig, ECM + qttools.
# CMakeLists: Qt6 Core/Gui/DBus/Positioning + KF6 Config/CoreAddons/DBusAddons/Holidays/I18n. ki18n_install(po)
# ⇒ ki18n → gettext-tiny. Todo su cierre KF6 sellado salvo kholidays y qtpositioning (esta misma tanda).
name    = "knighttime"
version = "6.7.2"

[source]
tarball = "https://download.kde.org/stable/plasma/6.7.2/knighttime-6.7.2.tar.xz"
sha256  = "3d26c7fe04512ab6367bfb2b092f296dbfd8331dedd576ab2cf30d840be6830e"

[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", "gettext-tiny", "qtpositioning", "kholidays", "ki18n", "kconfig", "kcoreaddons", "kdbusaddons"]
