Skip to content

Add meson build system#2086

Merged
jubalh merged 16 commits intomasterfrom
meson-build
Feb 5, 2026
Merged

Add meson build system#2086
jubalh merged 16 commits intomasterfrom
meson-build

Conversation

@jubalh
Copy link
Member

@jubalh jubalh commented Feb 5, 2026

Fix #1002.
Was already started in 2021 in #1619 but then abandoned it.

I want to take this opportunity to change a couple of other things regarding building:

  • The --plugins switch is gone. Use --python-plugins and --c-plugins instead.
  • We don't autoenable depending on dependencies being present. Every feature needs to be enabled explicitly. This helps with having deterministic builds.
  • Instead of setting PACKAGE_STATUS="development/release" in the configure.ac file we will use the default meson buildtype.

Autotools will probably stay a while. The next release will contain both with a note for packagers to try to use meson and give us feedback.

Meson/Ninja is significantly faster and the syntax is much easier to read.
The faster build times eventually will also help when waiting for CI results.

There are some things missing still like our make dist, make doublecheck and such.

Usage example:

meson setup build --buildtype=release -Domemo=enabled -Dpgp=enabled
meson compile -C build

The changes described above are only on meson. Autotools still behaves the same. The plan is to keep it as is and remove it once we know everything works in meson.

jubalh added 16 commits February 5, 2026 09:13
In autotools we had `package_status` which we set to either
`release` or `development`.
When converting from autotools to meson we used that mechanism
as well. But actually meson has a default way of handling this
with the option `buildtype`.

The following values are possible:
debug, debugoptimized, release, plain

So our `package_status = development` will now be
`if get_option('buildtype') == 'debug' or get_option('buildtype') ==
'debugoptimized'`. Probably we could also use
`if get_option('buildtype') == 'release'. But like this the
`plain` will be really plain.

Usage:
```
meson setup build --buildtype=debug
meson compile -C build
```
`.found()` does not work on lists. And since this feature needs
several deps it is a list.
For autotools this was added in:
75bb003

Regarding:
#1334

I think libstrophe is rather common now and should be treated
like all the other dependencies anyways.
So I'll remove this from the meson files at least. Since my
goal is to have a cleaner build system.
In out autotools build we check for all kinds of curses and their
support for wide character.
Let's focus on more modern systems until someone complains.
For meson we dont just check for the presence of a dependency and
then auto enable it.
Users must enable features explicit. This helps with having
deterministic results.

Also remove the general `plugins` switch which was used to
enable/disable both python and c plugins. Users can just use
those switches.
We don't actually need to check whether they were found.
Meson will just ignore the empty ones.
gtk2 is pretty old now. Let's just focus on gtk3.
Use disabler() for optional dependencies.
Extract repeated build type checks into is_debug/is_release variables.
Consolidate compiler flags into single add_project_arguments() calls.
Simplify dependency list building (Meson auto-ignores disabled deps).
Streamline platform checks using 'in' operator.
Remove redundant variables (xscrnsaver_found, gtk_version, config_h_inc).
Simplify ncurses and header detection with clearer fallback chains.
Consolidate install_data() calls for files in same directory.
Most likely we don't need to check for gpgme-config on most modern
systems.
This probably could be nicer. But since we will drop one in the future
it's not really a priority to make this pretty.
@jubalh jubalh added this to the next milestone Feb 5, 2026
@jubalh jubalh self-assigned this Feb 5, 2026
@jubalh jubalh added the build label Feb 5, 2026
@jubalh jubalh merged commit 13a0214 into master Feb 5, 2026
7 checks passed
@jubalh jubalh deleted the meson-build branch February 5, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Meson Build

1 participant