From 189987d64713de08d1e7a13e04d6c5dc67d8daa2 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Wed, 23 Mar 2016 17:00:53 -0400 Subject: Initial commit --- iraf/bld.bat | 3 + iraf/build.sh | 190 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ iraf/meta.yaml | 16 +++++ 3 files changed, 209 insertions(+) create mode 100644 iraf/bld.bat create mode 100644 iraf/build.sh create mode 100644 iraf/meta.yaml (limited to 'iraf') diff --git a/iraf/bld.bat b/iraf/bld.bat new file mode 100644 index 0000000..fa5316a --- /dev/null +++ b/iraf/bld.bat @@ -0,0 +1,3 @@ + +echo Not supported on Windows +exit 1 \ No newline at end of file diff --git a/iraf/build.sh b/iraf/build.sh new file mode 100644 index 0000000..43aa71f --- /dev/null +++ b/iraf/build.sh @@ -0,0 +1,190 @@ + +set -x + +export IRAFARCH='' +export target=`uname`.32 +export PLATFORM= +case "$target" in +Linux.32) +export IRAFARCH='linux' +export CFLAGS="-m32" +export LDFLAGS="-m32" +export PLATFORM='linux' +;; +Darwin.32) +export IRAFARCH='macosx' +export CFLAGS="-m32 -arch i386" +export LDFLAGS="-m32 -arch i386" +export PLATFORM='osx' +;; +*) +echo "UNSUPPORTED ARCHITECTURE (64-bit disabled, by the way...)" +exit 1 +;; +esac + + +VARIANTS=http://ssb.stsci.edu/stripped/$PLATFORM/variants.tar.gz +curl -O $VARIANTS +tar xf variants.tar.gz -C $PREFIX +rm -f variants.tar.gz + +mkdir -p $PREFIX/bin \ +$PREFIX/share/man + +for binary in $PREFIX/variants/common/bin/*.e +do +( cd $PREFIX/bin && ln -s -f $binary ) +done + +X11IRAF=http://ssb.stsci.edu/stripped/$PLATFORM/x11iraf.tar.gz +curl -O $X11IRAF +tar xf x11iraf.tar.gz +rm -f x11iraf.tar.gz + +rsync -aH x11iraf/bin/ $PREFIX/bin +rsync -aH x11iraf/man/ $PREFIX/share/man +rm -rf x11iraf + +export TERM=xterm +if [[ $PLATFORM == "osx" ]]; then +test -d /sw && export PATH=`purge_path /sw` +fi +export iraf=$PREFIX/iraf/ + +echo "Fixing c headers..." +find . -type f -name "*.h" | xargs sed -i -e "s|/iraf/iraf/|$iraf|" + +echo "Fixing c sources..." +find . -type f -name "*.c" | xargs sed -i -e "s|/iraf/iraf/|$iraf|" + +mkdir -p $iraf +rsync -aH `pwd`/ $iraf + +cd $iraf + +rm -rf bin_directory +rm -rf $iraf/vo/bin.generic/bin.macosx + + + +( cd $PREFIX/bin && \ +ln -s -f $iraf/unix/hlib/cl.sh cl && \ +ln -s -f $iraf/unix/hlib/mkiraf.sh mkiraf && \ +ln -s -f $iraf/unix/hlib/mkmlist.csh mkmlist && \ +ln -s -f $iraf/unix/bin.$IRAFARCH/generic.e generic && \ +ln -s -f $iraf/unix/bin.$IRAFARCH/mkpkg.e mkpkg && \ +ln -s -f $iraf/unix/bin.$IRAFARCH/rmbin.e rmbin && \ +ln -s -f $iraf/unix/bin.$IRAFARCH/rmfiles.e rmfiles && \ +ln -s -f $iraf/unix/bin.$IRAFARCH/rpp.e rpp && \ +ln -s -f $iraf/unix/bin.$IRAFARCH/rtar.e rtar &&\ +ln -s -f $iraf/unix/bin.$IRAFARCH/sgidispatch.e sgidispatch && \ +ln -s -f $iraf/unix/bin.$IRAFARCH/wtar.e wtar && \ +ln -s -f $iraf/unix/bin.$IRAFARCH/xc.e xc && \ +ln -s -f $iraf/unix/bin.$IRAFARCH/xpp.e && \ +ln -s -f $iraf/unix/bin.$IRAFARCH/xyacc.e xyacc ) + +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 + + + +mkdir -p $PREFIX/etc/conda/{activate.d,deactivate.d} + +echo " +export IRAFARCH=$IRAFARCH +export iraf=\$CONDA_ENV_PATH/iraf/ +export MACH=\$IRAFARCH +export hostid=unix +export host=\$iraf/\$hostid/ +export hbin=\$host/bin.\$IRAFARCH/ +export IMTOOLRC=\$iraf/dev/imtoolrc +export tmp=/tmp/ + +export CC=gcc +export F2C=\$hbin/f2c.e +export F77=\$hbin/f77.sh +export RANLIB=ranlib + +case "$IRAFARCH" in +macosx) +export HSI_CF=\"-O -DMACOSX -w -Wunused -arch i386 -m32 -mmacosx-version-min=10.4\" +export HSI_XF=\"-Inolibc -/DMACOSX -w -/Wunused -/m32 -/arch -//i386 -/mmacosx-version-min=10.4\" +export HSI_FF=\"-O -arch i386 -m32 -DBLD_KERNEL -mmacosx-version-min=10.4\" +export HSI_LF=\"-arch i386 -m32 -mmacosx-version-min=10.4\" +;; + +linux) +export HSI_CF=\"-I\$iraf/include -O -DLINUX -DREDHAT -DPOSIX -DSYSV -w -m32 -Wunused\" +export HSI_FF=\"-I\$iraf/include -O -DBLD_KERNEL -m32\" +export HSI_LF=\"-I\$iraf/include -m32\" +export HSI_XF=\"-I\$iraf/include -Inolibc -w -/Wunused -/m32\" +;; + +*) +echo "Unknown IRAFARCH. Dying." +exit 1 +;; + +esac + +export HSI_F77LIBS= +export HSI_LIBS=\"\$iraf/unix/hlib/libboot.a \$iraf/lib/libsys.a \$iraf/lib/libvops.a \$iraf/unix/hlib/libos.a\" +export HSI_OSLIBS= + +export UR_BITS=64 +export UR_CPU=x86_64 +export UR_DIR=\$CONDA_ENV_PATH +export UR_VARIANT=common +export UR_OS=$PLATFORM +export UR_TMP=/tmp +export UR_DIR_PKG=\$UR_DIR/variants/\$UR_VARIANT/ +" > $PREFIX/etc/conda/activate.d/iraf.sh +chmod 755 $PREFIX/etc/conda/activate.d/iraf.sh + +echo ' +unset iraf +unset IRAFARCH +unset IMTOOLRC +unset F2C +unset F77 +unset hbin +unset hlib +unset host +unset CC +unset CC_f2c +unset HSI_CF +unset HSI_F77LIBS +unset HSI_FF +unset HSI_LF +unset HSI_LFLAGS +unset HSI_LIBS +unset HSI_OSLIBS +unset HSI_XF +unset MACH +unset OS_MACH +unset RANLIB +unset hostid +unset tmp +unset UR_BITS +unset UR_CPU +unset UR_DIR +unset UR_VARIANT +unset UR_OS +unset UR_TMP +unset UR_DIR_PKG +' > $PREFIX/etc/conda/deactivate.d/iraf.sh +chmod 755 $PREFIX/etc/conda/deactivate.d/iraf.sh \ No newline at end of file diff --git a/iraf/meta.yaml b/iraf/meta.yaml new file mode 100644 index 0000000..39c05dc --- /dev/null +++ b/iraf/meta.yaml @@ -0,0 +1,16 @@ +about: + home: http://iraf.noao.edu + license: MIT + summary: NOAO Image Reduction and Analysis Facility +build: + binary_relocation: False [osx] + detect_binary_files_with_prefix: False [osx] + number: '0' +package: + name: iraf + version: 2.16.1 +source: + fn: iraf.tar.gz + url: + - http://ssb.stsci.edu/stripped/linux/iraf.tar.gz [linux] + - http://ssb.stsci.edu/stripped/osx/iraf.tar.gz [osx] -- cgit From 734f3d5e30f2a1baba9441ac33ef498cf385db7f Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 24 May 2016 09:35:44 -0400 Subject: Refactor recipe to support source build (in progress) --- iraf/build.sh | 183 ++++++++++++++++++++++++++++++--------------------------- iraf/meta.yaml | 9 +-- 2 files changed, 101 insertions(+), 91 deletions(-) (limited to 'iraf') diff --git a/iraf/build.sh b/iraf/build.sh index 43aa71f..b53692c 100644 --- a/iraf/build.sh +++ b/iraf/build.sh @@ -1,104 +1,115 @@ +# Make a log directory for "sm_logs" +mkdir -p `pwd`/logs + +# Drop extraneous conda-set environment variables +unset CFLAGS +unset CXXFLAGS +unset LDFLAGS + +# Complement build script +# ("UR_IRAFUSER" MUST BE SET OR BUILD WILL FAIL) +export UR_IRAFUSER=1 +export sm_logs=`pwd`/logs +export TERM=xterm +export FAKE_IRAF="../iraf" -set -x - -export IRAFARCH='' +# Minimal architecture detection +# (We don't care about 64-bit) +export IRAFARCH= export target=`uname`.32 -export PLATFORM= case "$target" in -Linux.32) -export IRAFARCH='linux' -export CFLAGS="-m32" -export LDFLAGS="-m32" -export PLATFORM='linux' -;; -Darwin.32) -export IRAFARCH='macosx' -export CFLAGS="-m32 -arch i386" -export LDFLAGS="-m32 -arch i386" -export PLATFORM='osx' -;; -*) -echo "UNSUPPORTED ARCHITECTURE (64-bit disabled, by the way...)" -exit 1 -;; + Linux.32) + export IRAFARCH='linux' + ;; + Darwin.32) + export IRAFARCH='macosx' + ;; + *) + echo "UNSUPPORTED ARCHITECTURE (64-bit disabled, by the way...)" + exit 1 + ;; esac -VARIANTS=http://ssb.stsci.edu/stripped/$PLATFORM/variants.tar.gz -curl -O $VARIANTS -tar xf variants.tar.gz -C $PREFIX -rm -f variants.tar.gz +# Copy working directory into PREFIX +export iraf=$PREFIX/iraf +#mkdir -p $iraf +rsync -aH `pwd`/ $iraf +cd $iraf + +# Execute build +printenv +./build 32 -mkdir -p $PREFIX/bin \ -$PREFIX/share/man +# Creating it made no sense... now we remove it +#rm -rfv $FAKE_IRAF -for binary in $PREFIX/variants/common/bin/*.e +# General tasks below + +# Link binaries +mkdir -p $PREFIX/bin +for exe in $iraf/bin_directory/* do -( cd $PREFIX/bin && ln -s -f $binary ) + ( cd $PREFIX/bin && ln -s -f $exe ) done -X11IRAF=http://ssb.stsci.edu/stripped/$PLATFORM/x11iraf.tar.gz -curl -O $X11IRAF -tar xf x11iraf.tar.gz -rm -f x11iraf.tar.gz - -rsync -aH x11iraf/bin/ $PREFIX/bin -rsync -aH x11iraf/man/ $PREFIX/share/man -rm -rf x11iraf +# Fix symlink loop in VO (can't figure it out based on the mkpkg files) +rm -rfv "$iraf/vo/bin.generic" +mkdir -p "$iraf/vo/bin.generic" +rm -fv "$iraf/vo/bin" +( cd $iraf/vo && ln -s bin.$IRAFARCH bin ) -export TERM=xterm -if [[ $PLATFORM == "osx" ]]; then -test -d /sw && export PATH=`purge_path /sw` -fi -export iraf=$PREFIX/iraf/ - -echo "Fixing c headers..." -find . -type f -name "*.h" | xargs sed -i -e "s|/iraf/iraf/|$iraf|" -echo "Fixing c sources..." -find . -type f -name "*.c" | xargs sed -i -e "s|/iraf/iraf/|$iraf|" -mkdir -p $iraf -rsync -aH `pwd`/ $iraf +# Not used... ? -cd $iraf +#echo "Fixing c headers..." +#find . -type f -name "*.h" | xargs sed -i -e "s|/iraf/iraf/|$iraf|" -rm -rf bin_directory -rm -rf $iraf/vo/bin.generic/bin.macosx +#echo "Fixing c sources..." +#find . -type f -name "*.c" | xargs sed -i -e "s|/iraf/iraf/|$iraf|" +#mkdir -p $iraf +#rsync -aH `pwd`/ $iraf +#cd $iraf -( cd $PREFIX/bin && \ -ln -s -f $iraf/unix/hlib/cl.sh cl && \ -ln -s -f $iraf/unix/hlib/mkiraf.sh mkiraf && \ -ln -s -f $iraf/unix/hlib/mkmlist.csh mkmlist && \ -ln -s -f $iraf/unix/bin.$IRAFARCH/generic.e generic && \ -ln -s -f $iraf/unix/bin.$IRAFARCH/mkpkg.e mkpkg && \ -ln -s -f $iraf/unix/bin.$IRAFARCH/rmbin.e rmbin && \ -ln -s -f $iraf/unix/bin.$IRAFARCH/rmfiles.e rmfiles && \ -ln -s -f $iraf/unix/bin.$IRAFARCH/rpp.e rpp && \ -ln -s -f $iraf/unix/bin.$IRAFARCH/rtar.e rtar &&\ -ln -s -f $iraf/unix/bin.$IRAFARCH/sgidispatch.e sgidispatch && \ -ln -s -f $iraf/unix/bin.$IRAFARCH/wtar.e wtar && \ -ln -s -f $iraf/unix/bin.$IRAFARCH/xc.e xc && \ -ln -s -f $iraf/unix/bin.$IRAFARCH/xpp.e && \ -ln -s -f $iraf/unix/bin.$IRAFARCH/xyacc.e xyacc ) +#rm -rf bin_directory +#rm -rf $iraf/vo/bin.generic/bin.macosx -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"' {} \; +#( cd $PREFIX/bin && \ +#ln -s -f $iraf/unix/hlib/cl.sh cl && \ +#ln -s -f $iraf/unix/hlib/mkiraf.sh mkiraf && \ +#ln -s -f $iraf/unix/hlib/mkmlist.csh mkmlist && \ +#ln -s -f $iraf/unix/bin.$IRAFARCH/generic.e generic && \ +#ln -s -f $iraf/unix/bin.$IRAFARCH/mkpkg.e mkpkg && \ +#ln -s -f $iraf/unix/bin.$IRAFARCH/rmbin.e rmbin && \ +#ln -s -f $iraf/unix/bin.$IRAFARCH/rmfiles.e rmfiles && \ +#ln -s -f $iraf/unix/bin.$IRAFARCH/rpp.e rpp && \ +#ln -s -f $iraf/unix/bin.$IRAFARCH/rtar.e rtar &&\ +#ln -s -f $iraf/unix/bin.$IRAFARCH/sgidispatch.e sgidispatch && \ +#ln -s -f $iraf/unix/bin.$IRAFARCH/wtar.e wtar && \ +#ln -s -f $iraf/unix/bin.$IRAFARCH/xc.e xc && \ +#ln -s -f $iraf/unix/bin.$IRAFARCH/xpp.e && \ +#ln -s -f $iraf/unix/bin.$IRAFARCH/xyacc.e xyacc ) -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 +#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 @@ -121,16 +132,18 @@ export RANLIB=ranlib case "$IRAFARCH" in macosx) -export HSI_CF=\"-O -DMACOSX -w -Wunused -arch i386 -m32 -mmacosx-version-min=10.4\" -export HSI_XF=\"-Inolibc -/DMACOSX -w -/Wunused -/m32 -/arch -//i386 -/mmacosx-version-min=10.4\" -export HSI_FF=\"-O -arch i386 -m32 -DBLD_KERNEL -mmacosx-version-min=10.4\" +export XC_CFLAGS="-Wno-return-type" +export HSI_CF=\"-O -DMACOSX -w -Wunused -arch i386 -m32 -mmacosx-version-min=10.4 -Wno-return-type\" +export HSI_XF=\"-Inolibc -/DMACOSX -w -/Wunused -/m32 -/arch -//i386 -/mmacosx-version-min=10.4 -/Wno-return-type\" +export HSI_FF=\"-O -arch i386 -m32 -DBLD_KERNEL -mmacosx-version-min=10.4 -Wno-return-type\" export HSI_LF=\"-arch i386 -m32 -mmacosx-version-min=10.4\" ;; linux) -export HSI_CF=\"-I\$iraf/include -O -DLINUX -DREDHAT -DPOSIX -DSYSV -w -m32 -Wunused\" -export HSI_FF=\"-I\$iraf/include -O -DBLD_KERNEL -m32\" -export HSI_LF=\"-I\$iraf/include -m32\" +export XC_CFLAGS="-Wno-return-type" +export HSI_CF=\"-I\$iraf/include -O -DLINUX -DREDHAT -DPOSIX -DSYSV -w -m32 -Wunused -Wno-return-type\" +export HSI_FF=\"-I\$iraf/include -O -DBLD_KERNEL -m32 -Wno-return-type\" +export HSI_LF=\"-I\$iraf/include -m32 -Wno-return-type\" export HSI_XF=\"-I\$iraf/include -Inolibc -w -/Wunused -/m32\" ;; @@ -187,4 +200,4 @@ unset UR_OS unset UR_TMP unset UR_DIR_PKG ' > $PREFIX/etc/conda/deactivate.d/iraf.sh -chmod 755 $PREFIX/etc/conda/deactivate.d/iraf.sh \ No newline at end of file +chmod 755 $PREFIX/etc/conda/deactivate.d/iraf.sh diff --git a/iraf/meta.yaml b/iraf/meta.yaml index 39c05dc..495b647 100644 --- a/iraf/meta.yaml +++ b/iraf/meta.yaml @@ -3,14 +3,11 @@ about: license: MIT summary: NOAO Image Reduction and Analysis Facility build: - binary_relocation: False [osx] - detect_binary_files_with_prefix: False [osx] + #binary_relocation: False [osx] + #detect_binary_files_with_prefix: False [osx] number: '0' package: name: iraf version: 2.16.1 source: - fn: iraf.tar.gz - url: - - http://ssb.stsci.edu/stripped/linux/iraf.tar.gz [linux] - - http://ssb.stsci.edu/stripped/osx/iraf.tar.gz [osx] + git_url: /eng/ssb/jhunk/git-repos/iraf.git -- cgit From 586b0ca31224ee8817dceb6a185bfe9dbf5f037d Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Thu, 26 May 2016 13:52:17 -0400 Subject: Ensure UR_PKG_DIR exists with a blank extern.pkg --- iraf/build.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'iraf') diff --git a/iraf/build.sh b/iraf/build.sh index b53692c..c500e74 100644 --- a/iraf/build.sh +++ b/iraf/build.sh @@ -9,9 +9,9 @@ unset LDFLAGS # Complement build script # ("UR_IRAFUSER" MUST BE SET OR BUILD WILL FAIL) export UR_IRAFUSER=1 +export UR_DIR_PKG=$PREFIX/variants/common/ export sm_logs=`pwd`/logs export TERM=xterm -export FAKE_IRAF="../iraf" # Minimal architecture detection # (We don't care about 64-bit) @@ -31,8 +31,12 @@ case "$target" in esac +# For UR_DIR_PKG to use (though I don't think we really need it anymore) +mkdir -p $UR_DIR_PKG +echo keep > $UR_DIR_PKG/extern.pkg + # Copy working directory into PREFIX -export iraf=$PREFIX/iraf +export iraf=$PREFIX/iraf/ #mkdir -p $iraf rsync -aH `pwd`/ $iraf cd $iraf @@ -41,9 +45,6 @@ cd $iraf printenv ./build 32 -# Creating it made no sense... now we remove it -#rm -rfv $FAKE_IRAF - # General tasks below # Link binaries @@ -59,8 +60,6 @@ mkdir -p "$iraf/vo/bin.generic" rm -fv "$iraf/vo/bin" ( cd $iraf/vo && ln -s bin.$IRAFARCH bin ) - - # Not used... ? #echo "Fixing c headers..." -- cgit From 2a3119dc73fce3ed647f227bc95fdad9c61bccfe Mon Sep 17 00:00:00 2001 From: RTF User Date: Tue, 7 Jun 2016 20:58:35 -0400 Subject: Work with my IRAF SVN branch for now. Correct version number and license info. Don't patch IRAF binary paths. Unset conda ARCH variable for the IRAF build (it didn't seem to break mine but I believe IRAF uses it differently & Joe has been having some arch-related issues). --- iraf/build.sh | 1 + iraf/meta.yaml | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'iraf') diff --git a/iraf/build.sh b/iraf/build.sh index c500e74..bdf4804 100644 --- a/iraf/build.sh +++ b/iraf/build.sh @@ -2,6 +2,7 @@ mkdir -p `pwd`/logs # Drop extraneous conda-set environment variables +unset ARCH unset CFLAGS unset CXXFLAGS unset LDFLAGS diff --git a/iraf/meta.yaml b/iraf/meta.yaml index 495b647..1719e86 100644 --- a/iraf/meta.yaml +++ b/iraf/meta.yaml @@ -1,13 +1,15 @@ about: home: http://iraf.noao.edu - license: MIT + license: MIT (and third-party licenses) summary: NOAO Image Reduction and Analysis Facility build: - #binary_relocation: False [osx] + binary_relocation: False #detect_binary_files_with_prefix: False [osx] number: '0' package: name: iraf - version: 2.16.1 + version: 2.16_UR source: - git_url: /eng/ssb/jhunk/git-repos/iraf.git + # svn_url: https://aeon.stsci.edu/ssb/svn/u-rel/iraf-2.16/branches/jhunk-patches + # svn_rev: 4156 + svn_url: https://aeon.stsci.edu/ssb/svn/u-rel/iraf-2.16/branches/conda_patches -- cgit From 5b43a4317256fb2be1a703b12224e44d0e385777 Mon Sep 17 00:00:00 2001 From: jturner Date: Wed, 29 Jun 2016 20:42:06 -0400 Subject: Use new IRAF installer & environment setup scripts in the now-much-smaller conda build script. --- iraf/build.sh | 194 +++++++--------------------------------------------------- 1 file changed, 22 insertions(+), 172 deletions(-) (limited to 'iraf') diff --git a/iraf/build.sh b/iraf/build.sh index bdf4804..09eb0e0 100644 --- a/iraf/build.sh +++ b/iraf/build.sh @@ -1,100 +1,41 @@ -# Make a log directory for "sm_logs" -mkdir -p `pwd`/logs - # Drop extraneous conda-set environment variables -unset ARCH -unset CFLAGS -unset CXXFLAGS -unset LDFLAGS +unset ARCH CFLAGS CXXFLAGS LDFLAGS # Complement build script -# ("UR_IRAFUSER" MUST BE SET OR BUILD WILL FAIL) -export UR_IRAFUSER=1 -export UR_DIR_PKG=$PREFIX/variants/common/ -export sm_logs=`pwd`/logs export TERM=xterm -# Minimal architecture detection -# (We don't care about 64-bit) -export IRAFARCH= -export target=`uname`.32 -case "$target" in - Linux.32) - export IRAFARCH='linux' - ;; - Darwin.32) - export IRAFARCH='macosx' - ;; - *) - echo "UNSUPPORTED ARCHITECTURE (64-bit disabled, by the way...)" - exit 1 - ;; -esac - - -# For UR_DIR_PKG to use (though I don't think we really need it anymore) -mkdir -p $UR_DIR_PKG -echo keep > $UR_DIR_PKG/extern.pkg - -# Copy working directory into PREFIX -export iraf=$PREFIX/iraf/ -#mkdir -p $iraf -rsync -aH `pwd`/ $iraf -cd $iraf - # Execute build printenv -./build 32 +if ! ./build 32; then + echo "The main IRAF build failed" 2>&1 + exit 1 +fi -# General tasks below +echo -# Link binaries -mkdir -p $PREFIX/bin -for exe in $iraf/bin_directory/* -do - ( cd $PREFIX/bin && ln -s -f $exe ) -done +# Install into PREFIX +if ! ./install $PREFIX; then + echo "IRAF installation into $PREFIX failed" 2>&1 + exit 1 +fi -# Fix symlink loop in VO (can't figure it out based on the mkpkg files) -rm -rfv "$iraf/vo/bin.generic" -mkdir -p "$iraf/vo/bin.generic" -rm -fv "$iraf/vo/bin" -( cd $iraf/vo && ln -s bin.$IRAFARCH bin ) +# "Register" the IRAF environment setup with conda activate: +mkdir -p $PREFIX/etc/conda/{activate.d,deactivate.d} -# Not used... ? +echo "source \$CONDA_ENV_PATH/bin/setup_iraf.sh" > \ + $PREFIX/etc/conda/activate.d/iraf.sh +chmod 755 $PREFIX/etc/conda/activate.d/iraf.sh -#echo "Fixing c headers..." -#find . -type f -name "*.h" | xargs sed -i -e "s|/iraf/iraf/|$iraf|" +echo "source \$CONDA_ENV_PATH/bin/forget_iraf.sh" > \ + $PREFIX/etc/conda/deactivate.d/iraf.sh +chmod 755 $PREFIX/etc/conda/deactivate.d/iraf.sh -#echo "Fixing c sources..." -#find . -type f -name "*.c" | xargs sed -i -e "s|/iraf/iraf/|$iraf|" -#mkdir -p $iraf -#rsync -aH `pwd`/ $iraf +# 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 -#rm -rf bin_directory -#rm -rf $iraf/vo/bin.generic/bin.macosx - - - -#( cd $PREFIX/bin && \ -#ln -s -f $iraf/unix/hlib/cl.sh cl && \ -#ln -s -f $iraf/unix/hlib/mkiraf.sh mkiraf && \ -#ln -s -f $iraf/unix/hlib/mkmlist.csh mkmlist && \ -#ln -s -f $iraf/unix/bin.$IRAFARCH/generic.e generic && \ -#ln -s -f $iraf/unix/bin.$IRAFARCH/mkpkg.e mkpkg && \ -#ln -s -f $iraf/unix/bin.$IRAFARCH/rmbin.e rmbin && \ -#ln -s -f $iraf/unix/bin.$IRAFARCH/rmfiles.e rmfiles && \ -#ln -s -f $iraf/unix/bin.$IRAFARCH/rpp.e rpp && \ -#ln -s -f $iraf/unix/bin.$IRAFARCH/rtar.e rtar &&\ -#ln -s -f $iraf/unix/bin.$IRAFARCH/sgidispatch.e sgidispatch && \ -#ln -s -f $iraf/unix/bin.$IRAFARCH/wtar.e wtar && \ -#ln -s -f $iraf/unix/bin.$IRAFARCH/xc.e xc && \ -#ln -s -f $iraf/unix/bin.$IRAFARCH/xpp.e && \ -#ln -s -f $iraf/unix/bin.$IRAFARCH/xyacc.e xyacc ) - #UR_BUILTIN=/Users/Shared/ureka.iraf/ur_work/iraf #find . -lname "$UR_BUILTIN/*" \ #-exec sh -c 'echo Re-linking builtin paths "$0" ;\ @@ -105,99 +46,8 @@ rm -fv "$iraf/vo/bin" #-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 - - -mkdir -p $PREFIX/etc/conda/{activate.d,deactivate.d} - -echo " -export IRAFARCH=$IRAFARCH -export iraf=\$CONDA_ENV_PATH/iraf/ -export MACH=\$IRAFARCH -export hostid=unix -export host=\$iraf/\$hostid/ -export hbin=\$host/bin.\$IRAFARCH/ -export IMTOOLRC=\$iraf/dev/imtoolrc -export tmp=/tmp/ - -export CC=gcc -export F2C=\$hbin/f2c.e -export F77=\$hbin/f77.sh -export RANLIB=ranlib - -case "$IRAFARCH" in -macosx) -export XC_CFLAGS="-Wno-return-type" -export HSI_CF=\"-O -DMACOSX -w -Wunused -arch i386 -m32 -mmacosx-version-min=10.4 -Wno-return-type\" -export HSI_XF=\"-Inolibc -/DMACOSX -w -/Wunused -/m32 -/arch -//i386 -/mmacosx-version-min=10.4 -/Wno-return-type\" -export HSI_FF=\"-O -arch i386 -m32 -DBLD_KERNEL -mmacosx-version-min=10.4 -Wno-return-type\" -export HSI_LF=\"-arch i386 -m32 -mmacosx-version-min=10.4\" -;; - -linux) -export XC_CFLAGS="-Wno-return-type" -export HSI_CF=\"-I\$iraf/include -O -DLINUX -DREDHAT -DPOSIX -DSYSV -w -m32 -Wunused -Wno-return-type\" -export HSI_FF=\"-I\$iraf/include -O -DBLD_KERNEL -m32 -Wno-return-type\" -export HSI_LF=\"-I\$iraf/include -m32 -Wno-return-type\" -export HSI_XF=\"-I\$iraf/include -Inolibc -w -/Wunused -/m32\" -;; - -*) -echo "Unknown IRAFARCH. Dying." -exit 1 -;; - -esac - -export HSI_F77LIBS= -export HSI_LIBS=\"\$iraf/unix/hlib/libboot.a \$iraf/lib/libsys.a \$iraf/lib/libvops.a \$iraf/unix/hlib/libos.a\" -export HSI_OSLIBS= - -export UR_BITS=64 -export UR_CPU=x86_64 -export UR_DIR=\$CONDA_ENV_PATH -export UR_VARIANT=common -export UR_OS=$PLATFORM -export UR_TMP=/tmp -export UR_DIR_PKG=\$UR_DIR/variants/\$UR_VARIANT/ -" > $PREFIX/etc/conda/activate.d/iraf.sh -chmod 755 $PREFIX/etc/conda/activate.d/iraf.sh - -echo ' -unset iraf -unset IRAFARCH -unset IMTOOLRC -unset F2C -unset F77 -unset hbin -unset hlib -unset host -unset CC -unset CC_f2c -unset HSI_CF -unset HSI_F77LIBS -unset HSI_FF -unset HSI_LF -unset HSI_LFLAGS -unset HSI_LIBS -unset HSI_OSLIBS -unset HSI_XF -unset MACH -unset OS_MACH -unset RANLIB -unset hostid -unset tmp -unset UR_BITS -unset UR_CPU -unset UR_DIR -unset UR_VARIANT -unset UR_OS -unset UR_TMP -unset UR_DIR_PKG -' > $PREFIX/etc/conda/deactivate.d/iraf.sh -chmod 755 $PREFIX/etc/conda/deactivate.d/iraf.sh -- cgit 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 From 94daaa0781d856cb8b47f06b61d343addee3cfc1 Mon Sep 17 00:00:00 2001 From: "James E.H. Turner" Date: Thu, 1 Sep 2016 12:48:55 -0300 Subject: Unset another environment variable that could potentially cause trouble. --- iraf/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'iraf') diff --git a/iraf/build.sh b/iraf/build.sh index 3392de1..0ce0b6e 100644 --- a/iraf/build.sh +++ b/iraf/build.sh @@ -1,7 +1,7 @@ set -x # Drop extraneous conda-set environment variables -unset ARCH CFLAGS CXXFLAGS LDFLAGS +unset ARCH CFLAGS CXXFLAGS LDFLAGS MACOSX_DEPLOYMENT_TARGET # Complement build script export TERM=xterm -- cgit From 4ee8301df6891df89ede6aa3012f9a984ab5623c Mon Sep 17 00:00:00 2001 From: "James E.H. Turner" Date: Thu, 29 Sep 2016 12:24:49 -0300 Subject: Change IRAF version spec to make conda use our updated IRAF build without being tied to a single version number and to allow for adding a running number more naturally. --- iraf/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'iraf') diff --git a/iraf/meta.yaml b/iraf/meta.yaml index 1719e86..2bd7031 100644 --- a/iraf/meta.yaml +++ b/iraf/meta.yaml @@ -8,7 +8,7 @@ build: number: '0' package: name: iraf - version: 2.16_UR + version: 2.16.UR source: # svn_url: https://aeon.stsci.edu/ssb/svn/u-rel/iraf-2.16/branches/jhunk-patches # svn_rev: 4156 -- cgit