website/index.html: Extend Feedback section (codeberg.org)
[a2jmidid.git] / meson.build
blobb7fb7267750f9f80a65d57171ba01e99cd01d833
1 project(
2   'a2jmidid',
3   'c',
4   default_options: [
5     'prefix=/usr/local',
6     'b_pie=true',
7     'b_lto=true'
8   ],
9   meson_version: '>=0.50.0',
10   license: 'GPL2+',
11   version: '12')
13 cc = meson.get_compiler('c')
15 # dependency definitions
16 dep_jack = dependency('jack')
17 dep_alsa = dependency('alsa')
18 lib_dl = cc.find_library('dl')
19 lib_pthread = cc.find_library('pthread')
20 deps_a2jmidid = [dep_alsa, dep_jack, lib_dl, lib_pthread]
22 # source definitions
23 src_a2jmidi_bridge = ['a2jmidi_bridge.c']
24 src_j2amidi_bridge = ['j2amidi_bridge.c']
25 src_a2jmidid = [
26         'a2jmidid.c',
27         'log.c',
28         'port.c',
29         'port_thread.c',
30         'port_hash.c',
31         'paths.c',
32         #'conf.c',
33         'jack.c',
34         'list.c',
35         'sigsegv.c']
37 # config.h input
38 conf_data = configuration_data()
39 conf_data.set('version', meson.project_version())
41 git = find_program('git', required : false)
42 if git.found()
43   git_version = run_command('git', 'describe', '--long', '--tags')
44   if git_version.returncode() == 0
45     conf_data.set('version', git_version.stdout().strip())
46   endif
47 endif
49 if get_option('disable-dbus')
50   conf_data.set10('dbus', false)
51 else
52   dep_dbus = dependency('dbus-1')
53   deps_a2jmidid += [dep_dbus]
54   dbus_data = configuration_data()
55   dbus_data.set('bindir', join_paths(get_option('prefix'), get_option('bindir')))
56   dbus_data.set('dbus_service_dir', join_paths(get_option('prefix'), 'share', 'dbus-1', 'services'))
57   configure_file(
58     input: 'org.gna.home.a2jmidid.service.in',
59     output: 'org.gna.home.a2jmidid.service',
60     install: true,
61     install_dir: dbus_data.get('dbus_service_dir'),
62     configuration: dbus_data
63   )
64   conf_data.set10('dbus', true)
65   src_a2jmidid += [
66     'dbus.c',
67     'dbus_iface_introspectable.c',
68     'dbus_iface_control.c']
69   install_man('man/a2j.1')
70   install_man('man/a2j_control.1')
71   configure_file(
72     input: 'a2j',
73     output: 'a2j',
74     copy: true,
75     install: true,
76     install_dir: dbus_data.get('bindir'))
77   configure_file(
78     input: 'a2j_control',
79     output: 'a2j_control',
80     copy: true,
81     install: true,
82     install_dir: dbus_data.get('bindir'))
83 endif
85 config_header = configure_file(
86   input: 'config.h.in',
87   output: 'config.h',
88   configuration: conf_data)
89 src_a2jmidid += [config_header]
91 # executables to compile
92 executable(
93   'a2jmidi_bridge',
94   sources: src_a2jmidi_bridge,
95   dependencies: [dep_alsa, dep_jack],
96   install: true)
97 executable(
98   'j2amidi_bridge',
99   sources: src_j2amidi_bridge,
100   dependencies: [dep_alsa, dep_jack],
101   install: true)
102 executable(
103   'a2jmidid',
104   sources: src_a2jmidid,
105   dependencies: deps_a2jmidid,
106   install: true)
108 # installing man pages
109 install_man('man/a2jmidi_bridge.1')
110 install_man('man/a2jmidid.1')
111 install_man('man/j2amidi_bridge.1')