nixpkgs/pkgs/helpers/set-env.sh
Eelco Dolstra ec3b5134c1 * Converted some old Fix descriptors.
* A solution to the library abstraction problem (i.e., if 
  package X needs library Y, and library Y needs library Z, 
  then we do not (generally) want to declare Z as a input to X 
  since that would break abstraction).  This was not possible 
  under the old Nix.

svn path=/nixpkgs/trunk/; revision=150
2003-07-11 21:08:53 +00:00

31 lines
554 B
Bash

addtoenv()
{
envpkgs="$envpkgs $1"
if test -d $1/bin; then
export PATH=$1/bin:$PATH
fi
if test -d $1/lib; then
export LIBRARY_PATH=$1/lib:$LIBRARY_PATH
export LD_LIBRARY_PATH=$1/lib:$LD_LIBRARY_PATH
fi
if test -d $1/lib/pkgconfig; then
export PKG_CONFIG_PATH=$1/lib/pkgconfig:$PKG_CONFIG_PATH
fi
if test -f $1/envpkgs; then
for i in $(cat $1/envpkgs); do
addtoenv $i
done
fi
}
oldenvpkgs=$envpkgs
envpkgs=
for i in $oldenvpkgs; do
addtoenv $i
done