summaryrefslogtreecommitdiff
path: root/src/backend/dbus/meson.build
blob: 8ab3bfe59da2f50c078569eba51b49cf5e939453 (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
if get_option('dbus')
  gdbus_codegen = find_program('gdbus-codegen')

  unitdir = ''
  systemd = dependency('systemd', required: false)
  if systemd.found()
    unitdir = systemd.get_variable(pkgconfig: 'systemduserunitdir')
  endif

  px_interface = [
    'org.libproxy.proxy.xml'
  ]

  px_interface_h = custom_target(
    'px-interface.h',
    input: px_interface,
    output: ['px-interface.h'],
    command: [
      gdbus_codegen,
      '--interface-info-header',
      '--output', '@OUTPUT@',
      '@INPUT@'
    ]
  )

  px_interface_c = custom_target(
    'libproxy-iface.c',
    input: px_interface,
    output: ['px-interface.c'],
    command: [
      gdbus_codegen,
      '--interface-info-body',
      '--output', '@OUTPUT@',
      '@INPUT@'
    ],
  )

  proxyd_sources = [
    px_interface_c,
    px_interface_h,
    'dbus.c',
  ]

  proxyd_deps = [
    px_backend_dep
  ]

  executable(
    'proxyd',
    proxyd_sources,
    dependencies: proxyd_deps,
    install_dir: join_paths(px_prefix, get_option('libexecdir')),
    install: true,
  )

  service_data = configuration_data()
  service_data.set('LIBEXECDIR', join_paths(px_prefix, get_option('libexecdir')))

  service = configure_file(
    input: 'proxyd.service.in',
    output: 'proxyd.service',
    configuration: service_data
  )

  if unitdir != ''
    install_data(service, install_dir: unitdir)
  endif
endif