Getting Pkg Built And Installed From Source On OpenSolaris
[Last updated: 12th January 2010]
|
On Monday I got OpenSolaris 2008.05 on my new work machine. I then followed step #2 in the release notes and updated to the latest packages. |
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://anon@hg.opensolaris.org/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
I then
added /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
Now back to pylint'ing. Looks like pylint isn't in the IPS repository yet, so I'll have to download and install it by hand.
( Jul 30 2008, 02:34:45 PM PDT ) [Listen] Permalink Comments [7]
Comments are closed for this entry.













Adding build-dep functionality to pkg would be awesome.
Posted by joanie on July 30, 2008 at 03:39 PM PDT #
I'm surprised that you had to add SUNWhea explicitly, as the sunstudioexpress package, pulled in by ss-dev, explicitly depends on SUNWhea. The gnome devel bits make sense, though I'll note they're only needed for building the gui.
Posted by Danek Duvall on July 30, 2008 at 04:01 PM PDT #
You know, I probably didn't need to do this.
Initially I got the Sun compilers via a
tarball download from the Sun Studio web site.
Then I did a "pkg search -r cc" to see if there
was a package in the repository that contained
these compilers, (that being easier).
It came back with both sunstudio and sunstudioexpress.
When I asked about it on #opensolaris, I was told
that installing ss-dev was better. (How you would
know that ss-dev is the magical meta-package to
install is another question, but I won't go there. :-) )
Anyhoo, I bet ss-dev would drag SUNWhea in, whereas
just installing via the tarball from the Sun Studio web site didn't.
If we can confirm that ss-dev does indeed
pull in SUNWhea, then I'll adjust the post
instructions accordingly.
Thanks.
Posted by Rich Burridge on July 30, 2008 at 04:13 PM PDT #
cant y'all
alias sudo=pfexec
so the rest of us know how to get things done?
Posted by paul on August 04, 2008 at 07:15 PM PDT #
*grins (sympathetically) at paul*
Is *that* what pfexec does? That thought crossed my mind the other day when I saw this entry, but I su out of habit (read: I sudo out of habit and get an error and then su). Hadn't gotten around to reading the man page to find out exactly what pfexec does....
Personally I'm torn between the view that OpenSolaris is not Linux and shouldn't attempt to imitate it and the view that I am old and tired and just want things to work. :-)
Posted by joanie on August 04, 2008 at 07:32 PM PDT #
They are not completely identical. See Darren's
post:
http://blogs.sun.com/darren/entry/opensolaris_rbac_vs_sudo_howto
Posted by Rich Burridge on August 04, 2008 at 07:57 PM PDT #
Hey Rich.
Was trying to build the fluendo mp3 plugin and was about to pull out my hair trying to work out how to figure out where a missing file lives. Then it occurred to me to check your blog:
"$ pkg search -r <missing file>"
Now I have tunes -- and the bulk of my hair. (The patches will grow back... I think... If not I'll just go punk.) Anyhoo.... Thanks (as always) for being a resource!
Posted by joanie on August 18, 2008 at 01:05 PM PDT #