vendor/gems/installit.sh in yakg-0.0.8 vs vendor/gems/installit.sh in yakg-0.0.9

- old
+ new

@@ -1,37 +1,65 @@ #!/bin/bash -x -if [ "x$1" = "appleruby" ]; then - export PATH="/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin:/usr/local/sbin" -fi -DIR="$( cd "$( dirname "$0" )" && pwd )" ; cd $DIR +export R18="system" +export R191="1.9.3-p448" +export R200="2.0.0-p195" -if ! [ -r `basename $0 2>/dev/null` ]; then - echo "FAIL! can't cd to the parent of $0" - exit 1 -fi +export FFI_VER="1.9.0" -export RUBY_VERSION=`ruby --version | cut -d \ -f 2 | cut -d . -f 1-2` -ruby --version +export GEM_CMD="gem install --no-ri --no-rdoc ffi corefoundation" -if [ "x${RUBY_VERSION}" = "x" ]; then - echo "FAIL! can't figure out ruby version" - exit 2 -fi +cd ${HOME}/heroku/yakg/vendor/gems/ruby && rm -rf * +mkdir -p 1.8 x86_64/1.9.1 x86_64/2.0.0 i386/1.9.1 1.8 i386/2.0.0 -rm -rf Gemfile.lock "ruby/${RUBY_VERSION}" -bundle install --path `pwd` +pushd ${HOME}/.rbenv/versions +rm ${R191} ${R200} +ln -sf x86_64-${R191} ${R191} +ln -sf x86_64-${R200} ${R200} +popd -FFI_C=`find ruby -type f -name ffi_c.bundle | head -n 1` -if [ "x${FFI_C}" = "x" ]; then - echo "FAIL! Couldn't install ffi" - exit 3 -fi +echo ${R18} > ${HOME}/.rbenv/version +${GEM_CMD} -i ./1.8 -CFRB=`find ruby -type f -name corefoundation.rb | head -n 1` -if [ "x${CFRB}" = "x" ]; then - echo "FAIL! Couldn't install corefoundation" - exit 4 -fi +pushd x86_64 -rm -rf ./ruby/*/gems/ffi-*/{ext,spec} -rm -rf ./ruby/*/cache +echo ${R191} > ${HOME}/.rbenv/version +${GEM_CMD} -i ./1.9.1 + +echo ${R200} > ${HOME}/.rbenv/version +${GEM_CMD} -i ./2.0.0 + +popd + +pushd ${HOME}/.rbenv/versions +rm ${R191} ${R200} +ln -sf i386-${R191} ${R191} +ln -sf i386-${R200} ${R200} +popd + +pushd i386 + +echo ${R191} > ${HOME}/.rbenv/version +${GEM_CMD} -i ./1.9.1 + +echo ${R200} > ${HOME}/.rbenv/version +${GEM_CMD} -i ./2.0.0 + +popd + +mv x86_64/{2.0.0,1.9.1} . + +lipo i386/1.9.1/gems/ffi-*/lib/ffi_c.bundle 1.9.1/gems/ffi-*/lib/ffi_c.bundle \ + -create -output 1.9.1/gems/ffi-${FFI_VER}/lib/ffi_c_universal.bundle +lipo i386/2.0.0/gems/ffi-*/lib/ffi_c.bundle 2.0.0/gems/ffi-*/lib/ffi_c.bundle \ + -create -output 2.0.0/gems/ffi-${FFI_VER}/lib/ffi_c_universal.bundle + +rm {2.0.0,1.9.1}/gems/ffi-*/lib/ffi_c.bundle + +pushd 2.0.0/gems/ffi-*/lib +mv ffi_c_universal.bundle ffi_c.bundle +popd +pushd 1.9.1/gems/ffi-*/lib +mv ffi_c_universal.bundle ffi_c.bundle +popd + +rm -rf i386 x86_64 */{cache,doc} */gems/*/{spec,ext,libtest}