# systemsettings 6.7.2 — el CENTRO DE CONFIGURACIÓN de Plasma (el shell que aloja los KCMs).
# Campaña KDE (ADR 0011). Era el hueco más grande del escritorio: los KCMs se habían apagado para poder
# compilar plasma-desktop, y sin systemsettings no hay dónde alojarlos.
#
# Todas sus deps ya estaban selladas. KF6DocTools está en OPTIONAL_COMPONENTS (no hace falta pelearlo).
# KF6Runner (krunner) y PlasmaActivities son REQUIRED. Qt6 QuickWidgets viene en qtdeclarative.
name    = "systemsettings"
version = "6.7.2"

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

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

[build.phases]
configure = '''
rm -rf po doc
sed -i '/add_subdirectory(doc)/d' CMakeLists.txt
sed -i '/kdoctools_install/d' CMakeLists.txt
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", "python3", "pkgconf", "qtbase", "qtsvg", "dbus", "extra-cmake-modules",
  "qttools", "gettext-tiny", "mesa", "libdrm", "libxkbcommon", "wayland", "qtdeclarative",
  "wayland-protocols", "plasma-wayland-protocols", "qtwayland",
  "plasma-activities", "krunner", "kirigami", "kirigami-addons", "kpackage", "kcmutils", "kdeclarative",
  "libplasma", "ksvg",
  "kauth", "kcrash", "kitemviews", "kitemmodels", "ki18n", "kio", "kservice", "kiconthemes",
  "kwidgetsaddons", "kwindowsystem", "kxmlgui", "kdbusaddons", "kconfig", "kguiaddons", "kjobwidgets",
  "kcolorscheme", "kcompletion", "kcoreaddons", "kconfigwidgets", "kcodecs", "karchive", "kbookmarks",
  "sonnet", "attica", "icu4c", "solid", "kglobalaccel", "knotifications",
  "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"]
