summaryrefslogtreecommitdiff
path: root/data/meson.build
blob: 65ddc4b77a2e129edccea4e53fdcfbc6a47ed3f4 (plain) (blame)
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
data_config = configuration_data({
  'PROJECT_NAME': project_name,
  'APPLICATION_ID': application_id,
  'EXEC': application_name,
  'APPLICATION_PATH': application_path,
  'LICENSE': ', '.join(meson.project_license()),
  'PROJECT_INFO': description,
  'DESKTOP_NAME': desktop_name,
})

i18n_data += configure_file(
  input: '@0@.desktop.in.in'.format(application_id),
  output: '@BASENAME@',
  configuration: data_config,
)

desktop_file = i18n.merge_file(
  input: i18n_data[-1],
  output: '@BASENAME@',
  type: 'desktop',
  po_dir: '../po',
  install: true,
  install_dir: join_paths(get_option('datadir'), 'applications')
)

desktop_utils = find_program('desktop-file-validate', required: false)
if desktop_utils.found()
  test('Validate desktop file', desktop_utils,
    args: [desktop_file]
  )
endif

i18n_data += configure_file(
  input: '@0@.appdata.xml.in.in'.format(application_id),
  output: '@BASENAME@',
  configuration: data_config,
)

appstream_file = i18n.merge_file(
  input: i18n_data[-1],
  output: '@BASENAME@',
  po_dir: '../po',
  install: true,
  install_dir: join_paths(get_option('datadir'), 'appdata')
)

appstream_util = find_program('appstream-util', required: false)
if appstream_util.found()
  test('Validate appstream file', appstream_util,
    args: ['validate', appstream_file]
  )
endif

i18n_data += configure_file(
  input: '@0@.gschema.xml.in.in'.format(application_id),
  output: '@BASENAME@',
  configuration: data_config,
)

gscheme_file = i18n.merge_file(
  input: i18n_data[-1],
  output: '@BASENAME@',
  po_dir: '../po',
  install: true,
  install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas')
)

compile_schemas = find_program('glib-compile-schemas', required: false)
if compile_schemas.found()
  test('Validate schema file', compile_schemas,
    args: ['--strict', '--dry-run', meson.current_source_dir()]
  )
endif

subdir('icons')
subdir('ui')

resources = gnome.compile_resources('@0@-resources'.format(project_name),
  '@0@.gresource.xml'.format(project_name),
  source_dir: meson.current_source_dir(),
  c_name: project_name,
  dependencies: ui_defs
)