Fridrich Strba provided the appended patch from http://pastebin.ca/1859665 for creating http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Factory/noarch/ He wrote about the patch: A very ugly and standard non-compliant patch This bug is intended for the required refactoring.
Created attachment 35052 [details] [review] patch for de-kde-ification of window dbus
Relating to the fix in bus/activation.c +#ifdef DBUS_WIN +const char *_dbus_windows_replace_prefix (const char *configure_time_path); +#endif + Because bus/activation is a cross plattform file, would it not be better to define a cross plattform function /* * replaces the term DBUS_PREFIX in configure_time_path by the * current dbus installation directory. On unix this function is a noop * * @param configure_time_path * @return real path */ const char *_dbus_replace_install_prefix (const char *configure_time_path); in dbus-sysdeps-unix.c const char *_dbus_replace_install_prefix (const char *configure_time_path); { return configure_time_path; } and to call _dbus_replace_install_prefix in bus/activation unconditional ? + exec = strdup (_dbus_replace_install_prefix (exec_tmp));
is this only a move in the fole or was something changed in this function ? +static dbus_bool_t +_dbus_get_install_root(char *prefix, int len)
I moved it just because I needed it to be known to the replace prefix function, but it is enough just to leave it where it was and forward declare it before the replace prefix function. Just if I recall well the _dbus_get_install_root was in an ifdef-ed block that I was also not sure whether it was actually meant to be in.
This patch does not apply on top of master branch G:\>git apply "de-kde-ification of window dbus.patch" error: activation.c: No such file or directory error: patch failed: dbus/dbus-sysdeps-win.c:2062 error: dbus/dbus-sysdeps-win.c: patch does not apply Please update and provide as format-patch.
Also there should be some documentation about this DBUS_PREFIX features in the dbus-daemon documentation.
Ralf: I will work on it, just these weeks I was too busy even to go to toilet :)
Created attachment 35197 [details] [review] new version of the de-kde-fication :) patch incorporating comments and applying to dbus master A version of the patch working with recent dbus master
(In reply to comment #8) > Created an attachment (id=35197) [details] > new version of the de-kde-fication :) patch incorporating comments and applying > to dbus master > > A version of the patch working with recent dbus master Thanks for this effort - patch applies. There are still some issues: in bus/activation: +/* + * replaces the term DBUS_PREFIX in configure_time_path by the + * current dbus installation directory. On unix this function is a noop + * + * @param configure_time_path + * @return real path + */ +const char * +_dbus_replace_install_prefix (const char *configure_time_path); + this prototype should be in dbus-sysdeps.h dbus/dbus-sysdeps-win.c: +const char * +_dbus_windows_replace_prefix (const char *configure_time_path); + beside the wrong name this prototyp is obsolate - it is already in dbus-sysdeps.h +const char * +_dbus_windows_replace_prefix (const char *configure_time_path) +{ wrong name - should be dbus_replace_install_prefix() otherwise looks good.
Created attachment 35199 [details] [review] Patch incorporating the latest comments and actually building :)
BTW, if this gets integrated it would be great to prod someone for a new devel release so that one can build on windows from a tarball instead from a custom git checkout (at least in my mingw repositories)
patch applies fine and did compile. Unfortunally the bus-test config file parser test fails: bin\bus-test: Running config file parser test Testing retrieving the default session service directories default service dir: data/dbus-1/services default service dir: E:\Programme\Gemeinsame Dateien/dbus-1/services test service dir: datadata/dbus-1/services datadata/dbus-1/services directory does not match data/dbus-1/services in the match set I did run (using cmake) cd <dbus-build-root> set DBUS_TEST_DATA=%CD%\test\data bin\bus-test
(In reply to comment #11) > BTW, if this gets integrated it would be great to prod someone for a new devel > release so that one can build on windows from a tarball we should ask Colin Walter > instead from a custom git checkout (at least in my mingw repositories) you cannot clone dbus freedesktop git master branch ?
OK, I just managed to cross-compile using cmake and I get the same error as you do. Do you have any clue where to start to look?
OK, with this little change: --- a/dbus/dbus-sysdeps-win.c +++ b/dbus/dbus-sysdeps-win.c @@ -2076,7 +2076,7 @@ _dbus_replace_install_prefix (const char *configure_time_path) { static char retval[1000]; #ifndef DBUS_PREFIX - strcat (retval, configure_time_path); + strcpy (retval, configure_time_path); #else static char runtime_prefix[1000]; int len = 1000; I get the attached result
Created attachment 35201 [details] copy & paste of test result
(In reply to comment #15) > OK, with this little change: > fine - works as expected. I applied the original patch and this fix to master branch. It would be nice if you would add an explanation of this feature to dbus-specification.xml section id="message-bus-starting-services".
Created attachment 35203 [details] [review] Just a little modification so that the function is really walk-through with the DBUS_PREFIX not being defined
Ralf: I modified the stuff a little tiny bit so that it does not allocate the 1000 bytes on the stack if not needed. I came with a way how to run the tests actually, just using "subst" I create a drive that maps exactly the unix system where I built on vmware :) so things like /usr/i686-pc-mingw32 will be Y:\usr\i686-pc-mingw32. Like that I was able to run the tests with the attached results.
Created attachment 35205 [details] result of dbus-test invocation
(In reply to comment #20) > Created an attachment (id=35205) [details] > result of dbus-test invocation nice - just one note: you need bus-test to test the implementation of this feature. Would it be good to have a unit test for this in the test suite ? Maybe by providing a litte service file, which is parsed by the related service file parse function and compared if DBUS_PRIFOX is replaced with the correct value ?
Ralf: I am just wondering, that file dbus-sysdeps-win.c has quite a number of functions there in ifdefed blocks and if I cross-compile using a normal stock configure options (only setting the host and paths). I get linking errors: CCLD libdbus-1.la Creating library file: .libs/libdbus-1.dll.a .libs/libdbus_1_la-dbus-connection.o: In function `_dbus_message_filter_unref': /home/fstrba/devel-cvs/dbus/dbus/dbus-connection.c:344: undefined reference to `__dbus_atomic_dec' .libs/libdbus_1_la-dbus-connection.o: In function `_dbus_message_filter_ref': /home/fstrba/devel-cvs/dbus/dbus/dbus-connection.c:334: undefined reference to `__dbus_atomic_inc' .libs/libdbus_1_la-dbus-message.o: In function `dbus_message_unref': /home/fstrba/devel-cvs/dbus/dbus/dbus-message.c:1549: undefined reference to `__dbus_atomic_dec' .libs/libdbus_1_la-dbus-message.o: In function `dbus_message_ref': /home/fstrba/devel-cvs/dbus/dbus/dbus-message.c:1527: undefined reference to `__dbus_atomic_inc' .libs/libdbus_1_la-dbus-object-tree.o: In function `_dbus_object_subtree_unref': /home/fstrba/devel-cvs/dbus/dbus/dbus-object-tree.c:1016: undefined reference to `__dbus_atomic_dec' .libs/libdbus_1_la-dbus-object-tree.o: In function `_dbus_object_subtree_ref': /home/fstrba/devel-cvs/dbus/dbus/dbus-object-tree.c:1006: undefined reference to `__dbus_atomic_inc' .libs/libdbus_1_la-dbus-threads.o: In function `init_locks': /home/fstrba/devel-cvs/dbus/dbus/dbus-threads.c:439: undefined reference to `__dbus_lock_atomic' .libs/libdbus_1_la-dbus-transport.o: In function `_dbus_transport_new_for_autolaunch': /home/fstrba/devel-cvs/dbus/dbus/dbus-transport.c:289: undefined reference to `__dbus_get_autolaunch_address' .libs/libdbus_1_la-dbus-internals.o: In function `_dbus_create_uuid_file_exclusively': /home/fstrba/devel-cvs/dbus/dbus/dbus-internals.c:742: undefined reference to `__dbus_make_file_world_readable' .libs/libdbus_1_la-dbus-internals.o: In function `_dbus_get_local_machine_uuid_encoded': /home/fstrba/devel-cvs/dbus/dbus/dbus-internals.c:823: undefined reference to `__dbus_read_local_machine_uuid' .libs/libdbus_1_la-dbus-sysdeps.o: In function `_dbus_abort': /home/fstrba/devel-cvs/dbus/dbus/dbus-sysdeps.c:84: undefined reference to `__dbus_print_backtrace' collect2: ld returned 1 exit status I am not really sure how to shuffle this and what is necessary in which if block. Concerning the docs and unit-tests: 1) I will do the docs (I promis) 2) I will think through the unit-tests, since there is the chicken-egg problem: we have to check somehow the runtime prefix to be able to compare it with what dbus is relocating but dbus does also the same check and since only one dllmain can be in a dll, we will use the same handle :) But I will come with something.
(In reply to comment #22) > Ralf: I am just wondering, that file dbus-sysdeps-win.c has quite a number of > functions there in ifdefed blocks and if I cross-compile using a normal stock > configure options (only setting the host and paths). I get linking errors: > CCLD libdbus-1.la > Creating library file: .libs/libdbus-1.dll.a Thanks for pointing this out. These issue is fixed in git master branch. > Concerning the docs and unit-tests: > 1) I will do the docs (I promis) > 2) I will think through the unit-tests, since there is the chicken-egg problem: > we have to check somehow the runtime prefix to be able to compare it with what > dbus is relocating but dbus does also the same check and since only one dllmain > can be in a dll, we will use the same handle :) But I will come with something. Could this not be checked by char install_root_with_something_appended[1000] if (!_dbus_get_install_root(install_root_with_something_appended,1000))
(In reply to comment #23) > (In reply to comment #22) > > Ralf: I am just wondering, that file dbus-sysdeps-win.c has quite a number of > > functions there in ifdefed blocks and if I cross-compile using a normal stock > > configure options (only setting the host and paths). I get linking errors: > > CCLD libdbus-1.la > > Creating library file: .libs/libdbus-1.dll.a > > Thanks for pointing this out. These issue is fixed in git master branch. > > > > Concerning the docs and unit-tests: > > 1) I will do the docs (I promis) > > 2) I will think through the unit-tests, since there is the chicken-egg problem: > > we have to check somehow the runtime prefix to be able to compare it with what > > dbus is relocating but dbus does also the same check and since only one dllmain > > can be in a dll, we will use the same handle :) But I will come with something. > > Could this not be checked by sorry posted uncomplete by accident. ... comparing the install root retrieved from _dbus_get_install_root() and appended "something" with the return value from _dbus_replace_install_prefix("DBUS_PREFIX" "something"), which should be equal ?
(In reply to comment #23) > > > Concerning the docs and unit-tests: > > 1) I will do the docs (I promis) Do you have any news in this area ?
doc could be provided in a separate bug
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.