# kirigami 6.27.0 — KDE Frameworks 6 (tier-4, ADR 0011). Toolkit QML de KDE (UI Plasma Mobile/Desktop).
# Tarball 6.27 se llama "kirigami" (ya no kirigami2). Precursor QML-pesado de Plasma.
# CMakeLists: find_package(Qt6 REQUIRED Core Quick Gui Svg QuickControls2 Concurrent ShaderTools).
#   Quick+QuickControls2 → qtdeclarative (en Qt6 QtQuickControls2 vive en el repo qtdeclarative).
#   Svg → qtsvg. ShaderTools (qsb) → qtshadertools. Core/Gui/Concurrent/DBus → qtbase.
# CERO deps KF6 (el único find_package(KF6Kirigami) es auto-referencia en examples, OFF). Sin option(WITH_X11).
# USE_DBUS ON por defecto en Linux → Qt6DBus (qtbase). BUILD_EXAMPLES OFF por defecto. DESKTOP_ENABLED ON.
name    = "kirigami"
version = "6.27.0"

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

[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 -DBUILD_EXAMPLES=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", "qtsvg", "qtshadertools"]
