Packagers of plasmoids (Plasma applets): please run plasma-dataengine-depextractor in %build

Kevin Kofler kevin.kofler at chello.at
Fri Nov 9 04:41:16 UTC 2012


Hi,

since I just noticed that even the newly submitted kde-print-manager was 
missing this, here's a gentle reminder to all maintainers of Plasma applets: 
in your specfiles, at the beginning of the %build section, please add 
something like the following:
if [ -x %{_bindir}/plasma-dataengine-depextractor ] ; then
  plasma-dataengine-depextractor plasmoid-package
fi
(The if check can be dropped once Fedora 16 reaches its end of life.) See:
https://fedoraproject.org/wiki/Features/Plasma_PackageKit_Integration
for why this is required.

The syntax of the plasma-dataengine-depextractor tool is:
plasma-dataengine-depextractor [path] [file]
where:
* "path" is the path to the source code of the plasmoid (relative to the
  current directory) – defaults to "." and
* "file" is the file name or path (relative to "path", NOT to the current
  directory) of the .desktop file – defaults to "metadata.desktop"
(If only one argument is specified, it will be interpreted as a "path", so 
if you want to specify only "file", you have to pass "." explicitly for the 
"path" argument.)
If you have multiple applets, then multiple calls to
plasma-dataengine-depextractor are needed.

The only case where this is not required is if the .desktop file shipped by 
upstream already contains a:
X-Plasma-RequiredDataEngines=…
key (which may or may not be empty), but chances are it won't, because 
upstream refused to merge the Plasma PackageKit Integration into kdelibs 4 
(they want it in KDE Frameworks 5 only). But thankfully, only a 
straightforward command is needed in the specfiles to autodetect the 
dependencies.

Now, strictly speaking, it is also not technically required if either no 
data engines are used at all (as in some very simple plasmoids) or all data 
engines used are provided by the plasmoid package itself (as happens to be 
the case for kde-print-manager), but IMHO it is still a good idea to run the 
depextractor even in that case because a later updated version of the 
plasmoid may start requiring additional data engines.

And before you ask why this is not done by the RPM auto-Requires script, 
this is because that script does not necessarily have access to the source 
code: Especially in the case of compiled (C++) plasmoids, the detection MUST 
be done from the source tree. So the auto-Requires script just always 
expects the depextractor to have been run, no matter what language the 
plasmoid was written in.

        Kevin Kofler



More information about the kde mailing list