# plasma-wayland-protocols 1.21.0 — definiciones XML de protocolos Wayland propios de KDE/Plasma
# (org_kde_*). Capa 0 campaña KDE (ADR 0011): kguiaddons/kwindowsystem (y luego kwin/plasmashell) piden
# find_package(PlasmaWaylandProtocols). No compila código: instala XML + PlasmaWaylandProtocolsConfig.cmake.
# CMake+ECM puro (sin Qt) ⇒ no necesita el set Qt-consumer, sólo ECM.
name    = "plasma-wayland-protocols"
version = "1.21.0"

[source]
tarball = "https://download.kde.org/stable/plasma-wayland-protocols/plasma-wayland-protocols-1.21.0.tar.xz"
sha256  = "698a7b28b711270314e396e248ae86087cfeaed01372009063995be6e1dc85ba"

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

[deps]
build = ["cmake", "samurai", "pkgconf", "extra-cmake-modules"]
