Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

odin-webkit

Odin bindings for WebKitGTK 6.0 and JavaScriptCore, 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: 2.52.6 (Mint 22's libwebkitgtk-6.0-dev (2.52.6)). 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

webkit/   package webkit: generated by runic from webkit/rune.yml
javascriptcore/   package javascriptcore: generated by runic from javascriptcore/rune.yml

Use

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

odin build . -collection:webkit=../odin-webkit
import "webkit:webkit"
import "webkit:javascriptcore"

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. WebKitGTK's headers are LGPL-2-or-later, apart from six BSD-licensed ones whose notices are kept in docs/LICENSE-webkitgtk-bsd.md. The choice is DECISIONS §4.

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 WebKitGTK 6.0 and JavaScriptCore, generated with runic

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages