Although [tag]KDE4[/tag] came out last week, I have not yet been able to try it out as I was out of town. Today (Sunday 20 January) however, I decided the time had come, I had some time to spare, and I was a few days behind everybody else. So I started googling…. and what a nightmare. The kde4 overlay that [tag]gentoo[/tag] had, has become obsoleted but the websites haven’t been updated. A thousand sites told me that kde4.0 will not be in the official portage tree – then I finally found out it IS in there (though it took a few days) and it is hard masked.
So confusing was things that at least one blogger gave up and posted a howto that relied on grabbing the source packages yourself and compiling them in a tree, rather than as packages.
Advantage of that method: It keeps it seperate from your existing stuff. Perhaps a lower risk.
Disadvantage: it’s not really the gentoo way is it ? Not to mention it’s a LOT of work.
So having spent ages googling, I felt I would summarize the right way ™ to install KDE4 on gentoo so others can skip digging through litterally hundreds of pages on the forums (not least because the kde4 release sparked the single largest flamewar I have ever seen on the usually amiable gentoo forums).
Finally, please note that I did my tests on gentoo for X64 – YMMV. Now on with the [tag]howto[/tag].
First things first, we’ll need an up-to-date gentoo system:
emerge –sync && emerge portage && emerge –update –deep –newuse world
Short version: Get the latest package list, upgrade portage to the latest version then do a deep world update with your current USE flags. If youhaven’t done a deep world update recently, you can expect some minor issues like blocks to deal with. This is a good time to go make coffee, mow the lawn, make love to somebody and a few other timekillers (it is not fast). If you are brave, you could skip this and run it instead of the emerge kde-meta later on (it will include it by then) – but while this is likely to be faster, it is also likely to break more often.
At this stage you need to get (if you don’t have it) the autounmask tool:
emerge autounmask
Autounmask if you don’t know it, is by far the easiest way to unmask bigger sets of software. With KDE4 hardmasked, you would need to find and unmask dozens of packages, which autounmask will do for you instantly. It’s a very usefull little app to keep for future reference anyway.
Next modify your USE flags a little and ensure that both opengl and xcomposite are in there (by editing /etc/make.conf) – this is required if you want to be able to enable the composition features in kwin later.
You can now test autounmask like so:
autounmask -p kde-base/kde-meta-4.0.0
Check the output, unless you see something very concerning, you can run it for real:
autounmask kde-base/kde-meta-4.0.0
To get a more minimalistic version, you could use kdebase-meta as well. However, kde-meta will get all the kde4 packages for you. Including the newly redesigned kdegames. There are a lot of packages on that list though, so be prepared to wait a while (again).
You will have to update startkde-3.5.8 first (KDE4 blocks any earlier revisions – the last one is patched to allow it to exist next to KDE4):
emerge –update /usr/portage/kde-base/kdebase-startkde/kdebase-startkde-3.5.8-r1.ebuild
You also need to force some special use flags for qt4.
Edit /etc/portage/package.use
Add the line:
x11-libs/qt:4 accessibility qt3support dbus gif jpg png ssl zlib
Finally, it’s time to emerge kde4:
emerge kde-meta
This will really take a long time. If you skipped the update world above, use this here and now. It is a good idea to do a -pv first, and check if you want to add some temporary USE flags as well. In my case I added:
USE="pdf svg wmf ppds htmlhandbook debug "
But the list will depend on your current USE setup and needs so decide for yourself.
Once it is finished, you will need to restart kdm to get to a kde4 session:
First edit /etc/conf.d/xdm and change it to read:
DISPLAYMANAGER=kdm-4.0
Then run:
/etc/init.d/xdm restart
Voila, you can now log into a KDE4 session. You KDE3 session is also still available should you desire it. I’ll post a review of my findings with it in about 24 hours.
Final note: After I started, but before I finished this task (which took me all of three entire days)- gentoo themselves published an up-to-date howto, I suggest reading it as well for comparison.