Hi all!
With GNOME 45 version of the Flatpak Runtime we are planning to move the valac
compiler from being included with the runtime to a separate Sdk.Extension
. This way the vala team can provide a better experience and bundle extra tools needed for development of applications, such as the Vala language server without being constrained by the stability guarantees of the Stable runtime.
An extension for using the version stable of the Vala compiler has existed for a while in flathub, org.freedesktop.Sdk.Extension.vala
but we have also started publishing a Nightly version of the extension straight from the Vala repo, in the GNOME Nightly Flatpak remote.
GNOME core applications must to use the vala-nightly
extension to match GNOME OS builds. Third party applications should use the stable org.freedesktop.Sdk.Extension.vala
from Flathub, unless they explicitly want to depend on the Nightly compiler.
What do I need to do:
If your application needs valac
you will have to add the following to your manifest for GNOME 45 and onward:
"sdk-extensions" : [
"org.freedesktop.Sdk.Extension.vala"
]
...
"build-options" : {
"prepend-path" : "/usr/lib/sdk/vala/bin/",
"prepend-ld-library-path" : "/usr/lib/sdk/vala/lib"
}
To use the Nightly version install org.freedesktop.Sdk.Extension.vala-nightly
and use /usr/lib/sdk/vala-nightly
paths instead.
If you need to install libgee or any other autotools vala dependency, you should add something like this:
{
"name" : "libgee",
"buildsystem" : "autotools",
"build-options" : {
"env" : {
"ACLOCAL_PATH" : "/usr/lib/sdk/vala-nightly/share/aclocal"
}
},
"sources" : [
{
"type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/libgee.git",
"branch" : "main"
}
]
},
To build Autotools projects using Vala, you’ll need to set the ACLOCAL_PATH
environment variable to point to /usr/lib/sdk/vala/share/aclocal
or /usr/lib/sdk/vala-nightly/share/aclocal
, depending on whether you’re using the stable or nightly extension. This is because the vala.m4 macros are installed outside the usual aclocal search path. You will see extremely confusing configure script errors if you forget this.
For more details and background, refer to this issue