# libplasma 6.7.2 — KDE Plasma (Capa Plasma-foundation, ADR 0011). El framework Plasma (ex plasma-framework KF5):
# componentes QML de Plasma (applets, themes, PlasmaCore/PlasmaComponents). Cadena directa a plasmashell/kwin.
#
# ##### BLOCKER DURO: Qt6WaylandClient (paquete `qtwayland`) NO SELLADO #####
# CMakeLists 6.7.2 línea 70: find_package(Qt6WaylandClient ${QT_MIN_VERSION} REQUIRED CONFIG).
# El catálogo tiene qtbase/qtdeclarative/qtsvg/qtshadertools/qtlanguageserver pero NO qtwayland.
# Esta receta NO construirá hasta que se selle `qtwayland` (Qt6 Wayland module). Se deja lista con el
# cierre completo; qtwayland está listado en [deps] a propósito (la materialización fallará claro hasta sellarlo).
#
# Del CMakeLists (6.7.2), REQUIRED reales (BUILD_EXAMPLES OFF ⇒ examples/templates ignorados):
#  Qt6: Quick Gui Qml Svg QuickControls2 DBus WaylandClient(*blocker*) (+GuiPrivate ≥6.10)
#  KF6: Config CoreAddons GlobalAccel GuiAddons I18n IconThemes KIO WindowSystem Notifications
#       Package KirigamiPlatform(kirigami) Svg(ksvg) ColorScheme
#  PlasmaActivities(plasma-activities) PlasmaWaylandProtocols(plasma-wayland-protocols) WaylandProtocols(wayland-protocols)
#  KF6DBusAddons opcional (no REQUIRED). option(WITHOUT_X11 ... OFF) → APAGAMOS X11 con -DWITHOUT_X11=ON.
# Arrastra el cierre entero de kio (tier-1/2/3 + kio + libgcrypt/libgpg-error/util-linux/openssl) + kirigami + kpackage + ksvg.
name    = "libplasma"
version = "6.7.2"

[source]
tarball = "https://download.kde.org/stable/plasma/6.7.2/libplasma-6.7.2.tar.xz"
sha256  = "133d8de5f00ad0d15b515ea9f13bc64fac7f7f52d077243dc8dfee16323f9f8c"

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

[deps]
build = ["cmake", "samurai", "python3", "pkgconf", "libX11", "xorgproto", "libXau", "libXdmcp", "libxcb", "qtbase", "dbus", "extra-cmake-modules", "qttools", "mesa", "libdrm", "libxkbcommon", "wayland", "wayland-protocols", "plasma-wayland-protocols", "gettext-tiny", "qtdeclarative", "qtsvg", "qtshadertools", "qtlanguageserver", "kconfig", "kcoreaddons", "kglobalaccel", "kguiaddons", "ki18n", "kiconthemes", "kio", "kwindowsystem", "knotifications", "kpackage", "kirigami", "ksvg", "kcolorscheme", "kcodecs", "kconfigwidgets", "kwidgetsaddons", "kcompletion", "kitemviews", "solid", "karchive", "sonnet", "ktextwidgets", "kbookmarks", "kxmlgui", "kservice", "kjobwidgets", "kwallet", "kdnssd", "kcrash", "kdbusaddons", "plasma-activities", "libgcrypt", "libgpg-error", "util-linux", "openssl", "zlib", "zstd", "qt5compat", "libXext", "libXrender", "libXfixes", "libXi"]
