GNOMEish way of doing dbus :)

Ralf Habacker ralf.habacker at freenet.de
Wed Apr 14 03:56:08 PDT 2010


Fridrich Strba schrieb:
> Hello, wonderful people
>
> Let me change the topic because this one is not about file-descriptor
> passing anymore.
>
> On Wed, 2010-04-14 at 12:07 +0300, Tor Lillqvist wrote: 
>   
>> And I would like to thank the KDE-on-Windows people for doing much of
>> the hard work in making dbus work / keeping it working on Windows.
>> Only small changes were needed to build it in the more "GNOMEish"
>> fashion in the openSUSE Build Service.
>>     
>
> I join Tor in paying to Cesar what is due to Cesar :)
>
> Let me explain somehow what we did to make dbus work also the way our
> GNOME stack on windows normally works.
>
> A very ugly and standard non-compliant patch can be found in
> http://pastebin.ca/1859665
>
> It is a common place in GNOME applications for windows that we never
> assume anything about installation prefix the user choses. That is why
> in my patch I relocated two things:
>
> 1) Where the dbus process is looking for service files, and 
>   
on KDE windows the following directories are searched by default

    1. default service dir: <dbus-install-root>/data/dbus-1/services
    2. default service dir: <CommonProgramFiles>/dbus-1/services

where <dbus-install-root> will be detected on runtime from the location 
of the shared dbus library according to one of these possible path layouts.

    <dbus-install-root>/bin/[lib]dbus-1.dll
    <dbus-install-root>/[lib]dbus-1.dll   

and <CommonProgramFiles> is the content of the environment variable 
"CommonProgramFiles".

According to your above statement it looks to me, that KDE uses the same 
assumption and there is no need to change anything.
> 2) the "exec" path in the service files.
>   
How does an exec path in a service file looks in gnome/windows - like 
the one below ?

exec=DBUS_PREFIX/bin/test-service.exe

Services located in 1. (which are from the dbus installation or if dbus 
is part of a bigger package from that package) are able to use relativ 
pathes without any relation to the installation prefix.

<dbus-install-root>/data/dbus-1/services/test.service
exec=../../../bin/test-service.exe

service files using case 2 will not work without any relation to the 
installation prefix.

<CommonProgramFiles>/dbus-1/services/test.service
exec=../../<dbus-install-root>/bin/test-service.exe

- having a string like DBUS_PREFIX as root will solve this problems.

exec=DBUS_PREFIX/bin/test-service.exe

On the other side this raises the question to which dbus installation 
root DBUS_PREFIX  will be expanded, when multiple dbus installations are 
available.

I guess that services installed in <CommonProgramFiles>/dbus-1/services 
are services from 3rd party applications using dbus as standalone 
package. Because those packages are installed somewhere in 
%PROGRAMFILES%/<package-install-root> they have to use an absolute path 
to the service executable. The conclusion is that there is no need for a 
DBUS_PREFIX here or are I'm completly wrong ?


Regards
Ralf


More information about the dbus mailing list