Features/Plasma PackageKit Integration

From FedoraProject

Jump to: navigation, search

Contents

KDE Plasma Dependency Generation and PackageKit Integration

Summary

Add automatically-generated RPM dependencies for services related to KDE Plasma (e.g. Plasma script engines, Plasma data engines) and PackageKit hooks to use them to Plasma.

Owner

Current status

All patches are already in Rawhide. Several of them have also been upstreamed to the relevant projects (but Fedora 17 is the first Fedora release where the feature is enabled and complete).

Detailed Description

Plasma widgets (also known as plasmoids) can be installed from 2 sources:

Such Plasmoids can depend on services provided by Plasma, in particular:

The need to be addressed is how to drag in those dependencies in an effective way:

Benefit to Fedora

Users will be able to install Plasma widgets (plasmoids) written in scripting languages through "Add widgets… / Download new widgets…" and automatically get the required Fedora packages for those widgets to actually work installed. This gives users convenient access to upstream's huge widget library without manually having to install dependencies such as plasma-scriptengine-*. (It is not possible to include all the script engines and the script interpreters they require on the live image and thus in the default installation.)

It looks like Fedora will be the first distribution to offer this convenient Plasma feature, developed by Fedora.

Scope

The feature can be split into 2 parts:

  1. Dependency extraction
  2. PackageKit integration

Dependency extraction can again be split into 2 parts:

  1. Provides: This is the easier part because it is already well covered by metadata. The main goal there is to bring the information provided by the metadata into a form usable in RPM.
  2. Requires: This is the harder part because the metadata provided by upstream does not currently include dependencies. Several strategies to handle this can and will be envisioned:
    • Explicit specification, i.e. require the Plasma metadata to list dependencies explicitly. Pros: reliable, allows installing dependencies immediately. Cons: does not work for existing plasmoids, error-prone.
    • Automatic extraction from the source code, similar to how the RPM dependency extractors for scripting languages work. Pros: allows installing dependencies immediately (build-time auto-extraction) or almost immediately (auto-extraction run on downloaded sources), works for existing plasmoids, no developer efforts. Cons: probably needs extra code for each scripting language, can be fooled by convoluted code (e.g. requesting a data engine in a non-obvious way).
    • Runtime downloading, i.e. firing up KPackageKit/Apper (KPackageKit will be renamed to Apper as of the next upstream release) when a service which is not installed yet is requested. Pros: reliable, works for existing plasmoids, no developer efforts. Cons: dependencies can only be installed on first use, which is not the most user-friendly approach.
    My plan is to try implementing all 3 approaches. It is likely that a combination of multiple approaches will be retained (e.g. use explicitly specified dependencies where available, try automatic extraction otherwise, fall back to runtime downloading if everything else fails).

For PackageKit integration, Plasma needs to be taught to request the installation of a dependency through a PackageKit interface (to be provided by KPackageKit/Apper; for Fedora, org.freedesktop.PackageKit.Modify.InstallPackageNames could probably be abused at first, but for cross-distribution compatibility, which is essential for getting the feature upstreamed, a dedicated API like the existing InstallFontconfigResources, InstallGStreamerResources or InstallPrinterDrivers APIs should be used):

The feature was implemented as a Google Summer of Code 2011 project with Fedora (mentored by Rex Dieter).

How To Test

  1. Install Fedora 17 KDE, or start the live CD. (No special hardware needed.)
  2. Verify that plasma-scriptengine-python is NOT installed, or yum remove plasma-scriptengine-python.
  3. Click on the "panel toolbox" icon (which looks like a cashew nut) at the right end of the panel.
  4. Click "Add widgets…".
  5. Click "Get new widgets… / Download new widgets".
  6. Search for "Veromix" (a widget written in Python) and install it.
  7. You should get prompted by Apper for installing the Python script engine.
  8. Installing the Python script engine (through the Apper interface which comes up) should succeed.
  9. Veromix should now be in the list of widgets which can be added to the panel through "Add widgets…". Add it.
  10. You should see a working widget.

Of course, Veromix is just an example known to work. The same should work for almost all widgets available through that interface (though some might be incorrectly packaged by the upstream author). Any required script engines and/or data engines should get dragged in.

User Experience

Before

  1. The user clicks on the panel "cashew".
  2. The user clicks "Add widgets…".
  3. The user clicks "Get new widgets… / Download new widgets".
  4. The user searches for his/her favorite widget and installs it.
  5. The widget now shows up in the list of widgets to add.
  6. The user adds the widget to the panel.
  7. The user ends up with a "broken widget" icon or a nonfunctional widget.
     ________________________ 
    < HEY, WHAT'S THE BEEF?! >
     ------------------------ 
            \   ^__^
             \  (oo)\_______
                (__)\       )\/\
                    ||----w |
                    ||     ||

After

  1. The user clicks on the panel "cashew".
  2. The user clicks "Add widgets…".
  3. The user clicks "Get new widgets… / Download new widgets".
  4. The user searches for his/her favorite widget and installs it.
  5. The user gets prompted by Apper to install the missing script and/or data engine(s).
     __________ 
    < MIRACLE! >
     ---------- 
            \   ^__^
             \  (oo)\_______
                (__)\       )\/\
                    ||----w |
                    ||     ||
  6. The user clicks "Yes" and enters the root password when prompted.
  7. The widget now shows up in the list of widgets to add.
  8. The user adds the widget to the panel.
  9. The widget just works.
     ________ 
    < BEEFY! >
     -------- 
            \   ^__^
             \  (oo)\_______
                (__)\       )\/\
                    ||----w |
                    ||     ||

Dependencies

Contingency Plan

Documentation

Release Notes

KDE Plasma's "download new widgets" feature now automatically prompts for installing the script engines and data engines required by the installed widget through Apper. (Plasma can also prompt for installing missing components at other times, but typically, the prompt happens when installing a widget.) This new feature, developed by Fedora, gives users convenient access to KDE's huge Plasma widget library without having to manually install dependencies such as plasma-scriptengine-*.

Comments and Discussion