# kglobalacceld 6.7.2 — KDE Plasma (Capa Plasma-foundation, ADR 0011). Daemon de atajos globales de teclado.
# Patrón KF6/ECM: dynamic, wrapper zig, ECM + qttools + dbus.
# Del CMakeLists (6.7.2): Qt6 DBus+Gui+Widgets (+GuiPrivate ≥6.10). KF6 REQUIRED:
# Config, CoreAddons, Crash, DBusAddons, WindowSystem, GlobalAccel, Service, KIO, JobWidgets.
# option(WITH_X11 ... ON) por defecto → APAGADO con -DWITH_X11=OFF (sin cadena xcb X11 runtime).
# Arrastra el cierre de kio (tier-1/2/3 + kio + libgcrypt/libgpg-error/util-linux/openssl).
name    = "kglobalacceld"
version = "6.7.2"
license = "GPL-2.0-or-later"

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

[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 -DWITH_X11=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", "gettext-tiny", "qtdeclarative", "qtshadertools", "qtlanguageserver", "kconfig", "kcoreaddons", "kcrash", "kdbusaddons", "kwindowsystem", "kglobalaccel", "kservice", "kio", "kjobwidgets", "ki18n", "kcodecs", "kconfigwidgets", "kwidgetsaddons", "kcolorscheme", "kcompletion", "kitemviews", "kguiaddons", "solid", "karchive", "sonnet", "ktextwidgets", "kbookmarks", "kxmlgui", "kiconthemes", "kwallet", "kdnssd", "kjobwidgets", "libgcrypt", "libgpg-error", "util-linux", "openssl", "zlib", "zstd", "kwindowsystem", "libxcb", "libX11", "xcb-util", "xcb-util-keysyms", "xorgproto", "util-macros"]
