I do intent to add a few more examples for GTK4 to the Nim bindings readme, as we have only one currently.
Unfortunately Gentoo Linux still have to GTK4 for testing. But maybe one year ago I already installed gtk 3.96 on /opt, see
I tried to remember the steps. Most difficult for me is finding the page with the instructions, but it was saved in the old forum post. Then I followed the instructions, that is
$ cat ~/gtk4_install
rm -rf /opt/gtk
mkdir /opt/gtk
cd
rm -rf gtk
git clone https://gitlab.gnome.org/GNOME/gtk.git
CPPFLAGS="-I/opt/gtk/include"
LDFLAGS="-L/opt/gtk/lib64" # caution: lib64 for recent gentoo linux
PKG_CONFIG_PATH="/opt/gtk/lib64/pkgconfig" # caution: lib64 for recent gentoo linux
export CPPFLAGS LDFLAGS PKG_CONFIG_PATH
LD_LIBRARY_PATH="/opt/gtk/lib64" # caution: lib64
PATH="/opt/gtk/bin:$PATH"
export LD_LIBRARY_PATH PATH
cd
cd gtk
meson --prefix /opt/gtk builddir
cd builddir
ninja
ninja install
Seems to work fine, I can launch gtk4-demo with
$ GSETTINGS_SCHEMA_DIR=/opt/gtk/share/glib-2.0/schemas /opt/gtk/bin/gtk4-demo
and it works well.
But during install I got messages like
Found ninja-1.10.0 at /usr/bin/ninja
[3/1583] Compiling C object 'gdk/wayland/cursor/4b92630@@wayland+cursor@sta/xcursor.c.o'.
cc1: warning: /opt/gtk/include: No such file or directory [-Wmissing-include-dirs]
[6/1583] Compiling C object 'gdk/wayland/cursor/4b92630@@wayland+cursor@sta/wayland-cursor.c.o'.
cc1: warning: /opt/gtk/include: No such file or directory [-Wmissing-include-dirs]
I guess that is because /opt/gtk/include does not exists before the final ninja install step.
So maybe I did something wrong?
And final question, what is the recommended strategy for linux distros about gtk4. Should distros provide already gtk4 for testing, or better not? I think some do, but gentoo does not. I do consider pushing gentoo maintainers to provide it, as manually installation is some effort.