lok_doc_view_new() right now requires the full path to the libreoffice "program/" subfolder. Instead, because the library is installed with LibreOffice itself anyway, the path shouldn't be needed. An alternate loading function could be useful for debugging (mainly for LO hackers), allowing to pass a path to use a specific LO set of libraries with the same LOKView version.
The way we discussed fixing this was to: - install the liblibreofficekitgtk.so in the "normal" libdir - correctly version the library's soname The library should know how to get to the "default" (whatever was the target installation) LO path, and can probably use other means, such as an envvar to override the default value. This would make it easier to switch the backend for debugging, but would make the bindings work out of the box.
That makes sense. I've been thinking along the same lines.
This got closed without any references to the fix.
Sorry about that. Just for log, here is the gerrit URL of this change https://gerrit.libreoffice.org/#/c/20476/
(In reply to Pranav Kant from comment #4) > Sorry about that. > > Just for log, here is the gerrit URL of this change > > https://gerrit.libreoffice.org/#/c/20476/ Right. But this isn't enough for applications to be able to find the LOK library. By the time you can call the _new() function, you will already have found the location of the program/ directory...
(In reply to Bastien Nocera from comment #5) > (In reply to Pranav Kant from comment #4) > > Sorry about that. > > > > Just for log, here is the gerrit URL of this change > > > > https://gerrit.libreoffice.org/#/c/20476/ > > Right. But this isn't enough for applications to be able to find the LOK > library. > > By the time you can call the _new() function, you will already have found > the location of the program/ directory... You will still find distributions installing liblibreofficekitgtk.so in normal libdir so that you find no difficulty in finding and initializing the widget; calling _new() function. However, this path would not work for the widget because widget needs libmergedlo and friends which resides in the program/ directory.