How to determine the dbus address on OSX/MacPorts OR How to make MacPorts-dbus work with non-MacPorts qt5-install

David Evans devans at macports.org
Fri Aug 22 15:37:55 PDT 2014


On 8/22/14 12:41 PM, Marko Käning wrote:
> Hi guys,
>
> how can I determine the dbus address of the session dbus started by launchd?
>
> The environment contains only DBUS_LAUNCHD_SESSION_BUS_SOCKET:
>> DBUS_LAUNCHD_SESSION_BUS_SOCKET=/tmp/launch-adIO4f/unix_domain_listener
>
>>
> So, the question is, can I query the session dbus somehow in order to obtain
> the dbus address which I could then use to set DBUS_SESSION_BUS_ADDRESS in
> my environment?
Marko,

You can form the DBUS_SESSION_BUS_ADDRESS as follows:

export DBUS_SESSION_BUS_ADDRESS='unix:path='$DBUS_LAUNCHD_SESSION_BUS_SOCKET

or, in your case,

unix:path=/tmp/launch-adIO4f/unix_domain_listener

The usual way to get the session bus address programatically is to the
GDBus API provided by GIO in glib2.
In MacPorts, this has been patched to work as I have described.

See the definition of get_session_address_macports_specific (GError
**error) in
files/patch-get-launchd-dbus-session-address.diff.

Dave



More information about the macports-dev mailing list