-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmeson.build
85 lines (83 loc) · 2.48 KB
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# OZI 0.16.0 meson.build:root_files,root_children
# Part of OZI.build.
# See LICENSE.txt in the project root for details.
# DO NOT EDIT BY HAND - This file was generated for use with OZI tools.
# ozi-fix -> meson rewrite is the standard editing pipeline.
project(
'OZI.build',
default_options: ['warning_level=3'],
license: 'Apache-2.0',
license_files: ['COPYING'],
meson_version: '>=1.1.0',
version: run_command(
'python3',
[
'-c',
'from setuptools_scm import get_version;print(get_version(normalize=False))',
],
check: true,
).stdout().strip(),
)
# BEGIN setup
fs = import('fs')
pymod = import('python')
python_dependencies = get_option('python-dependencies')
python = pymod.find_installation()
project_name = meson.project_name()
root_files = [
'README',
'CHANGELOG.md',
'pyproject.toml',
'COPYING',
'.gitignore',
]
# END setup
# BEGIN config MESON_BUILD_ROOT/pyproject.toml
pyproject_config = configuration_data()
pyproject_config.set('VCS_TAG', '@VCS_TAG@')
pyproject_config.set(
'PYTHON_VERSION_DIST',
'py' + ''.join(python.language_version().split('.')),
)
configure_file(
input: 'pyproject.toml',
output: 'pyproject.toml',
configuration: pyproject_config
)
vcs_tag(input: 'pyproject.toml', output: 'pyproject.orig.toml')
# END config MESON_BUILD_ROOT/pyproject.toml
# BEGIN install
foreach source : root_files
if source not in ['pyproject.toml', '.gitignore', 'README', 'CHANGELOG.md']
fs.copyfile(source)
elif source == 'README'
fs.copyfile(source, 'README.rst')
endif
endforeach
subdir('ozi_build')
subdir('tests')
# subdir('doc')
root_children = ['ozi.phony']
foreach child: root_children
if child != 'ozi.phony'
subdir(child)
endif
endforeach
if false
executable('root_files', root_files)
executable('root_children', root_children)
endif
if not meson.is_subproject()
dev = subproject('ozi')
foreach var : get_option('variables')
name = var.replace('-', '_')
set_variable(name, dev.get_variable(name))
endforeach
meson.add_dist_script(dev.get_variable('pip'), 'install', 'tomli>=2.0.0')
meson.add_dist_script(python, '-c', dev.get_variable('meson_dist_setuptools_scm'))
deps = run_command(python, '-c', dev.get_variable('install_dependencies'), check: true).stdout().strip().split('$$')
if deps[0] != ''
meson.add_postconf_script(dev.get_variable('pip'), 'install', deps)
endif
endif
# END install