GObject
Install
Section titled “Install”Each release
publishes the library for Linux with glibc as
maplibre-native-ffi-gobject-linux-gnu-<arch>.tar.gz. It needs GLib 2.80 or
later. Unpack it into the prefix of the
C library:
tar -xzf maplibre-native-ffi-gobject-linux-gnu-x64.tar.gz -C <prefix>On other platforms, build it from bindings/gobject into the prefix. This also
needs gobject-introspection 1.80, Vala, and meson 1.3
or later:
export PKG_CONFIG_PATH=<prefix>/share/pkgconfigmeson setup build bindings/gobject --prefix=<prefix> --libdir=libmeson install -C buildC programs include <maplibre-native-ffi.h> and link with pkg-config:
cc main.c $(pkg-config --cflags --libs maplibre-native-ffi-gobject-0) -o mainVala programs read the VAPI from the prefix:
valac --vapidir=<prefix>/share/vala/vapi --pkg maplibre-native-ffi-gobject-0 main.valaGJS and PyGObject load the typelib from <prefix>/lib/girepository-1.0, and
other GObject language bindings read MaplibreNativeFfi-0.gir from
<prefix>/share/gir-1.0. Unless the prefix is a system one, put those
directories on GI_TYPELIB_PATH and XDG_DATA_DIRS, and <prefix>/lib on the
library path:
import MaplibreNativeFfi from "gi://MaplibreNativeFfi?version=0";Asynchronous calls finish on the thread-default main context of the thread that starts them, so that thread must run its main loop.