ocaml-community / obus

Pure OCaml implementation of the D-Bus protocol
Other
33 stars 15 forks source link

OBus

Build Status

OBus is a pure OCaml implementation of the D-Bus protocol. It aims to provide a clean and easy way for ocaml programmers to access and provide D-Bus services.

OBus is using the cooperative threading library Lwt, which make it very simple to fully exploit the asynchronous nature of D-Bus.

Dependencies

Make sure you have dune installed, and install all the missing dependencies listed in the output of this command:

$ dune external-lib-deps @install --missing

Installation

The recommended way to install obus and its dependencies is via opam: opam install obus.

Manual installation from sources

To build and install obus:

$ dune build @install

Tests (optionnal)

To build and execute tests:

$ dune runtest

Using the library

OBus install the following packages:

Using the tools

There are several tools provided in the obus distribution:

There are manual pages for all this tools.

The caml files generated by obus-gen-client and obus-gen-server are meant to be edited and adapted. In practice introspections files contains only marshaling informations so it is often not sufficient for creating a usable binding.

Here is a simple example of use of the tools:

$ obus-introspect org.freedesktop.Notifications /org/freedesktop/Notifications > notif.xml
$ obus-gen-interface notif.xml
$ obus-gen-client notif.xml