Annotation of wikisrc/pkgsrc/how_to_use_pkgsrc_on_solaris.mdwn, revision 1.1

1.1     ! mspo        1: Document status: **DRAFT**
        !             2: 
        !             3: 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.
        !             4: 
        !             5: **Contents**
        !             6: 
        !             7: [[!toc]]
        !             8: 
        !             9: #Installation
        !            10: 
        !            11: Begin by installing a Solaris core system. When done, mount the Solaris CD/DVD and install the following extra packages:
        !            12: 
        !            13: * SUNWarc Lint Libraries (usr)
        !            14: * SUNWbtool CCS tools bundled with SunOS (Solaris 9)
        !            15: * SUNWbzip The bzip compression utility
        !            16: * SUNWdoc Documentation Tools
        !            17: * SUNWhea SunOS Header Files
        !            18: * SUNWlibm Math & Microtasking Library Headers & Lint Files (Usr)
        !            19: * SUNWlibmr Math Library Lint Files (Root) (Solaris 10)
        !            20: * SUNWman On-Line Manual Pages
        !            21: * SUNWscpr Source Compatibility, (Root)
        !            22: * SUNWscpu Source Compatibility, (Usr)
        !            23: * SUNWsprot Solaris Bundled tools
        !            24: * SUNWtoo SUNWtoo Programming Tools
        !            25: * SUNWxcu4 XCU4 Utilities 
        !            26: 
        !            27: These packages are required if you intend to use modular-xorg-server from pkgsrc:
        !            28: 
        !            29: * SUNWdfbh Dumb Frame Buffer Header Files
        !            30: * SUNWaudh Audio Header Files (don't ask why!) 
        !            31: <pre><code>
        !            32: # mount -F hsfs /dev/dsk/c1t1d0p0 /mnt
        !            33: # cd /mnt/Solaris10/Product
        !            34: # cp -r SUNW... /var/spool/pkg
        !            35: # pkgadd
        !            36: </code></pre>
        !            37: To see which SUNW packages are already installed, use the /usr/bin/pkginfo command. 
        !            38: 
        !            39: #Compiler setup
        !            40: 
        !            41: Now you need a compiler. You have a couple of options:
        !            42: 
        !            43: * Use my prebuilt compiler kit, available from <http://notyet>
        !            44: * Install SUNWgcc from the Solaris DVD
        !            45: * Install Sun Studio 10
        !            46: * Install gcc from Sunfreeware.com
        !            47: * [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. 
        !            48: 
        !            49: #pkgsrc
        !            50: 
        !            51: Got a compiler? Good! Let's download and bootstrap pkgsrc.
        !            52: 
        !            53: Grab pkgsrc.tar.gz from <ftp://ftp.NetBSD.org/pub/pkgsrc/current/> and untar to /usr, or get it from CVS.
        !            54: 
        !            55:     # cd /usr/pkgsrc/bootstrap
        !            56:     # env CFLAGS=-O2 CC=/usr/local/gcc4/bin/gcc ./bootstrap
        !            57: 
        !            58: [coffee break]
        !            59: 
        !            60: Now we can tune /usr/pkg/etc/mk.conf. I use the following additional settings:
        !            61: <pre><code>
        !            62: CFLAGS+=-O2
        !            63: CXXFLAGS+=-O2
        !            64: CC=/usr/local/gcc4/bin/gcc
        !            65: CXX=/usr/local/gcc4/bin/g++
        !            66: X11_TYPE=modular
        !            67: PKG_DEVELOPER=yes
        !            68: PKG_DEFAULT_OPTIONS+=freetype truetype mmx subpixel official-mozilla-branding
        !            69: </code></pre>
        !            70: At this point you're free to install whatever packages you like.
        !            71: 
        !            72: 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.) 
        !            73: 
        !            74: #Installing modular X.org from pkgsrc
        !            75: 
        !            76: 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.
        !            77: 
        !            78: Packages needed for modular X.org are:
        !            79: 
        !            80: * meta-pkgs/modular-xorg-fonts
        !            81:   * xxx: fonts/mkfontdir needs a hack that I have not yet committed 
        !            82: * meta-pkgs/modular-xorg-apps
        !            83: * x11/modular-xorg-server
        !            84:   * xxx: needs some hacks that have not yet been committed (--disable-dri, libdrm, driproto KDSETMODE ioctl, vtname /dev/fb) 
        !            85: * x11/xf86-input-keyboard
        !            86: * x11/xf86-input-mouse
        !            87: * x11/xf86-video-vesa (or pick a suitable driver for your card)
        !            88: * x11/xterm 
        !            89: 
        !            90: 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.
        !            91: 
        !            92: TODO: write about installing firefox, desktop stuff, ... 
        !            93: 
        !            94: #Outstanding PR's with patches
        !            95: 
        !            96: 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.
        !            97: 
        !            98: * [pkg/40153](http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=40153) - Synopsis: pkgsrc/devel/binutils fails to build on solaris 10 sparc
        !            99: * [pkg/40201](http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=40201) - Synopsis: pkgsrc/sysutils/memconf update needed
        !           100: * [pkg/39085](http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=39085) - Synopsis: firefox3 compile problem (just committed!)
        !           101: * [pkg/40221](http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=40221) - Synopsis: pkgsrc/mail/p5-Mail-Mbox-MessageParser requires GNU grep (needed by grepmail)
        !           102: * [pkg/40222](http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=40222) - Synopsis: pkgsrc/databases/sqsh fix build w/sybase libs on Solaris 
        !           103: 
        !           104: #Other hints
        !           105: 
        !           106: 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:
        !           107: 
        !           108: * errors building libffi (required by python 2.5+) using Sun Studio compiler can be worked around by using gcc or setting: 
        !           109: 
        !           110:     PYTHON_VERSION_DEFAULT=24
        !           111: 
        !           112: * errors regarding a **missing gtk-rebase** can be worked around by installing the package **textproc/gtk-doc**
        !           113: * 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: 
        !           114: 
        !           115:     PKG_JVM_DEFAULT=                sun-jdk6
        !           116:     _PKG_JVMS_ACCEPTED+=            sun-jdk6
        !           117: 
        !           118: * errors regarding wrong number of arguments to readdir_r() and some other xxx_r() functions can be fixed by adding to the package Makefile: 
        !           119: 
        !           120:     CFLAGS.SunOS+=                  -D_POSIX_PTHREAD_SEMANTICS
        !           121: 
        !           122: If you encounter issues with missing libraries, refer to [the pkgsrc guide](ftp://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/doc/pkgsrc.html#undefined-reference) first.
        !           123: #See also
        !           124: 
        !           125: * [[pkgsrc/The pkgsrc portability guide]]
        !           126: * [[pkgsrc/How to use pkgsrc on Mac OS X]]
        !           127: 
        !           128: #External links
        !           129: 
        !           130: * [NPC on Solaris developer HOWTO](http://solarpack.sourceforge.net/howto-dev.html)
        !           131: * [pkgsrc under Solaris](http://www.oe-files.de/oefiles/lab/solpkgsrc) at The -Files - recommends using gcc (the [GCC for Sun Systems package](http://cooltools.sunsource.net/gcc/) 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 <wikimaster@NetBSD.org> software: FreeBSD-CVSweb