Extracting project version from meson.build without 'meson setup'

136 views
Skip to first unread message

Aleksandr Mezin

unread,
Sep 9, 2020, 1:37:35 AM9/9/20
to The Meson Build System
Hello

I want to extract the version number from a meson.build in Arch Linux PKGBUILD script.

However, I need to do that before running `meson setup`, without a build dir. Is it possible? `meson introspect --projectinfo` refuses to work w/o build directory, i. e. without running `meson setup`, which is performed later in the packaging process.

Also, it would be nice to get only the version as the output, not a JSON, as parsing JSON in shell script (at least if I wanna do it correctly) requires additional tools (== additional build dependencies for PKGBUILD)

If no such functionality exists yet, would it be feasible to add a command for use cases like this (getting project's version number in packaging scripts)? Like setuptools' `setup.py --version`, for example
Reply all
Reply to author
Forward
0 new messages