meson.build 5.83 KB
Newer Older
1 2
gnome = import('gnome')

3 4
includedir = join_paths(get_option('includedir'), 'totem-pl-parser/1/plparser')

5 6 7 8 9 10 11 12 13 14 15 16
plparser_public_headers = [
  'totem-pl-parser.h',
  'totem-pl-playlist.h',
  'totem-pl-parser-mini.h',
]
install_headers(plparser_public_headers, subdir : 'totem-pl-parser/1/plparser')

# generate totem-pl-parser-features.h
version_cdata = configuration_data()
version_cdata.set('TOTEM_PL_PARSER_VERSION_MAJOR', plparse_major_version)
version_cdata.set('TOTEM_PL_PARSER_VERSION_MINOR', plparse_minor_version)
version_cdata.set('TOTEM_PL_PARSER_VERSION_MICRO', plparse_micro_version)
17 18
features_h = configure_file(input:  'totem-pl-parser-features.h.in',
                            output: 'totem-pl-parser-features.h',
19
                            install_dir: includedir,
20 21 22 23 24 25
                            configuration: version_cdata)

totem_pl_parser_builtins = gnome.mkenums('totem-pl-parser-builtins',
                                         sources: 'totem-pl-parser.h',
                                         c_template : 'totem-pl-parser-builtins.c.template',
                                         h_template : 'totem-pl-parser-builtins.h.template',
26
                                         install_dir : includedir,
27 28 29 30 31 32 33 34 35 36 37 38
                                         install_header : true)

totem_pl_parser_builtins_h = totem_pl_parser_builtins[1]

totem_pl_parser_marshalers = gnome.genmarshal('totemplparser-marshal',
                                              sources : 'totemplparser-marshal.list',
                                              prefix : '_totemplparser_marshal')

plparser_sources = [
  'totem-disc.c',
  'totem-pl-parser.c',
  'totem-pl-parser-amz.c',
39
  'totem-pl-parser-decode-date.c',
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
  'totem-pl-parser-lines.c',
  'totem-pl-parser-media.c',
  'totem-pl-parser-misc.c',
  'totem-pl-parser-pla.c',
  'totem-pl-parser-pls.c',
  'totem-pl-parser-podcast.c',
  'totem-pl-parser-qt.c',
  'totem-pl-parser-smil.c',
  'totem-pl-parser-videosite.c',
  'totem-pl-parser-wm.c',
  'totem-pl-parser-xspf.c',
  'totem-pl-playlist.c',
  'xmlparser.c',
  'xmllexer.c',
]

totemlib_inc = include_directories('../lib')

libexecdir = join_paths(get_option('prefix'), get_option('libexecdir'))

plparser_cflags = extra_warning_cflags + ['-DLIBEXECDIR="@0@"'.format(libexecdir)]

symbol_map = 'plparser.map'
symbol_link_args = '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), symbol_map)

plparser_lib = library('totem-plparser',
                       plparser_sources, features_h,
                       totem_pl_parser_builtins,
                       totem_pl_parser_marshalers,
                       include_directories: [config_inc, totemlib_inc],
                       c_args: plparser_cflags,
                       dependencies: totem_pl_parser_deps,
                       link_args : symbol_link_args,
                       link_with: totem_glibc_lib,
                       link_depends : symbol_map,
75
                       version: plparse_libversion,
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
                       install: true)

plparser_dep = declare_dependency(sources: [totem_pl_parser_builtins_h, features_h],
                                  include_directories: [config_inc, plparser_inc],
                                  dependencies: gio_dep,
                                  link_with: plparser_lib)

plparser_mini_sources = [
  'totem-pl-parser.c',
  'totem-pl-parser-lines.c',
  'totem-pl-parser-misc.c',
  'totem-pl-parser-pls.c',
  'totem-pl-parser-podcast.c',
  'totem-pl-parser-qt.c',
  'totem-pl-parser-smil.c',
  'totem-pl-parser-videosite.c',
  'totem-pl-parser-wm.c',
  'totem-pl-parser-xspf.c',
  'totem-pl-parser-amz.c',
  'totem-pl-playlist.c',
]

mini_symbol_map = 'plparser-mini.map'
mini_symbol_link_args = '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), mini_symbol_map)

plparser_mini_lib = library('totem-plparser-mini',
                            plparser_mini_sources,
                            totem_pl_parser_builtins, features_h,
                            include_directories: [config_inc, totemlib_inc],
                            c_args: plparser_cflags + ['-DTOTEM_PL_PARSER_MINI'],
                            dependencies: gio_dep,
                            link_args : mini_symbol_link_args,
                            link_with: totem_glibc_lib,
                            link_depends : mini_symbol_map,
110
                            version: plparse_libversion,
111 112 113
                            install: true)

if have_quvi
Bastien Nocera's avatar
Bastien Nocera committed
114 115 116 117 118 119 120
  videosite_quvi_exe = executable('99-totem-pl-parser-videosite-quvi',
                                  'videosite-quvi.c', totem_pl_parser_builtins_h,
                                  c_args: '-DLIBEXECDIR="@0@"'.format(libexecdir),
                                  include_directories: [config_inc, totemlib_inc],
                                  dependencies: [quvi_dep, glib_dep],
                                  install_dir: join_paths(libexecdir, 'totem-pl-parser'),
                                  install: true)
121 122 123
endif

# Introspection
124
if get_option('introspection')
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
  gnome.generate_gir(plparser_lib,
                     sources: plparser_public_headers + plparser_sources + [
                       totem_pl_parser_marshalers[1],
                       totem_pl_parser_builtins_h,
                       features_h,
                     ],
                     namespace: 'TotemPlParser',
                     nsversion: '1.0',
                     identifier_prefix: 'TotemPl',
                     symbol_prefix: 'totem_pl',
                     includes: ['GObject-2.0', 'Gio-2.0'],
                     extra_args: ['--identifier-prefix=TotemDisc',
                                  '--symbol-prefix=totem_disc',
                                  '--identifier-prefix=TotemCd',
                                  '--symbol-prefix=totem_cd',
                                  '--quiet'],
                     install: true)
endif

subdir('tests')