Skip to content

Update pango/cairo stack to current stable versions (#613) - #615

Open
jeroen wants to merge 1 commit into
r-wasm:mainfrom
jeroen:pango
Open

Update pango/cairo stack to current stable versions (#613)#615
jeroen wants to merge 1 commit into
r-wasm:mainfrom
jeroen:pango

Conversation

@jeroen

@jeroen jeroen commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

This PR tries to fix #613 by bumping the GNOME text stack past the legacy PangoFcShapeEngine subsystem: Pango ≥ 1.44 deletes shape engines and shapes inline via harfbuzz; the static GType/module-map state that's been fragmenting under Emscripten's duplicate-symbol merging.

All of pango/glib/cairo/harfbuzz/pixman/fribidi have moved to meson, so a small wrapper (libs/tools/gen-meson-cross.sh) emits an Emscripten meson cross-file from the make-level CFLAGS/LDFLAGS, and each recipe invokes emconfigure meson setup so pkg-config still finds the sysroot .pc files.

@jeroen
jeroen force-pushed the pango branch 5 times, most recently from 218ddf6 to 504d526 Compare June 16, 2026 13:15
Bump the GNOME text stack past the 2017/2018 era versions so that pango
no longer ships the legacy PangoFcShapeEngine subsystem. That static
GType/module registry is what fragments under Emscripten's duplicate-
symbol merging when both base R's cairo.so and the magick package's
side module statically embed pango -- the failure mode reported in r-wasm#613
('Pango-WARNING ** shaping failure ... text="m"' followed by a wasm
"remainder by zero" trap inside cairo).

Pango >= 1.44 deletes shape engines and shapes inline via harfbuzz, so
the version bump removes the failing code path.

Version map:
- pango     1.40.14 -> 1.56.4
- glib      2.56.4  -> 2.84.4
- harfbuzz  7.2.0   -> 11.5.0
- cairo     1.14.12 -> 1.18.4
- pixman    0.38.4  -> 0.46.4
- fribidi   1.0.12  -> 1.0.16
- expat     2.5.0   -> 2.7.2

All of pango/glib/cairo/harfbuzz/pixman/fribidi have moved to meson, so
a small wrapper (libs/tools/gen-meson-cross.sh) emits an Emscripten
meson cross-file from the make-level CFLAGS/LDFLAGS, and each recipe
invokes `emconfigure meson setup` so pkg-config still finds the sysroot
.pc files. Dockerfile now installs meson + ninja-build.

The legacy patch trees under patches/{cairo-1.14.12,glib-2.56.4,
pango-1.40.14}/ are dropped: they all targeted source layouts that no
longer apply, and the glib autoconf hackery is replaced by meson option
flags + cross-file properties. fontconfig and freetype stay where they
were.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Base R png() hangs when pango is loaded from a package

1 participant