diff options
author | jturner <jturner@gemini.edu> | 2016-07-04 13:23:07 -0400 |
---|---|---|
committer | jturner <jturner@gemini.edu> | 2016-07-04 13:23:07 -0400 |
commit | d8414f80d621961f6cc007d52b898d097efec72a (patch) | |
tree | f4c04993019011109ef4965402f664e704841d13 /iraf | |
parent | 5b43a4317256fb2be1a703b12224e44d0e385777 (diff) | |
download | astroconda-iraf-d8414f80d621961f6cc007d52b898d097efec72a.tar.gz |
Support new path prefix in Conda 4.1.2 (or 4.2.1?) and remove some commented-out bits that Joe agrees probably aren't needed.
Diffstat (limited to 'iraf')
-rw-r--r-- | iraf/build.sh | 41 |
1 files changed, 16 insertions, 25 deletions
diff --git a/iraf/build.sh b/iraf/build.sh index 09eb0e0..3392de1 100644 --- a/iraf/build.sh +++ b/iraf/build.sh @@ -1,3 +1,5 @@ +set -x + # Drop extraneous conda-set environment variables unset ARCH CFLAGS CXXFLAGS LDFLAGS @@ -22,32 +24,21 @@ fi # "Register" the IRAF environment setup with conda activate: mkdir -p $PREFIX/etc/conda/{activate.d,deactivate.d} -echo "source \$CONDA_ENV_PATH/bin/setup_iraf.sh" > \ - $PREFIX/etc/conda/activate.d/iraf.sh +echo ' +if [ -n "$CONDA_PREFIX" ]; then + source $CONDA_PREFIX/bin/setup_iraf.sh +else + source $CONDA_ENV_PATH/bin/setup_iraf.sh +fi +' > $PREFIX/etc/conda/activate.d/iraf.sh chmod 755 $PREFIX/etc/conda/activate.d/iraf.sh -echo "source \$CONDA_ENV_PATH/bin/forget_iraf.sh" > \ - $PREFIX/etc/conda/deactivate.d/iraf.sh +echo ' +if [ -n "$CONDA_PREFIX" ]; then + source $CONDA_PREFIX/bin/forget_iraf.sh +else + source $CONDA_ENV_PATH/bin/forget_iraf.sh +fi +' > $PREFIX/etc/conda/deactivate.d/iraf.sh chmod 755 $PREFIX/etc/conda/deactivate.d/iraf.sh - -# JT: the following are some commented bits from Joe's original build.sh that I -# think are no longer needed but have no replacement in the new install script. - -#cd $iraf - -#UR_BUILTIN=/Users/Shared/ureka.iraf/ur_work/iraf -#find . -lname "$UR_BUILTIN/*" \ -#-exec sh -c 'echo Re-linking builtin paths "$0" ;\ -#ln -snf "$(readlink "$0" \ -#| sed -e "s|$UR_BUILTIN|../..|" -e "s|/as/|/as.$IRAFARCH/|")" "$0"' {} \; -# -#find . -lname '/iraf/iraf/*' \ -#-exec sh -c 'echo Re-linking "$0" ;\ -#ln -snf "$(readlink "$0" \ -#| sed -e "s|/iraf/iraf|../..|" -e "s|/as/|/as.$IRAFARCH/|")" "$0"' {} \; - -#echo "Removing dead symlinks..." -#find $iraf $iraf/../variants -type l | xargs -n 1 -I'{}' \ -#sh -c 'file {} | grep broken | cut -f 1 -d :' | xargs rm -f - |