This is due to the version bump of the libmutter interfaces from 2 to 3.
Currently meson fails like this:
Dependency libmutter found: NO
Dependency libmutter found: NO
Dependency libmutter found: NO
Dependency libmutter-0 found: NO
Dependency libmutter-1 found: NO
Dependency libmutter-2 found: NO
Dependency libmutter-2 found: NO
meson.build:251:1: ERROR: Problem encountered: No supported mutter library found!
So, I think new checks (and more?) to add support for libmutter-3 will be necessary.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
@ricotz I'm trying to work on this, but I can't seem to figure out how to regenerate the mutter vapi files from the .gir files - it looks like I'm too stupid to use vapigen correctly, I'm only getting errors so far.
I'm sure you know the correct incantation for that?
@decathorpe This will help https://github.com/elementary/gala/commits/wip/ricotz/libmutter3
Thanks!
Now the build is failing with this on fedora rawhide:
Json-1.0.gir:914.7-918.24: error: `Builder' already contains a definition for `immutable'
Json-1.0.gir:654.7-656.25: note: previous definition of `immutable' was here
Json-1.0.gir:3260.7-3264.24: error: `Parser' already contains a definition for `immutable'
Json-1.0.gir:2882.7-2884.25: note: previous definition of `immutable' was here
Gio-2.0.gir:86796.7-86800.24: error: `UnixSocketAddress' already contains a definition for `abstract'
Gio-2.0.gir:86639.7-86641.21: note: previous definition of `abstract' was here
Is that an error in the .gir files supplied by json-glib and glib, or something else?
Just as a heads-up: I'm working on bringing a mutter328 compat package to fedora 29+, so support for mutter 3.30 is no longer time-critical.
The topic is again relevant.
Gentoo, mutter-3.30
`[dirli pkgconfig]$ ls | grep mutt
libmutter-3.pc
mutter-clutter-3.pc
mutter-clutter-x11-3.pc
mutter-cogl-3.pc
mutter-cogl-gles2-3.pc
mutter-cogl-pango-3.pc
mutter-cogl-path-3.pc`
In dependencies only libmutter-2
P.S. mutter-3.28 ok
In NixOS we've also kept the mutter 3.28 package around for this.
in gentoo, it's easier. The current official version of mutter-3.26. I was just being proactive)
I need to do increasingly nasty things to keep supporting mutter 3.28 on fedora:
Is there any progress with porting gala to the newer mutter versions?
Why exactly did you need patches 70-75?
Because some functionality was moved from gnome-settings-daemon to mutter with GNOME 3.32, and some GSettings keys were renamed in gsettings-desktop-schemas 3.32 - which made gala and elementary-greeter (master) SEGFAULT due to the now missing GSettings key.
So, the patch-set both adapts to the renamed GSettings key, and also adds the functionality that was moved from gnome-settings-daemon to mutter with 3.32.
The patches are backports of this upstream MR: https://gitlab.gnome.org/GNOME/mutter/merge_requests/133/commits
In fact I just succeeded (today) to build against mutter 3.30 on Gentoo (which is finally the official latest stable release, switching from 3.24 to 3.30, it seems that all the major distros have switched to 3.30+).
Patches are still a bit ugly so I didn't open a PR yet, but here are the instructions if anyone is interested.
libmutter-3.vapi will need to be merged with the current libmutter.vapi using macros conditionnals in order to avoid breaking compatibility with any other mutter version.I only regenerated libmutter-3.vapi file from scratch, any other vapi are just symlinked like their v2 (mutter-clutter-3.vapi, mutter-cogl-3.vapi, mutter-cogl-pango-3.vapi and mutter-cogl-path-3.vapi)
Generation is done through the vapigen tool, provided with vala.
This can be done properly by providing the gir file provided in the mutter package of your distribution (maybe mutter-dev on binary distros like Debian or Fedora).
You will also need to provide some metadatas to vapigen so that generated vala code is correct. Metadata needs to be written by hand in order to get what you want, so this is a loooong task.
More details can be found on those links :
https://wiki.gnome.org/Projects/Vala/Bindings
https://wiki.gnome.org/Projects/Vala/Manual/GIR%20metadata%20format
The vapi files provided with gala are vala front-end for C code, and generated through the gir files provided with mutter. Gir files are introspection of Gobject code used within C code.
Mutter provides multiple gir files, one for Mutter himself (Meta-3.gir) and other are introspection of (maybe modified ?) other component (Clutter-3.gir for clutter, Cogl-3.gir for cogl, ...).
So we have a mapping like :
Meta-3.gir ==> libmutter-3.vapi
Clutter-3.gir ==> mutter-clutter-3.vapi
Cogl-3.gir ==> mutter-cogl-3.vapi
CoglPango-3.gir ==> mutter-cogl-pango-3.vapi
??? ==> mutter-cogl-path-3.vapi
On Gentoo, the GIR files of mutter are installed within /usr/lib64/mutter.
To generate the file, you can do something like this :
META_GIR="/usr/lib64/mutter/Meta-3.gir"
MUTTER_GIR_DIR=" /usr/lib64/mutter"
VAPI_DIR="./"
METADATA_DIR="./metadata/"
FINAL_LIB_NAME="libmutter-3"
vapigen-0.42 "${META_GIR}" --library "${FINAL_LIB_NAME}" --girdir "${MUTTER_GIR_DIR}" --vapidir="${VAPI_DIR}" --metadatadir="${METADATA_DIR}"
With the following statements :
mutter-clutter-3.vapi, mutter-cogl-3.vapi and mutter-cogl-pango-3.vapi in this dir.vapi extension)As for the metadata dir, it should contain files named after the GIR they applies to. After 3 full days of work, I ended with this metadata file :
https://gist.github.com/Tireg/d94c04e30ead7a16f24c49d96901e910
Once you have generated the libmutter-3.vapi, you will need to :
libmutter.vapi within gala/vapi with this onelibmutter-3.vapi pointing to libmutter.vapi (it seems to work by just dropping the file as libmutter-3.vapi without erasing any file on gala, but fails on other projects like wingpanel and pantheon-greeter)
In addition to this, we need to :
${file}-3.vapi pointing to ${file}.vapimutter-clutter, mutter-cogl, mutter-cogl-pango, mutter-cogl-pathCurrently, the meson files still references libmutter-2.vapi for mutter-3.30.
We need to fix the dependencies right within the meson files :
https://gist.github.com/Tireg/840230b3e1b16c740945ef64109a2629
(Note : I removed dependency on the compat.vapi because I had trouble with it since the beginning but maybe it just works with it now. I don't know what it the purpose of this file anyway.)
Mutter 3.30 removed the Screen class and moved most of its old method within Display and the new WorkspaceManager and MonitorManager classes.
After digging out, I ended up with the following patch :
https://gist.github.com/Tireg/22482d842e12864bba97784a64eca41d
Note : I needed to cast most of the loop using Clutter.Actor to Meta.WindowActor because the current vapi may still be not perfect. The Meta.Compositor.get_window_actors currently returns Clutter.Actor when it seems to always return Meta.WindowActor.
You may have notice a TODO in the previous patch. I found the fix latter, within a budgie-desktop PR.
Mutter dropped the support for overriding schema because GLib 2.57+ allows to do per desktop schemas override (https://github.com/solus-project/budgie-desktop/pull/1523).
The following patch repairs the overrides settings :
https://gist.github.com/Tireg/a4fe6b798dcce93b9c5df6690cd4d29e
I still had trouble because of some missing import statement within mutter headers, and I did a manual change within /usr/include/mutter/meta/meta-background.h.
You need to add within the includes :
#include <meta/display.h>
You should now be able to build it using the common meson / ninja build instructions.
this thread has been helpful for insights https://github.com/solus-project/budgie-desktop/pull/1591
Binding updates can be found here https://github.com/elementary/gala/tree/wip/mutter-3.3x
I've continued the mutter-3.3x branch but the compilation fails because of MetaBackgroundGroup being a final class, I've opened a PR upstream to fix it https://gitlab.gnome.org/GNOME/mutter/merge_requests/640
This should be closed now that https://github.com/elementary/gala/pull/566 has been merged.
Discussions upon the related issues are available in this bug report: https://github.com/elementary/gala/issues/634
Yeah, I'll close this issue since we've actually got it to compile against all mutter versions now :)
Most helpful comment
Because some functionality was moved from gnome-settings-daemon to mutter with GNOME 3.32, and some GSettings keys were renamed in gsettings-desktop-schemas 3.32 - which made gala and elementary-greeter (master) SEGFAULT due to the now missing GSettings key.
So, the patch-set both adapts to the renamed GSettings key, and also adds the functionality that was moved from gnome-settings-daemon to mutter with 3.32.
The patches are backports of this upstream MR: https://gitlab.gnome.org/GNOME/mutter/merge_requests/133/commits