# modemmanager-qt 6.27.0 — KDE Frameworks 6 (ADR 0011). Wrapper Qt de la API D-Bus de ModemManager
# (KF6ModemManagerQt). Es REQUIRED en el find_package(KF6 ...) de plasma-nm (el applet de red), aunque el
# escritorio no tenga módem ⇒ hay que sellarlo igual.
#
# find_package(ModemManager 1.0 REQUIRED) resuelve contra la receta `modemmanager` (libmm-glib), habilitada
# por glib-shared. Qt REQUIRED: Core DBus Xml (todos sellados). Mismo caso que networkmanager-qt: la lib de
# ModemManager es dep de BUILD (headers/enums); el runtime del wrapper es D-Bus puro.
name    = "modemmanager-qt"
version = "6.27.0"

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

[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_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",
  "modemmanager", "glib-shared", "pcre2-shared", "libffi", "libudev-zero", "zlib-shared"]
