File:  [NetBSD Developer Wiki] / wikisrc / pkgsrc / how_to_use_pkgsrc_on_solaris.mdwn
Revision 1.3: download - view: text, annotated - select for diffs
Sun Feb 5 07:41:24 2012 UTC (10 years, 9 months ago) by schmonz
Branches: MAIN
CVS tags: HEAD
fix isutf8 complaints

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 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. 

#Compiler setup

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
* [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 <> and untar to /usr, or get it from CVS.

    # cd /usr/pkgsrc/bootstrap
    # env CFLAGS=-O2 CC=/usr/local/gcc4/bin/gcc ./bootstrap

[coffee break]

Now we can tune /usr/pkg/etc/mk.conf. I use the following additional settings:
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.) 

#Installing modular from pkgsrc

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/ choose /usr/dt/... which requires X11_TYPE=native instead of modular.

Packages needed for modular are:

* meta-pkgs/modular-xorg-fonts
  * xxx: fonts/mkfontdir needs a hack that I have not yet committed 
* meta-pkgs/modular-xorg-apps
* x11/modular-xorg-server
  * xxx: needs some hacks that have not yet been committed (--disable-dri, libdrm, driproto KDSETMODE ioctl, vtname /dev/fb) 
* x11/xf86-input-keyboard
* x11/xf86-input-mouse
* x11/xf86-video-vesa (or pick a suitable driver for your card)
* x11/xterm 

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, ... 

#Outstanding PR's with patches

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 

#Other hints

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: 

    CFLAGS.SunOS+=                  -D_POSIX_PTHREAD_SEMANTICS

If you encounter issues with missing libraries, refer to [the pkgsrc guide]( first.
#See also

* [[pkgsrc/The pkgsrc portability guide]]
* [[pkgsrc/How to use pkgsrc on Mac OS X]]

#External links

* [NPC on Solaris developer HOWTO](
* [pkgsrc under Solaris]( at The &#214;-Files - recommends using gcc (the [GCC for Sun Systems package]( on Sparc (note that 4.2.0 is the last version supporting Solaris 9), bootstrapped lang/gcc34 on x86), 32-bit binaries, building everything from pkgsrc 

CVSweb for NetBSD wikisrc <> software: FreeBSD-CVSweb