14.2. Using DarwinPorts

 < Day Day Up > 

14.1. Installing DarwinPorts

You'll find detailed documentation, written by Michael A. Maibaum, on the installation and use of DarwinPorts on the DarwinPorts web site. Although the DarwinPorts site should be checked for the most up-to-date information, a brief description of its installation and usage is provided here.

Before installing DarwinPorts, you must install the Xcode Tools, which as noted in Chapter 7, can be installed from the Mac OS X Install DVD, or downloaded from the Apple Developer Connection web site at http://developer.apple.com. Alternatively, on a new Mac, the Xcode Tools installer can be installed from /Applications/Installers/Developer Tools/. You also need to install X11, which is an optional installation when you install Mac OS X, and the X11 SDK, which is included with Xcode. Installation of DarwinPorts is built around the Concurrent Versioning System (CVS), which is installed with Xcode.

Possible Conflicts Between DarwinPorts and Fink

DarwinPorts and Fink can co-exist on the same system, but if you've already installed Fink (say, in its default location /sw), there is a chance that the configuration phase (described later) will identify the Fink-installed version of the required software.

For example, if you've installed Tcl/Tk with Fink, DarwinPorts may use the version of Tcl in /sw, rather than the Mac OS X-bundled Tcl in /usr/bin. If this happens and you later decide to remove Fink, you'll mess up your DarwinPorts installation.

To avoid this potential problem, you should temporarily remove /sw/bin from your path (or, if you've added it to your .bashrc file, comment out the line ./sw/bin/init.sh).


To install DarwinPorts, you should be logged in as an administrative user. In the following discussion, assume you're logged in as the administrative user ernestrothman.

You can install the latest point-release of DarwinPorts either from source or using a binary installer. To install DarwinPorts using the binary installer, download the .dmg file from the DarwinPorts web site to your Desktop, double-click this file to mount the disk image, and double-click the .mpkg installer in the disk image to install DarwinPorts.

To install DarwinPorts from source, log into Mac OS X as an administrative user and download either the source tarball from the DarwinPorts web site into your home directory.

For example, to install DarwinPorts-1.0, enter the following commands:

          cd     curl     http://darwinports.opendarwin.org/downloads/DarwinPorts-1.0.tar.gz 

14.1.1. Installing DarwinPorts from CVS

To download DarwinPorts and establish its infrastructure on your system, perform the following steps:

  1. Change to your home directory. Log into the OpenDarwin CVS server. When prompted for a password, press Return to supply a blank password:

         $ cd     $ cvs -d     :pserver:anonymous@anoncvs.opendarwin.org:/Volumes/src/cvs/od     login

  2. Download the package descriptions and DarwinPorts infrastructure:

         $ cvs -d     :pserver:anonymous@anoncvs.opendarwin.org:/Volumes/src/cvs/od \     co -P darwinports

The directory -/darwinports/dports contains the port description files (also known as Portfiles), and must be kept even after you've installed DarwinPorts. The location of dports is specified in the file /etc/ports/sources.conf. If you move the dports directory, you must change the line file://~/darwinports/dports in dports to specify the new location.


As an alternative to downloading the DarwinPorts files via the CVS commands above, you can download a nightly tarball (http://darwinports.opendarwin.org/darwinports-nightly-cvs-snapshot.tar.gz). To install DarwinPorts from the tarball, download and unpack it in your home directory. This creates the ~/darwinports directory. You can then proceed as outlined below.

After downloading DarwinPorts, you're now ready to build and install it on your system:

  1. Change to the ~/darwinports/base directory, which is known as the DarwinPorts infrastructure:

         $ cd darwinports/base 

  2. Perform the configure, make, and make install sequence:

         $ ./configure     $ make     $ sudo make install

    These commands build and install necessary files in /opt/local, /private/etc/ports, and /Library/Tcl/darwinports1.0.

No matter how you installed DarwinPorts, /opt/local/etc/ports/ports/conf is created with a line pointing to a dports directory. If you've installed the latest point release of DarwinPorts, the dports directory is specified by /rsync://rsync.opendarwin.org/dpupdate/dports. If you've installed a CVS-development version of DarwinPorts, a local dports directory will be specified as /opt/local/var/db/dports.

The local dports directory contains the ported software descriptions and related Portfiles, which are Tcl scripts needed to build and install the ported software. According to documentation on the DarwinPorts site, the sources.conf file is used to list the locations of both local and remote port software hierarchies.

Since DarwinPorts software is installed in /opt/local, you should add /opt/local/bin to your path. Once you have performed these steps, you'll have a working installation of DarwinPorts. If you want DarwinPorts software to install software in a directory other than /opt/local, you can edit the file /opt/local/etc/ports/ports.conf and change the value of prefix from /opt/local to the directory in which you want packages installed. As an alternative, you could run the configure command used in the build of DarwinPorts with the prefix option.

     < Day Day Up > 


    Mac OS X Tiger for Unix Geeks
    Mac OS X Tiger for Unix Geeks
    ISBN: 0596009127
    EAN: 2147483647
    Year: 2006
    Pages: 176

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net