MacPorts is a system to allow the installation and management of open-source software packages in Mac OS X. It is based on the ports system of FreeBSD. A recipe known as a "portfile" describes how to automatically compile and install a package, including downloading source and applying patches. There is also another system for Mac OS X, known as Fink.
Installing with MacPorts
To use MacPorts, Apple's Xcode and an X11 environment must be installed. These can be installed from the Mac OS X install CD. See the MacPorts webpage for details.
MacPorts uses dmg package files. You must select the dmg file that matches your operating system version. The dmg files can be downloaded from the MacPorts website:
Install OpenRTM-aist by the ports
A script to download the portfile and automatically build and install it is available:
In an appropriate directory, execute the script as below. You will be asked for a superuser password during the install.
$ sh port_install100_mac.sh sh port_install.sh file:///Users/n-ando/ports/ Getting Portfile from: http://www.openrtm.org/pub/MacOSX/macports//ports.tgz --2010-07-27 23:21:06-- http://www.openrtm.org/pub/MacOSX/macports//ports.tgz Resolving www.openrtm.org (www.openrtm.org)... 22.214.171.124 Connecting to www.openrtm.org (www.openrtm.org)|126.96.36.199|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 3600 (3.5K) [application/x-gzip] Saving to: `ports.tgz.1' 100%[================================================>] 3,600 --.-K/s in 0.002s 2010-07-27 23:21:06 (2.02 MB/s) - `ports.tgz' saved [3600/3600] x ports/ x ports/devel/ x ports/PortIndex x ports/PortIndex.quick x ports/devel/OpenRTM-aist/ x ports/devel/OpenRTM-aist/Portfile x ports/devel/OpenRTM-aist/files/ x ports/devel/OpenRTM-aist/Portfile~ x ports/devel/OpenRTM-aist/files/patch-src-lib-rtm-InPortConsumer.h x ports/devel/OpenRTM-aist/files/patch-src-lib-coil-posix-coil-UUID.cpp x ports/devel/OpenRTM-aist/files/patch-src-lib-coil-posix-coil-Routing.cpp x ports/devel/OpenRTM-aist/files/patch-examples-SimpleService-Makefile.in x ports/devel/OpenRTM-aist/files/patch-examples-Composite-Makefile.in x ports/devel/OpenRTM-aist/files/patch-examples-ConfigSample-Makefile.in x ports/devel/OpenRTM-aist/files/patch-examples-SeqIO-Makefile.in x ports/devel/OpenRTM-aist/files/patch-examples-SimpleIO-Makefile.in x ports/devel/OpenRTM-aist/files/patch-src-lib-rtm-idl-Makefile.in Creating port index in /Users/n-ando/ports Adding port devel/OpenRTM-aist Total number of ports parsed: 1 Ports successfully parsed: 1 Ports failed: 0 Up-to-date ports skipped: 0 Adding local ports repository entry to sources.conf # A password may be required for sudo. Input your password. Password: Installing OpemRTM-aist...it may take several minutes. # A password may be required for sudo. Input your password. ---> Computing dependencies for OpenRTM-aist ---> Fetching OpenRTM-aist ---> Verifying checksum(s) for OpenRTM-aist ---> Extracting OpenRTM-aist ---> Applying patches to OpenRTM-aist ---> Configuring OpenRTM-aist ---> Building OpenRTM-aist ---> Staging OpenRTM-aist into destroot ---> Installing OpenRTM-aist @1.0.0_2 ---> Activating OpenRTM-aist @1.0.0_2 ---> Cleaning OpenRTM-aist Cleaning local ports repository entry in sources.conf # A password may be required for sudo. Input your password. Password: $
ports will automatically resolve any dependencies required by the package. This may take some time.
The details of the install are contained in the port_installXXX_mac.sh script. It roughly follows this procedure:
- Download the portfile
- Extract the portfile
- Add the extracted location to sources.conf
- Build and install using the port
In MacPorts, it searches for the package specified to be installed with the port command from the specific place described in the settings file sources.conf, downloads the source according to Porrtfile and builds.