Odin Bindings to GTK4, libadwaita and associated libraries generated using runic
| Library | Path | License |
|---|---|---|
| glib | glib |
LGPL 2.1 |
| gobject | glib/gobject |
LGPL 2.1 |
| gmodule | glib/gmodule |
LGPL 2.1 |
| gio | glib/gio |
LGPL 2.1 |
| girepository | glib/girepository |
LGPL 2.1 |
| gdk-pixbuf | gdk-pixbuf |
LGPL 2.1 |
| pango | pango |
LGPL 2 |
| pangocairo | pango/pangocairo |
LGPL 2 |
| cairo | cairo |
LGPL 2.1 |
| graphene | graphene |
MIT |
| gtk | gtk |
LGPL 2.1 |
| gtk4-layer-shell | gtk/layer-shell |
MIT |
| libadwaita | adwaita |
LGPL 2.1 |
DANGER: Variadic functions that must be terminated with NULL (nil in odin), like adwaita.show_about_dialog, need to be treated with caution or they will segfault. Strings need to be explicitely converted to cstring, arrays need to be past as pointers arr -> &arr[0]. There may even be more things you need to pay attention to, therefore I suggest you to avoid them and use the non variadic options
| OS | Arch |
|---|---|
| Linux | x86_64, arm64 |
| Windows | x86_64 |
You could get other UNIX-like systems to work if you put in some effort, but anything else but 64-Bit won't work, since there are specific workarounds used for 64-Bit.
The gtk package on different linux distributions:
| Distribution | Package Name |
|---|---|
| Arch Linux | gtk4, gtk4-layer-shell |
| Ubuntu | libgtk-4-dev, libgtk4-layer-shell-dev |
| Alpine Linux | gtk4.0-dev, gtk4-layer-shell-dev |
The libadwaita package on different linux distributions:
| Distribution | Package Name |
|---|---|
| Arch Linux | libadwaita |
| Ubuntu | libadwaita-1-dev |
| Alpine Linux | libadwaita-dev |
Binaries can be built without any further effort. The repository provides all the different library files (which have been provided by gvsbuild) by itself. But to actually run the applications, the dynamic libraries are necessary. They can be downloaded using the following just recipe:
just install-windows-runtime INSTALL_DIR
Provide a directory for INSTALL_DIR and all the dynamic library files of the entire gtk stack will be installed into it. If you are having trouble installing just on windows, you can install it using winget install --id Casey.Just --exact or by downloading the binary from the releases page.
The bindings are already generated and can be used as is. This is just to document how to generate bindings for future versions.
The setup dependencies are:
- just
- meson
- ninja
- python
- gcc
- harfbuzz
- vulkan-headers
To install them on archlinux:
sudo pacman -S --needed base-devel just meson ninja python harfbuzz vulkan-headers gtk4 gtk4-layer-shell libadwaita glib2-devel shaderc wayland-protocols
on ubuntu:
sudo apt install -y build-essential just meson ninja-build python3 libharfbuzz-dev libvulkan-dev
on alpine:
sudo apk add just meson samurai python3 build-base harfbuzz-dev vulkan-headers
First make sure that the submodules are checked out, if they aren't you can do it like this:
git submodule update --init
Then execute:
just setup
just bindings