Repository navigation
Expand file tree
/
Copy pathmeson.build
More file actions
61 lines (50 loc) · 1.85 KB
/
Copy pathmeson.build
File metadata and controls
61 lines (50 loc) · 1.85 KB
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
project(
'pyalpm',
'c',
version: '0.12.0',
license: 'GPL-3-or-later',
default_options: ['warning_level=2', 'c_std=c99'],
meson_version: '>= 1.8.0',
)
add_global_arguments('-Wno-incompatible-pointer-types', '-Wno-unused-parameter', language : 'c')
# Dependencies
python = import('python').find_installation('python3', pure: false)
python_dep = python.dependency()
libalpm_dep = dependency('libalpm')
common_c_args = [
'-DVERSION="@0@"'.format(meson.project_version()),
]
subdir('src')
subdir('pycman')
# Test
build_dir = meson.current_build_dir() / 'src'
test_dir = meson.current_source_dir() / 'test'
test_args = [test_dir, '-v']
if get_option('b_coverage')
test_args += ['--junitxml=report.xml', '--cov-report=xml']
endif
test(
'integration tests',
find_program('pytest'),
args: test_args,
env: { 'PYTHONPATH': '@0@:@1@'.format(build_dir, meson.current_source_dir()) },
)
sphinx_build = find_program('sphinx-build', disabler: true, required: get_option('docs'))
sphinx_args = ['-Dversion=' + meson.project_version(), '-Drelease=' + meson.project_version()]
input_dir = meson.current_source_dir() / 'doc'
output_dir = meson.current_build_dir() / 'html'
doc_target = custom_target('html',
output: 'html',
input: files('doc/conf.py',
'doc/pyalpm/pyalpm.rst',
'doc/pyalpm/Database.rst',
'doc/pyalpm/Handle.rst',
'doc/pyalpm/Package.rst',
'doc/pyalpm/Pyalpm.rst',
'doc/pyalpm/Transaction.rst'),
command: [sphinx_build, '-b', 'html', sphinx_args, input_dir, output_dir],
env: { 'PYTHONPATH': meson.current_build_dir() / 'src' },
build_by_default: get_option('docs'),
install: get_option('docs'),
install_dir: get_option('datadir') / 'doc' / meson.project_name()
)