# breeze-icons 6.27.0 — el tema de iconos Breeze (SVG). Sin él, plasmashell reporta "Icon theme breeze
# not found" y el escritorio se ve sin iconos. CMake/ECM; SKIP_SANDBOX + iconos SVG (no rasteriza).
name    = "breeze-icons"
version = "6.27.0"
license = "LGPL-3.0-or-later"

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

[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"
# generate-24px-versions.py necesita python-lxml (ausente en el sandbox); genera iconos 24px desde 22px.
# Lo neutralizamos (→ true) para instalar los SVG base + escalables sin esa dep. Deuda: faltan 24px generados.
sed -i 's|${Python_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/generate-24px-versions.py|true|' icons/CMakeLists.txt
sed -i 's|${Python_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/generate-24px-versions.py|true|' icons-dark/CMakeLists.txt 2>/dev/null || true
# ICONS_LIBRARY/BINARY_ICONS_RESOURCE OFF: no compila el .rcc (evita qt-rcc en el sandbox), instala SVGs.
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 \
  -DBUILD_TESTING=OFF -DBINARY_ICONS_RESOURCE=OFF -DSKIP_INSTALL_ICONS=OFF
'''
compile = "cmake --build build"
install = "DESTDIR=/out cmake --install build"

[deps]
build = ["cmake", "samurai", "python3", "pkgconf", "qtbase", "extra-cmake-modules", "mesa", "libdrm", "libxkbcommon", "wayland"]
