Dropping recommendation to install system headers / command line tools

Rainer Müller raimue at macports.org
Wed Jul 5 17:41:33 UTC 2017


On 2017-07-05 18:28, Ken Cunningham wrote:
> I wasn’t around for it, but I think in the beginning /opt/local was chosen for macports in part because /usr/local was being heavily used by darwinbuild and they needed to keep away from that.

There are several reasons not to use /usr/local:

Lots of graphical installers will install files to /usr/local. When
unexperienced users follow instructions on how to install software, they
are likely to put stuff into /usr/local that will later conflict with
MacPorts. Similarly, you are not supposed to manually build and install
software with './configure --prefix=/opt/local' if this prefix is
managed by MacPorts.

/usr/local/{include,lib} cannot be removed from the search paths of the
compiler, so you would no longer be able to compile anything without
opportunistically linking to MacPorts.

Most notably, /usr/local/bin is in the default system PATH. By
installing incompatbile binaries with the same names as system binaries,
you may break third-party or system scripts. Therefore it is better to
use a separate prefix that is not in the default PATH, but can be added
for interactive shells only.

Fink and MacPorts chose a different prefix to avoid these problems and
conflicts. They can coexist as long as software build scripts do not
hardcode /sw or /opt/local (we usually patch it out if encountered).
Homebrew just did not care about previous experiences and chose to use
/usr/local.

Rainer


More information about the macports-dev mailing list