Repository navigation
Expand file tree
/
Copy pathmeson.build
More file actions
98 lines (84 loc) · 2.17 KB
/
Copy pathmeson.build
File metadata and controls
98 lines (84 loc) · 2.17 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
project(
'mesonfe',
version: '0.1.3',
license: 'GPL-3.0-or-later',
meson_version: '>= 0.59.0',
)
_app_name = 'MesonFE'
install_data(
meson.project_name(),
install_dir: get_option('bindir'),
install_mode: 'rwxr-xr-x',
)
_docdir = get_option('docdir')
if _docdir == ''
_docdir = get_option('datadir') / 'doc' / meson.project_name()
endif
install_data(
'README.md',
'LICENSE',
install_dir: _docdir,
)
py = import('python').find_installation(
'python3',
modules: ['PyQt5', 'platformdirs'],
)
_pkgdatadir = get_option('datadir') / meson.project_name()
_version_py = configure_file(
input: 'src/mesonfe/_version.py.in',
output: '_version.py',
configuration: {
'VERSION': meson.project_version(),
'APP_NAME': _app_name,
'PKGDATADIR': get_option('prefix') / _pkgdatadir,
'LOCALEDIR': get_option('prefix') / get_option('localedir'),
'NLS': get_option('with-nls').to_string('True', 'False'),
'URL': 'https://github.com/andy5995/mesonfe',
},
)
py.install_sources(
['src/mesonfe/__init__.py', _version_py],
subdir: 'mesonfe',
)
install_data(
'data/@0@.svg'.format(meson.project_name()),
install_dir: get_option('datadir') / 'icons' / 'hicolor' / 'scalable' / 'apps',
)
install_data(
'data/@0@.svg'.format(meson.project_name()),
'data/terminal.svg',
'data/tree.svg',
install_dir: _pkgdatadir,
)
configure_file(
input: 'data/mesonfe.desktop.in',
output: '@0@.desktop'.format(meson.project_name()),
configuration: {'NAME': meson.project_name(), 'APP_NAME': _app_name},
install: true,
install_dir: get_option('datadir') / 'applications',
)
if get_option('with-nls')
subdir('po')
endif
gnome = import('gnome')
gnome.post_install(
update_desktop_database: true,
)
pytest = find_program('pytest', required: false)
if pytest.found()
test(
'pytest',
pytest,
args: ['tests/'],
workdir: meson.project_source_root(),
)
endif
ruff = find_program('ruff', required: false)
if ruff.found()
test(
'ruff',
ruff,
args: ['check', 'mesonfe'],
workdir: meson.project_source_root(),
)
endif