(Prelude: I’m trying to find the proper forum with my problem. I have tried stackoverflow with the same question, but it seems no one is interested in GTK details there, so I try my luck here.)
I’m trying to compile and install the GTK 3 library from source packages using a custom built GCC into a separate installation directory on linux (mint 18.3). Since I couldn’t find any definitive guide for this, I started with common sense approach. (Is there anything to read? I couldn’t find detailed instructions by using google.)
First I have compiled and installed GCC (10.2.0, tested and working), then I started to install all the tools and libraries needed by GTK. (cmake, ninja, meson, gettext, glib, pixman, cairo, gobject-introspection, etc). Environmental variables (CC, CXX, PATH, PKG_CONFIG_PATH, etc) are carefully set to point to the new tools and installation directories.
After spending significant effort on combing the details, cmake, ninja, meson, gettext, glib, pixman, and cairo have been successfully compiled. However, I can’t compile the gobject-introspection library. After successful configuration by meson it fails with the following mystique error message:
[78/168] Generating gir-glib with a custom command
FAILED: gir/GLib-2.0.gir
/home/username/temp/gtk-install/gtk-3.24.23/source/native-builddir/gobject-introspection/tools/g-ir-scanner --output=gir/GLib-2.0.gir --no-libtool --quiet --reparse-validate --add-include-path /home/username/temp/gtk-install/gtk-3.24.23/source/native-builddir/gobject-introspection/gir --add-include-path /home/username/temp/gtk-install/gtk-3.24.23/source/gobject-introspection-1.66.0/gir --identifier-prefix=G --symbol-prefix=g --symbol-prefix=glib --c-include=glib.h --namespace=GLib --nsversion=2.0 --library=glib-2.0 --library=gobject-2.0 --external-library --pkg=glib-2.0 --cflags-begin -I/home/username/temp/gtk-install/gtk-3.24.23/native/include/glib-2.0 -I/home/username/temp/gtk-install/gtk-3.24.23/native/lib/x86_64-linux-gnu/glib-2.0/include -DGLIB_COMPILATION -D__G_I18N_LIB_H__ -DGETTEXT_PACKAGE=Dummy --cflags-end /home/username/temp/gtk-install/gtk-3.24.23/native/include/glib-2.0/gobject/glib-types.h /home/username/temp/gtk-install/gtk-3.24.23/native/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h /home/username/temp/gtk-install/gtk-3.24.23/native/include/glib-2.0/glib-unix.h
__Several similar items removed to shorter the message__
/home/username/temp/gtk-install/gtk-3.24.23/native/include/glib-2.0/glib/gwin32.h ../../gobject-introspection-1.66.0/gir/glib-2.0.c
/home/username/temp/gtk-install/gtk-3.24.23/source/native-builddir/gobject-introspection/tmp-introspectb7f8nxow/GLib-2.0: symbol lookup error: /home/username/temp/gtk-install/gtk-3.24.23/source/native-builddir/gobject-introspection/tmp-introspectb7f8nxow/GLib-2.0: undefined symbol: g_number_parser_error_quark
Command '['/home/username/temp/gtk-install/gtk-3.24.23/source/native-builddir/gobject-introspection/tmp-introspectb7f8nxow/GLib-2.0', '--introspect-dump=/home/username/temp/gtk-install/gtk-3.24.23/source/native-builddir/gobject-introspection/tmp-introspectb7f8nxow/functions.txt,/home/username/temp/gtk-install/gtk-3.24.23/source/native-builddir/gobject-introspection/tmp-introspectb7f8nxow/dump.xml']' returned non-zero exit status 127
ninja: build stopped: subcommand failed.
Apparently, this error message isn’t originating from the C compiler but from a tool provided by the gobject-introspection library itself.
Among other things I’ve tried various combinations of library versions: gobject-interspection 1.30.0, 1.36.0, 1.49.2, 1.58.3, 1.60.2, 1.64.1, 1.66.0, glib 2.66.0, 2.58.3, 2.56.4, 2.50.3, 2.46.2, etc. All of the plentyful combinations I have tried breaks down with some error message, similar to the one shown above, but referring to some other undefined symbols. Some of these library version come with a configure script instead of meson. These break down too, therefore I guess the problem is not directly related to meson.
I have spent the entire weekend with this problem and tried to dig up relevant webpages, forums, stackoverflow, etc using google, without any success. Now I feel there is nothing else left than resorting to black magic. Before committing myself to such devices, I’m asking the kind help of the members of the stackoverflow community.
Questions:
- What to do now?
- Is there any detailed instructions for setting up GTK from scratch (native, and possibly cross compiled from linux to win using mingw)?
- How can I determine the required versions of the dependency/dependent libraries of components of GTK? (E.g. What version of library yy satisfies the dependency of libxx version a.b.c?)
(I have to emphasise that I do need to install everything from scratch, since I need to retain some control over the choice of compiler/library versions, versioning of the binaries built with regard to the system .so libraries, etc. So I can not simply install every dev library from the system repository or use precompiled packages. Moreover, I have to install some auxiliary tools as well, since some of the tools/libraries to be installed need higher version of them than available from the system repository. For example cmake 3.5.1 is available form the repo but some libraries need 3.18.)