diff --git a/recipes/cairo-ctime-r.patch b/recipes/cairo-ctime-r.patch new file mode 100644 index 00000000..9abb7b05 --- /dev/null +++ b/recipes/cairo-ctime-r.patch @@ -0,0 +1,44 @@ +cairo bajo zig-cc/musl: dos parches para poder construir la librería en la granja. + +(1) meson.build — el loop `foreach name : check_funcs` corre `cc.has_function('ctime_r')` SIN +prefix de header ⇒ meson genera un prototipo desnudo `char ctime_r();` que bajo zig-cc y gcc +sobre musl choca con el builtin y el probe FALLA. Entonces cairo-ps-surface.c:105 +(`#ifndef HAVE_CTIME_R`) define un fallback `static char *ctime_r(...)` que colisiona con la +declaración no-static de (presente porque el build define _GNU_SOURCE) ⇒ error duro. +musl SIEMPRE provee ctime_r; forzamos el define tras el loop (pasar _GNU_SOURCE en c_args NO +alcanza: el probe es de prototipo desnudo, ignora el header). + +(2) util/meson.build — los ejecutables util (csi-* del intérprete cairo-script, cairo-trace) no +linkean libpixman-1.a bajo la estrategia `no_fallback` de zig-cc. Son herramientas de dev, no la +librería que pango/gtk4 consumen. Saltamos esos subdirs; libcairo.a se construye e instala igual. + +diff -Naur a/meson.build b/meson.build +--- a/meson.build ++++ b/meson.build +@@ -708,4 +708,9 @@ + endif + endforeach + ++# hammer: has_function('ctime_r') sin prefix falla bajo zig/gcc+musl (prototipo desnudo choca ++# con el builtin); musl SIEMPRE provee ctime_r => forzar y evitar el fallback static de ++# cairo-ps-surface.c:105 que colisiona con la declaracion no-static de . ++conf.set('HAVE_CTIME_R', 1) ++ + conf.set('HAVE_STRNDUP', cc.has_function('strndup', prefix : '#include ')) +diff -Naur a/util/meson.build b/util/meson.build +--- a/util/meson.build ++++ b/util/meson.build +@@ -7,10 +7,10 @@ + endif + +-if conf.get('CAIRO_HAS_INTERPRETER', 0) == 1 ++if false # hammer: saltar ejecutables csi-* (interprete); link de pixman falla bajo zig no_fallback + subdir('cairo-script') + else + libcairoscript_dep = dependency('', required: false) + endif + +-if conf.get('CAIRO_HAS_TRACE', 0) == 1 ++if false # hammer: saltar cairo-trace (mismo link de pixman bajo zig) + subdir('cairo-trace') + diff --git a/recipes/cairo.toml b/recipes/cairo.toml index c703451b..e769aa68 100644 --- a/recipes/cairo.toml +++ b/recipes/cairo.toml @@ -4,6 +4,8 @@ version = "1.18.4" [source] tarball = "https://gitlab.freedesktop.org/cairo/cairo/-/archive/1.18.4/cairo-1.18.4.tar.bz2" sha256 = "6d9281e786fd289d382324d4588d59973a36911e1865b40e64f9ec39936ceba8" +# fuerza HAVE_CTIME_R: el probe has_function de meson falla bajo zig/gcc+musl (ver el .patch) +patches = ["cairo-ctime-r.patch"] [build] compiler = "zig-cc" target = "x86_64-linux-musl"