Compiling with Libhandy

If you need to build Libhandy, get the source from here and see the file.

Using pkg-config

Like other GNOME libraries, Libhandy uses pkg-config to provide compiler options. The package name is libhandy-1.

If you use Automake/Autoconf, in your script, you might specify something like:


Or when using the Meson build system you can declare a dependency like:


The 1 in the package name is the “API version” (indicating “the version of the Libhandy API that first appeared in version 1”) and is essentially just part of the package name.

Bundling the library

As Libhandy uses the Meson build system, bundling it as a subproject when it is not installed is easy. Add this to your

libhandy_dep = dependency('libhandy-1', version: '>= 1', required: false)
if not libhandy_dep.found()
  libhandy = subproject(
    install: false,
    default_options: [
  libhandy_dep = libhandy.get_variable('libhandy_dep')

Then add Libhandy as a git submodule:

git submodule add subprojects/libhandy

To bundle the library with your Flatpak application, add the following module to your manifest:

  "name" : "libhandy",
  "buildsystem" : "meson",
  "config-opts": [
  "sources" : [
      "type" : "git",
      "url" : ""

Building on macOS

To build on macOS you need to install the build-dependencies first. This can e.g. be done via brew:

brew install pkg-config gtk+3 adwaita-icon-theme meson glade gobject-introspection vala

After running the command above, one may now build the library:

git clone
cd libhandy
meson . _build
ninja -C _build test
ninja -C _build install

Working with the library on macOS is pretty much the same as on Linux. To link it, use pkg-config:

gcc $(pkg-config --cflags --libs gtk+-3.0) $(pkg-config --cflags --libs libhandy-1) main.c -o main