Merged pidgin/main into default
[pidgin-git.git] / libpurple / meson.build
blob7d0b288cc024030b3b5b8ba50fad8a2c4fceb90c
1 purple_coresources = [
2         'account.c',
3         'accounts.c',
4         'accountopt.c',
5         'blistnode.c',
6         'buddy.c',
7         'buddylist.c',
8         'buddyicon.c',
9         'chat.c',
10         'circularbuffer.c',
11         'cmds.c',
12         'connection.c',
13         'contact.c',
14         'conversation.c',
15         'conversationtypes.c',
16         'conversations.c',
17         'core.c',
18         'countingnode.c',
19         'debug.c',
20         'e2ee.c',
21         'eventloop.c',
22         'group.c',
23         'http.c',
24         'idle.c',
25         'image.c',
26         'image-store.c',
27         'keyring.c',
28         'log.c',
29         'media/backend-fs2.c',
30         'media/backend-iface.c',
31         'media/candidate.c',
32         'media/codec.c',
33         'media/enum-types.c',
34         'media.c',
35         'mediamanager.c',
36         'memorypool.c',
37         'message.c',
38         'mime.c',
39         'nat-pmp.c',
40         'network.c',
41         'notify.c',
42         'plugins.c',
43         'pluginpref.c',
44         'pounce.c',
45         'prefs.c',
46         'presence.c',
47         'proxy.c',
48         'protocol.c',
49         'protocols.c',
50         'purple-gio.c',
51         'queuedoutputstream.c',
52         'request.c',
53         'request-datasheet.c',
54         'roomlist.c',
55         'savedstatuses.c',
56         'server.c',
57         'signals.c',
58         'smiley-custom.c',
59         'smiley-list.c',
60         'smiley-parser.c',
61         'smiley-theme.c',
62         'smiley.c',
63         'status.c',
64         'stringref.c',
65         'stun.c',
66         'sound.c',
67         'sound-theme.c',
68         'sound-theme-loader.c',
69         'sslconn.c',
70         'theme.c',
71         'theme-loader.c',
72         'theme-manager.c',
73         'tls-certificate.c',
74         'tls-certificate-info.c',
75         'trie.c',
76         'upnp.c',
77         'util.c',
78         'version.c',
79         'whiteboard.c',
80         'xfer.c',
81         'xmlnode.c'
84 purple_coreheaders = [
85         'account.h',
86         'accounts.h',
87         'accountopt.h',
88         'blistnode.h',
89         'buddy.h',
90         'buddylist.h',
91         'buddyicon.h',
92         'chat.h',
93         'circularbuffer.h',
94         'cmds.h',
95         'connection.h',
96         'contact.h',
97         'conversation.h',
98         'conversationtypes.h',
99         'conversations.h',
100         'core.h',
101         'countingnode.h',
102         'dbus-maybe.h',
103         'debug.h',
104         'e2ee.h',
105         'eventloop.h',
106         'group.h',
107         'http.h',
108         'idle.h',
109         'image.h',
110         'image-store.h',
111         'keyring.h',
112         'log.h',
113         'media.h',
114         'mediamanager.h',
115         'memorypool.h',
116         'message.h',
117         'mime.h',
118         'nat-pmp.h',
119         'network.h',
120         'notify.h',
121         'plugins.h',
122         'pluginpref.h',
123         'pounce.h',
124         'prefs.h',
125         'presence.h',
126         'proxy.h',
127         'protocol.h',
128         'protocols.h',
129         'purple-gio.h',
130         'queuedoutputstream.h',
131         'request.h',
132         'request-datasheet.h',
133         'roomlist.h',
134         'savedstatuses.h',
135         'server.h',
136         'signals.h',
137         'smiley-custom.h',
138         'smiley-list.h',
139         'smiley-parser.h',
140         'smiley-theme.h',
141         'smiley.h',
142         'status.h',
143         'stringref.h',
144         'stun.h',
145         'sound.h',
146         'sound-theme.h',
147         'sound-theme-loader.h',
148         'sslconn.h',
149         'tests.h',
150         'theme.h',
151         'theme-loader.h',
152         'theme-manager.h',
153         'tls-certificate.h',
154         'tls-certificate-info.h',
155         'trie.h',
156         'upnp.h',
157         'util.h',
158         'whiteboard.h',
159         'xfer.h',
160         'xmlnode.h',
163 if enable_vv
164         purple_coreheaders += 'media-gst.h'
165 endif
167 if IS_WIN32
168         purple_coresources += [
169                 'win32/libc_interface.c',
170                 'win32/win32dep.c'
171         ]
173         purple_coreheaders += [
174                 'win32/libc_interface.h',
175                 'win32/libc_internal.h',
176                 'win32/win32dep.h',
177                 'win32/wpurpleerror.h'
178         ]
180         libpurplerc = configure_file(
181             input : 'win32/libpurplerc.rc.in',
182             output : 'libpurplerc.rc',
183             configuration : version_conf)
184         purple_coresources += windows.compile_resources(libpurplerc)
185 endif
187 purple_mediaheaders = [
188         'media/backend-iface.h',
189         'media/candidate.h',
190         'media/codec.h',
191         'media/enum-types.h'
194 purple_enumheaders = [
195         'account.h',
196         'buddyicon.h',
197         'connection.h',
198         'conversation.h',
199         'conversationtypes.h',
200         'debug.h',
201         'eventloop.h',
202         'notify.h',
203         'plugins.h',
204         'protocol.h',
205         'protocols.h',
206         'roomlist.h',
207         'status.h',
208         'sound.h',
209         'xfer.h',
210         'xmlnode.h'
214 enums = gnome.mkenums('enums',
215     sources : purple_enumheaders,
216     h_template : 'enums.h.in',
217     c_template : 'enums.c.in',
218     install_header : true,
219     install_dir : get_option('includedir') + '/libpurple')
220 enums_c = enums[0]
221 enums_h = enums[1]
223 purple_h = configure_file(input : 'purple.h.in',
224                           output : 'purple.h',
225                           configuration : conf,
226                           install : true,
227                           install_dir : get_option('includedir') + '/libpurple')
228 version_h = configure_file(input : 'version.h.in',
229                            output : 'version.h',
230                            configuration : version_conf,
231                            install : true,
232                            install_dir : get_option('includedir') + '/libpurple')
234 purple_builtsources = [
235         enums_c,
238 purple_builtheaders = [
239         purple_h,
240         version_h,
241         enums_h,
244 if enable_dbus
246 # purple dbus server
248 dbus_sources = [
249         'dbus-server.c',
250         'dbus-useful.c'
252 dbus_headers = [
253         'dbus-server.h',
254         'dbus-bindings.h',
255         'dbus-purple.h',
256         'dbus-useful.h',
257         'dbus-define-api.h',
259 dbus_exported = [
260         'dbus-useful.h',
261         'dbus-define-api.h',
262         'account.h',
263         'accounts.h',
264         'blistnode.h',
265         'buddy.h',
266         'buddylist.h',
267         'buddyicon.h',
268         'connection.h',
269         'conversation.h',
270         'conversationtypes.h',
271         'conversations.h',
272         'core.h',
273         'xfer.h',
274         'log.h',
275         'notify.h',
276         'prefs.h',
277         'presence.h',
278         'roomlist.h',
279         'savedstatuses.h',
280         'smiley.h',
281         'smiley-list.h',
282         'status.h',
283         'server.h',
284         'util.h',
285         'xmlnode.h',
286         'protocol.h',
287         'protocols.h'
290 purple_build_coreheaders = purple_coreheaders + purple_mediaheaders
291 purple_build_coreheaders += purple_builtheaders
294 # We should probably make this better
295 dbus_signals = purple_coresources + ['protocols/irc/irc.c', 'protocols/jabber/jabber.c']
297 dbus_analyze_functions = files('dbus-analyze-functions.py')[0]
298 dbus_analyze_signals = files('dbus-analyze-signals.py')[0]
299 dbus_analyze_types = files('dbus-analyze-types.py')[0]
301 dbus_types_c = custom_target('dbus_types_c',
302                              input : purple_build_coreheaders,
303                              output : 'dbus-types.ch',
304                              command : [python, dbus_analyze_types, '-o', '@OUTPUT@',
305                                         '--pattern=PURPLE_DBUS_DEFINE_TYPE(%s)', '@INPUT@'])
307 dbus_types_h = custom_target('dbus_types_h',
308                              input : purple_build_coreheaders,
309                              output : 'dbus-types.h',
310                              command : [python, dbus_analyze_types, '-o', '@OUTPUT@',
311                                         '--pattern=PURPLE_DBUS_DECLARE_TYPE(%s)', '@INPUT@'],
312                              install : true,
313                              install_dir : join_paths(get_option('includedir'), 'libpurple'))
315 dbus_bindings_c = custom_target('dbus_bindings_c',
316                                 input : dbus_exported,
317                                 output : 'dbus-bindings.ch',
318                                 command : [python, dbus_analyze_functions, '-o', '@OUTPUT@',
319                                            '@INPUT@'])
321 dbus_signals_c = custom_target('dbus_signals_c',
322                                input : dbus_signals,
323                                output : 'dbus-signals.ch',
324                                command : [python, dbus_analyze_signals, '-o', '@OUTPUT@',
325                                           '@INPUT@'])
327 dbus_builtheaders = [dbus_types_h]
328 dbus_builtsources = [dbus_types_c, dbus_bindings_c, dbus_signals_c]
330 # libpurple-client
332 purple_client_bindings_h1 = custom_target('purple_client_bindings_h1',
333     input : purple_build_coreheaders,
334     output : 'purple-client-bindings1.h',
335     command : [
336         python, dbus_analyze_types,
337         '--keyword=enum', '--verbatim', '-o', '@OUTPUT@', '@INPUT@'
338     ]
341 purple_client_bindings_h2 = custom_target('purple_client_bindings_h2',
342     input : dbus_exported,
343     output : 'purple-client-bindings2.h',
344     command : [
345         python, dbus_analyze_functions,
346         '--client', '--headers', '-o', '@OUTPUT@', '@INPUT@'
347     ]
350 purple_client_bindings_h = custom_target('purple_client_bindings_h',
351     input : [purple_client_bindings_h1, purple_client_bindings_h2],
352     output : 'purple-client-bindings.h',
353     capture : true,
354     command : ['cat', '@INPUT@'])
356 purple_client_bindings_c = custom_target('purple_client_bindings_c',
357     input : dbus_exported,
358     output : 'purple-client-bindings.ch',
359     command : [
360         python, dbus_analyze_functions,
361         '--client', '-o', '@OUTPUT@', '@INPUT@'
362     ]
365 libpurple_client = library('purple-client',
366     'purple-client.c', purple_client_bindings_c, purple_client_bindings_h,
367     version : PURPLE_LIB_VERSION,
368     dependencies : [dbus, dbus_glib],
369     install : true)
371 # scripts
373 install_data(['purple-remote', 'purple-send', 'purple-send-async', 'purple-url-handler'],
374     install_dir : get_option('bindir'))
376 else
378 dbus_sources = []
379 dbus_headers = []
380 dbus_builtsources = []
381 dbus_builtheaders = []
383 endif
385 libpurple_inc = include_directories('.')
386 libpurple = library('purple',
387                     purple_coresources + purple_builtsources +
388                     dbus_sources + dbus_builtsources +
389                     purple_builtheaders + dbus_builtheaders,
390                     include_directories : [toplevel_inc, libpurple_inc],
391                     install : true,
392                     version : PURPLE_LIB_VERSION,
393                     dependencies : # static_link_libs
394                         [dbus, dbus_glib, dnsapi, ws2_32, glib, gio, gplugin, libxml,
395                          farstream, gstreamer, gstreamer_video,
396                          gstreamer_app, idn, json, math])
397 libpurple_dep = declare_dependency(
398     sources : purple_builtheaders,  # Ensure built before any dependencies.
399     include_directories : [toplevel_inc, libpurple_inc],
400     link_with : libpurple,
401     dependencies : [gstreamer, gplugin, glib, gio])
403 if enable_dbus
405 # purple-client-example
407 purple_client_example = executable('purple-client-example',
408     'purple-client-example.c', purple_client_bindings_h,
409     link_with : [libpurple_client, libpurple],
410     dependencies : [dbus, dbus_glib, glib],
411     install : true)
413 endif
415 install_headers(purple_coreheaders + dbus_headers,
416                 subdir : 'libpurple')
418 install_headers(purple_mediaheaders,
419                 subdir : 'libpurple/media')
421 configure_file(input : 'data/purple-3.pc.in',
422                output : 'purple-3.pc',
423                configuration : pkg_conf,
424                install : true,
425                install_dir : get_option('libdir') + '/pkgconfig')
427 if INSTALL_I18N
428         DESKTOP_FILE = 'purple-url-handler.desktop'
429         desktop_file_in = configure_file(
430             input : 'data/' + DESKTOP_FILE + '.in.in',
431             output : DESKTOP_FILE + '.in',
432             configuration : conf)
433         desktop_file = custom_target(DESKTOP_FILE,
434             input : desktop_file_in,
435             output : DESKTOP_FILE,
436             command : [intltool_merge, '--desktop-style', '-u',
437                        '-c', '@BUILD_DIR@/po/.intltool-merge-cache',
438                        meson.source_root() + '/po', '@INPUT@', '@OUTPUT@'],
439             install : true,
440             install_dir : get_option('datadir') + '/applications')
441 endif  # INSTALL_I18N
443 if enable_introspection
444         introspection_sources = (purple_coreheaders + purple_builtheaders +
445                                  dbus_headers + purple_mediaheaders)
447         Purple_gir_includes = ['GObject-2.0', 'Gio-2.0']
448         if PLUGINS
449                 Purple_gir_includes += ['GPlugin-0.0']
450         endif
451         if enable_dbus
452                 Purple_gir_includes += ['DBus-1.0', 'DBusGLib-1.0']
453         endif
454         if enable_gst
455                 Purple_gir_includes += ['Gst-1.0']
456         endif
458         libpurple_gir = gnome.generate_gir(libpurple,
459             sources : introspection_sources,
460             includes : Purple_gir_includes,
461             namespace : 'Purple',
462             symbol_prefix : 'purple',
463             identifier_prefix : 'Purple',
464             export_packages : 'purple-@0@'.format(purple_major_version),
465             nsversion : '@0@.@1@'.format(purple_major_version,
466                                          purple_minor_version),
467             install : true)
468 endif
470 subdir('tests')
471 subdir('example')
472 subdir('plugins')
473 subdir('protocols')