# plasma-nm 6.7.2 — el APPLET DE RED de Plasma (KCM + applet QML + plasma-nm). Campaña KDE (ADR 0011).
# Cierra el frente de red que plasma-workspace había esquivado parcheando NetworkManagerQt a opcional
# (el "rabbit-hole libnm→glib"): ahora la cadena existe entera y soberana:
#   glib-shared → networkmanager (libnm) → networkmanager-qt ─┐
#   glib-shared → modemmanager (libmm-glib) → modemmanager-qt ─┴→ plasma-nm
#
# BUILD_OPENCONNECT=OFF es IMPORTANTE: con ON, plasma-nm hace find_package(Qt6WebEngineWidgets REQUIRED)
# ⇒ arrastraría qtwebengine (Chromium embebido), la receta más cara del proyecto, DIFERIDA por el ADR.
# (Igual auto-desactiva al no hallar openconnect, pero se explicita para determinismo.)
#
# RUNTIME (no bloquean el build): kirigami, prison (códigos QR de redes WiFi), kquickcharts — los 3 ya
# sellados. ecm_find_qmlmodule REQUIRED: org.kde.prison + org.kde.kirigamiaddons.formcard (kirigami-addons).
name    = "plasma-nm"
version = "6.7.2"

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

[build]
compiler = "zig-cc"
target   = "x86_64-linux-musl"
link     = "dynamic"
flags    = []

[build.phases]
configure = '''
rm -rf po
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_OPENCONNECT=OFF
'''
compile = "cmake --build build"
install = "DESTDIR=/out cmake --install build"

[deps]
build = ["cmake", "samurai", "python3", "pkgconf", "qtbase", "qtsvg", "dbus", "extra-cmake-modules",
  "qttools", "gettext-tiny", "mesa", "libdrm", "libxkbcommon", "wayland", "qtdeclarative",
  "networkmanager", "networkmanager-qt", "modemmanager", "modemmanager-qt",
  "qtkeychain", "qcoro-shared", "openssl", "glib-shared", "pcre2-shared", "libffi", "libudev-zero",
  "libplasma", "ksvg", "kcmutils", "kdeclarative", "kirigami", "kirigami-addons", "prison",
  "kquickcharts", "plasma-activities", "kpackage", "kpty",
  "kcolorscheme", "kcompletion", "kcoreaddons", "kdbusaddons", "kio", "ki18n", "kjobwidgets",
  "knotifications", "kservice", "solid", "kwidgetsaddons", "kwindowsystem",
  "kconfig", "kconfigwidgets", "kxmlgui", "kguiaddons", "kitemviews", "kcodecs", "kcrash",
  "karchive", "kbookmarks", "sonnet", "attica", "kglobalaccel", "kauth", "icu4c", "kiconthemes",
  "zlib-shared", "libX11", "xorgproto", "libXau", "libXdmcp", "libXext", "libXrender", "libXfixes",
  "libXi", "libxcb", "xcb-util", "xcb-util-keysyms", "xcb-util-wm", "xcb-util-image",
  "xcb-util-renderutil"]
