Commit 4e3e4fc3 authored by Zeeshan Ali's avatar Zeeshan Ali

WIP: Generate Rust code for our D-Bus interfaces

parent 7dbdc951
Pipeline #28907 failed with stage
in 3 minutes and 26 seconds
dbus_interface_dir = join_paths(datadir, 'dbus-1', 'interfaces')
geoclue_iface_sources = []
geoclue_iface_rust_sources = []
# Fetch dbus-codegen-rust command
cargo = find_program('cargo')
dbus_codegen_rs_fetch_cmd = [
cargo,
'install', 'dbus-codegen',
'--bin', 'dbus-codegen-rust',
'--root', meson.current_build_dir() ]
dbus_codegen_rs_dep = custom_target(
'dbus-codegen-rs-dep',
output: 'dbus-codegen-rs-dep.out',
capture: true,
command: dbus_codegen_rs_fetch_cmd)
dbus_codegen_rs = join_paths(
meson.current_build_dir(),
'bin',
'dbus-codegen-rust')
dbus_codegen_rs_cmd = [dbus_codegen_rs, '<', '@INPUT@']
# Client interface
client_interface_xml = 'org.freedesktop.GeoClue2.Client.xml'
......@@ -10,6 +30,16 @@ geoclue_iface_sources += gnome.gdbus_codegen(
interface_prefix: 'org.freedesktop.GeoClue2.',
namespace: 'GClueDBus',
docbook: 'docs')
geoclue_iface_rust_sources += custom_target(
'gclue-client-interface',
input: client_interface_xml,
output: 'client-dbus-rs',
capture: true,
install: true,
install_dir: dbus_interface_dir,
depends: dbus_codegen_rs_dep,
command: dbus_codegen_rs_cmd)
# Location interface
location_interface_xml = 'org.freedesktop.GeoClue2.Location.xml'
geoclue_iface_sources += gnome.gdbus_codegen(
......@@ -18,6 +48,7 @@ geoclue_iface_sources += gnome.gdbus_codegen(
interface_prefix: 'org.freedesktop.GeoClue2.',
namespace: 'GClueDBus',
docbook: 'docs')
# Manager interface
manager_interface_xml = 'org.freedesktop.GeoClue2.Manager.xml'
geoclue_iface_sources += gnome.gdbus_codegen(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment