[Preview] Testing GtkAda4 with Alire on Ubuntu 26.04

Hi everyone,

If you are running Ubuntu 26.04, you can now try out the GtkAda4 crate directly via Alire.

Prerequisites:

  • alr (Alire package manager) installed.
  • GTK4 4.22+ development libraries:
# Installs GTK 4.22.4 on Ubuntu 26.04
sudo apt install libgtk-4-dev

Quick Start:

alr init --bin gtkada4_test
cd gtkada4_test
alr with gtkada4 --use=https://github.com/AdaCore/gtkada
Requested changes:

   ✓ gtkada4 ^27.0.0 (add)
                          
Changes to dependency solution:

   New solution is incomplete.
   +📌      gtkada4    27.0.0   (new,path=alire/cache/pins/gtkada4,url=https://github.com/AdaCore/gtkada)
   +📦      make       4.4.1    (new,indirect,system package)
   +📦      pkg_config 2.5.1    (new,indirect,system package)
   Missing:
   +❗      libgtk4    >=4.22.2 (new,missing:unknown,indirect)

Do you want to proceed?
[Y] Yes  [N] No  (default is No) 

At this point Alire will complain that libgtk4>=4.22 is not found. You should type Yes to proceed! Now you can build the crate:

alr build

You also can build gtkada_demo:

alr exec -- gprbuild -P gtkada_demo/gtkada_demo.gpr

If you had configured Alire to avoid shared dependency (alr settings --global --set dependencies.shared false) then you can lauch the demo as

./alire/cache/pins/gtkada4/gtkada_demo/gtkada_demo

Oherwise find it somewhere in $HOME/.local/share/alire/

Feel free to test it out and report any issues or feedback here. Happy hacking with Ada and GTK4!

I was able to build the crate and run the demo successfully on Fedora 44, with the minor deviation that the libepoxy development packages were also needed:

sudo dnf install gtk4-devel libepoxy-devel
alr init --bin gtk4ada_test
cd gtk4ada_test/
alr with gtkada4 --use=https://github.com/AdaCore/gtkada
alr build
  ...
✓ Build finished successfully in 89.59 seconds.
alr exec -- gprbuild -P gtkada_demo/gtkada_demo.gpr
  ...
Link
   [link]         gtkada_demo.adb

./alire/cache/pins/gtkada4/gtkada_demo/gtkada_demo

And there is first GtkAda4 application ever, see gtkada4 folder in

:slight_smile: