1src_inc = include_directories('.')
2plugins_inc = include_directories('plugins')
3
4subdir('gst')
5subdir('backend')
6
7enum_headers = files(
8  'backend/bacon-time-label.h',
9  'backend/bacon-video-controls-actor.h',
10  'backend/bacon-video-spinner-actor.h',
11  'backend/bacon-video-widget-gst-missing-plugins.h',
12  'backend/bacon-video-widget.h',
13  'backend/clock.h',
14  'backend/totem-aspect-frame.h',
15  'icon-helpers.h',
16  'totem-grilo.h',
17  'totem-interface.h',
18  'totem-main-toolbar.h',
19  'totem-menu.h',
20  'totem-open-location.h',
21  'totem-options.h',
22  'totem-playlist.h',
23  'totem-preferences.h',
24  'totem-private.h',
25  'totem-profile.h',
26  'totem-resources.h',
27  'totem-search-entry.h',
28  'totem-selection-toolbar.h',
29  'totem-session.h',
30  'totem-subtitle-encoding.h',
31  'totem-uri.h',
32  'totem.h'
33)
34
35gnome.mkenums(
36  'org.gnome.totem.enums.xml',
37  sources: enum_headers,
38  comments: '<!-- @comment@ -->',
39  fhead: '<schemalist>',
40  vhead: '  <@type@ id="org.gnome.totem.@EnumName@">',
41  vprod: '    <value nick="@valuenick@" value="@valuenum@"/>',
42  vtail: '  </@type@>',
43  ftail: '</schemalist>',
44  install_header: true,
45  install_dir: totem_schemadir
46)
47
48totem_common_incs = [
49  top_inc,
50  plugins_inc
51]
52
53totem_common_deps = libbacon_video_widget_deps + python_deps + [
54  glib_dep,
55  gio_dep,
56  gtk_dep,
57  dependency('gmodule-2.0'),
58  totem_plparser_dep,
59  gir_dep,
60  peas_dep,
61  peas_gtk_dep,
62  dependency('grilo-0.3', version: grilo_req_version),
63  dependency('grilo-pls-0.3', version: grilo_req_version),
64  dependency('gnome-desktop-3.0')
65]
66
67totem_common_cflags = common_flags + warn_flags + [
68  '-DDBUS_API_SUBJECT_TO_CHANGE',
69  '-DGNOMELOCALEDIR="@0@"'.format(totem_localedir),
70  '-DDATADIR="@0@"'.format(totem_datadir),
71  '-DLIBEXECDIR="@0@"'.format(totem_libexecdir),
72  '-DTOTEM_PLUGIN_DIR="@0@"'.format(totem_pluginsdir),
73  '-DBINDIR="@0@"'.format(totem_bindir),
74  '-DGTKBUILDERDIR=""'
75]
76
77headers = files(
78  'plugins/totem-plugin.h',
79  'plugins/totem-dirs.h',
80  'totem-interface.h',
81  'totem.h'
82)
83
84install_headers(
85  headers,
86  subdir: totem_api_path
87)
88
89libtotem_player_sources = files(
90  'totem-interface.c',
91)
92
93libtotem_player_deps = totem_common_deps + [
94  libtotem_time_helpers_dep
95]
96
97libtotem_player = static_library(
98  'totem_player',
99  sources: libtotem_player_sources,
100  include_directories: top_inc,
101  dependencies: libtotem_player_deps,
102  c_args: totem_common_cflags + [
103    '-DG_LOG_DOMAIN="Totem"'
104  ]
105)
106
107libtotem_player_dep = declare_dependency(
108  link_with: libtotem_player,
109  include_directories: src_inc,
110  dependencies: libtotem_player_deps
111)
112
113libtotem_sources = files(
114  'plugins/totem-dirs.c',
115  'plugins/totem-plugins-engine.c',
116  'icon-helpers.c',
117  'totem-grilo.c',
118  'totem-main-toolbar.c',
119  'totem-menu.c',
120  'totem-object.c',
121  'totem-open-location.c',
122  'totem-options.c',
123  'totem-playlist.c',
124  'totem-preferences.c',
125  'totem-search-entry.c',
126  'totem-selection-toolbar.c',
127  'totem-session.c',
128  'totem-subtitle-encoding.c',
129  'totem-uri.c'
130)
131
132libtotem_sources += gnome.compile_resources(
133  'griloresources',
134  'grilo.gresource.xml',
135  export: true,
136  source_dir: '.',
137  c_name: '_totem'
138)
139
140libtotem_deps = [
141  libtotem_player_dep,
142  libbacon_video_widget_dep,
143  libgd_dep
144]
145
146libtotem = shared_library(
147  'totem',
148  sources: libtotem_sources + gen_sources,
149  version: libversion,
150  soversion: soversion,
151  include_directories: totem_common_incs,
152  dependencies: libtotem_deps,
153  c_args: totem_common_cflags + [
154    '-DG_LOG_DOMAIN="Totem"'
155  ],
156  install: true,
157  install_dir: totem_libdir
158)
159
160libtotem_dep = declare_dependency(
161  link_with: libtotem,
162  include_directories: src_inc,
163  dependencies: libtotem_deps
164)
165
166pkg.generate(
167  libraries: libtotem,
168  version: totem_version,
169  name: 'Totem',
170  description: 'Totem Movie Player plugin API',
171  filebase: meson.project_name(),
172  subdirs: totem_api_path,
173  requires: [
174    'gio-2.0 ' + glib_req_version,
175    'gtk+-3.0 ' + gtk_req_version,
176    'totem-plparser ' + totem_plparser_req_version
177  ],
178  variables: [
179    'exec_prefix=' + totem_libexecdir,
180    'pluginsdir=' + totem_pluginsdir
181  ],
182  install_dir: join_paths(totem_libdir, 'pkgconfig')
183)
184
185totem = executable(
186  meson.project_name(),
187  'totem.c',
188  include_directories: totem_common_incs,
189  dependencies: libtotem_dep,
190  c_args: totem_common_cflags + [
191    '-DG_LOG_DOMAIN="Totem"'
192  ],
193  install: true,
194  install_dir: totem_bindir
195)
196
197totem_video_thumbnailer_sources = files(
198  'totem-resources.c',
199  'totem-video-thumbnailer.c'
200)
201
202totem_video_thumbnailer_deps = [
203  totem_plparser_dep,
204  gst_tag_dep,
205  gst_video_dep,
206  m_dep,
207  libtotem_gst_helpers_dep,
208  libtotem_gst_pixbuf_helpers_dep,
209]
210
211executable(
212  'totem-video-thumbnailer',
213  totem_video_thumbnailer_sources,
214  include_directories: top_inc,
215  dependencies: totem_video_thumbnailer_deps,
216  c_args: totem_common_cflags + [
217    '-DG_LOG_DOMAIN="TotemVideoThumbnailer"'
218  ],
219  install: true,
220  install_dir: totem_bindir
221)
222
223totem_gallery_thumbnailer_sources = files(
224  'totem-gallery-thumbnailer.c'
225)
226
227totem_gallery_thumbnailer_deps = [
228  dependency('gdk-3.0'),
229  totem_plparser_dep,
230  gst_tag_dep,
231  gst_video_dep,
232  m_dep,
233  libtotem_gst_helpers_dep,
234  libtotem_gst_pixbuf_helpers_dep,
235  libtotem_time_helpers_dep
236]
237
238executable(
239  'totem-gallery-thumbnailer',
240  totem_gallery_thumbnailer_sources,
241  include_directories: top_inc,
242  dependencies: totem_gallery_thumbnailer_deps,
243  c_args: totem_common_cflags + [
244    '-DG_LOG_DOMAIN="TotemGalleryThumbnailer"'
245  ],
246  install: true,
247  install_dir: totem_libexecdir
248)
249
250test_icons_sources = files(
251  'icon-helpers.c',
252  'test-icons.c'
253)
254
255executable(
256  'test-icons',
257  test_icons_sources,
258  dependencies: [
259    libtotem_player_dep,
260    libbacon_video_widget_dep
261  ],
262  c_args: totem_common_cflags
263)
264
265gir_sources = libtotem_sources + libtotem_player_sources + headers
266
267gir_incs = [
268  'Gio-2.0',
269  'GLib-2.0',
270  'GObject-2.0',
271  'Gtk-3.0',
272  'TotemPlParser-1.0'
273]
274
275gir_extra_args = [
276  '--c-include=totem.h',
277  '--pkg-export=totem'
278]
279
280gir_dir = join_paths(totem_datadir, 'gir-' + totem_api_version)
281typelib_dir = join_paths(totem_libdir, 'girepository-' + totem_api_version)
282
283libtotem_gir = gnome.generate_gir(
284  libtotem,
285  sources: gir_sources,
286  nsversion: totem_api_version,
287  namespace: totem_gir_ns,
288  symbol_prefix: totem_gir_ns.to_lower(),
289  identifier_prefix: totem_gir_ns,
290  includes: gir_incs,
291  include_directories: src_inc,
292  install: true,
293  install_dir_gir: gir_dir,
294  install_dir_typelib: typelib_dir,
295  extra_args: gir_extra_args
296)
297
298tests = [ 'test-totem' ]
299
300foreach test_name : tests
301  exe = executable(test_name, '@0@.c'.format(test_name),
302                   include_directories: [src_inc, top_inc],
303                   dependencies: libtotem_dep)
304
305  test(test_name, exe)
306endforeach
307
308subdir('plugins')
309