# kparts 6.27.0 — KDE Frameworks 6 (tier-4, ADR 0011). Componentes embebibles (visores/editores GUI).
# Precursor de aplicaciones y del stack Plasma. CMakeLists: Qt6 Core+Widgets+Xml.
# KF6 (REQUIRED): Config, CoreAddons, I18n, KIO, JobWidgets, Service, WidgetsAddons, XmlGui.
# KIO arrastra vía sus Config.cmake el CIERRE ENTERO tier-1..3 → listado exhaustivo abajo.
# Sin option(WITH_X11) en el árbol 6.27. ki18n → gettext-tiny.
name    = "kparts"
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/kparts-6.27.0.tar.xz"
sha256  = "0c2ce39f110e12ff0882c725bee7455b9085489c12d31eb4b3164b150fb8de24"

[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", "mesa", "libdrm", "libxkbcommon", "wayland", "gettext-tiny", "qtdeclarative", "qtsvg", "kio", "kbookmarks", "kcompletion", "kconfigwidgets", "kservice", "solid", "kwallet", "kjobwidgets", "kdbusaddons", "kcrash", "kguiaddons", "kiconthemes", "kitemviews", "kwindowsystem", "karchive", "kcodecs", "kcolorscheme", "ki18n", "kconfig", "kcoreaddons", "kwidgetsaddons", "sonnet", "ktextwidgets", "kglobalaccel", "kxmlgui", "libgcrypt", "libgpg-error", "util-linux", "openssl", "libX11", "xorgproto", "libXau", "libXdmcp", "libXext", "libXrender", "libXfixes", "libXi", "libxcb"]
