MacPorts Packages

From Exterior Memory
Jump to: navigation, search

MacPorts Packages

MacPorts is currently my preferred package manager for Mac OS X. It is more active than Fink and Homebrew (in number of provided packages)

One of the most striking features of MacPorts is that it provides its own libraries rather than relying on the Apple-provided libraries. This increases robustness, at the downside of requiring long dependency lists. While I dislike the long dependency list, I've seen too many migration problems (e.g. with X11 from Xfree to Xorg or from gcc to llvm compiler, and I'm sure that a migration of Python 2 to Python 3 will also introduce some issues) that I prefer MacPort's philosophy to avoid these issues. It certainly helps that MacPorts nowadays provides binary packages, which both reduces the total compile time as well as the number of build dependencies.

For a good manual, see http://guide.macports.org/

Installing a Package

First, get new packages description, and install a particular package:

sudo port sync
sudo port install curl
port list installed

List Installed Packages

To list all installed packages:

port installed

To list all manually installed packages:

port installed requested

or

port installed requested and active

To list all ports that are not requested, but have no dependents (e.g. no other port relies on it). This typically gives a list of packages that you can uninstall without problems (a common reason how they get installed is due to build dependencies):

port installed leaves

To mark a port as requested:

port setrequested <portnames>

To delete leaves:

port uninstall leaves

See also Config:MacPorts Packages for a list of currently installed packages.

Build from Source

If available, a precompiled binary of a package is installed. To force the package to be build from source, specify:

port -s

or set buildfromsource always in macports.conf.

Local Builds

It is possible to create a Portfile, and run that build script. Make sure you have a Portfile in a folder with the same name of the port.

E.g. for a port called py-mymod:

cd py-mymod
port build

In case the Portfile defines subports (such as most Python and Perl modules do):

cd py-mymod
port build subport=py33-mymod

Update

First, download new package descriptions:

% sudo port selfupdate

Then, check for outdated packages:

% port outdated
  The following installed ports are outdated:
  gnupg                          1.4.2.2_0 < 1.4.3_0
  pango                          1.12.0_1 < 1.12.1_0
  subversion                     1.3.0_2 < 1.3.1_0

Finally, upgrade the packages:

% sudo port upgrade installed

Force Rebuild

In case a package is broken, you can force a rebuild:

% sudo port installed php5
The following ports are currently installed:
  php5 @5.1.4_3+apache2+darwin_8+macosx+mysql5 (active)
% sudo port uninstall php5
% sudo port clean --all php5
% sudo port install php5 +apache2+darwin_8+macosx+mysql5

Ports Variants

Packages may have multiple variants. For example, a version with or without IPv6 support. Most packages are default configured with most options enabled, so that the packages has maximum use. However, it may sometimes be necessary to specify a certain option, for example to disable SSL by specifying +no_ssl

 % port variants wireshark
wireshark has the variants:
   adns: use adns library for async. dns resolution instead of the default c-ares library
   gnutls
   ipv6
   libgcrypt
   libsmi
   lua
   no_ssl
   no_x11
   pcre
   python25: use python25 for the experimental python interface
     * conflicts with python26 python27
   python26: use python26 for the experimental python interface
     * conflicts with python25 python27
   python27: use python27 for the experimental python interface
     * conflicts with python25 python26
   rtp: add rtp support with portaudio
   universal: Build for multiple architectures

To specify the non-default variant during installation, use the +variant option:

% sudo port install wireshark +ipv6

Replace an installed variant

The following example adds the ipv6 variant to wireshark.

% port installed ethereal
  ethereal @0.10.14_0+darwin_8 (active)

% sudo port deactivate ethereal @0.10.14_0+darwin_8

% port installed ethereal
  ethereal @0.10.14_0+darwin_8

% port clean ethereal
% sudo port install ethereal @0.10.14_0+darwin_8+ipv6

% port installed ethereal
  ethereal @0.10.14_0+darwin_8
  ethereal @0.10.14_0+darwin_8+ipv6 (active)

Installed Files

To find which file installed a particular package:

% port provides /opt/local/bin/xe*
/opt/local/bin/xelatex is not provided by a MacPorts port.
/opt/local/bin/xetex is provided by: texlive_base

To list which files are installed by a particular packages:

% port contents texlive
/opt/local/bin/etex
/opt/local/bin/latex
/opt/local/bin/pdflatex

Contributions

See MacPorts Trac page for a list of package contributions I made in the past.


List of Useful MacPorts packages

This is a list of packages I've found useful. For a more recent list, see Config:MacPorts_Packages.

LAMP packages

To customize the existing LAMP ("Linux", Apache, MySQL, PHP/Perl/Python) installation, you can use these packages:

Package Category Description
apache2 www The extremely popular second version of the Apache http server
lua lang powerful, lightweight programming language
mysql5 databases Multithreaded SQL database server
perl5.18 lang Perl 5.18.x - Practical Extraction and Report Language
pypy lang, python, devel implementation of Python in Python
python26 lang An interpreted, object-oriented programming language
python27 lang An interpreted, object-oriented programming language
python32 lang An interpreted, object-oriented programming language
python33 lang An interpreted, object-oriented programming language
ruby19 lang, ruby Powerful and clean object-oriented scripting language
php5-pear php, www Optional port adds the PEAR repository to the include path for php5.

Developer packages

Package Category Description
ddd devel Data Display Debugger
git-core devel A fast version control system
libgcrypt devel, security Crypto library
mercurial devel, python A fast, lightweight, distributed SCM system written in Python.
openssl devel, security OpenSSL SSL/TLS cryptography library
readline devel Library that provides command line editing
subversion devel subversion (svn) -- a version control system designed to be a better cvs

GNU replacement packages

To replace the BSD tools with GNU tools, you can use these packages:

Package Category Description
coreutils sysutils GNU File, Shell, and Text utilities
findutils sysutils findutils contains GNU find, xargs, and locate
logrotate sysutils Rotates, compresses, and mails system logs
mlterm x11 Multi-lingual X11 terminal emulator
xterm x11 the ubiquitous X terminal emulator, stand-alone

Multimedia packages

Package Category Description
ImageMagick graphics, devel Tools and libraries to manipulate images in many formats
graphviz graphics graph visualization software
gnuplot math, science A command-driven interactive function plotting program
fondu print A set of programs to interconvert between Mac font formats and pfb, ttf, otf and bdf files on UNIX.
pdflib print PDFlib Lite (Source Code) is a subset of PDFlib
MPlayer multimedia The MPlayer movie player built from SVN.
soundtouch audio, multimedia Audio processing application and library for changing the Tempo, Pitch and Playback Rates of audio streams or files.

WWW packages

Package Category Description
curl net, www Tool for transferring files with URL syntax
curl-ca-bundle net CA certificate bundle for curl
lynx www The text web browser
wget net, www internet file retriever

Compression tools

Package Category Description
bzip2 archivers, sysutils compression library and tools
deb2targz archivers converts .deb packages to .tar.gz archives
p7zip archivers 7-Zip implementation
unrar archivers Extract, view & test RAR archives

Email packages

Package Category Description
gnupg mail, security GNU pretty-good-privacy package
signing-party mail, security Various OpenPGP related tools

Network tools

Package Category Description
ifstat sysutils, net ifstat is a tool to report network interface bandwidth
lft net, security Layer Four Traceroute - advanced traceroute tool
mtr net traceroute and ping in a single tool
ngrep net Network grep
nmap net Port scanning utility for large networks
ptunnel net tunnel over ICMP
rrdtool net Round Robin Database
rsync net Fast incremental file transfer
sipcalc net An advanced IP subnet calculator
tuntaposx net Tun and tap virtual devices.
whois net A replacement whois client
wireshark net Graphical network analyzer and capture tool

Text processing packages

Package Category Description
aspell textproc Spell checker with better logic than ispell
diffutils sysutils, textproc, devel GNU diff utilities
enca textproc character set analyser
figlet textproc, amusements banner-like program prints strings as ASCII art
flip textproc convert text file line endings
gsed textproc GNU version of the stream editor, sed
tidy www Fixes and tidies up HTML files
xml2rfc textproc RFC formatting utility using XML source
xtail sysutils like 'tail -f' on a bunch of files at once

LaTeX packages

Package Category Description
latexdiff tex determine and mark up significant differences between latex files
texlive-bibtex-extra tex TeX Live: BibTeX additional styles
texlive-bin tex TeX Live Binaries.
texlive-fonts-extra tex TeX Live: Additional fonts
texlive-fonts-recommended tex TeX Live: Recommended fonts
texlive-formats-extra tex TeX Live: Additional formats
texlive-generic-extra tex TeX Live: Generic additional packages
texlive-generic-recommended tex TeX Live: Generic recommended packages
texlive-latex tex TeX Live: LaTeX fundamental packages
texlive-latex-extra tex TeX Live: LaTeX additional packages
texlive-latex-recommended tex TeX Live: LaTeX recommended packages
texlive-pictures tex TeX Live: Graphics, pictures, diagrams
texlive-plain-extra tex TeX Live: Plain TeX packages
texlive-publishers tex TeX Live: Publisher styles, theses, etc.
texlive-science tex TeX Live: Natural and computer sciences
texlive-xetex tex TeX Live: XeTeX and packages

Python packages

Package Category Description
py-checker python python source code checker for finding bugs
py-construct python python module for parsing and building binary or textual data structures
py-dnspython python, net DNS toolkit for Python
py-docutils python, textproc A set of tools for processing plaintext documentation
py-dot python, graphics python module for creating graphs
py-epydoc python API documentation generator for Python modules
py-gnuplot python, devel, math A Python interface to the gnuplot plotting program.
py-hggit python, devel Push to and pull from a Git server repository from Mercurial.
py-hgsvn python, devel hgsvn is a set of scripts for Subversion and Mercurial
py-ipython python An enhanced Interactive Python shell
py-libxml2 python, textproc Python bindings for libxml2
py-matplotlib python, graphics, math Matplotlib is a python plotting library
py-modulegraph python, devel Python module dependency analysis tool
py-mysql python, devel, databases Python interface to mysql
py-networkx python, science NetworkX in a Python package for graph manipulation.
py-numpy python, math The core utilities for the scientific library scipy for Python
py-openssl python, devel, security python wrapper around the OpenSSL library
py-oursql python, devel, databases Python driver for MySQL
py-pdfminer python Python pdf extraction package
py-pdfrw python, graphics Pure Python PDF file reader/writer library
py-pep8 python, devel Python style guide checker
py-Pillow python, devel Python Imaging Library (fork)
py-pip python, www A tool for installing and managing Python packages.
py-pychecker python python source code checker for finding bugs
py-pyflakes python, devel Passive checker of Python programs.
py-pygraphviz python, science A Python wrapper for the Graphviz Agraph data structure.
py-pypdf python, devel A Pure-Python PDF toolkit.
py-pypdf2 python, devel A utility to read and write pdfs with Python
py-rdflib python, textproc Python library for working with RDF
py-readline python GNU readline extension for Python
py-scipy python An opensource library of scientific tools for Python
py-setuptools python, devel distutils enhancement for build and distribution
py-sphinx python, textproc, devel Python documentation generator
py-tkinter python, graphics Python bindings to the Tk widget set
py-unittest2 python New features in the unittest library
py-wxpython python, graphics Python interface to the wxWidgets 2.8 cross platform GUI
py-yaml python, devel YAML 1.1 parser and emitter for Python