# plasma-activities-stats 6.7.2 — Plasma (ADR 0011). Estadísticas de uso por actividad (PlasmaActivitiesStats),
# la usan Kickoff / lanzadores de plasma-workspace (documentos y apps recientes). CMakeLists: Qt6
# Core+DBus+Sql (Sql = QtSql de qtbase, sqlite) + KF6Config + PlasmaActivities (sellado) + Threads.
# find_package(Boost 1.49) SÓLO dentro de if(BUILD_TESTING) → con BUILD_TESTING=OFF, Boost NO es blocker.
# Sin X11 obligatorio. Construye limpio.
name    = "plasma-activities-stats"
version = "6.7.2"
license = "LGPL-2.1-or-later OR LGPL-3.0-or-later"

[source]
tarball = "https://download.kde.org/stable/plasma/6.7.2/plasma-activities-stats-6.7.2.tar.xz"
sha256  = "1928355838356bcd59790701cb8d470849b0dc4bec183e3eae26d12f789459b4"

[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_PYTHON_BINDINGS=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", "kconfig", "kcoreaddons", "plasma-activities", "qtdeclarative"]
