[Mesa-dev] [PATCH] meson: Add script to use VERSION file for getting version

Dylan Baker dylan at pnwbakers.com
Wed Nov 8 22:06:01 UTC 2017


Quoting Eric Engestrom (2017-11-08 12:38:26)
> 
> 
> On 8 November 2017 19:32:22 GMT, Dylan Baker <dylan at pnwbakers.com> wrote:
> > Quoting Eric Engestrom (2017-11-08 04:21:41)
> > > On Wednesday, 2017-11-01 11:58:16 -0700, Dylan Baker wrote:
> > > > Meson has up until this point set it's version in the root
> > meson.build
> > > > script. While there are other build systems them creates "one more
> > > > thing" to duplicate between meson and every other build system,
> > this
> > > > script is a simple "read, strip, print" sort of deal to allow
> > meson to
> > > > read the VERSION file.
> > > > 
> > > > I chose to implement this in python since python is portable, and
> > to
> > > > keep the meson.build script clean. This is also complicated by the
> > fact
> > > > that the project() call *must* be the first non-comment,non-blank
> > in the
> > > > toplevel meson.build script.
> > > > 
> > > > Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
> > > > ---
> > > >  meson.build                  |  2 +-
> > > >  scripts/meson_get_version.py | 35
> > +++++++++++++++++++++++++++++++++++
> > > >  2 files changed, 36 insertions(+), 1 deletion(-)
> > > >  create mode 100644 scripts/meson_get_version.py
> > > > 
> > > > diff --git a/meson.build b/meson.build
> > > > index 6ad8c8bbf4b..3f77380f7df 100644
> > > > --- a/meson.build
> > > > +++ b/meson.build
> > > > @@ -21,7 +21,7 @@
> > > >  project(
> > > >    'mesa',
> > > >    ['c', 'cpp'],
> > > > -  version : '17.3.0-devel',
> > > > +  version :
> > run_command(find_program('scripts/meson_get_version.py')).stdout(),
> > 
> > And actually, thinking about windows, this should be:
> > run_command(
> > [find_program('python', 'python2', 'python3'),
> > 'bin/meson_get_version.py']
> > ).stdout(),
> > 
> > Since windows doesn't support shabangs link nix does.
> 
> Indeed; r-b still stands with this change :)
> 
> Speaking of, did you manage to get mesa building with meson on windows?

Not yet, it's on my list of things to do soon, but I'd like to get as much of
the Linux/unix-like stuff building first as possible. macOS is my first
adventure outside of the comfortable Linux/BSD world.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171108/a8f4e261/attachment.sig>


More information about the mesa-dev mailing list