summaryrefslogtreecommitdiff
path: root/metadata/meson.build
blob: 20ef5e0381b9f3629ed312c47063cfd3dece4490 (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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
dbus_service = gvfs_namespace + '.Metadata'
dbus_exec = 'gvfsd-metadata'
dbus_systemd_service = ''

if install_systemd_systemduserunitdir
  service = 'gvfs-metadata.service'

  configure_file(
    input: service + '.in',
    output: service,
    configuration: service_conf,
    install: true,
    install_dir: systemd_systemduserunitdir,
  )

  dbus_systemd_service = 'SystemdService=' + service
endif

dbus_service_conf = configuration_data()
dbus_service_conf.set('service', dbus_service)
dbus_service_conf.set('exec', gvfs_libexecdir / dbus_exec)
dbus_service_conf.set('systemd_service', dbus_systemd_service)

metadata_service = configure_file(
  input: dbus_service_in,
  output: dbus_service + '.service',
  configuration: dbus_service_conf,
  install: true,
  install_dir: dbus_session_bus_services_dir,
)

# FIXME: Ugly workaround that simulates the generation of
#        two different targets.
namespace = 'GVfs'
name = 'metadata-dbus'

dbus_sources = custom_target(
  name,
  input: 'dbus-interface.xml',
  output: [name + '.c', name + '.h'],
  command: [codegen, gvfs_namespace + '.', name, namespace, meson.current_build_dir(), '@INPUT@', '@OUTPUT@'],
)

sources = files(
  'crc32.c',
  'metabuilder.c',
  'metatree.c',
)

deps = [
  gio_dep,
  glib_dep,
]

cflags = [
  '-DDBUS_API_SUBJECT_TO_CHANGE',
  '-DG_LOG_DOMAIN="@0@"'.format(gvfs_name.to_upper()),
  '-DGVFS_LOCALEDIR="@0@"'.format(gvfs_localedir),
]

libmetadata = static_library(
  'metadata',
  sources: sources + [dbus_sources],
  include_directories: [top_inc, common_inc],
  dependencies: deps + [gio_unix_dep],
  c_args: cflags,
  pic: true,
)

libmetadata_dep = declare_dependency(
  sources: dbus_sources[1],
  include_directories: include_directories('.'),
  dependencies: deps,
  link_with: libmetadata,
)

deps = [
  libgvfscommon_dep,
  libmetadata_dep,
]

if enable_gudev
  deps += gudev_dep
endif

executable(
  'gvfsd-metadata',
  'meta-daemon.c',
  include_directories: top_inc,
  dependencies: deps,
  c_args: cflags,
  install: true,
  install_rpath: gvfs_rpath,
  install_dir: gvfs_libexecdir,
)

if enable_devel_utils
  apps = [
    'meta-ls',
    'meta-get',
    'meta-set',
    'meta-get-tree',
  ]

  foreach app: apps
    executable(
      app,
      app + '.c',
      include_directories: top_inc,
      dependencies: [
        libgvfscommon_dep,
        libmetadata_dep,
      ],
      c_args: cflags,
    )
  endforeach

  if have_libxml
    executable(
      'convert-nautilus-metadata',
      'metadata-nautilus.c',
      include_directories: top_inc,
      dependencies: [
        libmetadata_dep,
        libxml_dep,
      ],
      c_args: cflags,
    )
  endif
endif