In this article I'll explain, how to install and use pkgsrc on Mac OS X (> 10.4.8)
On a stock Mac OS X you are missing a compiler and important tools for development. Therefore you will need to install the Xcode package that Apple provides upfront. The compressed Xcode disk image (.dmg) is rather big and has a size of currently 924 MB. You will need about 3 GB of free disk space to install it.
You can download the Xcode dmg at <http://developer.apple.com/tools/download/> which requires a free membership at ADC.
To install Xcode you will need Administrator privileges.
#Checking out pkgsrc
After you have downloaded and installed Xcode, you have cvs on your system and can now check out the latest pkgsrc tree from your closest mirror.
To do this, please set following environment variables:
$ export CVS_RSH=ssh
$ export CVSROOTemail@example.com:/cvsroot
and check out using the command:
$ cvs co -PA pkgsrc
the checkout takes a few minutes and requires currently about 368 MB (growing steadily).
#Bootstrapping Mac OS X
By default Mac OS runs with an HFS+ file system. This is by default created to be case-insensitive. HFS+ supports case-sensitivity, if you pass the option -s, when creating your HFS+ file system.
As pkgsrc needs to be run on a case-sensitive file system, you can either choose to create an additional case-sensitive file system for pkgsrc or, you can tell pkgsrc to ignore-cases to be able to use it, without modifying anything. In the latter case, please be aware that some packages (only a few) may not work.
$ cd pkgsrc/bootstrap
If you choose to bootstrap pkgsrc to use your default case-insensitive file system use following option:
$ sudo ./bootstrap --ignore-case-check
If you wish to bootstrap as non-root in your own home folder for testing purposes, please change to your home folder and then change into the bootstrap directory (pkgsrc/bootstrap) and run:
$ ./bootstrap --ignore-case-check --unprivileged
Please remember to add /Users/Zafer/pkg/bin to your PATH environment variable
and /Users/Zafer/pkg/man to your MANPATH environment variable, if necessary.
An example mk.conf file with the settings you provided to "bootstrap"
has been created for you. It can be found in:
You can find extensive documentation of the NetBSD Packages Collection
in /Users/Zafer/pkgsrc/doc/pkgsrc.txt and packages(7).
Hopefully everything is now complete.
===> bootstrap started: Thu Mar 1 13:34:34 CET 2007
===> bootstrap ended: Thu Mar 1 13:38:20 CET 2007
When done, please add your **pkg/bin** directory to your PATH variable **and** pkg/man to your MANPATH variable as mentioned above.
#Installing a new package
Installing packages is straightforward works like on other platforms. At first, pick a program you wish to install from the pkgsrc repository. For example misc/figlet. Change in that directory and run bmake.
$ cd pkgsrc/misc/figlet
$ bmake install clean
=> Registering installation for figlet-2.2.2
===> Cleaning for figlet-2.2.2
You can now simply run it by entering:
$ figlet MacOS X
__ __ ___ ____ __ __
| \/ | __ _ ___ / _ \/ ___| \ \/ /
| |\/| |/ _` |/ __| | | \___ \ \ /
| | | | (_| | (__| |_| |___) | / \
|_| |_|\__,_|\___|\___/|____/ /_/\_\
$ uname -a
Darwin macmini.aydogan.net 8.8.0 Darwin Kernel Version 8.8.0: Fri Sep 8 17:18:57 PDT 2006;
root:xnu-792.12.6.obj~1/RELEASE_PPC Power Macintosh powerpc
That's it. Have fun.
* [[pkgsrc/How to use pkgsrc on Solaris]]
* [[pkgsrc/How to use pkgsrc on Linux]]
* [[pkgsrc/The pkgsrc portability guide]]
CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb