-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
111 lines (102 loc) · 2.69 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
project(
'a2jmidid',
'c',
default_options: [
'prefix=/usr/local',
'b_pie=true',
'b_lto=true'
],
meson_version: '>=0.50.0',
license: 'GPL2+',
version: '12')
cc = meson.get_compiler('c')
# dependency definitions
dep_jack = dependency('jack')
dep_alsa = dependency('alsa')
lib_dl = cc.find_library('dl')
lib_pthread = cc.find_library('pthread')
deps_a2jmidid = [dep_alsa, dep_jack, lib_dl, lib_pthread]
# source definitions
src_a2jmidi_bridge = ['a2jmidi_bridge.c']
src_j2amidi_bridge = ['j2amidi_bridge.c']
src_a2jmidid = [
'a2jmidid.c',
'log.c',
'port.c',
'port_thread.c',
'port_hash.c',
'paths.c',
#'conf.c',
'jack.c',
'list.c',
'sigsegv.c']
# config.h input
conf_data = configuration_data()
conf_data.set('version', meson.project_version())
git = find_program('git', required : false)
if git.found()
git_version = run_command('git', 'describe', '--long', '--tags')
if git_version.returncode() == 0
conf_data.set('version', git_version.stdout().strip())
endif
endif
if get_option('disable-dbus')
conf_data.set10('dbus', false)
else
dep_dbus = dependency('dbus-1')
deps_a2jmidid += [dep_dbus]
dbus_data = configuration_data()
dbus_data.set('bindir', join_paths(get_option('prefix'), get_option('bindir')))
dbus_data.set('dbus_service_dir', join_paths(get_option('prefix'), 'share', 'dbus-1', 'services'))
configure_file(
input: 'org.gna.home.a2jmidid.service.in',
output: 'org.gna.home.a2jmidid.service',
install: true,
install_dir: dbus_data.get('dbus_service_dir'),
configuration: dbus_data
)
conf_data.set10('dbus', true)
src_a2jmidid += [
'dbus.c',
'dbus_iface_introspectable.c',
'dbus_iface_control.c']
install_man('man/a2j.1')
install_man('man/a2j_control.1')
configure_file(
input: 'a2j',
output: 'a2j',
copy: true,
install: true,
install_dir: dbus_data.get('bindir'))
configure_file(
input: 'a2j_control',
output: 'a2j_control',
copy: true,
install: true,
install_dir: dbus_data.get('bindir'))
endif
config_header = configure_file(
input: 'config.h.in',
output: 'config.h',
configuration: conf_data)
src_a2jmidid += [config_header]
# executables to compile
executable(
'a2jmidi_bridge',
sources: src_a2jmidi_bridge,
dependencies: [dep_alsa, dep_jack],
install: true)
executable(
'j2amidi_bridge',
sources: src_j2amidi_bridge,
dependencies: [dep_alsa, dep_jack],
install: true)
executable(
'a2jmidid',
sources: src_a2jmidid,
dependencies: deps_a2jmidid,
install: true)
# installing man pages
install_man('man/a2jmidi_bridge.1')
install_man('man/a2jmidid.1')
install_man('man/j2amidi_bridge.1')