summaryrefslogtreecommitdiff
path: root/data/meson.build
blob: f757527957402433932198e948ba5cd9d8ba9b27 (plain)
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
subdir('appdata')
subdir('icons')

desktop_sh = find_program('desktop.sh')
thumbnailer_sh = find_program('thumbnailer.sh')
mime_type_include_sh = find_program('mime-type-include.sh')
mime_type_imports_sh = find_program('mime-type-imports.sh')
uri_scheme_include_sh = find_program('uri-scheme-include.sh')

mime_type_list = files('mime-type-list.txt')
uri_schemes_list = files('uri-schemes-list.txt')

pod2man = find_program('pod2man', required: false)

if pod2man.found()
  thumbnailer_name = 'totem-video-thumbnailer'
  pod2man_opts = [
    '-c', '""',
    '-s', '1',
    '-q', 'none',
    '-n', thumbnailer_name,
    '-r', 'GNOME'
  ]

  custom_target(
    thumbnailer_name + '.1',
    input: thumbnailer_name + '.pod',
    output: thumbnailer_name + '.1',
    command: [pod2man, pod2man_opts, '@INPUT@', '@OUTPUT@'],
    install: true,
    install_dir: join_paths(totem_mandir, 'man1')
  )

  install_data(
    'totem.1',
    install_dir: join_paths(totem_mandir, 'man1')
  )
else
  message('Man page generation disabled')
endif

ui_files = files(
  'controls.ui',
  'playlist.ui',
  'preferences.ui',
  'properties.ui',
  'shortcuts.ui',
  'totem.ui',
  'uri.ui'
)

install_data(
  ui_files,
  install_dir: totem_pkgdatadir
)

r = run_command(desktop_sh, mime_type_list, uri_schemes_list)

desktop_conf = configuration_data()
desktop_conf.set('VERSION', totem_version)
desktop_conf.set('MIME_TYPE', r.stdout().strip())

desktop = 'org.gnome.Totem.desktop'

desktop_in = configure_file(
  input: desktop + '.in.in',
  output: desktop + '.in',
  configuration: desktop_conf
)

i18n.merge_file (
  desktop,
  type: 'desktop',
  input: desktop_in,
  output: desktop,
  po_dir: po_dir,
  install: true,
  install_dir: join_paths(totem_datadir, 'applications')
)

service_conf = configuration_data()
service_conf.set('bindir', totem_bindir)

service = 'org.gnome.Totem.service'

configure_file(
  input: service + '.in',
  output: service,
  install: true,
  install_dir: join_paths(totem_datadir, 'dbus-1', 'services'),
  configuration: service_conf
)

r = run_command(thumbnailer_sh, mime_type_list)

thumbnailer_conf = configuration_data()
thumbnailer_conf.set('BINDIR', totem_bindir)
thumbnailer_conf.set('MIME_TYPE', r.stdout().strip())

thumbnailer = 'totem.thumbnailer'

configure_file(
  input: thumbnailer + '.meson',
  output: thumbnailer,
  install: true,
  install_dir: join_paths(totem_datadir, 'thumbnailers'),
  configuration: thumbnailer_conf
)

gen_sources = []

totem_mime_header = 'totem-mime-types.h'

gen_sources += custom_target(
  totem_mime_header,
  output: totem_mime_header,
  capture: true,
  command: [mime_type_include_sh, mime_type_list]
)

nautilus_mime_header = 'nautilus-video-mime-types.h'

custom_target(
  nautilus_mime_header,
  output: nautilus_mime_header,
  capture: true,
  command: [mime_type_include_sh, '--nautilus', mime_type_list]
)

totem_mime_js = 'totemMimeTypes.js'

custom_target(
  totem_mime_js,
  output: totem_mime_js,
  capture: true,
  command: [mime_type_imports_sh, mime_type_list]
)

totem_uri_header = 'totem-uri-schemes.h'

gen_sources += custom_target(
  totem_uri_header,
  output: totem_uri_header,
  capture: true,
  command: [uri_scheme_include_sh, uri_schemes_list],
)

schema_conf = configuration_data()
schema_conf.set('GETTEXT_PACKAGE', meson.project_name())

schema = 'org.gnome.totem.gschema.xml'

configure_file(
  input: schema + '.in',
  output: schema,
  install: true,
  install_dir: totem_schemadir,
  configuration: schema_conf
)

install_data(
  'totem.convert',
  install_dir: join_paths(totem_datadir, 'GConf', 'gsettings')
)