-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
65 lines (54 loc) · 1.65 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
project('alsa-utils-completions', 'c', version: '0.0.3', license: 'Unlicense')
prefix = get_option('prefix')
assert(prefix.startswith('/'), 'Prefix is not absolute: "@0@"'.format(prefix))
bindir = join_paths(prefix, get_option('bindir'))
datadir = join_paths(prefix, get_option('datadir'))
cc = meson.get_compiler('c')
alsadep = dependency('alsa', required : true)
bashcompdep = dependency('bash-completion', required : true)
if bashcompdep.found()
completionsdir = bashcompdep.get_pkgconfig_variable('completionsdir')
else
completionsdir = join_paths(datadir, 'bash-completion', 'completions')
endif
version_conf = configuration_data()
version_conf.set_quoted('VERSION_ID', meson.project_version())
version_h = configure_file(output: 'version.h', configuration: version_conf)
executable(
'alsa-list',
[ version_h, 'list.c' ],
dependencies : alsadep,
install : true,
install_dir : bindir,
)
utils_aliases = [
'alsactl',
'alsaloop',
'alsamixer',
'amidi',
'amixer',
'aplay',
'arecord',
'axfer',
'speaker-test',
'alsa-list',
'iecset',
]
install_data('alsa-utils', install_dir: completionsdir)
foreach alias : utils_aliases
dst = join_paths(completionsdir, alias)
cmd = 'ln -fs @0@ $DESTDIR@1@'.format('alsa-utils', dst)
meson.add_install_script('sh', '-c', cmd)
endforeach
utils_seq_aliases = [
'aconnect',
'aplaymidi',
'aseqdump',
'aseqnet',
]
install_data('alsa-utils-seq', install_dir: completionsdir)
foreach alias : utils_seq_aliases
dst = join_paths(completionsdir, alias)
cmd = 'ln -fs @0@ $DESTDIR@1@'.format('alsa-utils-seq', dst)
meson.add_install_script('sh', '-c', cmd)
endforeach