1dbus_interface_dir = join_paths(datadir, 'dbus-1', 'interfaces')
2
3geoclue_iface_sources = []
4
5# Client interface
6client_interface_xml = 'org.freedesktop.GeoClue2.Client.xml'
7geoclue_iface_sources += gnome.gdbus_codegen(
8    'gclue-client-interface',
9    client_interface_xml,
10    interface_prefix: 'org.freedesktop.GeoClue2.',
11    namespace: 'GClueDBus',
12    docbook: 'docs')
13# Location interface
14location_interface_xml = 'org.freedesktop.GeoClue2.Location.xml'
15geoclue_iface_sources += gnome.gdbus_codegen(
16    'gclue-location-interface',
17    location_interface_xml,
18    interface_prefix: 'org.freedesktop.GeoClue2.',
19    namespace: 'GClueDBus',
20    docbook: 'docs')
21# Manager interface
22manager_interface_xml = 'org.freedesktop.GeoClue2.Manager.xml'
23geoclue_iface_sources += gnome.gdbus_codegen(
24    'gclue-manager-interface',
25    manager_interface_xml,
26    interface_prefix: 'org.freedesktop.GeoClue2.',
27    namespace: 'GClueDBus',
28    docbook: 'docs')
29
30annotations = [[ 'fi.w1.wpa_supplicant1',
31                 'org.gtk.GDBus.C.Name',
32                 'WPA_Supplicant' ],
33               [ 'fi.w1.wpa_supplicant1.Interface',
34                 'org.gtk.GDBus.C.Name',
35                 'WPA_Interface' ],
36               [ 'fi.w1.wpa_supplicant1.BSS',
37                 'org.gtk.GDBus.C.Name',
38                 'WPA_BSS' ],
39               [ 'fi.w1.wpa_supplicant1.BSS:SSID',
40                 'org.gtk.GDBus.C.ForceGVariant',
41                 'whatever' ],
42               [ 'fi.w1.wpa_supplicant1.BSS:BSSID',
43                 'org.gtk.GDBus.C.ForceGVariant',
44                 'whatever' ],
45               [ 'fi.w1.wpa_supplicant1.Interface::BSSAdded',
46                 'org.gtk.GDBus.C.Name',
47                 'BSS_Added' ],
48               [ 'fi.w1.wpa_supplicant1.Interface::BSSRemoved',
49                 'org.gtk.GDBus.C.Name',
50                 'BSS_Removed' ]]
51
52geoclue_agent_sources = gnome.gdbus_codegen(
53    'geoclue-agent-interface',
54    'org.freedesktop.GeoClue2.Agent.xml',
55    interface_prefix: 'org.freedesktop.GeoClue2.',
56    namespace: 'GClue',
57    docbook: 'docs')
58geoclue_iface_sources += geoclue_agent_sources
59
60#libgeoclue_iface_inc = include_directories('.', '../..')
61
62if get_option('enable-backend')
63  wpa_supplicant_sources = gnome.gdbus_codegen(
64      'wpa_supplicant-interface',
65      'fi.w1.wpa_supplicant1.xml',
66      interface_prefix: 'fi.w1.wpa_supplicant1.',
67      annotations: annotations)
68
69  compass_iface_sources = gnome.gdbus_codegen(
70      'compass-interface',
71      'net.hadess.SensorProxy.xml',
72      interface_prefix: 'net.hadess.SensorProxy')
73endif
74
75install_data('org.freedesktop.GeoClue2.Agent.xml',
76             install_dir: dbus_interface_dir)
77
78interface_files = [ location_interface_xml,
79                    client_interface_xml,
80                    manager_interface_xml ]
81# Provide a single interface file too for backwards compatiblity.
82# At least gnome-settings-daemon currently relies on that.
83unified_interface_xml = 'org.freedesktop.GeoClue2.xml'
84python = find_program('python3')
85create_interface = find_program('create-unified-xml.py')
86cmd = [python, create_interface, '@OUTPUT@', '@INPUT@' ]
87
88custom_target('gclue-xml-interface',
89              input: interface_files,
90              output: unified_interface_xml,
91              install: true,
92              install_dir: dbus_interface_dir,
93              command: cmd)
94install_data(interface_files,
95             install_dir: dbus_interface_dir)
96