aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libdino/meson.build7
-rw-r--r--libdino/version.py1
-rw-r--r--meson.build10
3 files changed, 14 insertions, 4 deletions
diff --git a/libdino/meson.build b/libdino/meson.build
index 42910463..aa88e979 100644
--- a/libdino/meson.build
+++ b/libdino/meson.build
@@ -1,10 +1,11 @@
# version_vala
-dot_git = meson.current_source_dir() / '../.git'
-version_file = meson.current_source_dir() / '../VERSION'
-command = [prog_python, files('version.py'), version_file, '--git-repo', meson.current_source_dir()]
+version_py = files('version.py')[0]
+command = [prog_python, version_py.full_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]
version_vala = vcs_tag(command: command, input: 'src/version.vala.in', output: 'version.vala', replace_string: '%VERSION%')
# libdino
diff --git a/libdino/version.py b/libdino/version.py
index d057ddf2..ca779898 100644
--- a/libdino/version.py
+++ b/libdino/version.py
@@ -56,6 +56,7 @@ def main():
p.add_argument("--git", help="Path to git executable", default="git")
p.add_argument("version_file", metavar="VERSION_FILE",
help="Use this file's contents as version if the file exists")
+ p.add_argument("ignored", nargs="*", help=argparse.SUPPRESS)
args = p.parse_args()
version = compute_version(args.version_file, args.git_repo, args.git)
print(version)
diff --git a/meson.build b/meson.build
index f10381a8..f8f497fa 100644
--- a/meson.build
+++ b/meson.build
@@ -1,4 +1,4 @@
-project('Dino', 'c', 'cpp', 'vala', license: 'GPL-3.0')
+project('Dino', 'c', 'cpp', 'vala', license: 'GPL-3.0', meson_version: '>=1.4.0')
fs = import('fs')
gnome = import('gnome')
@@ -56,6 +56,14 @@ endif
prog_git = find_program('git', required: false)
prog_python = python.find_installation()
+if import('fs').is_file('VERSION')
+ version_file = files('VERSION')[0]
+ version_file_path = version_file.full_path()
+else
+ version_file = 'invalid'
+ version_file_path = meson.current_source_dir() / 'VERSION'
+endif
+
default_install_rpath = ''
if get_option('set-install-rpath')
default_install_rpath = get_option('prefix') / get_option('libdir')