Odin bindings for Pango and PangoCairo, generated with runic from the headers of the version Amber ships.
In a hurry? docs/CHEATSHEET.md has the calls a program makes, in order, and the rules worth remembering.
Bound version: 1.52.1 (Mint 22's libpango1.0-dev (1.52.1)). A test compares the library's version macros with the version recorded in this repo, so a header bump that is not recorded fails the build.
pango/ package pango: generated by runic from pango/rune.yml, plus hand.odin (structs with bit fields)
pangocairo/ package pangocairo: generated by runic from pangocairo/rune.yml
Point a collection at this repo. The collection is named pango in every repo of the suite:
odin build . -collection:pango=../odin-pango
import "pango:pango"
import "pango:pangocairo"A program links one GLib. No binding declares GLib, GObject or GIO itself; each imports
them from odin-glib (the glib collection); pangocairo imports cairo from odin-cairo (the cairo collection, CAIRO ?= ../odin-cairo). Two bindings declaring the same C function with
their own types fail the build ("Redeclaration of foreign procedure … with different type
signatures"). Makefiles take sibling paths as ?= variables (GLIB ?= ../odin-glib).
The output is committed: consumers need neither runic nor the headers to build, only the shared libraries to link.
make deps # runic, shellcheck, the -dev packages
make generate # runic, then the post-processing rules (scripts/)
make ci # check, test, lint
Hand fixes to generated output are listed in docs/PATCHED.md, each pinned
by a typed variable in the package's patched.odin, so a regeneration that drops one fails
to compile.
make generate needs runic, pinned in odin-glib's docs/DECISIONS.md §2: clone
Hyperquader-Coders/runic beside this repo, check
out amber-patched and run runic/amber-build.sh; the Makefile finds ../runic/build/runic.
The bindings are generated with runic 0.8 from Amber's fork (../runic, branch amber-patched,
commit ddc6f8f: upstream 0.8 9bd8391, the Amber build script and Odin pin, and two patches:
declared array parameters and skipped va_list procedures), built by runic/amber-build.sh with
the Odin its own runic/mise.toml pins. make generate runs runic through scripts/generate.sh,
then scripts/postprocess.sh (the remaining fixes). Never edit a generated .odin file by hand:
the next make generate undoes it. The config parameters: declared in each rune.yml makes
parameters single objects unless arrays: lists them; a va_list procedure is skipped, with a
comment in the output. make lint fails (scripts/check-generated.sh) if a [^] outside the
lists, a [^]^T outside the list, or a va_list procedure appears.
- docs/SPEC.md: package layout and the API surface
- docs/ARCHITECTURE.md: generation, patches, collections
- docs/DECISIONS.md: settled choices
- MoSCoW.md: open work
- diags/: the dependency graph
LGPL-2.1-or-later, the licence of the library bound; see LICENSE.
Copyright © 2025 Andre Bremer hyperquader@gmail.com, https://hyperquader.com, for the generation scripts, post-processing rules, helper code, tests and documentation. Copyright in the library's headers, from which the bindings are generated, stays with its authors.
The runic configuration starts from PucklaJ/odin-gtk (MIT, Copyright 2024 Kassandra Pucher); its notice is kept in docs/LICENSE-odin-gtk.md.