Search This Blog

Saturday, November 15, 2014

Installing Plasma 5 on Gentoo Linux: problems and fixes

Yesterday I removed my Plasma 4 installation and installed Plasma 5. I know it is not ready for production yet but, you know, I am a KDE developer and want to contribute to improve Plasma 5 :-)

I used Gentoo's live ebuilds to install Frameworks 5 and Plasma 5's master branches. After some... several... ok, many hours compiling things Plasma 5 was installed and then I had my first surprise: I need kwallet 4 installed to import my secrets into kwallet 5, but I had uninstalled it before start compiling Plasma 5. Solution: compile kwallet 4 :-/ and try again. However, it was not that simple.

I used to use kwallet 4.14.2 (Gentoo's unstable version) but I installed 4.12.5 (Gentoo's stable version) without kdepimlibs installed. There are two problems with what I did: 1. kwallet uses a different file format when compiled with kdepimlibs installed. Since it was not installed kwallet 4 failed to open my wallet with "Unsupported file format version" error. Desperation started growing into my heart (my secrets, my precious secrets...). Looking at kwallet's source code (I love open source programs for allowing me to do that) I noticed that I needed to recompile it against kdepimlibs. So I did and... it did not work, the same "Unsupported file format version" error message appeared. 2. Looking into kwallet's git log I noticed that the file format's version changed between kwallet 4.12.5 and 4.14.2. I recompiled kwallet 4.14.2 and then kwallet 5 was able to import my old wallet :-). Tip of the day: do not uninstall Plasma 4 before importing your wallet. For Gentoo users that be a problem since akonadi-server's ebuild is configured to prevent compiling both qt4 and qt5 versions and akonadi-server is a dependency to compile kdepimlibs. I had to force (emerge --nodeps) Gentoo to compile kdelibs, akonadi-server, kdepimlibs and kwallet ebuilds to solve this problem.

With my wallet imported I though I had finished with that. However, Google Chrome did not list/show any of my secrets. The problem: Chrome uses the old dbus names org.kde.kwalletd and /modules/kwalletd instead of org.kde.kwalletd5 and /modules/kwalletd5. At least for now I decided to recompile kwallet 5 to use the old names, it works. Maybe we should add a command line option to make kwallet5 to also register those old names for backward compatibility.

After configuring my personal options in systemsettings my Plasma 5 desktop looks as productive as my old Plasma 4 desktop, which by the way I completely removed after fixing the kwallet issue. I still miss some applications such as Amarok, Digikam, Superkaramba (I created four applets for it that I would like to keep using). Two others, kdialog and polkit-kde-agent, are already ported to Plasma 5 but there is no ebuild for then, so I created the ebuilds and installed them. The kdialog ebuild still needs tweaking though.

polkit-kde-agent is necessary to allow Plasma NM to read secrets from system connections, which are stored in NetworkManager. It is a important program not only for me but for anybody that uses Plasma NM. After compiling it it did not work at first (always crashing). I had to apply this patch from reviewboard to fix the crashes.

To replace Amarok I recompiled Vlc to enable its qt plugin, which is already ported to Qt5 but Vlc compilation system insisted in using Qt4's include and libs even though it detected Qt5. For that reason when g++ tried to find QtWidgets' includes it failed. QtWidgets does not exist in Qt4. My solution was to export those two variables before compiling Vlc:

export QT_CFLAGS=$(pkg-config Qt5Widgets --cflags)
export QT_LIBS=$(pkg-config Qt5Widgets --libs

Sorry to the bashism in the line aboves, but it makes things shorter :-P

Vlc works, but crashes everytime it quits, not a big problem except that it never saves may playlist :-/ I still can press Ctrl+1 to make it load the first directory in the recent used list. I had to tweak my qdbus script to make my global shortcuts for play previous/pause/play next song to work with Vlc. Now it works almost as Amarok, except for the fancy features such as tablatures, lyrics, playlist sorting that I used to use from time to time. For the time being it will suffice. By the way, what is happening (or not happening) with Amarok? The lastest release was more than a year ago. Will it be ported to Plasma 5? Is there a Plasma 5 replacement for it?

One feature I missed since yesterday was the hability to select "shutdown computer" from leave dialog. Being the one that ported the old QWidget based shutdown dialog to Qml I expected the new dialog to be located in /usr/share/apps/ksmserver/themes/default, but now it is located in /usr/share/plasma/look-and-feel/org.kde.breeze.desktop/contents/logout/Logout.qml. Plasma 4's shutdown dialog theme is still in /usr/share/apps/ksmserver/themes/. After digging into ksmserver and libkworkspace's source codes I figured out that using kwrapper5 with ksmserver prevents shutdown and restart buttons from appearing in the shutdown dialog. The problem is that org.freedesktop.ConsoleKit.Manager.CanStop always return false when ksmserver is started through kwrapper5. I had to edit startkde script to do not use kwrapper5. OBS: I am using sddm and consolekit.

There are some random crashes here in there, but Plasma 5 is usable for what I need. Now I am ready to start fixing Plasma 5 issues :-)


13 comments:

genstorm said...

polkit-kde-agent & kdialog ebuilds: I can't find your pull request on kde overlay's github mirror ;)

Anonymous said...

Cool man!, I'm a Gentoo user too and I just can't wait to use KDE 5! though until KDE applications 5 won't be out it's just like using a different theme instead of an upgrade IMHO

Dave said...

> I still miss some applications such as Amarok, Digikam, Superkaramba [and] polkit-kde-agent


Use the KDElibs4 versions.

It's always always /always/ been the plan to have have KF5 and kdelibs4 applications running side by side.

We even backport the styles to Qt4 and sync most config options in systemsettings.

Somehow this message keeps getting lost.

Rajat said...

I have done this previously on Gentoo, It was not easy. Took a lot of time to compile. However It worked fine. But I just gave up. Plasma 5 is not ready for production yet. I am happy with KDE 4.14.2. Plasma 5 will be the official release in a few months.. Thanks for your post though....

genstorm said...

> It's always always /always/ been the plan to have have KF5 and kdelibs4 applications running side by side.

Dave, that sounds good in theory, but it's not so easy on a source based distro. It's also quite a task for packagers. :)

That's why my plasma5 system won't feel complete as well for quite some time and/or rely on live versions for a lot of applications.

Lamarque said...

@genstorm I have sent them to https://bugs.gentoo.org/show_bug.cgi?id=517052

@Anonymous and @Rajat Pandita yes, but as a KDE developer I am one of those who need to improve things in Plasma 5 to make it ready for production :-)

@Dave
> It's always always /always/ been the plan to have have KF5 and kdelibs4 applications running side by side.

KF5 is not problem in Gentoo, I can install KF5 and kdelibs 4.x applications without problems. The problems arises when I try to install Plasma 5 and kdelibs 4.x.

For now, in Gentoo, it is not possible compile both qt4 and qt5 versions of akanadi-server. Without that Gentoo users cannot install both kdelibs 4.x and Plasma 5. I am not a Gentoo developer, so I do not know if there is a plan to improve that.

Do you know if kdelibs 4.x applications can work with akonadi-server compiled against Qt5? If that is not possible then we have a big problem. For instance, kmail is not ported to Plasma 5 yet as far as I know, if that is not possible then we would not be able use kmail on Plasma 5.

The kwallet issue is also a problem. We would have to run both kwallet4 and kwallet5. That works but causes some inconveniences, such as having to sync wallets from time to time.

genstorm said...

Thanks for posting those! I'll give 'em a shot once I get back to my plasma5 box.

A good way to interact with Gentoo's KDE team is to pull directly from their github mirror and send pull requests with your work: https://github.com/gentoo/kde

Lamarque said...

Answering my own question: we cannot install both qt4 and qt5 versions of akonadi-server, so no kmail 4.x on Plasma 5, or anything else that uses kdepimlibs (kgpg for instance).

After disabling all use flags that pull kdepimlibs and translations (kde-l10n ebuild blocks Plasma 5) emerge -pv does not complain at installing those applications: amarok digikam calligra kcachegrind okular massif-visualizer

The only problems so far are akonadi-server and having to run both kwalletd4 and kwalletd5.

@genstorm yeah, I know, but I do not use github and do not want to create an account there just yet.

Dave said...

Thanks for the update.

We don't use Akonadi at all in Plasma 5 for this very reason.

Nothing should be depending on Akonadi 5.

As for kwallet, we changed the app and the and dbus path so they'd be co-installable.

It makes kwalletmanager a mess, but for everything else it's only going to be broken in the case where you have two different apps reading and writing to the same kwallet entries.

Anonymous said...

Why don't you make your life easier? I had none of those issues installing Plasma 5 on Fedora 21 (I did have to ask dvratil to update his packages, which he was very happy to do, but otherwise quite easy).

Lamarque said...

@Dave hmmm that is a big problem for programs that rely on kdepimlibs.

For kwallet issue we could create a small Qt4 library to replace kwalletd4. The library would just redirect calls to kwalletd5's dbus interface.

@Diggory I like Gentoo, use it since 2001. If you are suggesting that I should reinstall my computer just to have Plasma 5 installed that does not look easier. I want to keep all the home made scripts, programs and setups that I have done for my computer since 2001. Yes, I do not reinstall my computer since 2001, just upgrade, that is one of the reasons I like Gentoo :-P. Actually I reinstalled in 2005 when I moved from 32-bit to 64-bit Gentoo, but still, I do not like reinstalling my computer, I did that a lot before moving to Gentoo and I do not plan start doing again.

genstorm said...

There is a lot more to Gentoo than not having to reinstall though... ;)

Now, I'm not at my plasma5 box; but while kde overlay does provide a qt5 version of akonadi-server, I couldn't find any dependency on it (`equery d -a akonadi-server`).

Lamarque said...

I know :-)

I meant that kdepimlibs cannot be used in Plasma 5 until all programs that rely on it are not ported to Plasma 5 as well. But, who will be willing to port them if the Plasma 4 versions work for them?