Paths to internal executables (c.f. libexec) hard-coded
David Faure
faure at kde.org
Thu Aug 27 07:42:23 UTC 2015
On Thursday 27 August 2015 00:14:50 Kevin Funk wrote:
>
> If we want to support this case, then we'd need to create a
> KSomething::libexecPaths() method returning the following search path (in
> order):
> - Windows:
> - Just QCA::applicationDirPath() (we control the install layout anyway)
> - Unix:
> - a list based on {DY,}LD_LIBRARY_PATH, each suffixed by libexec/
> - then : As fallback: the hardcoded install prefix of KF5 as before
> (otherwise we might not check /usr/lib/libexec at all, if installed there)
>
> This is somewhat in line what David F. suggested in his initial mail, I think.
The reason I got stuck on this issue is that I would want that to be in Qt
(e.g. QStandardPaths) to avoid creating additional inter-frameworks dependencies
just for that "KSomething". But there's no standard solution for libexec, nobody
has been able to present me with any kind of standard there.
I suppose smaller projects just use the applicationDirPath type solution,
or don't support relocateability. Bigger projects control the whole stack and
need no standards (LibreOffice, Firefox etc.).
This being said I like the idea of LD_LIBRARY_PATH + libexec/,
as long as there's the builtin fallback too (which the caller has to pass,
since hardcoded-into-Qt doesn't help us).
Hehe, we could use QT_PLUGIN_PATH instead and call
QStandardPaths::findExecutable("libexec/kfoobar", QCoreApplication::libraryPaths() + libExecDir)
but ok that might be a bit weird, to treat libexec binaries like "plugins" ;)
It's the easiest solution though, isn't it? We just have to install libexec stuff under plugins/libexec,
on all platforms....
--
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5
More information about the Kde-frameworks-devel
mailing list