# kscreen 6.7.2 — gestión de pantallas de Plasma (kscreen KDED daemon + KCM de monitores + OSD).
# Campaña KDE (ADR 0011). Deps ya selladas: KF6Screen (libkscreen), Plasma/PlasmaQuick (libplasma),
# LayerShellQt (layer-shell-qt), KCMUtils, Svg (ksvg). KF6ImageFormats es CONFIG opcional → se salta.
name    = "kscreen"
version = "6.7.2"

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

[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", "kitemmodels", "plasma5support",
  "libkscreen", "libplasma", "layer-shell-qt", "ksvg", "kcmutils", "kdeclarative", "kirigami",
  "kpackage", "plasma-activities",
  "kconfig", "kdbusaddons", "ki18n", "kxmlgui", "kcrash",
  "kcolorscheme", "kcompletion", "kcoreaddons", "kjobwidgets", "kservice", "kconfigwidgets",
  "kguiaddons", "kitemviews", "kcodecs", "karchive", "kbookmarks", "sonnet", "attica", "kauth",
  "icu4c", "kiconthemes", "kio", "kwindowsystem", "solid", "kglobalaccel", "kwidgetsaddons",
  "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"]
