New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Version 16 (modified by markd@…, 6 years ago) (diff)

--

1. Install Xcode Tools

  1. Download the latest verson of Xcode Tools from Apple's developer site —do not install an older version from the OS X 10.4 install disk or some ports may fail to install.
  2. Run the binary installer.
  3. Click Customize, expand the Applications category and click the checkbox beside X11 SDK to add it to the default items.
  4. Click Install to install Xcode Tools and the X11 SDK.

Notes: Xcode Tools is neither installed nor updated via the Software Update utility.

2. Install XWindows (X11)

On OS X 10.4, Apple's X11 is an optional install (MacPorts' X11 package is not recommended at this time). If the application X11 is not present in /Applications/Utilities:

  1. Insert the OS X 10.4 installation DVD and run the package named Additional Software.
  2. At the software selection window expand the Applications categoty and click the checkbox beside X11 (and nothing else).
  3. Click Install to install X11.
  4. Drag the /Applications/Utilities/X11 icon to your dock —you must open X11 before launching an X11 application.

Notes:

  • XWindows (X11) is required for many MacPorts apps and it is highly recommended that you install it even if you don't plan to run X11 apps immediately.
  • The X11SDK is also required to run X11 software, but it is installed by default during the Xcode Tools install above. If you wish to check to see if X11 (X11User) and X11SDK are installed, look in /Library/Receipts for the files X11User.pkg and X11SDK.pkg.

3. Set the shell environment

Setting the Unix shell environment is critical for MacPorts to function.

Requirements for the MacPorts' shell environment

The MacPorts binary installer places a .profile file in your home directory (view files preceded by a dot with 'ls -a'). The contents of this ~/.profile file adds the MacPorts paths in front of the standard Unix paths for the default BASH shell. This is done so that if you have utilities or libraries from both MacPorts and OS X's standard install, the MacPorts libraries will be run instead of the ones provided by Apple.

export PATH=/opt/local/bin:/opt/local/sbin:$PATH

You'll need to add this variable to your ~/.profile to run X11 applications:

export DISPLAY=:0.0

So a basic ~/.profile file will look like this:

export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export DISPLAY=:0.0

Important Notes:

  • To understand why MacPorts libraries are often installed when Apple has provided one, see section "Why is MacPorts using its own libraries?" in the FAQ.
  • Changes to ~/.profile do not take effect on the current shell session — they take effect on new sessions so open a new shell session and type 'env' to see the path and variable changes.
  • Other profile files may take precedence over ~/.profile. If you are using one of the following profile files in your home directory, you will need to merge the contents of it into ~./profile, or vice versa because the shell will ignore one of them:
    • ~/.bash_login
    • ~/.bash_profile

Verify the shell environment

To verify that your ~/.profile has set your shell environment:

  1. Open a new terminal window
  2. Type the command: env

Check to make sure the reported path begins with the MacPorts' paths as show above.

Sample output of command env:

TERM_PROGRAM=Apple_Terminal
TERM=xterm-color
SHELL=/bin/bash
TERM_PROGRAM_VERSION=133
USER=mduling
__CF_USER_TEXT_ENCODING=0x1F6:0:0
PATH=/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin

Options for the MacPorts' shell and X11 environment

To set a default editor for use with the port command (e. g. 'port ed mysql5'), add a variable EDITOR with the path of your favorite editor to the ~/.profile file.

export EDITOR=/usr/bin/pico

A sample ~/.profile with optional EDITOR variable set:

export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export DISPLAY=:0.0
export EDITOR=/usr/bin/pico

To launch X11 apps directly from an X11 window (instead of a terminal window), you need to add the MacPorts paths to X11's .xinitrc. An easy way to do that is to add this statement to the file /etc/X11/xinit/xinitrc at the top:

source ~/.profile

Sample /etc/X11/xinit/xinitrc snippet:

#!/bin/sh
# $Id: xinitrc,v 1.1.1.1 2005/02/24 22:35:39 akosut Exp $

source ~/.profile

4. Install MacPorts

Install MacPorts using the binary installer (to /opt/local/ only)

  1. Download the latest MacPorts .dmg disk image, currently 1.3.1.
  2. Run the binary installer.
  3. Perform the default “easy” install.

Install MacPorts from source (to any path except /usr/local/)

  1. Download and unzip the latest MacPorts tarball, currently 1.3.2.
  2. Perform these commands in a terminal window.
    cd ~/darwinports-1.x.x
    ./configure
    make
    make install
    

Note: To see why /usr/local is not a viable install location for MacPorts, see the MacPorts FAQ

5. Run 'port selfupdate' to download the latest ports and if necessary update MacPorts to the latest point release, currently 1.3.2.

  1. Open a terminal window.
  2. Execute the MacPorts selfupdate command.
port selfupdate

or for verbose output:

port -vd selfupdate