# qt6-qtsvg 6.11.1 — soporte SVG (QtSvg). Dep de qtdeclarative y de temas/iconos KDE. Campaña KDE
# (ADR 0011), Capa 1. Patrón Qt del gate H-Qt (dinámico, wrappers zig, Qt6 sellado vía PREFIX_PATH).
name    = "qt6-qtsvg"
version = "6.11.1"
license = "LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only"

[source]
tarball = "https://download.qt.io/official_releases/qt/6.11/6.11.1/submodules/qtsvg-everywhere-src-6.11.1.tar.xz"
sha256  = "7f3cf02f4824bf03c2c5859ea6db173bf1482a1daf24e6cdf7bc78cfa26a8a94"

[build]
compiler = "zig-cc"
target   = "x86_64-linux-musl"
link     = "dynamic"
flags    = []

[build.phases]
configure = '''
ZW="$PWD/.zwrap"; mkdir -p "$ZW"
printf '#!/bin/sh\nexec /opt/zig/zig cc -mcpu=baseline "$@"\n'  > "$ZW/cc"
printf '#!/bin/sh\nexec /opt/zig/zig c++ -mcpu=baseline "$@"\n' > "$ZW/cxx"
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_INTERPROCEDURAL_OPTIMIZATION=OFF -DCMAKE_PREFIX_PATH=/usr \
  -DINSTALL_BINDIR=lib/qt6/bin -DINSTALL_PUBLICBINDIR=bin -DINSTALL_LIBEXECDIR=lib/qt6/libexec \
  -DINSTALL_ARCHDATADIR=lib/qt6 -DINSTALL_DATADIR=share/qt6 -DINSTALL_INCLUDEDIR=include/qt6 \
  -DINSTALL_MKSPECSDIR=lib/qt6/mkspecs \
  -DQT_BUILD_EXAMPLES=OFF -DQT_BUILD_TESTS=OFF
'''
compile = "cmake --build build"
install = "DESTDIR=/out cmake --install build"

[deps]
build = ["cmake", "samurai", "python3", "pkgconf", "qtbase", "mesa", "libdrm", "libxkbcommon"]
