Skip to content

About

Odin bindings for GtkSourceView 5, generated with runic

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

odin-gtksourceview

Odin bindings for GtkSourceView 5, 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.

Bound version: 5.12.0 (Mint 22's libgtksourceview-5-dev (5.12.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

gtksourceview/   package gtksourceview: generated by runic from gtksourceview/rune.yml

Use

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

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

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 ?= $(AMBER_ROOT)/odin-glib, AMBER_ROOT being the folder above this checkout unless it is set).

siblings.txt names the sibling bindings this one imports, one a line as AMBER_ROOT,<GitHub URL>; make setup (or make init-siblings) clones the missing ones beside this checkout, in $AMBER_ROOT.

The output is committed: consumers need neither runic nor the headers to build, only the shared libraries to link.

Generate

make setup      # the system packages (sudo apt), ols.json, the toolchain report
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 $(AMBER_ROOT)/runic/build/runic.

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.

About

Odin bindings for GtkSourceView 5, generated with runic

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages