-
Notifications
You must be signed in to change notification settings - Fork 15
/
meson.build
82 lines (68 loc) · 1.76 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
project(
'uwsm',
version: run_command('sh', 'version.sh', check: true).stdout().strip(),
license: 'MIT',
)
PYTHON = import('python')
PYTHON_PROG = PYTHON.find_installation('python3')
PYTHON_VERSION = PYTHON_PROG.language_version()
if not PYTHON_VERSION.version_compare('>=3.10')
error('python version >=3.10 required, found: @0@'.format(PYTHON_VERSION))
endif
PKG_DATA_DIR = join_paths(
get_option('prefix'),
get_option('datadir'),
meson.project_name(),
)
PKG_PYTHON_MODULES_DIR = join_paths(PKG_DATA_DIR, 'modules')
PKG_DOC_DIR = get_option('docdir')
if PKG_DOC_DIR == ''
PKG_DOC_DIR = join_paths(
get_option('prefix'),
get_option('datadir'),
'doc',
meson.project_name(),
)
endif
PKG_LICENSE_DIR = get_option('licensedir')
if PKG_LICENSE_DIR == ''
PKG_LICENSE_DIR = join_paths(
get_option('prefix'),
get_option('datadir'),
'licenses',
meson.project_name(),
)
endif
PROJECT_NAME = meson.project_name()
PROJECT_VERSION = meson.project_version()
PYTHON_BIN = get_option('python-bin')
if PYTHON_BIN == ''
PYTHON_BIN = PYTHON_PROG.full_path()
endif
COPY_TO_SUBDIR_SCRIPT = '''
import os
import sys
import shutil
args = dict()
args["build_root"] = sys.argv[1]
args["input"] = sys.argv[2]
args["output"] = sys.argv[3]
if not args["output"].startswith(args["build_root"]):
sys.exit(2)
os.makedirs(os.path.dirname(args["output"]), exist_ok=True)
shutil.copy2(args["input"], args["output"])
'''
GENERATED_DIR = meson.build_root() / 'uwsm-generated'
subdir('uwsm')
subdir('uwsm-plugins')
subdir('example-units')
subdir('scripts')
subdir('man')
uwsm_doc_files = [
'README.md',
]
install_data(uwsm_doc_files, install_dir: PKG_DOC_DIR)
uwsm_license_files = [
'LICENSE',
]
install_data(uwsm_license_files, install_dir: PKG_LICENSE_DIR)