summaryrefslogtreecommitdiffstats
path: root/plugins/epiphany/meson.build
blob: 05fc7b6e4b1e9b129c1e5a580e748b90b79f8fcc (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
cargs = ['-DG_LOG_DOMAIN="GsPluginEpiphany"']

# The WebAppProvider interface xml comes from:
# https://gitlab.gnome.org/GNOME/epiphany/-/blob/master/src/webapp-provider/org.gnome.Epiphany.WebAppProvider.xml
epiphany_generated = gnome.gdbus_codegen(
  'gs-epiphany-generated',
  sources : ['org.gnome.Epiphany.WebAppProvider.xml'],
  interface_prefix : 'org.gnome.Epiphany',
  namespace : 'GsEphy',
)

shared_module(
  'gs_plugin_epiphany',
  epiphany_generated,
  sources : 'gs-plugin-epiphany.c',
  include_directories : [
    include_directories('../..'),
    include_directories('../../lib'),
  ],
  install : true,
  install_dir: plugin_dir,
  c_args : cargs,
  dependencies : plugin_libs,
  link_with : [
    libgnomesoftware,
  ],
)
metainfo = 'org.gnome.Software.Plugin.Epiphany.metainfo.xml'

i18n.merge_file(
  input: metainfo + '.in',
  output: metainfo,
  type: 'xml',
  po_dir: join_paths(meson.project_source_root(), 'po'),
  install: true,
  install_dir: join_paths(get_option('datadir'), 'metainfo'),
)

if get_option('tests')
  # The DynamicLauncher interface xml comes from:
  # https://github.com/flatpak/xdg-desktop-portal/blob/main/data/org.freedesktop.portal.DynamicLauncher.xml
  gdbus_codegen = find_program('gdbus-codegen')
  dynamic_launcher_portal_iface_h = custom_target(
    'gs-dynamic-launcher-portal-iface.h',
    input: ['org.freedesktop.portal.DynamicLauncher.xml'],
    output: ['gs-dynamic-launcher-portal-iface.h'],
    command: [gdbus_codegen,
              '--interface-info-header',
              '--output', '@OUTPUT@',
              '@INPUT@'],
  )
  dynamic_launcher_portal_iface_c = custom_target(
    'gs-dynamic-launcher-portal-iface.c',
    input: ['org.freedesktop.portal.DynamicLauncher.xml'],
    output: ['gs-dynamic-launcher-portal-iface.c'],
    command: [gdbus_codegen,
              '--interface-info-body',
              '--output', '@OUTPUT@',
              '@INPUT@'],
  )
  cargs += ['-DLOCALPLUGINDIR="' + meson.current_build_dir() + '"']
  cargs += ['-DLOCALPLUGINDIR_CORE="' + meson.current_build_dir() + '/../core"']
  cargs += ['-DTESTDATADIR="' + join_paths(meson.current_source_dir(), '..', '..', 'data') + '"']
  e = executable(
    'gs-self-test-epiphany',
    compiled_schemas,
    sources : [
      'gs-self-test.c',
      dynamic_launcher_portal_iface_c,
      dynamic_launcher_portal_iface_h,
      epiphany_generated,
    ],
    include_directories : [
      include_directories('../..'),
      include_directories('../../lib'),
    ],
    dependencies : [
      plugin_libs,
      dependency('glib-testing-0', fallback: ['libglib-testing', 'libglib_testing_dep']),
    ],
    link_with : [
      libgnomesoftware,
    ],
    c_args : cargs,
  )
  test('gs-self-test-epiphany', e, suite: ['plugins', 'epiphany'], env: test_env)
endif