Document status: DRAFT
In this article I will document how to transform a Solaris 10 x86 core installation into a pkgsrc-powered desktop system. The Solaris core installation does not include any X11, GNOME or GNU utilites. We will use modular X.org from pkgsrc. The guide assumes that the reader has some prior experience using Solaris and pkgsrc.
Begin by installing a Solaris core system. When done, mount the Solaris CD/DVD and install the following extra packages:
- SUNWarc Lint Libraries (usr)
- SUNWbtool CCS tools bundled with SunOS (Solaris 9)
- SUNWbzip The bzip compression utility
- SUNWdoc Documentation Tools
- SUNWhea SunOS Header Files
- SUNWlibm Math & Microtasking Library Headers & Lint Files (Usr)
- SUNWlibmr Math Library Lint Files (Root) (Solaris 10)
- SUNWman On-Line Manual Pages
- SUNWscpr Source Compatibility, (Root)
- SUNWscpu Source Compatibility, (Usr)
- SUNWsprot Solaris Bundled tools
- SUNWtoo SUNWtoo Programming Tools
- SUNWxcu4 XCU4 Utilities
These packages are required if you intend to use modular-xorg-server from pkgsrc:
- SUNWdfbh Dumb Frame Buffer Header Files
- SUNWaudh Audio Header Files (don't ask why!)
# mount -F hsfs /dev/dsk/c1t1d0p0 /mnt # cd /mnt/Solaris10/Product # cp -r SUNW... /var/spool/pkg # pkgadd
To see which SUNW packages are already installed, use the /usr/bin/pkginfo command.
Now you need a compiler. You have a couple of options:
- Use my prebuilt compiler kit, available from http://notyet
- Install SUNWgcc from the Solaris DVD
- Install Sun Studio 10
- Install gcc from Sunfreeware.com
- [advanced] Bootstrap your own gcc, using one of the above. If you get an error about a library not being found, remember to use crle -u -l libpath to add it to the link path. Make sure any /usr/pkg/* library paths are included early in this string so that pkgsrc binaries will only have dependencies on pkgsrc libraries as much as possible.
Got a compiler? Good! Let's download and bootstrap pkgsrc.
Grab pkgsrc.tar.gz from ftp://ftp.NetBSD.org/pub/pkgsrc/current/ and untar to /usr, or get it from CVS.
# cd /usr/pkgsrc/bootstrap # env CFLAGS=-O2 CC=/usr/local/gcc4/bin/gcc ./bootstrap
Now we can tune /usr/pkg/etc/mk.conf. I use the following additional settings:
CFLAGS+=-O2 CXXFLAGS+=-O2 CC=/usr/local/gcc4/bin/gcc CXX=/usr/local/gcc4/bin/g++ X11_TYPE=modular PKG_DEVELOPER=yes PKG_DEFAULT_OPTIONS+=freetype truetype mmx subpixel official-mozilla-branding
At this point you're free to install whatever packages you like.
On Solaris 9 (at least), Python 2.4 is the latest version that will build. You may want to set PYTHON_VERSION_DEFAULT= 24 in mk.conf in order to build python packages. (As of 13feb2010.)
It is mentioned above, but easy to miss... you really want to set X11_TYPE=modular in mk.conf, otherwise none of this will work. You will also want to set MOTIF_TYPE=openmotif or MOTIF_TYPE=lesstif to avoid having pkgsrc/mk/motif.buildlink3.mk choose /usr/dt/... which requires X11_TYPE=native instead of modular.
Packages needed for modular X.org are:
- xxx: fonts/mkfontdir needs a hack that I have not yet committed
- xxx: needs some hacks that have not yet been committed (--disable-dri, libdrm, driproto KDSETMODE ioctl, vtname /dev/fb)
- x11/xf86-video-vesa (or pick a suitable driver for your card)
Now run /usr/pkg/bin/Xorg -configure, which should work. Move the generated configuration file to /etc/X11/xorg.conf. Now you can attempt to start the server, by running Xorg with no arguments. If you get a picture, but the mouse isn't working, try to set your mouse device to "/dev/kdmouse" and the protocol to "PS/2" in xorg.conf.
TODO: write about installing firefox, desktop stuff, ...
There are some PR's with patches that solve Solaris build issues that are not yet committed. These may solve a problem you are having.
- pkg/40153 - Synopsis: pkgsrc/devel/binutils fails to build on solaris 10 sparc
- pkg/40201 - Synopsis: pkgsrc/sysutils/memconf update needed
- pkg/39085 - Synopsis: firefox3 compile problem (just committed!)
- pkg/40221 - Synopsis: pkgsrc/mail/p5-Mail-Mbox-MessageParser requires GNU grep (needed by grepmail)
- pkg/40222 - Synopsis: pkgsrc/databases/sqsh fix build w/sybase libs on Solaris
These may not be the 'right' think to do, but are still a help to get past some issues until the right thing can be figured out:
errors building libffi (required by python 2.5+) using Sun Studio compiler can be worked around by using gcc or setting:
errors regarding a missing gtk-rebase can be worked around by installing the package textproc/gtk-doc
using a native jdk (on anything except SunOS-5.11-i386, which already works) can be done by adding these to /usr/pkg/etc/mk.conf:
PKG_JVM_DEFAULT= sun-jdk6 _PKG_JVMS_ACCEPTED+= sun-jdk6
errors regarding wrong number of arguments to readdir_r() and some other xxx_r() functions can be fixed by adding to the package Makefile:
If you encounter issues with missing libraries, refer to the pkgsrc guide first.