# libX11 1.8.10 — la Xlib clásica (libX11.so + libX11-xcb.so). Cima de la Capa 0 X11 de la campaña KDE
# (ADR 0011): muchos componentes de Qt/KDE y libs GUI todavía la enlazan por encima de libxcb. Autotools;
# consume xorgproto (headers + keysymdef), xtrans, libxcb (>=1.11) y sus .pc. Sin docs (specs off, evita
# xmlto/fop/xsltproc) y sin xf86bigfont. En el build genera tablas de keysyms con un helper C compilado
# nativo (build==host musl ⇒ CC_FOR_BUILD=CC, sin cross real). Linking dinámico.
name    = "libX11"
version = "1.8.10"
license = "MIT"

[source]
tarball = "https://www.x.org/releases/individual/lib/libX11-1.8.10.tar.xz"
sha256  = "2b3b3dad9347db41dca56beb7db5878f283bde1142f04d9f8e478af435dfdc53"

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

[build.phases]
# PKG_CONFIG_PATH: xproto/xextproto/kbproto.pc en /usr/share/pkgconfig; xcb/xtrans/xau.pc en /usr/lib.
# --disable-specs + --without-xmlto/fop/xsltproc: sin documentación (toolchain sin esos generadores).
configure = '''
PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/share/pkgconfig \
./configure --prefix=/usr --disable-static --enable-shared \
  --disable-xf86bigfont --disable-specs \
  --without-xmlto --without-fop --without-xsltproc
'''
compile   = "make -j\"$(nproc)\""
install   = "make install DESTDIR=/out"

[deps]
# libXau+libXdmcp: libxcb.pc los declara en Requires.private ⇒ pkg-config los exige transitivamente al
# resolver xcb (sin sus .pc: "Package 'xdmcp', required by 'xcb', not found"). Patrón .pc→[deps].build.
build = ["pkgconf", "python3", "util-macros", "xorgproto", "xcb-proto", "libxcb", "xtrans", "libXau", "libXdmcp"]
