sergio/takana
> Una distribución Linux construida con un laboratorio funcional y hermético en el > sótano, y una terminal mutable, clásica y anárquica en el piso de arriba — diseñada > desde el suelo para que una IA programadora entienda, modifique y co…
harkaq: revertir busybox (era runtime base, rompía builds) + coordinar el §3 con Fable 5
1# gtk4-hello — app GTK4 mínima de VALIDACIÓN: prueba que libgtk-4.a (static) es linkeable de verdad.
2# Reutiliza el tarball de GTK4 solo como acarreo de [source] (lo ignora); escribe su propio hello.c y
3# lo linkea ESTÁTICO contra todo el cierre GTK4 vía `pkg-config --static gtk4`. Si sella, el toolkit
4# de GUI del lab es usable por apps, no solo "compila". deps = cierre .pc completo + gtk4.
5name = "gtk4-hello"
6version = "4.18.6"
7
8[source]
9tarball = "https://download.gnome.org/sources/gtk/4.18/gtk-4.18.6.tar.xz"
10sha256 = "e1817c650ddc3261f9a8345b3b22a26a5d80af154630dedc03cc7becefffd0fa"
11
12[build]
13compiler = "zig-cc"
14target = "x86_64-linux-musl"
15link = "static"
16
17[build.phases]
18# no-op: el tarball trae meson.build y el lab inyectaría `meson setup` por defecto si omito configure.
19configure = "true"
20compile = '''
21cat > hammer_hello.c <<'CEOF'
22#include <gtk/gtk.h>
23static void activate(GtkApplication *app, gpointer user_data) {
24 GtkWidget *win = gtk_application_window_new(app);
25 gtk_window_set_title(GTK_WINDOW(win), "Hola desde hammer");
26 gtk_window_set_default_size(GTK_WINDOW(win), 360, 220);
27 GtkWidget *label = gtk_label_new("GTK4 static-musl ✓ (zig cc)");
28 gtk_window_set_child(GTK_WINDOW(win), label);
29 gtk_window_present(GTK_WINDOW(win));
30}
31int main(int argc, char **argv) {
32 GtkApplication *app = gtk_application_new("org.hammer.hola", G_APPLICATION_DEFAULT_FLAGS);
33 g_signal_connect(app, "activate", G_CALLBACK(activate), NULL);
34 int status = g_application_run(G_APPLICATION(app), argc, argv);
35 g_object_unref(app);
36 return status;
37}
38CEOF
39# gtk4.pc NO declara Libs.private (asume link dinámico contra libgtk-4.so); para ESTÁTICO hay que sumar
40# las privadas que gdk/gsk linkean directo (harfbuzz-subset, epoxy, wayland, xkbcommon, tiff, jpeg).
41export PKG_CONFIG_PATH=/usr/lib/pkgconfig
42zig cc -mcpu=baseline -static hammer_hello.c -o gtk4-hello $(pkg-config --cflags --libs --static gtk4 harfbuzz-subset epoxy xkbcommon wayland-client wayland-egl libtiff-4 libjpeg cairo-script-interpreter)
43'''
44install = "mkdir -p /out/usr/bin && cp gtk4-hello /out/usr/bin/gtk4-hello"
45
46[deps]
47build = ["pkgconf", "gtk4", "pango", "gdk-pixbuf", "cairo", "graphene", "glib", "harfbuzz", "fribidi", "fontconfig", "freetype", "pixman", "libpng", "expat", "libjpeg-turbo", "libtiff", "libepoxy", "wayland", "libxkbcommon", "libdrm", "pcre2", "libffi", "zlib", "mesa"]