-
Notifications
You must be signed in to change notification settings - Fork 119
/
meson.build
345 lines (278 loc) · 10.3 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
project('audacious-plugins', 'c', 'cpp',
version: '4.5-devel',
meson_version: '>= 0.51',
default_options: [
'c_std=gnu99',
'cpp_std=gnu++17',
'warning_level=1'
])
copyright = 'Copyright (C) 2001-2024 Audacious developers and others'
have_darwin = host_machine.system() == 'darwin'
have_windows = host_machine.system() == 'windows'
have_cygwin = host_machine.system() == 'cygwin'
cc = meson.get_compiler('c')
cxx = meson.get_compiler('cpp')
if have_darwin
add_languages('objc', 'objcpp')
objc = meson.get_compiler('objc')
objcpp = meson.get_compiler('objcpp')
endif
audacious_req = '>= 4.5'
audacious_dep = dependency('audacious', version: audacious_req, required: true)
# XXX - make this its own .pc file
audtag_dep = declare_dependency(link_args: [
'-L@0@'.format(audacious_dep.get_variable(pkgconfig: 'lib_dir')),
'-laudtag'
])
# XXX - make this its own .pc file
audqt_dep = declare_dependency(link_args: [
'-L@0@'.format(audacious_dep.get_variable(pkgconfig: 'lib_dir')),
'-laudqt'
])
# XXX - make this its own .pc file
audgui_dep = declare_dependency(link_args: [
'-L@0@'.format(audacious_dep.get_variable(pkgconfig: 'lib_dir')),
'-laudgui'
])
glib_req = '>= 2.32'
glib_dep = dependency('glib-2.0', version: glib_req, required: true)
gmodule_dep = dependency('gmodule-2.0', version: glib_req, required: true)
zlib_dep = dependency('zlib', required: true)
math_dep = cxx.find_library('m', required: false)
samplerate_dep = dependency('samplerate', required: false)
xml_dep = dependency('libxml-2.0', required: false)
x11_dep = dependency('x11', required: false)
if get_option('qt')
if get_option('qt5')
qt_req = '>= 5.2'
qt_dep = dependency('qt5', version: qt_req, required: true, modules: ['Core', 'Widgets', 'Gui'])
else
qt_req = '>= 6.0'
qt_dep = dependency('qt6', version: qt_req, required: true, modules: ['Core', 'Widgets', 'Gui'])
endif
endif
if get_option('gtk')
if get_option('gtk2')
gtk_req = '>= 2.24'
gtk_dep = dependency('gtk+-2.0', version: gtk_req, required: true)
else
gtk_req = '>= 3.18'
gtk_dep = dependency('gtk+-3.0', version: gtk_req, required: true)
endif
endif
if cc.get_id() in ['gcc', 'clang']
common_flags = [
'-ffast-math',
'-Wtype-limits',
'-Wno-stringop-truncation',
'-fvisibility=hidden'
]
cxx_flags = [
'-Wno-non-virtual-dtor',
'-Woverloaded-virtual'
]
check_cflags = common_flags
check_cxxflags = common_flags + cxx_flags
add_project_arguments(cc.get_supported_arguments(check_cflags), language: 'c')
add_project_arguments(cxx.get_supported_arguments(check_cxxflags), language: 'cpp')
if have_darwin
add_project_arguments(objc.get_supported_arguments(check_cflags), language: 'objc')
add_project_arguments(objcpp.get_supported_arguments(check_cxxflags), language: 'objcpp')
endif
endif
conf = configuration_data()
conf.set_quoted('COPYRIGHT', copyright)
conf.set_quoted('PACKAGE', meson.project_name())
conf.set_quoted('VERSION', meson.project_version())
conf.set('PACKAGE_VERSION', meson.project_version())
if host_machine.endian() == 'big'
conf.set10('WORDS_BIGENDIAN', true)
endif
# XXX - investigate to see if we can do better
if have_windows or have_cygwin
conf.set_quoted('PLUGIN_SUFFIX', '.dll')
elif have_darwin
conf.set_quoted('PLUGIN_SUFFIX', '.dylib')
else
conf.set_quoted('PLUGIN_SUFFIX', '.so')
endif
if have_windows
conf.set('EXPORT', '__declspec(dllexport)')
elif cxx.has_argument('-fvisibility=default')
conf.set('EXPORT', '__attribute__((visibility("default")))')
else
error('Could not define EXPORT keyword for public symbols.')
endif
if meson.version().version_compare('>= 0.59')
intl_dep = dependency('intl', required: false)
intl_found = intl_dep.found()
else
if cxx.has_function('ngettext', prefix: '#include <libintl.h>')
intl_dep = dependency('', required: false)
intl_found = true
else
intl_dep = cxx.find_library('intl', required: false)
intl_found = intl_dep.found()
endif
endif
if intl_found
conf.set10('HAVE_GETTEXT', true)
endif
install_plugindir = audacious_dep.get_variable(pkgconfig: 'plugin_dir')
conf.set_quoted('INSTALL_PLUGINDIR', install_plugindir)
conf.set('plugindir', install_plugindir)
container_plugin_dir = join_paths(install_plugindir, 'Container')
effect_plugin_dir = join_paths(install_plugindir, 'Effect')
general_plugin_dir = join_paths(install_plugindir, 'General')
input_plugin_dir = join_paths(install_plugindir, 'Input')
output_plugin_dir = join_paths(install_plugindir, 'Output')
transport_plugin_dir = join_paths(install_plugindir, 'Transport')
visualization_plugin_dir = join_paths(install_plugindir, 'Visualization')
if get_option('qt')
conf.set10('USE_QT', true)
endif
if get_option('gtk')
conf.set10('USE_GTK', true)
if not get_option('gtk2')
conf.set10('USE_GTK3', true)
endif
endif
if get_option('qt') or get_option('gtk')
conf.set10('USE_GTK_OR_QT', true)
endif
subdir('src')
subdir('po')
if meson.version().version_compare('>= 0.53')
summary({
'Prefix': get_option('prefix'),
'Bin dir': get_option('bindir'),
'Lib dir': get_option('libdir'),
'Data dir': get_option('datadir'),
}, section: 'Directories')
summary({
'Qt 5 support': get_option('qt5'),
'Qt 6 support': get_option('qt') and not get_option('qt5'),
'GTK 2 support': get_option('gtk2'),
'GTK 3 support': get_option('gtk') and not get_option('gtk2'),
}, section: 'GUI Toolkits')
summary({
'Audio CD': get_variable('have_cdaudio', false),
'Free Lossless Audio Codec': get_variable('have_flac', false),
'Ogg Vorbis': get_variable('have_vorbis', false),
'Opus': get_variable('have_opus', false),
'MIDI (via FluidSynth)': get_variable('have_amidiplug', false),
'MPEG-1 Layer I/II/III (via mpg123)': get_variable('have_mpg123', false),
'MPEG-2/4 AAC': get_variable('have_aac', false),
'WavPack': get_variable('have_wavpack', false),
}, section: 'Audio Formats')
summary({
'FFmpeg': get_variable('have_ffaudio', false),
'Libsndfile': get_variable('have_sndfile', false),
}, section: 'External Decoders')
summary({
'AdLib synthesizer (adplug)': get_variable('have_adplug', false),
'Commodore 64 audio (sid)': get_variable('have_sid', false),
'Game Music Emu (spc, nsf, gbs, etc.)': get_option('console'),
'ModPlug': get_variable('have_modplug', false),
'OpenMPT': get_variable('have_openmpt', false),
'Nintendo DS audio (xsf)': true,
'PlayStation audio (psf/psf2)': true,
'Vortex Tracker (vtx)': true,
}, section: 'Chiptunes')
summary({
'Metronome': true,
'Tone Generator': true,
}, section: 'Other Inputs')
summary({
'Background Music': true,
'Bauer stereophonic-to-binaural (bs2b)': get_variable('have_bs2b', false),
'Bitcrusher': true,
'Channel Mixer': true,
'Crystalizer': true,
'Dynamic Range Compressor': true,
'Echo/Surround': true,
'Extra Stereo': true,
'LADSPA Host (requires GTK)': conf.has('USE_GTK'),
'Sample Rate Converter': get_variable('have_resample', false),
'Silence Removal': true,
'SoX Resampler': get_variable('have_soxr', false),
'Speed and Pitch': get_variable('have_speedpitch', false),
'Voice Removal': true,
}, section: 'Effects')
summary({
'Advanced Linux Sound Architecture': get_variable('have_alsa', false),
'Jack Audio Connection Kit': get_variable('have_jack', false),
'Open Sound System': get_variable('have_oss4', false),
'PipeWire': get_variable('have_pipewire', false),
'PulseAudio': get_variable('have_pulse', false),
'Simple DirectMedia Layer': get_variable('have_sdlout', false),
'Sndio': get_variable('have_sndio', false),
'Win32 waveOut': have_windows or have_cygwin,
'FileWriter': get_option('filewriter'),
' -> MP3 encoding': conf.has('FILEWRITER_MP3'),
' -> Vorbis encoding': conf.has('FILEWRITER_VORBIS'),
' -> FLAC encoding': conf.has('FILEWRITER_FLAC'),
}, section: 'Outputs')
summary({
'Cue sheets': get_variable('have_cue', false),
'M3U playlists': true,
'Microsoft ASX (legacy)': true,
'Microsoft ASX 3.0': get_variable('have_asx3', false),
'PLS playlists': true,
'XML Sharable Playlist Format (XSPF)': get_variable('have_xspf', false),
}, section: 'Playlists')
summary({
'FTP, SFTP, SMB (via GIO)': true,
'HTTP/HTTPS (via neon)': get_variable('have_neon', false),
'MMS (via libmms)': get_variable('have_mms', false),
}, section: 'Transports')
summary({
'Ampache browser (requires Qt)': get_variable('have_ampache', false),
'Delete Files': conf.has('USE_GTK_OR_QT'),
'Libnotify OSD': get_variable('have_notify', false),
'Linux Infrared Remote Control (LIRC)': get_variable('have_lirc', false),
'Lyrics Viewer': get_variable('have_lyrics', false),
'MPRIS 2 Server': get_variable('have_mpris2', false),
'Scrobbler 2.0': get_variable('have_scrobbler2', false),
'Song Change': get_option('songchange'),
}, section: 'General')
if conf.has('USE_QT')
summary({
'Qt Multimedia output': get_variable('have_qtaudio', false),
'Qt Interface': true,
'Winamp Classic Interface': true,
'Album Art': true,
'Blur Scope': true,
'OpenGL Spectrum Analyzer': get_variable('have_qtglspectrum', false),
'Playlist Manager': true,
'Search Tool': true,
'Song Info': true,
'Spectrum Analyzer (2D)': true,
'Status Icon': true,
'Stream Tuner (experimental)': get_variable('have_streamtuner', false),
'VU Meter': get_option('vumeter'),
'X11 Global Hotkeys': get_variable('have_qthotkey', false),
}, section: 'Qt Support')
endif
if conf.has('USE_GTK')
summary({
'GTK Interface': true,
'Winamp Classic Interface': true,
'Album Art': true,
'Blur Scope': true,
'OpenGL Spectrum Analyzer': get_variable('have_glspectrum', false),
'Playlist Manager': true,
'Search Tool': true,
'Spectrum Analyzer (2D)': true,
'Status Icon': true,
'X11 Global Hotkeys': get_variable('have_hotkey', false),
'X11 On-Screen Display (aosd)': get_variable('have_aosd', false),
}, section: 'GTK Support')
endif
if have_darwin
summary({
'CoreAudio Output': get_option('coreaudio'),
'Media Keys': get_option('mac-media-keys'),
}, section: 'macOS Support')
endif
endif