Permalink
Browse files

sync'd improvements from development branch

  • Loading branch information...
1 parent 533a5ab commit 54d4f6a783ff0596b269c11bea494582db61a438 @virtualstaticvoid committed Feb 12, 2014
Showing with 43 additions and 8 deletions.
  1. +19 −2 support/build-r
  2. +10 −6 support/heroku-build
  3. +14 −0 support/vars.mk
View
@@ -43,7 +43,7 @@ function build() {
r_version="${1:-2.15.1}"
r_version_major=${r_version:0:1}
-build_no=${2:-`date +%Y%m%d-%H%M`}
+build_no="${2:-`date +%Y%m%d-%H%M`}"
# check arguments
if ([ -z "$r_version" ] || [ -z "$build_no" ]); then
@@ -56,6 +56,11 @@ if ([ -z "$r_version" ] || [ -z "$build_no" ]); then
exit 1
fi
+echo
+echo R Version = $r_version
+echo Build No. = $build_no
+echo
+
basedir="$( cd -P "$( dirname "$0" )" && pwd )"
# create output directory
@@ -133,11 +138,21 @@ build "$basedir/cairo-$cairo_version" cairo
echo ============================================================
echo Building R
echo ============================================================
+
+# copy over our customized vars.mk file
+cp -f $basedir/vars.mk $basedir/R-$r_version/share/make/vars.mk
+
pushd $basedir/R-$r_version/
+# download the recommended packages
+# ./tools/rsync-recommended
+
export LDFLAGS="-L$vendordir/gcc-$gcc_version/lib64"
export CPPFLAGS="-I$vendordir/glibc-$glibc_version/string -I$vendordir/glibc-$glibc_version/time -I$vendordir/cairo/include/cairo/include"
export PATH="$vendordir/gcc-$gcc_version/bin:$PATH"
+export R_BASE="$vendordir/R"
+export R_HOME=$R_BASE/lib64/R
+export R_INCLUDE=$R_HOME/lib64/R/include
echo ----------------------------------------------------------------------
echo LD_LIBRARY_PATH=$LD_LIBRARY_PATH
@@ -150,9 +165,11 @@ popd
# TODO: remove unneeded files to make buildpack smaller
-# upload to S3 bucket
+# compress and upload to S3 bucket
pushd $vendordir
tar czf "R-$r_version-binaries-$build_no.tar.gz" freetype DirectFB libpng pixman fontconfig cairo R
popd
+echo
+echo Uploading binaries to S3
bundle exec ruby ./s3_upload.rb "$vendordir/R-$r_version-binaries-$build_no.tar.gz"
View
@@ -16,12 +16,12 @@ if [[ ! -f .env ]]; then
exit 1
fi
-rversion=2.15.1
-build_no=${2:-`date +%Y%m%d-%H%M`}
+r_version="${1:-2.15.1}"
+build_no="${2:-`date +%Y%m%d-%H%M`}"
rm -rf .git &> /dev/null
git init
-git add Gemfile Gemfile.lock s3_upload.rb build-r features.h .env
+git add Gemfile Gemfile.lock s3_upload.rb build-r features.h vars.mk .env
git commit -m "build scripts"
heroku apps:create
@@ -30,10 +30,14 @@ app=${app:5}
git push heroku master
-heroku run "bash -c ./build-r $rversion $build_no > ./build-r.log && bundle exec ruby ./s3_upload.rb ./build-r.log" --app $app
+# NOTE: only redirecting stdout to file, stderr will be displayed!
+heroku run "bash -c './build-r $r_version $build_no' > ./build-r-$build_no.log && bundle exec ruby ./s3_upload.rb ./build-r-$build_no.log" --app $app
heroku apps:destroy $app --confirm $app
# download the file off s3
-wget "https://heroku-buildpack-r.s3.amazonaws.com/build-r.log"
-# wget "https://heroku-buildpack-r.s3.amazonaws.com/R-$r_version-binaries-$build_no.tar.gz"
+echo Downloading log file
+wget "https://heroku-buildpack-r.s3.amazonaws.com/build-r-$build_no.log"
+
+echo Downloading binaries file
+wget "https://heroku-buildpack-r.s3.amazonaws.com/R-$r_version-binaries-$build_no.tar.gz"
View
@@ -0,0 +1,14 @@
+## Static (i.e., not determined by configure) Make variables to be
+## shared *and* grepped from m4/R.m4 and tools/*-recommended.
+
+## There is also 'translations', but that is not Priority: base
+## so it can be handled by update.packages() in due course.
+R_PKGS_BASE = base tools utils grDevices graphics stats datasets methods grid splines stats4 tcltk compiler parallel
+## Those which can be installed initially compiled (not base tools)
+R_PKGS_BASE1 = utils grDevices graphics stats datasets methods grid splines stats4 tcltk parallel
+## Those with standard R directories (not datasets, methods)
+R_PKGS_BASE2 = base tools utils grDevices graphics stats grid splines stats4 tcltk compiler parallel
+
+R_PKGS_RECOMMENDED = MASS lattice Matrix nlme survival boot cluster codetools foreign KernSmooth rpart class nnet spatial mgcv
+# there are dependencies in src/library/Recommended/Makefile*
+# which this order respects

0 comments on commit 54d4f6a

Please sign in to comment.