From d8414f80d621961f6cc007d52b898d097efec72a Mon Sep 17 00:00:00 2001 From: jturner Date: Mon, 4 Jul 2016 13:23:07 -0400 Subject: 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. --- iraf/build.sh | 41 ++++++++++++++++------------------------- 1 file changed, 16 insertions(+), 25 deletions(-) (limited to 'iraf') 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 - -- cgit