Getting Pkg Built And Installed From Source On OpenSolaris
By user12607856 on Jul 30, 2008
[Last updated: 12th January 2010]
I now want to be able to checkout the source code for the pkg project, build and install it, and start to try to understand how it all works.
Hopefully some day it'll be as simple as:
$ pfexec pkg build-dep pkg $ pkg source pkg $ cd .../pkg_src_dir $ make install
but we aren't there yet. I couldn't actually find a set of step-by-step instructions on how to do this, so I muddled through. Thanks to the helpful folks on the #opensolaris channel on irc.freenode.net and various Google searches.
Before I could get the source code, I first had to get the Mercurial source control management system. That was with:
$ pfexec pkg install SUNWmercurial
Getting the pkg project source code was with:
$ hg clone ssh://email@example.com/hg/pkg/gate
Most of the code is in Python, but there is some C. Before I could compile that, I needed to get a C compiler and all the things it needs. (I went with the Sun compilers). That's accomplished with:
$ pfexec pkg install sunstudio12u1
/opt/sunstudio12.1/bin to my PATH and
/opt/SunStudioExpress/man to my MANPATH in my
~/.bashrc and sourced it
Trying to do:
$ cd .../gate/src $ make install
in the pkg workspace, now resulted in compiler errors because a variety of standard C include files were missing.
Note that doing:
$ pkg search -r <missing file>
gives the names of the package you need to install, then you can use the "pfexec pkg install" command to install that package. Rinse and repeat. Here are the packages I had to install:
SUNWhea SUNWgnome-common-devel SUNWzoneint SUNWxwinc SUNWpython26-setuptools