# kwallet 6.27.0 — KDE Frameworks 6 (Capa 2 tier-3, ADR 0011). Billetera de credenciales. Patrón KF6: dynamic,
# wrapper zig que filtra -Wl,--fatal-warnings, CMAKE_PREFIX_PATH=/usr, ECM + qttools + dbus.
# Qt6 Core+DBus+Gui+Widgets. ki18n → gettext-tiny.
# Deps KF6 (del CMakeLists + subdirs kwalletd/kwalletbackend): kconfig, kwindowsystem, kcoreaddons, ki18n,
# kwidgetsaddons, kdbusaddons, kcrash, knotifications. Todas selladas (tier-1/tier-2).
# TIENE código X11 tras option(WITH_X11 ON) (KWindowSystem::isPlatformX11) → -DWITH_X11=OFF.
# SÓLO LIBRERÍA CLIENTE (libKF6Wallet.so, lo que kio/apps linkean). Daemons DIFERIDOS por deps externas:
#  - BUILD_KSECRETD=OFF: ksecretd exige Qca-qt6 REQUIRED 2.3.1 (QCA no sellado).
#  - BUILD_KWALLETD=OFF: el daemon runtime hace pkg_check_modules(libsecret-1 REQUIRED) (bridge
#    org.freedesktop.secrets, arrastra glib/gobject; deuda Capa 0). BUILD_KWALLET_QUERY=OFF (tool del daemon).
# La librería cliente NO necesita libsecret/QCA. libgcrypt(PIC) queda en deps para el backend blowfish del
# daemon cuando se reactive. Gpgmepp opcional (GPG support off). Reactivar daemon = sellar libsecret+QCA.
name    = "kwallet"
version = "6.27.0"

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

[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 -DBUILD_DESIGNERPLUGIN=OFF \
  -DWITH_X11=OFF -DBUILD_KSECRETD=OFF -DBUILD_KWALLETD=OFF -DBUILD_KWALLET_QUERY=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", "kconfig", "kwindowsystem", "kcoreaddons", "ki18n", "kwidgetsaddons", "kdbusaddons", "kcrash", "knotifications", "qtdeclarative", "libgcrypt"]
