KDE 4 was released a few days ago. However, Gentoo developers have no yet included KDE 4 ebuilds to the portage tree, and thus Gentoo users have to install it by hand.
The instructions here can be followed by users of other Linux distributions too, but for example Debian users may use apt-get, which is much less error-prone.
Actually, I am going to describe the way I installed KDE 4 to my own PC, and I cannot guarantee that this is going to work for you too. You have to be sure about what you are doing, as I don’t want to be blamed if someone’s computer is harmed in any way!
What you ‘ll need
* latest version of Qt (emerge -av qt)
* latest version of cmake (emerge -av cmake)
* I had KDE 3.5 installed, but I’m not sure if you actually need it
* Strigi strigi.sourceforge.net
* Soprano framework soprano.sourceforge.net
* QImageBlitz library http://sourceforge.net/projects/qimageblitz
Start the fun!
First of all, create a folder where you will build kde4. e.g.:
mkdir ~/kde4 cd ~/kde4
Now, download all the needed files from kde.org. You can use a bash script invoking the wget command:
#!/bin/bash SERVER='http://files.kde.org/stable/4.0.0/src/' #add any other package you like FILES=( kdelibs kdepimlibs kdebase kdebase-runtime kdebase-workspace kdebindings kdesdk kdeutils ) NAME_END='-4.0.0.tar.bz2' for file in ${FILES[@]} do wget $SERVER$file$NAME_END &> /dev/null echo "Done downloading $file"; done echo "Done."
write this to a file and execute it:
vi download.sh # (paste the code here) chmod u+x download.sh ./download.sh
…or you could download them from http://www.kde.org/info/4.0.php…
I’ve included only the packages that I believe to be necessary. For a complete list enter the kde download site.
Building the packages!
Now, for every package you ‘ve downloaded, you ‘ll have to do the following: (e.g. for kdelibs)
1. Decompress the .tar.bz2 file
tar -xvjf kdelibs-4.0.0.tar.bz2
2. Make a new directory where you ”ll build the package
mkdir kdelibs-build
3. Enter the directory and create the MakeFile for the package (via the cmake command):
cd kdelibs-build cmake ../kdelibs-4.0.0
4. Build and install the package
sudo make sudo make install cd ../
You could actually create a nice little script to do this for the package of your choice: pkginstall.sh
#!/bin/bash PACKAGE=$1; tar -xvjf $PACKAGE-4.0.0.tar.bz2 mkdir $PACKAGE-build cd $PACKAGE-build cmake ../$PACKAGE-4.0.0 sudo make sudo make install cd ../
And now for e.g. kdeutils:
./pkginstall.sh kdeutils
but I think it would be better to write every command on its own, as you may encounter various errors.
The packages are recommended to be installed in this order:
* kdelibs
* kdepimlibs
* kdebase
* kdebase-runtime
* kdebase-workspace
* kdebindings
* kdesdk
* kdeutils
and any other package after these.
Try it out!
By now, you should have build KDE 4.
To try it, execute this script: kde4.sh:
#!/bin/bash X -ac :1 & export DISPLAY=:1 exec startkde
The first line creates a new X display – e.g. I have X on tty7, and a new X display starts on tty8
and the second starts the KDE.
If everything is ok, you are ready to use KDE 4!
Troubleshooting
First of all, the previous script for testing KDE 4, didn’t work on my PC. KDE 4 loaded OK, but just after it loaded, KDE 3 started on top of it! I had to write my own “startkde”, and thankfully it was easier than I thought: kde4.sh:
#!/bin/bash X -ac :1 & export DISPLAY=:1 plasma exec kwin dolphin
Instead of calling startkde, which doesn’t work as it should, we manually start plasma (the KDE desktop), kwin (the window manager for KDE) and the dolphin file manager.
And now, KDE 4 started, but it was very KDE 3-ish. I had to go to Computer -> System Settings on the main menu, and set all options on “Appearance” from “Plastique” to “Oxygen”, the default for KDE 4 (e.g. theme).
During building KDE 4 I got errors like: Package “X” missing, so I had to install that package. Don’t hesitate, and just do it.
You’ll probably don’t face such a problem if you follow my instructions at “What you ‘ll need”.
Also, I got some errors during compiling (kdebase-4.0.0 I think), and I had to change some files. Specifically:
I got an error in two files, that QWidget::SetAccessibleName was not defined, so I had to comment out one line from them. That didn’t produce any problems, but I don’t think that it is the best solution.
I hope you won’t have any other problems. If you have any, just post a comment!
In The End
Here we come to the end of this guide, I hope you had fun!
Happy KDE 4 for everyone!
UPDATE: Added description of what each line of the bash scripts does.
UPDATE 2: KDE 4 ebuilds have been added to the portage tree, but they are masked on profile.mask and under ~x86 because they are unstable (and they are absolutely right).
Why you do not make a ebuild for Gentoo ?
I had never read about how to create ebuilds, so I could not make one.
I read a few things, and I guess it’s not that difficult.
But, I think that there will be a official ebuild added to the Portage tree, as soon as KDE 4 becomes stable. Until then, you can check the KDE 4 Overlay Wiki at http://overlays.gentoo.org/proj/kde/wiki (I didn’t manage to install KDE 4 from the instructions there..)
My intention was to show how you could build KDE 4 on your own, and not with an automated script. I could just post a bash script doing everything I wrote, but it would not be fun
Quick question, does the order of compiling those packages on KDE.org matter?
Just realized you put up the order – out of curiosity, where did you find that list? I’m finding that official documentation is lacking severely.
That was my own recommendation based on what I did and what I understand.
It’s not something official.
hello,
if you use kde-4.1.3, you will need qt-4.4.x
and don’t forget to build qt with “dbus”.
thanks for guide^^
have fun
maddin