From 986f2e20e4779bed8b23a02d741f3a42ae12f75a Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 20 Jul 2025 21:38:48 +0200 Subject: Meson: Add legacy support for Meson 1.3 This is for compatibility with Ubuntu 24.04 LTS --- libdino/meson.build | 9 +++++++-- meson.build | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/libdino/meson.build b/libdino/meson.build index aa88e979..c84eafc3 100644 --- a/libdino/meson.build +++ b/libdino/meson.build @@ -1,11 +1,16 @@ # version_vala version_py = files('version.py')[0] -command = [prog_python, version_py.full_path(), version_file_path, '--git-repo', meson.current_source_dir()] +if meson.version().version_compare('>=1.4.0') + version_py_path = version_py.full_path() +else + version_py_path = meson.current_source_dir() / 'version.py' +endif +command = [prog_python, version_py_path, version_file_path, '--git-repo', meson.current_source_dir()] if prog_git.found() command += ['--git', prog_git] endif # We add those dummy args to ensure meson sees the dependency -command += ['--', version_py, version_file] +command += [version_py, version_file] version_vala = vcs_tag(command: command, input: 'src/version.vala.in', output: 'version.vala', replace_string: '%VERSION%') # libdino diff --git a/meson.build b/meson.build index f8f497fa..ae5b4fac 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,4 @@ -project('Dino', 'c', 'cpp', 'vala', license: 'GPL-3.0', meson_version: '>=1.4.0') +project('Dino', 'c', 'cpp', 'vala', license: 'GPL-3.0', meson_version: '>=1.3.0') fs = import('fs') gnome = import('gnome') @@ -56,7 +56,7 @@ endif prog_git = find_program('git', required: false) prog_python = python.find_installation() -if import('fs').is_file('VERSION') +if import('fs').is_file('VERSION') and meson.version().version_compare('>=1.4.0') version_file = files('VERSION')[0] version_file_path = version_file.full_path() else -- cgit v1.3