Projects/KDE on Solaris
Solaris (and OpenSolaris) are Free Software operating systems released under the CDDL by Sun Microsystems. They are vaguely BSD-like. KDE4 runs on this operating system.
The KDE Project on the OpenSolaris site is intended to be the definitive source of information, but this page on TechBase is intended to collect information, porting and compilation guides, etc. Since TechBase is a wiki, this is much easier than going through the OpenSolaris editing process.
Solaris and OpenSolaris are trademarks of Sun Microsystems, Inc.
This page is about KDE4 (usually trunk; we are aiming for having KDE4.1 fully functional on Solaris) on Sun Solaris S10U5 or OpenSolaris Nevada 70b or OpenSolaris Nevada 83 running on both amd64 or SPARCv9 hardware and compiled with Sun Studio 12. No other KDE releases, operating system versions or hardware platforms are the target of this project, simply because the core contributors to the project do not have them.
That's not to say it will not necessarily work; people have and continue to contribute work for obsolete hardware platforms (32-bit only like i386 and SPARCv8). You can probably run the binaries produced by the project on other OpenSolaris releases, even OpenSolaris 2008.5, but you're on your own.
On your own, that is, unless you register for Techbase and add your comments on what needed doing and what was problematic somewhere below.
The core team for KDE4 on Solaris is Adriaan de Groot, Lukas Oboril Stefan Teleman. We'd like to thank E. O'Callaghan, Ben Taylor and Mark Wright for their help in particular.
You can use either Solaris 10 update 5 (S10U5) or Solaris Express (Nevada build 70b or 83 -- these two versions run on our build machine and on at least one developer's desktop). Other versions of the operating system might work, but there are no guarantees and probably not much sympathy either; OpenSolaris 2008.5 is downright broken as a development platform.
Also patch your OS with (again, these are listed on the SS12 patches page):
You can check with CC -V if you are up-to-date for the 124864 patch and cc -V for the 124868. Those are the most important ones.
Solaris Express Solaris Express, also known as Nevada, ships with Sun Studio Express instead of Sun Studio 12. You should remove it and manually download/install Sun Studio 12. Apply the required patches as mentioned in the section above, although you can skip the OS patches.
There is some confusion about which version(s) of Sun Studio 12 are really supported; it seems that SXDE 1/08 nv79 is the best version to have. Some (even newer) versions of the compile cause trouble when compiling the dependencies and KDE itself. That's for you to find out, though, and we appreciate hearing about bug reports. The developers themselves use nv70b and nv83. The more recent nv91 seems to have some issues which we have not yet fully identified. OpenSolaris 2008.5 is not a viable development platform for KDE4 on Solaris.
Compilation and Installation
Getting KDE4 on your Solaris machine is a three step process:
- You need the tools with which we will build everything else. This is the KDE Build Environment, KBE. KBE is inspired by CBE. KBE packages are installed in the package category KBE. The software installs in /opt/kdebld. Long-term goal: Merge CBE and KBE again, make our build depend only on CBE.
- You need all of the dependencies for KDE. This is a lot of software and is held in the CVSDude SVN repository. The dependencies are all provided as RPM-style SPEC files and sources. The packages produced by this step are all called FOSS<something> and are in the category KCE. KCE lies between KBE and KDE, hence the name. The software installs in /opt/foss. Long-term goal: Merge as much as possible with the existing Solaris packages.
- You need KDE4 itself. This software is not packaged yet, but does install in /opt/kde-4.0. That version number might change. Long-term goal: Provide installable packages.
There's actually a zero'th step: getting the sources which you need. We'll go over the four steps in turn.
Getting the Sources
First, we need to get the sources to KBE and the KDE dependencies. These all live in an SVN repository called CVSDude (which is a SVN hosting company that the KDE-Solaris team pays for an account). But not all Solaris installations have SVN installed already. If you do not have SVN installed, get it first (somehow).
SVN is also included in KBE itself, so there is some chicken-and-egg solution here: get a tarball of KBE only, then install that, then use the SVN included in there to restart the process from here. See #KBE Compilation and Installation, below.
Once you have SVN, check out the CVSDude repository (it might be over 3GB in size - be prepared for a long download and lots of disk use) as follows:
svn co https://svn2.cvsdude.com/kdesolaris/trunk
KBE Compilation and Installation
SVN is included in KBE. There is also make and cmake and other build tools. There is also pkgtool, which is used for building SysV packages.
This script will install dependencies that KBE has which are on the Solaris install media (SUNWi2c and twenty others, I think). Then it will start building the packages for KBE itself, starting with pkgtool. It should go off without a hitch (otherwise post output to the mailing list). If it craps out somehow, you will have to start over from scratch:
pkgrm -Y KBE ; bash kbe-install
Once KBE is done installing, you can check with pkginfo -c KBE to see what it has installed. You will have a /opt/kdebld filled with "stuff". Right. Now source the environment from KBE, which you will use in later steps:
(Use source /opt/kdebld/bin/env.csh if that's your poison). If you don't have an env.sh at the end, something is definitely wrong. I end up with 210 or so files in /opt/kdebld/bin, so keep that in mind as a metric. There are 23 packages in the KBE group.
You can give kbe-install a --nodeps to avoid the SUNW packages that it wants to install. You do need to have Sun Studio 12 9/07 or later installed; any later patches are welcome as well (but see the prerequisites section). I do not know what avoiding the SUNW dependencies will do, actually: they don't really seem to be essential, but I would suggest skipping this step only if you don't have the install media handy.
There are SYSV packages for the parts of KBE available from bionicmutton.org, see the index of packages for details. You can get the packages from the individual links there or fetch all of them with wget as follows. For x86 / amd64 machines, use "x86" for <arch>, for SPARC machines use "SPARC".
/usr/sfw/bin/wget --recursive http://www.bionicmutton.org/solaris/KBE/<arch>/
Use pkgadd on each unpacked package to install it.
If kbe-install does not work, please pop into #kde-solaris on Freenode (irc.kde.org works) and ask questions.
KDE4 has a lot of dependencies. Without getting near to porting all of the optional dependencies for the first four KDE SVN modules, the KDE Solaris team has already done about 50 different Open Source packages. These need to be installed first before you can compile KDE4. The packages range from single header files to Qt 4.3.1, which is kind of big. All of the dependencies are distributed as SysV packages.
Getting spec files
The next part of the equation is getting all of the dependencies of KDE to build. These are numerous, multifarious, and huge. And at least one of them will break. It is a 3GB SVN checkout, at least (and will use about 6GB of disk space).
$ . /opt/kdebld/bin/env.sh
$ nohup svn co https://svn2.cvsdude.com/kdesolaris/trunk Dude &
$ tail -f nohup.out
Find something to do while the SVN download runs. It takes a while. Probably you'll have to
$ pgrep -l svn; kill xxxx and start the checkout again once or twice. When it's done, go to the SPECS.
$ cd Dude/SPECS
In the SPECS/ directory you will find a whole bunch of *.pspc files. These represent all the dependencies currently packaged. Some of these may conflict with files and packages already sitting in your ~/packages/ directory, so it is safest to remove ~/packages/BUILD/* and ~/packages/SPECS/* and ~/packages/SOURCES/* (but not the directories themselves).
The pspc files are "Pre-SPEC files", meaning that they need to be processed in order to produce the .spec files that pkgtool understands. We do this for two reasons:
- The build and install sequence for each package is the same; all the logic lives in the Solaris/ directory of each source tarball.
- We need to create 32- and 64-bit spec files which are almost alike anyway.
Patching your System
Boost, one of the dependencies, builds Python bindings, and the Python headers installed by the system Python package are broken. So you will have to edit them as root to fix this. Fortunately it will take a while before Boost gets there, so start the make process and then an editor. In /usr/include/python2.4/pyport.h there is a gethostname() prototype that must be commented out. Or get a good copy of pyport.h here.
You will have to source the environment from KBE and then run make in the Dude/SPECS folder:
$ cd Dude/SPECS; nohup time make & tail -f nohup.out
That will start building all of the packages, one by one. For each package, the perl script Respect.pl is used to create the .spec files and tar up the source directory which you have checked out of SVN. Then pkgtool is used to build the resulting packages (both 32- and 64-bit if your hardware supports it). Typical output from one package looks like this:
perl Respect.pl --with-all --without-upload --without-build flac
Respect: Reading pspc file flac ...
Respect: Reading pspc file flac ...
Respect: Creating spec file flac.spec ...
Respect: Checking consistency ...
Respect: Creating spec file flac.spec ...
Respect: Warning - no dependency packages specified.
Respect: Installing replacement libtool ...
Respect: Creating source tarball ...
Respect: Copying tarball to packages/SOURCES ...
Respect: Skipping upload of tarball.
Respect: Use --with-upload to enable.
Respect: Skipping package build.
Respect: Use --with-build to enable.
pkginfo -q "FOSSflac" || pkgtool build "FOSSflac.spec"
INFO: Copying %use'd or %include'd spec files to SPECS directory
INFO: Processing spec files
INFO: Finding sources
INFO: Running pkgbuild -ba [...] FOSSflac.spec (FOSSflac)
If a package build fails, there will be a /tmp/FOSS*.log file explaining what went wrong. If configure fails in these packages, look for /tmp/config.log as well. Unfortunately pkgtool seems to destroy the build results directory even when it fails; you may also be able to look into ~/packages/BUILD/ to find the directory where things were building.
In case you face error like this:
ERROR: FOSSa52dec: Source file http://www.bogus.org//A52DEC-0.7.4.tar.gz not found
perl Respect.pl --with-spec --with-libtool --with-tarball --with-copy *.pspc in the SPECS dir. Then run a "make". Things, will build, hopefully ;)
Compiling by hand
You may want to work on a single pspc file or a single package by hand. Respect.pl has a whole bunch of options, but what you will most commonly do is create .spec files, create a tarball, build and install the package. This is straightforward:
perl Respect.pl --with-all --without-upload pspc-file
If you forget the --without-upload, it will try uploading the resulting package to bionicmutton, which probably is not what you want.
You can get packages from bionicmutton.org just as you can for KBE. Use
/usr/sfw/bin/wget --recursive http://www.bionicmutton.org/solaris/FOSS/<arch>
As usual, the IRC channel is a good place to start, but you must be able to pastebin compilation errors in order to get any help.
Removing FOSS* packages
If you want to remove the packages, run
for i in 1 2 3 4 ; do yes | pfexec pkgrm -Y KCE ; done
pkgrm -Y KCE removes all the packages in the category KCE (which is the category for our FOSS packages). However, there are some nasty circular dependencies that need special kinds of violence. This is why we need to remove the packages repeatedly. Each run through removes one cycle of packages.
KDE4 still builds out of KDE SVN. We have a setup that applies a handful of Solaris-specific patches to the code and then builds everything. We don't use kdesvn-build yet, but probably should when there are no external patches left.
Setting up an SVN checkout
Get a checkout of KDE SVN trunk, like so:
/opt/kdebld/bin/svn co svn://anonsvn.kde.org/home/kde/trunk/KDE
That's a huge checkout. Remember where you put it.
Using the build system
The build system lives in CVSDude SVN, so you need to check it out as well:
/opt/kdebld/bin/svn co https://svn2.cvsdude.com/kdesolaris/trunk/Build
Now is probably the right time to source /opt/kdebld/bin/env.sh again. Notice that Build/ just contains Makefiles. Everything here is driven by (GNU) make.
Configuration is stored in Makefile.config and you can override most of that in a file Makefile.config.local. The contents of my local configuration file are as follows:
DESTRUCTIVE_UNPACK=YESThat ought to be self-explanitory: I have the KDE SVN checkout under ~/KDE.
A good trial run is of the kdesupport SVN module, so run make -f Makefile.kdesupport
The IRC channel is never too busy. #kde-solaris on irc.freenode.net . However, keep in mind that IRC is a live medium and it may not be the best place to ask questions. The mailing list kde-discuss at opensolaris.org is much more patient.
Also, you are expected to do your homework. Compiling KDE4 on Solaris is not for the faint of heart and you really need to know your way around compiling stuff and dealing with system software installation; otherwise you will be quickly ignored.
KDE4 on Solaris is not done yet. Not by a long shot. Most of the time it compiles, but there is much cleaning up of the codebase and dependencies to do. We list them here:
- iconv_open fails in all Qt applications; it looks like it is trying a non-existent encoding -- but why? This appeared on Nevada build 70b, but not on Nevada 79b. That's weird :(
- glew, freeglut - we have to build our own Mesa (libGLU.so), because in Nevada build is libGLU linked with libgcc and libstdc++. That's very bad.
- gnutls - build issue in gnutls-extra lib
- ffmpeg - many build issues in different stages for 64bit or 32bit.
Those tools aren't possible to build at this time. I'm still working on. keep tuned.
Adding a KDE Session to DTLogin
(Material taken from Pradhap's blog entry) To be able to choose KDE4 from the login screen, you need to add a session to the dtlogin configurations -- and you need to have at least KDEBase compiled and installed. Then (as root):
# cd /usr/dt/config/C/Xresources.d
- cp -Ppr Xresources.jds Xresources.kde
- # Edit that file so it goes to KDE instead of GNOME
- cd /usr/dt/config
- cp -Ppr Xsession2.jds Xsession.kde
- # Edit that file so it goes to KDE instead of GNOME
- cp -Rpr Xinitrc.jds Xinitrc.kde
- # Edit that file so it goed to KDE instead of GNOME
You can also get a tarball with the fixed-up files.