meson.build 7.8 KB
Newer Older
1
2
3
4
5
6
7
8
#
# meson.build
#
# Author: Juan A. Suarez Romero <jasuarez@igalia.com>
#
# Copyright (C) 2016 Igalia S.L. All rights reserved.

project('grilo-plugins', 'c',
9
        version: '0.3.13',
10
11
12
13
14
15
        default_options: [
            'buildtype=debugoptimized',
            'c_std=gnu99',
            'warning_level=1'
        ],
        license: 'LGPL 2.1',
Victor Toso's avatar
Victor Toso committed
16
        meson_version: '>= 0.44.0')
17
18
19
20
21
22
23
24
25

plugin_version = meson.project_version()
version_array = plugin_version.split('.')
grl_major = version_array[0]
grl_minor = version_array[1]

prefix = get_option('prefix')
localedir = join_paths(prefix, get_option('localedir'))
libdir = get_option('libdir')
26
datadir = get_option('datadir')
27
28
pluginsdir =join_paths(libdir, 'grilo-@0@.@1@'.format(grl_major, grl_minor))

29
glib2_required = '2.44'
30
grilo_required = '0.3.8'
31
glib2_required_info = '>= @0@'.format(glib2_required)
32
grilo_required_info = '>= @0@'.format(grilo_required)
33
34
35
36

glib_dep = dependency('glib-2.0', version: glib2_required_info, required: true)
gmodule_dep = dependency('gmodule-2.0', version: glib2_required_info, required: true)
gobject_dep = dependency('gobject-2.0', version: glib2_required_info, required: true)
37
38
grilo_dep = dependency('grilo-0.3', version: grilo_required_info, required: true,
                       fallback: ['grilo', 'libgrl_dep'])
39

Marinus Schraal's avatar
Marinus Schraal committed
40
41
42
43
44
45
46
47
48
49
pkgconf = configuration_data()
pkgconf.set('VERSION', plugin_version)

pkgconfig_file = 'grilo-plugins-@0@.@1@'.format(grl_major, grl_minor)

configure_file(input: pkgconfig_file + '.pc.in',
               output: pkgconfig_file + '.pc',
               configuration: pkgconf,
               install_dir: '@0@/pkgconfig'.format(get_option('libdir')))

50
51
52
53
54
55
avahi_client_dep = dependency('avahi-client', required: false)
avahi_glib_dep = dependency('avahi-glib', required: false)
avahi_gobject_dep = dependency('avahi-gobject', required: false)
gio_dep = dependency('gio-2.0', required: false)
gio_unix_dep = dependency('gio-unix-2.0', required: false)
goa_dep = dependency('goa-1.0', version: '>= 3.17.91', required: false)
Bastien Nocera's avatar
Bastien Nocera committed
56
gom_dep = dependency('gom-1.0', version: '>= 0.4', required: false)
57
58
59
60
grilo_net_dep = dependency('grilo-net-0.3', version: '>= 0.3.0', required: false,
                           fallback: ['grilo', 'libgrlnet_dep'])
grilo_pls_dep = dependency('grilo-pls-0.3', version: '>= 0.3.0', required: false,
                           fallback: ['grilo', 'libgrlpls_dep'])
61
62
63
64
gstreamer_dep = dependency('gstreamer-1.0', required: false)
gthread_dep = dependency('gthread-2.0', required: false)
json_glib_dep = dependency('json-glib-1.0', required: false)
libarchive_dep = dependency('libarchive', required: false)
65
libdmapsharing4_dep = dependency('libdmapsharing-4.0', version: '>= 3.9.9', required: false)
66
67
68
69
70
if libdmapsharing4_dep.found()
    libdmapsharing_dep = libdmapsharing4_dep
else
    libdmapsharing_dep = dependency('libdmapsharing-3.0', version: '>= 2.9.12', required: false)
endif
71
72
73
74
75
76
77
78
libgdata_dep = dependency('libgdata', version: '>= 0.9.1', required: false)
libmediaart_dep = dependency('libmediaart-2.0', required: false)
libsoup_dep = dependency('libsoup-2.4', required: false)
libxml_dep = dependency('libxml-2.0', required: false)
oauth_dep = dependency('oauth', required: false)
sqlite3_dep = dependency('sqlite3', required: false)
totem_plparser_dep = dependency('totem-plparser', version: '>= 3.4.1', required: false)
totem_plparser_mini_dep = dependency('totem-plparser-mini', version: '>= 3.4.1', required: false)
79
tracker_sparql_dep = dependency('tracker-sparql-2.0', version: '>= 2.3.0', required: false)
Carlos Garnacho's avatar
Carlos Garnacho committed
80
tracker3_dep = dependency('tracker-sparql-3.0', required: false)
81
tracker3_testutils_dep = dependency('tracker-testutils-3.0', required: false)
82
83
84
85

lua_dep = dependency('lua', version: '>= 5.3.0', required: false)
if not lua_dep.found()
    lua_dep = dependency('lua5.3', version: '>= 5.3.0', required: false)
86
87
88
    if not lua_dep.found()
        lua_dep = dependency('lua-5.3', version: '>= 5.3.0', required: false)
    endif
89
90
91
92
93
94
95
96
97
98
99
100
101
102
endif

gperf = find_program('gperf', required: false)
glib_compile_resources = find_program('glib-compile-resources', required: false)

must_deps = [glib_dep, gmodule_dep, gobject_dep, grilo_dep]

cdata = configuration_data()
cdata.set('GRL_MAJOR', grl_major)
cdata.set('GRL_MINOR', grl_minor)
cdata.set_quoted('GETTEXT_PACKAGE', meson.project_name())
cdata.set_quoted('LOCALEDIR', localedir)
cdata.set_quoted('VERSION', plugin_version)

103
104
105
106
# Defines for optional dependencies
cdata.set('GOA_ENABLED', goa_dep.found())
cdata.set('HAVE_TOTEM_PLPARSER_MINI', totem_plparser_mini_dep.found())

107
NAME = 0
108
109
REQ_DEPS = 1
OPT_DEPS = 2
110

111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
plugins = [ # NAME, REQ_DEPS, OPT_DEPS
    ['bookmarks', [gio_dep, libxml_dep, gom_dep], []],
    ['chromaprint', [gstreamer_dep], []],
    ['dleyna', [gio_dep, gio_unix_dep, libsoup_dep], []],
    ['dmap', [libdmapsharing_dep, libxml_dep], []],
    ['filesystem', [grilo_pls_dep], []],
    ['flickr', [grilo_net_dep, libxml_dep, oauth_dep], [goa_dep]],
    ['freebox', [grilo_pls_dep, avahi_client_dep, avahi_glib_dep, avahi_gobject_dep], []],
    ['gravatar', [], []],
    ['jamendo', [grilo_net_dep, libxml_dep], []],
    ['local-metadata', [gio_dep, libmediaart_dep], []],
    ['lua-factory', [lua_dep, libarchive_dep, grilo_net_dep, json_glib_dep, libxml_dep], [goa_dep, totem_plparser_mini_dep]],
    ['magnatune', [sqlite3_dep, grilo_net_dep], []],
    ['metadata-store', [sqlite3_dep], []],
    ['opensubtitles', [gio_dep, libsoup_dep], []],
    ['optical-media', [totem_plparser_dep], []],
127
    ['podcasts', [grilo_net_dep, libxml_dep, sqlite3_dep, totem_plparser_dep], []],
128
129
130
131
132
    ['raitv', [grilo_net_dep, libxml_dep], []],
    ['shoutcast', [grilo_net_dep, libxml_dep], []],
    ['thetvdb', [grilo_net_dep, libxml_dep, libarchive_dep, gom_dep], []],
    ['tmdb', [json_glib_dep, libsoup_dep, grilo_net_dep], []],
    ['tracker', [tracker_sparql_dep], []],
Carlos Garnacho's avatar
Carlos Garnacho committed
133
    ['tracker3', [tracker3_dep], []],
134
135
    ['vimeo', [grilo_net_dep, libxml_dep, totem_plparser_dep], []],
    ['youtube', [grilo_net_dep, libxml_dep, libgdata_dep, totem_plparser_dep], []],
136
137
138
139
140
141
142
143
144
]

idx = 0
foreach p: plugins
    varname = p[NAME].underscorify()
    varname_enabled = varname + '_enabled'
    varname_idx = varname + '_idx'

    current_enabled = get_option('enable-' + p[NAME]) == 'no' ? false : true
145
    current_deps = p[REQ_DEPS]
146
147
148
149
150
151
152
153
154
155
156
157
    if current_enabled
        current_auto = get_option('enable-'+ p[NAME]) == 'auto'
        foreach d: current_deps
            if current_auto
                current_enabled = current_enabled and d.found()
            elif not d.found()
                error('Missing dependencies for @0@ plugin'.format(p[NAME]))
            endif
        endforeach
    endif
    set_variable(varname_enabled, current_enabled)
    set_variable(varname_idx, idx)
158
159
160
161
162
163
    if p[NAME] != 'dmap'
        cdata.set_quoted(varname.to_upper() + '_PLUGIN_ID', 'grl-' + p[NAME])
    else
        cdata.set_quoted('DPAP_PLUGIN_ID', 'grl-dpap')
        cdata.set_quoted('DAAP_PLUGIN_ID', 'grl-daap')
    endif
164
165
166
    if p[NAME] == 'dleyna'
      cdata.set_quoted('DLEYNA_DBUS_NAME', get_option('dleyna-service-name'))
    endif
167
168
169
170
171
172
173
    idx = idx + 1
endforeach

# Special case: Lua Factory requires gperf program
if lua_factory_enabled
    if get_option('enable-lua-factory') == 'auto'
        lua_factory_enabled = lua_factory_enabled and gperf.found() and glib_compile_resources.found()
174
    elif not gperf.found() or not glib_compile_resources.found()
175
176
177
178
        error('Missing dependencies for lua-factory plugin')
    endif
endif

179
180
181
182
183
# Special case: tracker and tracker3 modules are mutually exclusive
if tracker3_enabled and tracker_enabled
    error('tracker3 and tracker modules cannot be enabled at the same time')
endif

184
185
186
187
188
189
190
191
message('Plugins:')
foreach p: plugins
    name = p[NAME].underscorify() + '_enabled'
    message('   @0@ : @1@'.format(p[NAME], get_variable(name).to_string('yes', 'no')))
endforeach

gnome = import('gnome')

Victor Toso's avatar
Victor Toso committed
192
193
rootdir = include_directories('.')

194
195
196
197
subdir('src')
subdir('help')
subdir('po')
subdir('tests')