Minor Python module installation tweak
[jack_mixer.git] / meson.build
blobfaf3b99dcda169ebfb9200bebbfac4cbeecbc4ac
1 project(
2     'jack_mixer',
3     'c',
4     version: '14',
5     license: 'GPL2+',
6     default_options: [
7         'warning_level=2'
8     ],
9     meson_version: '>=0.53.0'
12 # Dependencies
13 cc = meson.get_compiler('c')
14 glib_dep = dependency('glib-2.0')
15 math_dep = cc.find_library('m', required: false)
16 jack2_dep = dependency('jack', version:'>=1.9.11', required: false)
17 jack1_dep = dependency('jack', version:'>=0.125.0, <1.0', required: false)
19 if not jack2_dep.found() and jack1_dep.found()
20     jack_dep = jack1_dep
21 elif jack2_dep.found()
22     jack_dep = jack2_dep
23 else
24     error('No recent enough (jack2>=1.9.11 or jack1>=0.125.0) version of JACK found.')
25 endif
27 if get_option('gui').disabled() and get_option('jack-midi').disabled()
28     error('Disabling both GUI and JACK-MIDI is not supported.')
29 endif
31 if get_option('gui').enabled()
32     pymod = import('python')
33     python = pymod.find_installation(
34         'python3',
35         required: true,
36         modules: get_option('check-py-modules') ? ['gi', 'cairo', 'xdg'] : []
37     )
38 endif
40 # Installation directories
41 prefix = get_option('prefix')
42 bindir = join_paths(prefix, get_option('bindir'))
43 datadir = join_paths(prefix, get_option('datadir'))
44 #localedir = join_paths(prefix, get_option('localedir'))
45 #pythondir = join_paths(prefix, python.get_path('purelib'))
46 desktopdir = join_paths(datadir, 'applications')
47 icondir = join_paths(datadir, 'icons', 'hicolor')
49 # Build jack_mix_box and generate _jack_mixer extension source
50 subdir('src')
52 # Build & install C extension module and Python package
53 if get_option('gui').enabled()
54     subdir('jack_mixer')
55 endif
57 # Install desktop file and icons
58 if get_option('gui').enabled()
59     subdir('data')
60 endif
62 # Install documentation
63 subdir('docs')
65 if get_option('gui').enabled() and not get_option('wheel')
66     meson.add_install_script('meson_postinstall.py')
67 endif
69 summary({
70     'Build jack_mixer GUI': get_option('gui').enabled(),
71     'JACK MIDI support': get_option('jack-midi').enabled(),
72     'Debug messages (verbose)': get_option('verbose'),
73     'Build for wheel': get_option('wheel'),
74 }, section: 'Configuration')