sysadmin: is there a manifesto on environment settings for macports?

Darren Weber dweber at macports.org
Thu Apr 9 16:25:51 PDT 2009


Is there a general manifesto on how to configure OSX for macports?

I see the following documents online, but they don't answer all my questions
for macports:
http://trac.macports.org/wiki/FAQ
http://trac.macports.org/wiki/InstallingMacPorts

The installation of macports proposes a user-specific environment (using
~/.profile or similar, but I wonder if that resolves path issues when using
sudo or for system deamons, etc.).

An issue that I have is with the dynamic linker unable to resolve some
library paths at run-time.  I would like to see a document on macport wisdom
for dyld.

In my explorations today, to resolve some environment settings, I found a
few places where the environment is configured (I'm using bash).

I see the following system path settings available:

/etc/paths
/etc/paths.d/*  (used by /usr/libexec/path_helper, called from /etc/profile
[and elsewhere?])
/etc/manpaths
/etc/manpaths.d
/etc/man.conf

For bash, there are a few /etc files around:
/etc/bashrc
/etc/profile (which calls path_helper and it handles at /etc/paths.d/*)

For csh, there are /etc/csh.* files.

In the user domain, there are the usual suspects (~/.bashrc, ~/.profile,
~/.cshrc, ~/.login, etc.).  Then there is a sneeky OSX specific environment
file in ~/.MacOSX/environment.plist.  The macports installation recommends
using the *nix convention of setting up the environment in the shell login
profiles (.profile, .bashrc, etc.).

What about dynamic library path configuration (for dyld)?  What is the best
way to configure this for macports?  Should settings apply at the system
level (I would assume so) or at the user level (probably not).  I currently
have one env setting for postgresql83 (and I think this one is user
specfic):
DYLD_FALLBACK_LIBRARY_PATH=:/opt/local/lib/postgresql83

When building libraries, is there a general philosophy on using rpath?  I'm
confused about this, eg consider:
http://wiki.debian.org/RpathIssue
http://www.mail-archive.com/bug-libtool@gnu.org/msg00700.html
http://lists.apple.com/archives/unix-porting/2008/Mar/msg00008.html
http://developer.apple.com/releasenotes/DeveloperTools/RN-dyld/index.html

I've found that rpath can be a problem because macports builds into a
destroot.  When I use rpath outside of a destroot, it works fine, but I
don't understand how to use it with a destroot, as in macports.  If a port
should use rpath, how should a port set RPATH correctly (maybe a relative
path to ${prefix})?  Or, should a port update a DYLD path setting so that
run-time dependencies get resolved (see options for path settings in `man
dyld` and maybe ports should set a system or user equivalent to
~/.MacOSX/environment.plist)?

See also:
http://developer.apple.com/documentation/DeveloperTools/Conceptual/DynamicLibraries/index.html
http://developer.apple.com/documentation/MacOSX/Conceptual/BPSystemStartup/BPSystemStartup.html
http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/BPRuntimeConfig.html
http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/EnvironmentVars.html#//apple_ref/doc/uid/20002093

http://developer.apple.com/documentation/Porting/Conceptual/PortingUnix/intro/intro.html

Take care, Darren
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20090409/0e7ee541/attachment.html>


More information about the macports-users mailing list