Where should non-macports sw be installed? (Was: Problem with Macports, homebrew, and ghostscript)

Clemens Lang cal at macports.org
Wed Feb 12 16:24:57 PST 2014


Hi,

> Actually, I don't think there is that much of a problem with installing
> software in /usr/local, the problem is the particular way that Homebrew does
> it by default, taking over /usr/local completely, and it's disregard for
> standard ownership and permissions.

You're wrong on that one. The problem are the headers in /usr/local/include and libraries in /usr/local/lib. Compilers *will* search there by default and there's really no good way to tell them not to do that short of full-blown sandboxing with all the gory details related to that (which is what trace mode does).

> As long as you insure that MacPorts comes before /usr/local in your paths:
> 
> export PATH="/opt/local/sbin:/opt/local/bin:${PATH}"

$PATH doesn't really affect compiler's search paths. C_INCLUDE_PATH and LIBRARY_PATH do that for newer clangs, but those won't stop compilers from checking /usr/local, too.
Plus, your personal setting of $PATH doesn't affect MacPorts' $PATH variable in any way – MacPorts will sanitize its own environment before it starts compiling.

> export MANPATH="/opt/local/share/man:${MANPATH}"
> export INFOPATH="/opt/local/share/info:${INFOPATH}"

As far as I know those aren't used on newer versions of OS X and are automatically derived from the value of $PATH.

> I can only speak from personal experience, but I have lots of third-party
> stuff installed in /usr/local from binary .pkg installers and manually, and
> I haven't experienced any issues as a result of that.

If those binary installers did install headers in /usr/local/include and libraries in /usr/local/lib that has been pure luck. As soon as you install a port that has an optional dependency not installed via MacPorts but present in /usr/local you'll run into problems sooner or later.

-- 
Clemens Lang


More information about the macports-users mailing list