[MacPorts] FAQ modified

MacPorts noreply at macports.org
Tue Apr 10 07:55:47 PDT 2012


Changed page "FAQ" by hans at stare.cz from 147.32.8.38*
Page URL: <https://trac.macports.org/wiki/FAQ>
Diff URL: <https://trac.macports.org/wiki/FAQ?action=diff&version=122>
Revision 122
Comment: /opt/local vs /usr/local as discussed on macports-users

-------8<------8<------8<------8<------8<------8<------8<------8<--------
Index: FAQ
=========================================================================
--- FAQ (version: 121)
+++ FAQ (version: 122)
@@ -51,12 +51,34 @@
 See also [wiki:Universal] for a (highly outdated at this point) list of ports that were tested for +universal support and the results.
 
 === Why is /opt/local the default install location for MacPorts? === #defaultprefix
-
-`/opt/local` was chosen so as to avoid stomping on other various installations (e.g. fink uses `/sw` to do the same); `/usr/local` is not a viable choice for several reasons:
- 1. Some software (especially auto* tools from Gnu) look in `/usr/local` as a default location, which means MacPorts can't be easily isolated when needed
- 2. `/usr/local` is usually reserved for the given system's admin to install items local to that system, and tends to be a bad choice to have taken over by a non-system port system
- 3. gcc considers `/usr/local` to be a standard system directory, causing (at least) the include directory to be unable to appear early in the list of include directories, and hence causing MacPorts-installed items to be difficult to use properly for items which need them (where another version is installed elsewhere, like `/usr/X11R6`)
-
+                        
+Traditionally, the place to install third party software on many UNIX systems is `/usr/local`.
+However, having macports under `/usr/local` would be error-prone for precisely that reason.  
+Many other software packages and packaging systems install into `/usr/local`,
+and could accidentaly overwrite what macports has installed, or vice versa.
+
+While this could be dismissed as the user's own error, it is a fact that
+people click through installers blindly, and consequently collisions under       
+`/usr/local` (and other prominent directories) happen very often.
+Macports doesn't want to be a victim of that, and `/opt/local` provides
+the splendid isolation (as would any other dedicated directory, of course).
+
+Also, `/usr/local` traditionally contains the given system's local admin tools;
+macports doesn't want to stomp on that either.
+
+(For the same reasons, fink uses `/sw` as its prefix.)
+
+=== So with macports under /opt/local I can use /usr/local freely? === #usrlocal
+                                                                                
+No, not entirely. Even with macports living elsewhere, `/usr/local` can still interfere.
+Some software (especially the GNU auto* tools and gcc) looks into `/usr/local` for external headers, libraries, and binaries. Certain ports might (and do) fail to build because during their build something incompatible is found and picked up
+from `/usr/local`. Good ports avoid this by explicitly specifying `--with-libfoo=/opt/local/lib/` or explicitly disabling all such possible dependencies altogether with `--disable-foo` or `--without-bar` but not all ports are able to do that.
+
+If you ask on a macports mailing list about a port failing to build because it chokes on something
+that it found and picked up in `/usr/local` you will probably be adviced to temporarily rename
+`/usr/local` to make it disappear entirely for the duration of the build.
+Obviously, this wouldn't be possible to do if macports itself lived under `/usr/local`.          
+ 
 === How do I remove or uninstall MacPorts? === #uninstall
 
 See [http://guide.macports.org/chunked/installing.macports.uninstalling.html the Guide].

-------8<------8<------8<------8<------8<------8<------8<------8<--------

* The IP shown here might not mean anything if the user or the server is
behind a proxy.

--
MacPorts <http://www.macports.org/>
Ports system for Mac OS

This is an automated message. Someone at http://www.macports.org/ added your email
address to be notified of changes on FAQ. If it was not you, please
report to .


More information about the macports-changes mailing list