1. Introduction
2. Installing MacPorts
2.1. Install X11
2.2. Install Xcode
2.3. Install MacPorts
2.4. MacPorts Upgrade
2.5. Uninstall
2.6. MacPorts and the Shell
3. Using MacPorts
3.1. The port Command
3.2. Port Variants
3.3. Common Tasks
3.4. Port Binaries
4. Portfile Development
4.1. Portfile Introduction
4.2. Creating a Portfile
4.3. Example Portfiles
4.4. Port Variants
4.5. Patch Files
4.6. Local Portfile Repositories
4.7. Portfile Best Practices
4.8. MacPorts' buildbot
5. Portfile Reference
5.1. Global Keywords
5.2. Global Variables
5.3. Port Phases
5.4. Dependencies
5.5. Variants
5.6. Tcl Extensions
5.7. StartupItems
5.8. Livecheck / Distcheck
5.9. PortGroups
6. MacPorts Internals
6.1. File Hierarchy
6.2. Configuration Files
6.3. Port Images
6.4. APIs and Libs
6.5. The MacPorts Registry
7. MacPorts Project
7.1. Using Trac for tickets
7.2. Contributing to MacPorts
7.3. Port Update Policies
7.4. MacPorts Membership
7.5. The PortMgr Team
8. MacPorts Guide Terms
Glossary
Single Page Chunked

This chapter shows you how to install MacPorts and its prerequisites step-by-step. Note that the sections about installing X11 and installing Xcode are Mac OS X specific. If you wish to install MacPorts on another platform, first make sure you have X11 and gcc installed, and then skip ahead to installing MacPorts from source and continue to the end of the chapter.

X11.app allows you to run applications using the X Window System, which is the traditional display server on most other UNIX like systems. Additionally, the Xquartz project provides an updated version of the X server.

Note

As of Mac OS X 10.5 Leopard, X11.app is included in the default installation. You can just skip this section for any later version of Mac OS X.

  1. Insert the Mac OS X Install Disk and run the package named Optional Installs.

  2. At the software selection window expand the Applications category and click the check box beside X11 (and nothing else).

  3. Click Install to install X11.

Before launching an X11 application on Mac OS X 10.4, you must open X11.app and start an xterm session. Later OS versions should launch X11.app automatically when an X11 application is run from the Terminal.

%% xterm

After the X11 session window opens, you may launch X11 apps from another terminal window. See Optional X11 Settings if you wish to launch X11 applications from an X11 session window.

Note

X11 and the X11SDK (from Xcode Tools) are both required for X11 apps. To verify the presence of both, check for files com.apple.pkg.X11User.bom & com.apple.pkg.X11SDKLeo.bom in /Library/Receipts/boms/. On Mac OS X 10.4, look for files X11User.pkg & X11SDK.pkg in /Library/Receipts/.

To launch X11 applications directly from an X11 window (instead of a regular terminal window), you need to make it so X11 sessions opened using the menu bar respect your .profile file.

  1. Open X11 and select Customize Menu ... from the Applications menu.

  2. Double-click the menu item Terminal and change: xterm to xterm -ls

  3. Click Done to save the change.