Commit Graph
4 Commits
Author SHA1 Message Date
Eli Schwartz dc4d6203a5 meson: extract the version directly from ./VERSION without subprocesses
With the new minimum meson_version, it is possible to retrieve the
project version from a file by passing a files() output directly to the
version argument. It is no longer necessary to call run_command with
various arguments to configure its behavior, nor depend on a system
/usr/bin/cat (which admittedly does exist on non-Windows systems).

And meson will also treat the VERSION file as a build input, and
reconfigure the build if it changes -- meaning that the built binaries
are updated to have the correct version number (configure_file,
PACKAGE_VERSION, etc).

Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>
2026-10-27 12:21:42 -04:00
Eli Schwartz ede2251c36 meson: port off of deprecated functions
meson.source_root() is deprecated since 0.56, and should be replaced
with either project_source_root or global_source_root depending on
whether it is supposed to refer to a different subproject if the current
project is a subproject. The default for source_root itself was the
latter, which is broken in subproject builds, and is also incorrect for
us since our usage is to construct the path to a file that is part of
the zoitechat source tree.

Make this work semantically correctly by specifically accessing the root
of the current (sub)project, and fix a deprecation warning in the
process.

Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>
2026-10-27 12:14:33 -04:00
Eli Schwartz 2b4e79faa7 meson: explicitly mark run_command as fallible when returncode is checked
Meson emits a warning stating that the default will change from false to
true, in some future version, and that one should always pass
`check: BOOL` explicitly. Normally this is because commands that
unexpectedly fail would result in wrong behavior if the build treats it
as though it succeeded.

In this case, we were specifically relying on it being `check: false`,
as the returncode is immediately checked in order to provide a better
error message. Make this explicit in the meson.build file.

Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>
2026-10-27 12:14:33 -04:00
Eli Schwartz 92969629bd meson: remove if conditionals for meson versions less than meson_version
The minimum version is too high to allow these checks to ever be false.
We can delete else branches as dead code and remove "if true"
constants.

Fixes:
```
meson.build:170: WARNING: Conditional on version '>= 0.55.0' always evaluates to true
meson.build:232: WARNING: Conditional on version '>= 0.55.0' always evaluates to true
```

Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>
2026-10-27 12:14:33 -04:00