libexec (Re: "kde5" or "kf5" ?)

David Faure faure+bluesystems at kde.org
Sat Feb 23 15:56:14 UTC 2013


On Saturday 23 February 2013 10:43:51 Alexander Neundorf wrote:
> Well, it would be great if with KF5, if I install some library which needs
> to  find its own files, it would find them without needing the help from
> environment variables.

You're forgetting the other cases where files have to be found, which are not 
"a lib finding its own files".

In many many cases (other than libexec), the files have to be found 
"externally".
The icon loader code needs to find the icons.
The mimetype code has to find the mimetype definitions.
kconf_update has to find update files.
Workspace autostart has to find autostart files.
etc. etc.

XDG_DATA_DIRS does this. Magic determination of a lib's own prefix inside that 
lib's code doesn't.

But yes, if you install libkarchive, you don't need any of this. It's just 
code, no data files and no external processes, so your "plug and play" wish is 
granted, it's just like any other "pure library". The commercial developer can 
just put karchive.dll next to QtCore.dll (and IIRC, if that's in the same dir 
as the .exe, no $PATH needed).

However when you install KIO, helper binaries have to be found, config files 
have to be found, icons have to be found, plugins have to be found 
(kioslaves), etc. The current solution (QStandardPaths) is to either install 
that into standard directories (/usr or /usr/local on Unix, "Application Data" 
on Windows), or to set additional XDG env vars (on Unix), for custom prefixes.
If you have a specific idea on how to improve that I'm listening, but "it 
should work out of the box" is just a wish. I guess QStandardPaths could also 
look in the application directory, on Windows, to help with the "everything in 
the same directory" case.
But on Unix, using the lib's own dir and then "going up" seems very very 
fragile and non-standard to me. I don't see the full solution you have in mind 
there.

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Sponsored by BlueSystems and KDAB to work on KDE Frameworks



More information about the Kde-frameworks-devel mailing list