"man port" not working?

Ryan Schmidt ryandesign at macports.org
Mon Oct 8 13:36:50 PDT 2007


On Oct 8, 2007, at 15:25, Instruct ICC wrote:

> > > In Terminal (as opposed to X11 xterm) where "port search php"  
> works:
> > > /sw/share/man:/usr/share/man:/usr/local/share/man:/usr/X11R6/man:/
> > > sw/lib/perl5/5.8.6/man
> > >
> > > Should there be (Was there an) /opt/... when it worked?
> > > Maybe Porticus hosed it?
> >
> > MacPorts does not set your MANPATH to anything. You may set it if  
> you
> > wish.
> >
> > I see /sw in your path there. So I guess you have Fink installed  
> too.
> > That's just asking for trouble. I recommend you use either Fink or
> > MacPorts, but not both. Completely remove the one you no longer wish
> > to use.
> >
> > I also see /usr/local in that path. Stuff in /usr/local can  
> interfere
> > with MacPorts too. I recommend you remove everything from /usr/local
> > and use MacPorts to install whatever software you need. If software
> > you need is not in MacPorts, portfiles can be added.
>
> I was thinking to mark this thread RESOLVED, but you raised an  
> interesting point.
>
> "That's just asking for trouble."
> I thought the great thing about Fink and Macports is that they each  
> use their own directory, so I don't have to worry about my Apple  
> installations.
>
> Obviously Fink changed my MANPATH, but what is the normal setup for  
> man to work with Macports?
>
> I ended up adding /opt/local/man to MANPATH and "man port" works.
>
> My co-worker says, "adding any non-Apple software is asking for  
> trouble".  So what do you do when you can't find a package in your  
> current setup?  You look for something like Macports, Fink, or a  
> tarball.

My MANPATH is empty, /opt/local/bin and /opt/local/sbin are in my  
PATH, and I have a symlink at /opt/local/man pointing to /opt/local/ 
share/man, and "man port" works fine for me. I believe it was  
explained to me that for every component of PATH, "man" looks in ../ 
share/man for manpages. It looks like that only occurs if MANPATH is  
empty; if I set MANPATH to e.g. /usr/share/man, then "man port" does  
not work.

I do not remember whether MacPorts put that symlink there. "man port"  
still works if I delete the symlink. However it's a good idea to keep  
it there (or make it if you do not have it: "cd /opt/local && sudo ln  
-s share/man man") as some ports still try (erroneously) to install  
manpages into /opt/local/man instead of /opt/local/share/man. Having  
the symlink ensures that this works anyway.

If you want to use software from MacPorts, you will probably have / 
opt/local/bin and /opt/local/sbin in your PATH. If you want to use  
software from Fink, you will probably have /sw/bin and /sw/sbin in  
your PATH. During the configuration phase of some software, it will  
look for programs which tell it how to link with other software. For  
example, pkg-config may be used to figure out where you have, say,  
fontconfig installed. So it's possible that while building software  
using Fink, it finds pkg-config from MacPorts, which will tell it to  
link against fontconfig (or other libraries) that were installed with  
MacPorts. Or vice-versa. This is bad, and you avoid it by using only  
one package manager or the other, not both.

Compilers like gcc always look in /usr/local for libraries. We do not  
know how to turn this off. Therefore, if you have libraries in /usr/ 
local/lib, software built using MacPorts or Fink may link with those  
libraries, which is also bad. The solution is to remove everything  
from /usr/local and only use your package manager to install such  
software.

If MacPorts does not contain portfiles for software you wish to use,  
you can write a portfile and submit it for inclusion in our tree.  
Instructions for writing portfiles are in the guide which is in the  
process of being written (but already fairly far along as I  
understand it). The URL is currently:

http://geeklair.net/new_macports_guide/




More information about the macports-users mailing list