# gtk4 4.18.6 — VARIANTE ISLA DINÁMICA (SHADOW de recipes/gtk4.toml estática).
# El toolkit. gnome-shell/mutter lo usan y su JS (gjs) dlopea Gtk-4.0/Gdk-4.0/Gsk-4.0.typelib en runtime
# ⇒ gtk4 DEBE producir esos typelibs + libgtk-4.so real. Es la receta más dura de onda 2: introspection
# arrastra el cierre transitivo entero (wayland/libdrm/mesa/libepoxy). Ver [[gnome-introspection-dinamica]].
#
# vs corpus (mundo estático), REVERTIDO:
#  · SIN el sed `libgtk_dep→libgtk_static_dep`: en la isla las tools linkean libgtk-4.so (natural).
#  · SIN el fat-archive de install: era un hack para que `-static -lgtk-4` linkeara; los consumidores de
#    la isla (mutter/gnome-shell) toman la .so. meson instala libgtk-4.so directo.
#  · link=dynamic, default_library=both, introspection=ENABLED, SIN --prefer-static.
#  · deps pango/gdk-pixbuf/graphene resuelven a las ISLAS (shadow) ⇒ sus typelibs+.so visibles al scan.
#
# ⚠ ITERATIVA: el scanner construye un dumper que linkea libgtk-4.so + todo su cierre. Las libs C del
# corpus (cairo/harfbuzz/wayland/libdrm/mesa/libepoxy) siguen ESTÁTICAS embebidas — si el scan falla por
# símbolo/estado duplicado, escalar la lib culpable a su propia isla. Esperar walls en el worker.
name    = "gtk4"
version = "4.18.6"
license = "LGPL-2.1-or-later"

[source]
tarball = "https://download.gnome.org/sources/gtk/4.18/gtk-4.18.6.tar.xz"
sha256  = "e1817c650ddc3261f9a8345b3b22a26a5d80af154630dedc03cc7becefffd0fa"

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

[build.phases]
configure = "PKG_CONFIG_PATH=/usr/lib/pkgconfig PYTHONPATH=/usr/lib/python3.12/site-packages meson setup output --prefix=/usr --buildtype=release --wrap-mode=nodownload -Ddefault_library=both -Dwayland-backend=true -Dx11-backend=false -Dbroadway-backend=false -Dwin32-backend=false -Dmacos-backend=false -Dvulkan=disabled -Dintrospection=enabled -Dbuild-demos=false -Dbuild-testsuite=false -Dbuild-tests=false -Dbuild-examples=false -Dmedia-gstreamer=disabled -Dprint-cups=disabled -Dprint-cpdb=disabled -Dcloudproviders=disabled -Dsysprof=disabled -Dtracker=disabled -Dcolord=disabled -Df16c=disabled -Ddocumentation=false -Dman-pages=false -Dc_args=-Wno-error=date-time"
compile   = "PYTHONPATH=/usr/lib/python3.12/site-packages ninja -C output"
install   = "PYTHONPATH=/usr/lib/python3.12/site-packages DESTDIR=/out meson install -C output --no-rebuild"

# glib-introspected + gobject-introspection = la maquinaria de typelibs. pango/gdk-pixbuf/graphene =
# ISLAS (shadow) con sus typelibs. El resto = cierre C estático del corpus (wayland/mesa/libdrm/etc.).
[deps]
# Cierre C DINÁMICO (-shared) + gi-foreign-girs (cairo-1.0/etc.): mismo patrón que gjs/pango. pango/
# gdk-pixbuf/graphene/harfbuzz resuelven a las ISLAS (shadow). wayland/mesa/libdrm/libepoxy/libjpeg/
# libtiff quedan corpus (se embeben si son PIC; si no, el worker pide su -shared).
# libtiff-shared/libjpeg-turbo-shared: gtk4 EXIGE libtiff-4/libjpeg (loaders gdktiff/gdkjpeg, sin
# required:false ⇒ no se pueden quitar). El .a estático arrastra zlib no resuelto ('undefined inflate')
# ⇒ variantes .so (NEEDED libz.so/libjpeg.so). libtiff-shared autorado; libjpeg-turbo-shared de KDE.
build = ["meson", "samurai", "python3", "py3-setuptools", "pkgconf", "gi-foreign-girs", "glib", "glib-introspected", "gobject-introspection", "cairo-shared", "pango", "gdk-pixbuf", "graphene", "libepoxy", "wayland", "wayland-protocols", "libxkbcommon", "libdrm", "fontconfig-shared", "harfbuzz", "fribidi", "libpng-shared", "pixman", "freetype-shared", "expat", "libffi", "pcre2", "zlib-shared", "libtiff-shared", "libjpeg-turbo-shared", "mesa"]
