# knotifyconfig 6.27.0 — KDE Frameworks 6 (Capa 2, dep de plasma-desktop). Patrón KF6 (dynamic, wrapper
# zig filtra -Wl,--fatal-warnings, ECM + qttools). Deps KF6: kcompletion, kconfig, kconfigwidgets,
# kcoreaddons, ki18n, knotifications.
name    = "knotifyconfig"
version = "6.27.0"
license = "LGPL-2.1-or-later OR LGPL-3.0-or-later"

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

[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
'''
compile = "cmake --build build"
install = "DESTDIR=/out cmake --install build"

[deps]
build = ["cmake", "samurai", "python3", "pkgconf", "qtbase", "dbus", "extra-cmake-modules", "qttools",
  "gettext-tiny", "mesa", "libdrm", "libxkbcommon", "wayland", "qtdeclarative",
  "qtmultimedia", "libcanberra",
  "kcompletion", "kconfig", "kconfigwidgets", "kcoreaddons", "ki18n", "knotifications",
  "kio", "kservice", "kbookmarks", "kjobwidgets", "solid", "kwindowsystem", "kcrash",
  "kdbusaddons", "karchive", "kwidgetsaddons", "kitemviews", "kcodecs", "kcolorscheme",
  "kguiaddons", "kiconthemes", "kxmlgui", "kitemmodels", "kparts", "ktextwidgets", "sonnet",
  "kglobalaccel", "kauth",
  "libX11", "xorgproto", "libXau", "libXdmcp", "libXext", "libXrender", "libXfixes", "libXi",
  "libxcb", "xcb-util", "xcb-util-keysyms", "xcb-util-wm", "xcb-util-image", "xcb-util-renderutil"]
