Libadwaita dependencies issues while starting development with Rust and Flatpak

I’m trying to my first application for Gnome. I wanted to utilize Rust and LibAdwaita and develop via Gnome Builder, however I’m having dependency issues.

Attempting to build the libadwaita create results in this error, apparently because the latest Gnome Platform runtime doesn’t provide a recent enough GTK version

Configuring adw-version.h using configuration
Program glib-mkenums found: YES (/usr/bin/glib-mkenums)
Program glib-mkenums found: YES (/usr/bin/glib-mkenums)
Program glib-mkenums found: YES (/usr/bin/glib-mkenums)
Program glib-mkenums found: YES (/usr/bin/glib-mkenums)
Program gen-public-types.py found: YES (/bin/env python3 /run/build/libadwaita/src/gen-public-types.py)
Found pkg-config: /usr/bin/pkg-config (1.8.0)
Run-time dependency gio-2.0 found: YES 2.70.2
Dependency gtk4 found: NO found 4.4.1 but need: '>= 4.5.0'
Found CMake: /usr/bin/cmake (3.22.1)
Run-time dependency gtk4 found: NO (tried cmake)

../src/meson.build:227:0: ERROR: Invalid version of dependency, need 'gtk4' ['>= 4.5.0'] found '4.4.1'.

A full log can be found at /run/build/libadwaita/_flatpak_build/meson-logs/meson-log.txt

My Cargo.Toml:

[package]
name = "quickocr"
version = "0.1.0"
edition = "2018"

[dependencies]
gettext-rs = { version = "0.7", features = ["gettext-system"] }
adw = { version = "0.1.0", package = "libadwaita" }

Meanwhile I took libadwaita manifest module straight from: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.0.0/build-howto.html

What runtime version should I target?

You need to use master sdk, not 41.

See https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/build-howto.html#using-flatpak. And you should target the latest stable runtime

Oh I forgot you need newer gtk for libadwaita, eg

 {
            "name": "libsass",
            "sources": [
                {
                    "type" : "archive",
                    "url" : "https://github.com/sass/libsass/archive/3.6.4.tar.gz",
                    "sha256": "f9484d9a6df60576e791566eab2f757a97fd414fce01dd41fc0a693ea5db2889"
                },
                {
                    "type" : "script",
                    "dest-filename" : "autogen.sh",
                    "commands" : [ "autoreconf -si" ]
                }
            ]
        },
        {
            "name": "sassc",
            "sources": [
                {
                    "type" : "archive",
                    "url" : "https://github.com/sass/sassc/archive/3.6.1.tar.gz",
                    "sha256": "8cee391c49a102b4464f86fc40c4ceac3a2ada52a89c4c933d8348e3e4542a60"
                },
                {
                    "type" : "script",
                    "dest-filename" : "autogen.sh",
                    "commands" : [ "autoreconf -si" ]
                }
            ]
        },
        {
            "name" : "pango",
            "buildsystem": "meson",
            "config-opts" : [
                "-Dintrospection=disabled"
            ],
            "sources" : [
                {
                    "type" : "archive",
                    "url" : "https://gitlab.gnome.org/GNOME/pango/-/archive/1.50.3/pango-1.50.3.tar.gz",
                    "sha256" : "4a8b0cf33d5f9ecaa9cd99dd72703d5c4c53bc58df64dd9538493bb4356ab691"
                }
            ]
        },
        {
            "name" : "gtk",
            "buildsystem": "meson",
            "config-opts" : [
                "-Dbuild-examples=false",
                "-Dbuild-tests=false",
                "-Dintrospection=disabled"
            ],
            "sources" : [
                {
                    "type" : "archive",
                    "url" : "https://download.gnome.org/sources/gtk/4.6/gtk-4.6.0.tar.xz",
                    "sha256" : "782d5951fbfd585fc9ec76c09d07e28e6014c72db001fb567fff217fb96e4d8c"
                }
            ]
        },
        {
            "name" : "libadwaita",
            "buildsystem": "meson",
            "config-opts" : [
                "-Dvapi=false",
                "-Dexamples=false",
                "-Dtests=false"
            ],
            "sources" : [
                {
                    "type" : "archive",
                    "url" : "https://gitlab.gnome.org/GNOME/libadwaita/-/archive/1.0.1/libadwaita-1.0.1.tar.gz",
                    "sha256" : "2a178c074ce9a78d39a5889a007b201ef130690b6afab6b773c9baaebdf7d980"
                }
            ]
        }

Updated to make use of libadwaita 1.0.1 instead of 1.0.0

1 Like

Are there runtimes beyond 41? I tried to change the version via the Gnome Builder UI, but it gave me available only 3.something, 40 and 41

There is going to be a 42 version runtime along with the GNOME 42 release, but for the time being there isn’t a newer stable runtime.

The best path for now would be to use the snippet bilal linked in the comment above with GNOME 41 runtime.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.