Skip to content

PucklaJ/odin-gtk

Repository files navigation

Odin GTK

Odin Bindings to GTK4, libadwaita and associated libraries generated using runic

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

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

Supported Platforms

OS Arch
Linux x86_64, arm64

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.

Usage

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

By default all the libraries will be linked dynamically. Installing the gtk package of your linux distribution should be fine. Library files for some wrappers are provided, therefore the package can be used as is and does not need any further effort to work on the supported platforms. But in case you want to rebuild them you need to follow these instructions:

The build 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

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 init
git submodule update

Then execute:

just setup && just wrapper