File: meson.build

package info (click to toggle)
revelation 0.5.4-2
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 2,184 kB
  • sloc: python: 6,243; xml: 244; makefile: 144; sh: 5
file content (79 lines) | stat: -rw-r--r-- 2,016 bytes parent folder | download
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
subdir('icons')

# Compile the resources
resource_data = files(
  'ui/help-overlay.ui',
  'ui/menubar.ui',
  'ui/popup-tree.ui',
)

gnome.compile_resources(
  rvl_name,
  rvl_name + '.gresource.xml',
  gresource_bundle: true,
  source_dir: meson.current_build_dir(),
  install_dir: rvl_pkgdatadir,
  install: true,
  dependencies: resource_data,
)

# Install the schema file
install_data(
  rvl_namespace + '.gschema.xml',
  install_dir: join_paths(rvl_datadir, 'glib-2.0', 'schemas')
)

# Install the mime file
install_data(
  rvl_name + '.xml',
  install_dir: join_paths(rvl_datadir, 'mime', 'packages')
)

# Merge the translations with the desktop file
desktop_conf = configuration_data()
desktop_conf.set('icon', rvl_namespace)
i18n.merge_file(
  type: 'desktop',
  input: configure_file(
    output: rvl_namespace + '.desktop.in',
    input: rvl_namespace + '.desktop.in.in',
    configuration: desktop_conf),
  output: rvl_namespace + '.desktop',
  po_dir: join_paths(meson.source_root(), 'po'),
  install: true,
  install_dir: join_paths(rvl_datadir, 'applications')
)

# Validate the desktop file
desktop_file_validate = find_program('desktop-file-validate', required:false)
if desktop_file_validate.found()
  test (
    'Validate desktop file',
    desktop_file_validate,
    args: join_paths(meson.current_build_dir (), rvl_namespace + '.desktop')
  )
endif

appdata = rvl_namespace + '.appdata.xml'
rvl_appstreamdir = join_paths(rvl_datadir, 'metainfo')

# Merge the translations with the appdata file
i18n.merge_file(
  appdata,
  input: appdata + '.in',
  output: appdata,
  po_dir: join_paths(meson.source_root(), 'po'),
  install: true,
  install_dir: rvl_appstreamdir,
)

# Validate the appdata file
appstream_util = find_program('appstream-util', required: false)
if appstream_util.found()
  test (
    'Validate appdata file',
    appstream_util,
    args: ['validate-relax', join_paths(meson.current_build_dir (),
                                        rvl_namespace + '.appdata.xml')]
  )
endif