Skip to content

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

odin-adwaita

Odin bindings for libadwaita, generated with runic from the headers of the version Amber ships.

In a hurry? docs/CHEATSHEET.md has the calls a program makes, in the order it makes them, and docs/API.md lists every public declaration.

Bound version: 1.5.0 (Mint 22's libadwaita-1-dev (1.5.0)). 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.

Packages

adwaita/   package adwaita: generated by runic from adwaita/rune.yml; type_casts.odin by scripts/type-casts.sh

Use

Point a collection at this repo. The collection is named adwaita in every repo of the suite:

odin build . -collection:adwaita=../odin-adwaita
import "adwaita:adwaita"

A program links one GLib. No binding declares GLib, GObject or GIO itself; each imports them from odin-glib (the glib collection). 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.

Generate

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.

Regenerating

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.

Documents

Licence

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.

Releases

Packages

Used by

Contributors

Languages