Skip to content

Instantly share code, notes, and snippets.

@mzabaluev
Last active October 6, 2015 09:43
Show Gist options
  • Save mzabaluev/ffbe78e6ef043bad6df5 to your computer and use it in GitHub Desktop.
Save mzabaluev/ffbe78e6ef043bad6df5 to your computer and use it in GitHub Desktop.
Setting up gobject-introspection and glib from git for local development

Setting up and building

Assuming glib and gobject-introspection are checked out from git into the current directory.

mkdir ~/devinstall
cd glib
NOCONFIGURE=1 ./autogen.sh  # run once on a fresh checkout
./configure --prefix=$HOME/devinstall
make
make install

# this is needed for both ./configure and the GI tools,
# otherwise the system includes will be used:
export PKG_CONFIG_PATH=$HOME/devinstall/lib/pkgconfig

cd ../gobject-introspection
NOCONFIGURE=1 ./autogen.sh  # run once on a fresh checkout
./configure --prefix=$HOME/devinstall --with-glib-src=../glib
make
make install  # if need to work with the tools out of tree

The libraries, headers, and tools will be available under prefix directory ~/devinstall.

Editing annotations to test changes

In the source tree of gobject-introspection, extracts of annotated comments from GLib source files, used to build the GIR files in-tree, are maintained as gir/*.c. Any changes to annotations in the *.c sources of the glib source tree need to be merged into the respective gir/*.c shims so that the changes can be observed in the generated GIR. There is a script to automate that:

cd gobject-introspection/misc
./update-glib-annotations.py ../../glib
cd ..
make *.gir

The location of GLib header files, on the other hand, is obtained from pkg-config. After changes are made to the headers in the glib source tree, install them with make install so that the gobject-introspection build sees the updated headers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment