Skip to content

Meson: Simplify mutter library detection - #2927

Open
leolost2605 wants to merge 1 commit into
mainfrom
leolost/simplify-mutter-detection
Open

leolost2605 wants to merge 1 commit into
mainfrom
leolost/simplify-mutter-detection

Conversation

@leolost2605

@leolost2605 leolost2605 commented Sep 15, 2026

Copy link
Copy Markdown
Member

Instead of having if for every mutter version add a dictionary that maps mutter api version to gnome version (this can be a list in the future since mutter changed the api version to follow the gnome version from 51 on) and then find the installed mutter version in a loop.

In the best case this means that adding support for detecting a new version only needs to add a new entry to the dictionary instead of copy pasting the if and manually changing the versions etc.

This is prep for some more improvements I'd like to make in this area

@leolost2605
leolost2605 force-pushed the leolost/simplify-mutter-detection branch from 4940464 to a0cf6ff Compare September 15, 2026 08:49
@leolost2605
leolost2605 force-pushed the leolost/simplify-mutter-detection branch from a0cf6ff to 77e92f4 Compare September 15, 2026 08:51
@leolost2605
leolost2605 requested a review from a team September 15, 2026 08:59
@leolost2605

Copy link
Copy Markdown
Member Author

@tintou @garaevdi does this make sense?

@tintou

tintou commented Sep 15, 2026

Copy link
Copy Markdown
Member

I'm not really in favor because we've seen the dependency list changing from one version to another so I want to keep it simple even if it's a bit redundant

@tintou

tintou commented Sep 15, 2026

Copy link
Copy Markdown
Member

Like here you have mutter-cogl-pango-14 and mutter-cogl-pango-15 that disappear from the list

@leolost2605

Copy link
Copy Markdown
Member Author

dependency list changing

@tintou yeah that was my thought as well. Though with mtk in place and cogl-pango gone I thought it will probably be relatively stable now but I don't feel very strongly about this.

Another question while I have you here: Is there a reason we don't use the generated vapi directly but instead via a single one with #if? I did some experimenting and at least with mutter 18 and a few metadata adjustments it seems to work for me and would be less work, wouldn't it? That's the next thing I wanted to do :)

@garaevdi

Copy link
Copy Markdown
Contributor

I don't have much of an opinion here. Copying lines manually twice a year isn't a massive task and personally it isn't a huge deal for me. Most of the time there would be around 7 supported mutter version so the size of meson.build shouldn't grow that much over time.

But I also think that this looks much cleaner than what we have now, especially if you also shorten vapi/meson.build with a similar string substitution.

@tintou

tintou commented Sep 15, 2026

Copy link
Copy Markdown
Member

We have to document the reasoning because this comes every few year :) but I don't mind, the reason we have the single .vapi with #ifs is because It makes very easy to spot differences in the .vapi and soo where some API has been moved while having a single one makes it harder to compare 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants