meson.build 2.19 KB
Newer Older
1 2 3 4 5 6 7 8 9
gnome = import('gnome')
zathura_resources = gnome.compile_resources(
  'resources',
  'zathura.gresource.xml',
  c_name: 'zathura_resources',
  dependencies: files('zathura.css_t', 'org.pwmt.zathura.xml')
)

install_data('org.pwmt.zathura.xml', install_dir: dbusinterfacesdir)
10 11
install_data('org.pwmt.zathura.svg', install_dir: join_paths(datadir, 'icons', 'scalable', 'apps'))

12
rsvg_convert = find_program('rsvg-convert', required: get_option('convert-icon'), native: true)
13 14 15 16 17
if rsvg_convert.found()
  foreach width : [16, 32, 64, 128, 256]
    subdir('icon-@0@'.format(width))
  endforeach
endif
18 19

i18n = import('i18n')
20 21
podir = join_paths(meson.source_root(), 'po')

Sebastian Ramacher's avatar
Sebastian Ramacher committed
22
desktop = i18n.merge_file('desktop',
23 24
  input: 'org.pwmt.zathura.desktop.in',
  output: 'org.pwmt.zathura.desktop',
25 26
  install: true,
  install_dir: desktopdir,
27
  po_dir: podir,
28 29
  type: 'desktop'
)
Sebastian Ramacher's avatar
Sebastian Ramacher committed
30

31 32 33 34 35 36 37 38
appdata = i18n.merge_file('appdata',
  input: 'org.pwmt.zathura.appdata.xml.in',
  output: 'org.pwmt.zathura.appdata.xml',
  install: true,
  install_dir: metainfodir,
  po_dir: podir,
)

Sebastian Ramacher's avatar
Sebastian Ramacher committed
39
desktop_file_validate = find_program('desktop-file-validate', required: get_option('tests'), native: true)
Sebastian Ramacher's avatar
Sebastian Ramacher committed
40 41 42 43 44 45
if desktop_file_validate.found()
  test('validate-desktop',
    desktop_file_validate,
    args: [desktop.full_path()]
  )
endif
46

Sebastian Ramacher's avatar
Sebastian Ramacher committed
47
appstream_util = find_program('appstream-util', required: get_option('tests'), native: true)
48 49 50
if appstream_util.found()
  test('validate-appdata',
    appstream_util,
51
    args: ['validate-relax', '--nonet', appdata.full_path()]
52 53
  )
endif
Sebastian Ramacher's avatar
Sebastian Ramacher committed
54 55 56 57 58 59 60 61

conf_data = configuration_data()
conf_data.set('PLUGINDIR', join_paths(prefix, plugindir))
bash_completion = configure_file(
  input: 'bash-completion.in',
  output: 'zathura',
  configuration: conf_data
)
Sebastian Ramacher's avatar
Sebastian Ramacher committed
62 63 64 65 66
zsh_completion = configure_file(
  input: 'zsh-completion.in',
  output: '_zathura',
  configuration: conf_data
)
Ivan Tham's avatar
Ivan Tham committed
67 68 69 70 71
fish_completion = configure_file(
  input: 'fish-completion.in',
  output: 'zathura.fish',
  configuration: conf_data
)
Sebastian Ramacher's avatar
Sebastian Ramacher committed
72 73

install_data(bash_completion, install_dir: join_paths(datadir, 'bash-completion', 'completions'))
Ronan Pigott's avatar
Ronan Pigott committed
74
install_data(zsh_completion, install_dir: join_paths(datadir, 'zsh', 'site-functions'))
Ivan Tham's avatar
Ivan Tham committed
75
install_data(fish_completion, install_dir: join_paths(datadir, 'fish', 'completions'))