Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

R 3.1.0, support for saving a plot created via the ggplot2 library #36

Open
wants to merge 12 commits into from

1 participant

@riebeekn

My first pull request, apologies if I've done anything incorrectly, also I just noticed you've been making some changes to the development branch so it could be the issues I was running into have been corrected by now.

By motivation for creating the R-3.1.0 branch was to get the ggplot2 package working correctly, specifically ggsave was failing for me. I probably made too many extraneous changes in the process of getting this going, but figured I would create a pull request, and if there is anything that is useful for you to pull into the main branch, great, if not, no worries.

So a summary of the changes I made:

/support

  • removed the old vulcan build files.
  • removed the auto-upload to S3 (it tended to time out on me).
  • changed how the source files and versions are specified, split this out into build-r.config, so that at least in theory version / source location changes don't require changing the actual build script.
  • changed where source files are downloaded to, they now get put in /support/sources.
  • copied the output of the build to /support/sources.
  • added an unpack helper function which only unpacks the downloaded zip files if they haven't already been unzipped.
  • altered the build-r file some, modelling more closely on the old R 2.15.1 version of the script as I was able to run ggsave with this version of the build script.
  • updated the readme adding a bit more detail.

/test

  • added a test for ggplot.
  • added a readme file.
  • updated the install files to source the buildpack URL from a config file, test.config.

/bin

  • made the configurable section of the compile file more obvious.
  • removed the tokenized build URL and instead specified it directly (I found this less error prone, I was forever typing in the wrong buildpack version number).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 25, 2014
  1. @riebeekn
Commits on Jun 26, 2014
  1. @riebeekn

    updated / added some tests

    riebeekn authored
Commits on Jun 28, 2014
  1. @riebeekn
  2. @riebeekn

    fix binaries url

    riebeekn authored
  3. @riebeekn

    test

    riebeekn authored
  4. @riebeekn

    test

    riebeekn authored
  5. @riebeekn

    test

    riebeekn authored
  6. @riebeekn

    test

    riebeekn authored
Commits on Jun 29, 2014
  1. @riebeekn
  2. @riebeekn

    fix readme

    riebeekn authored
  3. @riebeekn

    update readme

    riebeekn authored
  4. @riebeekn

    update R binary URL

    riebeekn authored
This page is out of date. Refresh to see the latest.
View
14 bin/compile
@@ -31,15 +31,17 @@ CACHE_DIR="$2/vendor"
LP_DIR=`cd $(dirname $0); cd ..; pwd`
BUILDPACK_DIR="$(dirname $(dirname $0))"
-# config
-BUILD_PACK_VERSION="20130729"
+###################################################
+# >>> CONFIGURABLE SETTINGS, change as appropriate
+###################################################
+R_BINARIES="https://s3.amazonaws.com/r-buildpack/R-3.1.0-binaries-20140629-2201.tar.gz"
+R_VERSION="3.1.0"
GCC_VERSION="4.3"
GLIBC_VERSION="2.7"
-R_VERSION="2.15.1"
-
-S3_BUCKET="heroku-buildpack-r"
-R_BINARIES="http://${S3_BUCKET}.s3.amazonaws.com/R-${R_VERSION}-binaries-${BUILD_PACK_VERSION}.tar.gz"
+###################################################
+# <<< END CONFIGURABLE SETTINGS
+###################################################
VENDOR_DIR="$BUILD_DIR/vendor"
R_BASE="$VENDOR_DIR/R"
View
2  support/.env.example
@@ -1,2 +0,0 @@
-AWS_ACCESS_KEY_ID=TO_BE_SUPPLIED
-AWS_SECRET_ACCESS_KEY=TO_BE_SUPPLIED
View
1  support/.gitignore
@@ -1,3 +1,4 @@
*.tar.*
+*.log
*/**
.vagrant
View
4 support/Gemfile
@@ -1,4 +0,0 @@
-source 'https://rubygems.org'
-ruby '1.9.3'
-gem 'dotenv'
-gem 'aws-sdk'
View
18 support/Gemfile.lock
@@ -1,18 +0,0 @@
-GEM
- remote: https://rubygems.org/
- specs:
- aws-sdk (1.24.0)
- json (~> 1.4)
- nokogiri (>= 1.4.4, < 1.6.0)
- uuidtools (~> 2.1)
- dotenv (0.8.0)
- json (1.8.1)
- nokogiri (1.5.10)
- uuidtools (2.1.4)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- aws-sdk
- dotenv
View
76 support/README.md
@@ -1,30 +1,78 @@
-# Building R binaries for buildpack
+# Building R binaries for the buildpack
-The binaries for the build pack can be built using Heroku's [vulcan](https://github.com/heroku/vulcan) build server.
+This directory contains the files necessary for building the R binaries to be used with the buildpack. The binaries for the buildpack can be built using a Vagrant virtual machine.
-## Steps for building R on vulcan
-Create a build server using vulcan:
+## Steps for building R with Vagrant
+### Set-up
+* Download and install Vagrant, http://www.vagrantup.com/
+* Update the build-r.config file. This file is what determines the version and url of the source files that will be used by the build. When the build starts, a "heroku-buildpack-r/support/sources/"" directory will be created and the source files will be downloaded to this directory.
+
+### Build
+* Start the Vagrant virtual machine.
```
-vulcan create vulcan-build-r
+$ vagrant up
```
-Where `vulcan-build-r` is the name of the Heroku application created.
+* Run the build
+
+```
+$ vagrant ssh -c "cd /vagrant && ./build-r &> build-r.log"
+```
-Initiate the build by running the [`vulcan-build`](../../master/support/vulcan-build) executable script:
+* Alternatively the build can be run by SSH'ing into Vagrant
```
-$ ./vulcan-build
+$ vagrant ssh
+$ cd /vagrant/
+$ ./build-r
```
+### Post build steps
+* The output of the build will placed in "heroku-buildpack-r/support/output/".
+* Upload the zip file in the "heroku-buildpack-r/support/output/" folder to S3.
+* Set the S3 permissions on the uploaded zip file to Public.
+* Update the R binaries URL and version information in the configuration settings section of the bin/compile file:
-The [build-r](../../master/support/build-r) script will be uploaded to the vulcan build server and executed.
-The R sources and dependencies are downloaded and compiled, and the binary output downloaded.
-During the build process, the outputs from `configure` and `make` will be displayed in the console.
+```
+ ###################################################
+ # >>> CONFIGURABLE SETTINGS, change as appropriate
+ ###################################################
+ R_BINARIES="https://s3.amazonaws.com/r-buildpack/R-3.1.0-binaries-20140625-1902.tar.gz"
+
+ R_VERSION="3.1.0"
+ GCC_VERSION="4.3"
+ GLIBC_VERSION="2.7"
+ ###################################################
+ # <<< END CONFIGURABLE SETTINGS
+ ###################################################
+```
## Notes
-* To configure the R version to build, edit the `rversion` variable in the [vulcan-build](../../master/support/vulcan-build) file.
-* The binaries output file must be uploaded to S3.
-* Update the path in the [compile](../../master/bin/compile#L20) file for your S3 bucket name and path.
+If wanting to test the R build from within the Vagrant virtual machine, this can be done by SSH'ing into the virtual machine and setting a few environment variable, i.e.
+```
+$ vagrant ssh
+$ cd /vagrant/
+$ export PATH=/app/vendor/R/bin:/app/vendor/gcc-4.3/bin:$PATH
+$ export LDFLAGS="-L/app/vendor/gcc-4.3/lib64/"
+$ export CPPFLAGS="-I/app/vendor/glibc-2.7/string/ -I/app/vendor/glibc-2.7/time"
+$ export R_HOME=/app/vendor/R/lib64/R
+$ export R_INCLUDE=/app/vendor/R/lib64/R/include
+```
+
+Now the R build can be run and tested on the virtual machine, i.e.
+```
+$ R()
+```
+
+Once R has started, it can be used as normal from within the virtual machine, i.e.
+```
+install.packages('ggplot2')
+library(ggplot2)
+head(diamonds)
+p <- ggplot(data = diamonds, aes(x = carat, y = price, colour = cut)) + layer(geom = "point")
+p <- p + layer(geom = "point")
+ggsave("plot.svg")
+```
## Credits
Build script inspired by [Noah Lorang's Rook on Heroku](https://github.com/noahhl/rookonheroku) project.
View
202 support/build-r
@@ -14,11 +14,20 @@ set -e
## HELPERS
function download() {
- if [ ! -f "$2" ]; then
+ if [ ! -f "$sourcesdir/$2" ]; then
echo Downloading $2...
- curl $1 -o $2 -s -S
+ curl $1 -o $sourcesdir/$2 -s -S
+ else # otherwise already have it
+ echo Already downloaded $2...
+ fi
+}
+
+function unpack() {
+ if [ ! -d "$vendordir/$2" ]; then
+ echo Unpacking $2...
+ tar $1 $sourcesdir/$2.tar.gz -C $vendordir
else
- echo Got $2...
+ echo Already unpacked $2...
fi
}
@@ -27,90 +36,85 @@ function build() {
echo Building $@...
echo ----------------------------------------------------------------------
echo
- pushd $1
- ./configure --prefix=$vendordir/$2 ${@:3} && make && make install && make clean
+ pushd $vendordir/$1
+ prefix=${2:-$vendordir}
+ ./configure --prefix=$prefix && make && make install && make clean
popd > /dev/null
echo
+ echo ----------------------------------------------------------------------
+ echo Finished Building $@...
+ echo ----------------------------------------------------------------------
echo
# add to libraries and pkg-config
export LD_LIBRARY_PATH="$vendordir/$2:$LD_LIBRARY_PATH"
export PKG_CONFIG_PATH="$vendordir/$2/lib/pkgconfig:$PKG_CONFIG_PATH"
-
}
## SCRIPT
-
-r_version="${1:-2.15.1}"
-r_version_major=${r_version:0:1}
+source build-r.config
build_no="${2:-`date +%Y%m%d-%H%M`}"
-# check arguments
-if ([ -z "$r_version" ] || [ -z "$build_no" ]); then
- echo
- echo "USAGE: $0 VERSION [BUILDNUM]"
- echo
- echo " VERSION is the R version. E.g. 2.15.1"
- echo " BUILDNUM the build number. E.g. 20131031-1400"
- echo
- exit 1
-fi
-
+echo ======================================================================
+echo
+echo Starting build...
echo
echo R Version = $r_version
echo Build No. = $build_no
echo
+echo ======================================================================
basedir="$( cd -P "$( dirname "$0" )" && pwd )"
# create output directory
vendordir=/app/vendor
mkdir -p $vendordir
+sourcesdir=/vagrant/sources
+mkdir -p $sourcesdir
+outputdir=/vagrant/output
+mkdir -p $outputdir
echo ======================================================================
echo Downloading and unpacking dependancies...
echo ======================================================================
-# http://www.freetype.org/freetype2/
-freetype_version=2.5.0
-download "http://www.mirrorservice.org/sites/download.savannah.gnu.org/releases/freetype/freetype-$freetype_version.tar.gz" freetype-$freetype_version.tar.gz
-tar xzf freetype-$freetype_version.tar.gz
+# http://www.freedesktop.org/wiki/Software/pkg-config/
+download $pkgconfig_url pkg-config-$pkgconfig_version.tar.gz
+unpack xzf pkg-config-$pkgconfig_version
+
+# NOT USED in old version of the build pack and seems to work
+# fine without it, so skipping this
+# http://www.freetype.org/freetype2/
+# download $freetype_url freetype-$freetype_version.tar.gz
+# unpack xzf freetype-$freetype_version
-# http://directfb.org/
-directfb_version=1.2.9
-directfb_ver_major=${directfb_version:0:3}
-download "http://directfb.org/downloads/Core/DirectFB-$directfb_ver_major/DirectFB-$directfb_version.tar.gz" DirectFB-$directfb_version.tar.gz
-tar xzf DirectFB-$directfb_version.tar.gz
+# NOT USED in old version of the build pack and seems to work
+# fine without it, so skipping this
+# http://directfb.org/
+# download $directfb_url DirectFB-$directfb_version.tar.gz
+# unpack xzf DirectFB-$directfb_version
# http://www.libpng.org/pub/png/libpng.html
-libpng_version=1.2.50
-download "ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng12/libpng-$libpng_version.tar.gz" libpng-$libpng_version.tar.gz
-tar xzf libpng-$libpng_version.tar.gz
+download $libpng_url libpng-$libpng_version.tar.gz
+unpack xJf libpng-$libpng_version
# http://www.cairographics.org
-pixman_version=0.30.2
-download "http://www.cairographics.org/releases/pixman-$pixman_version.tar.gz" pixman-$pixman_version.tar.gz
-tar xzf $basedir/pixman-$pixman_version.tar.gz
+download $pixman_url pixman-$pixman_version.tar.gz
+unpack xzf pixman-$pixman_version
+# NOT USED in old version of the build pack and seems to work
+# fine without it, so skipping this
# http://www.freedesktop.org/software/fontconfig
-fontconfig_version=2.10.93
-download "http://www.freedesktop.org/software/fontconfig/release/fontconfig-$fontconfig_version.tar.gz" fontconfig-$fontconfig_version.tar.gz
-tar xzf $basedir/fontconfig-$fontconfig_version.tar.gz
+# download $fontconfig_url fontconfig-$fontconfig_version.tar.gz
+# unpack xzf fontconfig-$fontconfig_version
# http://www.cairographics.org
-cairo_version=1.12.16
-download "http://www.cairographics.org/releases/cairo-$cairo_version.tar.xz" cairo-$cairo_version.tar.xz
-tar xJf $basedir/cairo-$cairo_version.tar.xz
-
-# R
-download "http://cran.r-project.org/src/base/R-$r_version_major/R-$r_version.tar.gz" R-$r_version.tar.gz
-tar xzf R-$r_version.tar.gz
+download $cairo_url cairo-$cairo_version.tar.gz
+unpack xzf cairo-$cairo_version
# http://gcc.gnu.org/wiki/GFortran
-gcc_ver=4.3.6
-gcc_version=${gcc_ver:0:3}
-download "http://gfortran.com/download/x86_64/snapshots/gcc-$gcc_version.tar.xz" gcc-$gcc_version.tar.xz
-tar xJf $basedir/gcc-$gcc_version.tar.xz -C $vendordir
+download $gcc_url gcc-$gcc_version.tar.gz
+unpack xJf gcc-$gcc_version
# patch gcc features.h file
# see http://permalink.gmane.org/gmane.comp.gcc.help/40166
@@ -119,57 +123,87 @@ cp $basedir/features.h $vendordir/gcc-$gcc_version/lib/gcc/x86_64-unknown-linux-
export LD_LIBRARY_PATH="$vendordir/gcc-$gcc_version:$LD_LIBRARY_PATH"
# https://www.gnu.org/software/libc/
-glibc_version=2.7
-download "http://ftp.gnu.org/gnu/glibc/glibc-$glibc_version.tar.gz" glibc_$glibc_version.tar.gz
-tar xzf $basedir/glibc_$glibc_version.tar.gz -C $vendordir
+download $glibc_url glibc-$glibc_version.tar.gz
+unpack xzf glibc-$glibc_version
+
+# patch gcc features.h file
+# See http://permalink.gmane.org/gmane.comp.gcc.help/40166
+cp $basedir/features.h $vendordir/gcc-4.3/lib/gcc/x86_64-unknown-linux-gnu/4.3.6/include-fixed/features.h
echo ============================================================
echo Building dependencies...
-echo ======================================================================
+echo ============================================================
+
+# pkgconfig
+build pkg-config-$pkgconfig_version
+export PKG_CONFIG=$vendordir/bin/pkg-config
+export PKG_CONFIG_PATH=$vendordir/lib/pkgconfig
-build "$basedir/freetype-$freetype_version" freetype
-build "$basedir/DirectFB-$directfb_version" DirectFB
-build "$basedir/libpng-$libpng_version" libpng
-build "$basedir/pixman-$pixman_version" pixman
-build "$basedir/fontconfig-$fontconfig_version" fontconfig
-build "$basedir/cairo-$cairo_version" cairo
+build libpng-$libpng_version
+build pixman-$pixman_version
+build cairo-$cairo_version
-# build R
echo ============================================================
-echo Building R
+echo Downloading R
echo ============================================================
-# copy over our customized vars.mk file
-cp -f $basedir/vars.mk $basedir/R-$r_version/share/make/vars.mk
+download $r_url R-$r_version.tar.gz
+unpack xzf R-$r_version
+
+echo ============================================================
+echo Building R
+echo ============================================================
-pushd $basedir/R-$r_version/
+# R needs to know where gfortran and glibc header files are
+export PATH=$vendordir/gcc-4.3/bin:$PATH
+export LDFLAGS="-L$vendordir/gcc-4.3/lib64/"
+export CPPFLAGS="-I$vendordir/glibc-2.7/string/ -I$vendordir/glibc-2.7/time"
-# download the recommended packages
-# ./tools/rsync-recommended
+echo GCC Version: 4.3
+echo PATH: $PATH
+echo LDFLAGS: $LDFLAGS
+echo CPPFLAGS: $CPPFLAGS
-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
+# configure and make R
+build R-$r_version $vendordir/R
+cp $vendordir/lib/*.* $vendordir/R/lib64/R/lib/
-echo ----------------------------------------------------------------------
-echo LD_LIBRARY_PATH=$LD_LIBRARY_PATH
-echo PKG_CONFIG_PATH=$PKG_CONFIG_PATH
-echo ----------------------------------------------------------------------
+echo ============================================================
+echo Removing uneeded files to make output smaller
+echo ============================================================
+# TODO: might be more files that can be removed to make build smaller still
-./configure --prefix=$vendordir/R --with-x --with-libpng --with-cairo --enable-R-shlib && make && make install
+pushd $vendordir
+# gcc
+rm glibc-$glibc_version/BUGS
+rm glibc-$glibc_version/CANCEL*
+rm glibc-$glibc_version/ChangeLog*
+rm glibc-$glibc_version/CONFORMANCE
+rm glibc-$glibc_version/COPYING*
+rm glibc-$glibc_version/NAMESPACE
+rm glibc-$glibc_version/NEWS
+rm glibc-$glibc_version/NOTES
+rm glibc-$glibc_version/PROJECTS
+rm glibc-$glibc_version/README*
+rm glibc-$glibc_version/Rules
+rm glibc-$glibc_version/WUR-REPORT
+rm -rf glibc-$glibc_version/man
+
+rm -rf gcc-$gcc_version/info
+rm -rf gcc-$gcc_version/man
+
+rm -rf R/lib64/R/doc
+rm R/lib64/R/COPYING*
+rm R/lib64/R/SVN-REVISION
popd
-# TODO: remove unneeded files to make buildpack smaller
+echo ============================================================
+echo Compressing and copying to shared directory: /vagrant/
+echo ============================================================
-# compress and upload to S3 bucket
+# compress
pushd $vendordir
-tar czf "R-$r_version-binaries-$build_no.tar.gz" freetype DirectFB libpng pixman fontconfig cairo R
+tar czf "R-$r_version-binaries-$build_no.tar.gz" gcc-$gcc_version glibc-$glibc_version R
+cp R-$r_version-binaries-$build_no.tar.gz $outputdir
popd
-
-echo
-echo Uploading binaries to S3
-bundle exec ruby ./s3_upload.rb "$vendordir/R-$r_version-binaries-$build_no.tar.gz"
View
45 support/build-r.config
@@ -0,0 +1,45 @@
+# This config file contains the version and download information
+# used by the build
+
+# R
+r_version="3.1.0"
+r_version_major=${r_version:0:1}
+r_url="http://cran.r-project.org/src/base/R-$r_version_major/R-$r_version.tar.gz"
+
+# pkgconfig
+pkgconfig_version="0.23"
+pkgconfig_url="http://pkgconfig.freedesktop.org/releases/pkg-config-$pkgconfig_version.tar.gz"
+
+# freetype
+freetype_version="2.5.0"
+freetype_url="http://www.mirrorservice.org/sites/download.savannah.gnu.org/releases/freetype/freetype-$freetype_version.tar.gz"
+
+# directfb
+directfb_version="1.2.9"
+directfb_ver_major="${directfb_version:0:3}"
+directfb_url="http://directfb.org/downloads/Core/DirectFB-$directfb_ver_major/DirectFB-$directfb_version.tar.gz"
+
+# libpng
+libpng_version="1.5.18"
+libpng_url="http://r-buildpack.s3.amazonaws.com/libpng-$libpng_version.tar.xz"
+
+# pixman
+pixman_version="0.30.2"
+pixman_url="http://cairographics.org/releases/pixman-$pixman_version.tar.gz"
+
+# cairo
+cairo_version="1.12.0"
+cairo_url="http://cairographics.org/releases/cairo-$cairo_version.tar.gz"
+
+# fontconfig
+fontconfig_version="2.10.93"
+fontconfig_url="http://www.freedesktop.org/software/fontconfig/release/fontconfig-$fontconfig_version.tar.gz"
+
+# gcc
+gcc_ver="4.3.6"
+gcc_version="${gcc_ver:0:3}"
+gcc_url="http://gfortran.com/download/x86_64/snapshots/gcc-$gcc_version.tar.xz"
+
+# glib
+glibc_version="2.7"
+glibc_url="http://ftp.gnu.org/gnu/glibc/glibc-$glibc_version.tar.gz"
View
33 support/fetch-binary
@@ -1,33 +0,0 @@
-#!/bin/bash
-
-# Utility to download the binaries created by the vulcan build server
-
-build_uuid=$1
-cloudant_uid=${2:-$CLOUDANT_UID}
-cloudant_pwd=${3:-$CLOUDANT_PWD}
-rversion=${4:-2.15.1}
-
-if [ -z "$build_uuid" ] || [ -z "$cloudant_uid" ] || [ -z "$cloudant_pwd" ] || [ -z "$rversion" ]; then
-
- echo ""
- echo " USAGE: $0 build_uuid cloudant_uid cloudant_pwd [rversion]"
- echo ""
- echo " build_uid vulcan build UUID"
- echo " cloudant_uid Cloudant user name"
- echo " cloudant_pwd Cloudant password"
- echo " rversion Optionally, the R version. Defaults to $rversion"
- echo ""
- echo " To get your Cloudant user name and password, from the vulcan build instance,"
- echo " run the following command and extract from CLOUDANT_URL configuration variable."
- echo ""
- echo " heroku config --app <vulcan-app-name>"
- echo ""
- echo " Where <vulcan-app-name> is the name of your heroku application"
- echo ""
-
- exit 1
-fi
-
-wget https://$cloudant_uid:$cloudant_pwd@cloudant.com/db/$cloudant_uid/make/$build_uuid/output \
- --no-check-certificate \
- -O R-$rversion-binaries-$(date +%Y%m%d).tar.gz
View
43 support/heroku-build
@@ -1,43 +0,0 @@
-#!/bin/bash
-
-#
-# vulcan has be deprecated, use this script to build the R binaries
-#
-
-# fail fast
-set -e
-
-# debug
-# set -x
-
-if [[ ! -f .env ]]; then
- cp .env.example .env
- echo "Please edit the .env file and supply your AWS credentials before continuing."
- exit 1
-fi
-
-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 vars.mk .env
-git commit -m "build scripts"
-
-heroku apps:create
-app=`heroku apps:info -s | grep ^name=`
-app=${app:5}
-
-git push heroku master
-
-# 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
-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
9 support/publish
@@ -1,9 +0,0 @@
-#!/bin/bash
-
-#
-# If you have the heroku-buildpacks plugin, publish it
-#
-# See https://github.com/heroku/heroku-buildpacks for details
-#
-
-heroku buildpacks:publish virtualstaticvoid/heroku-buildpack-r
View
27 support/s3_upload.rb
@@ -1,27 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'dotenv'
-require 'aws-sdk'
-
-Dotenv.load
-
-file = ARGV.first || 'build.tar.gz'
-obj_name = File.basename(file)
-
-puts "Uploading '#{Pathname.new(file)}'..."
-puts "Using '#{ENV['AWS_ACCESS_KEY_ID']}' access key."
-
-AWS.config(
- :access_key_id => ENV['AWS_ACCESS_KEY_ID'],
- :secret_access_key => ENV['AWS_SECRET_ACCESS_KEY']
-)
-
-s3 = AWS::S3.new
-
-bucket = s3.buckets['heroku-buildpack-r']
-
-obj = bucket.objects[obj_name]
-obj.write(Pathname.new(file))
-obj.acl = :public_read
-
-puts "Uploaded '#{obj_name}' to S3 successfully."
View
2  support/vagrant-install
@@ -10,5 +10,5 @@ echo NOTE: SSH into vagrant, cd into /vagrant and run build-r
echo
echo Or run the following command:
echo
-echo vagrant ssh -c "cd /vagrant && ./build-r &> build-r.log"
+echo " vagrant ssh -c \"cd /vagrant && ./build-r &> build-r.log\""
echo
View
14 support/vars.mk
@@ -1,14 +0,0 @@
-## 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
View
13 support/vulcan-build
@@ -1,13 +0,0 @@
-#!/bin/bash
-
-# assuming `vulcan-setup` command has been run
-
-rversion=2.15.1
-
-rm build.tgz
-tar czf build.tgz build-r features.h
-
-vulcan build --source=./build.tgz \
- --prefix=/app/vendor \
- --command="./build-r $rversion" \
- --verbose
View
3  support/vulcan-setup
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-vulcan create heroku-buildpack-r
View
36 test/README.md
@@ -0,0 +1,36 @@
+# Buildpack tests
+
+This directory contains various tests that can be run against the buildpack.
+
+## Set-up
+* Update the test.config file to point to the buildpack url that you wish the tests to run against.
+* Update ruby/.buildpacks file to point to the buildpack url that you wish the test to run against. This test uses the multi buildpack (https://github.com/ddollar/heroku-buildpack-multi) to install both R and Ruby, as a result the test.config file cannot be used to specify the R buildpack url.
+
+## Running the tests
+* Navigate to the test directory and run the install file, i.e.
+
+```
+$ cd heroku-buildpack-r/test/console
+$ ./install
+```
+
+## Description of tests
+* Console - creates a new Heroku app, installs the nlme R package (as specified in the init.r file) and launches the R console on Heroku.
+* ggplot - creates a new Heroku app, installs the ggplot package (as specified in the init.r file) and launches the R console on Heroku. To test that ggplot has been installed correctly and can save images, type the following at the R prompt:
+
+```
+library(ggplot2)
+head(diamonds)
+p <- ggplot(data = diamonds, aes(x = carat, y = price, colour = cut)) + layer(geom = "point")
+p <- p + layer(geom = "point")
+ggsave("plot.svg")
+```
+* rcpp - creates a new Heroku app, installs the rcpp R package (as specified in the init.r file) and launches the R console on Heroku. To ensure Rcpp has been installed correctly type library('Rcpp') at the R prompt.
+* rserve - creates a new Heroku app, installs [Rserve](http://rforge.net/Rserve/) (as specified in the init.r file) and launches an Rserve server on Heroku.
+* ruby - creates a new Heroku app installing both R and Ruby. To check that Ruby and R have been installed, run:
+
+```
+$ heroku run bash
+$ ruby --version
+$ R --version
+```
View
3  test/console/install
@@ -1,10 +1,11 @@
#!/bin/bash
+source ../test.config
rm -rf .git
git init
git add --all
git commit -m "initial"
-heroku create -s cedar -b https://github.com/virtualstaticvoid/heroku-buildpack-r.git
+heroku create -s cedar -b $buildpack_url
app=`heroku apps:info -s | grep ^name=`
app=${app:5}
1  test/ggplot
@@ -0,0 +1 @@
+Subproject commit c10c603e1960f39ce4bc18676516889934dcc843
View
3  test/rcpp/install
@@ -1,10 +1,11 @@
#!/bin/bash
+source ../test.config
rm -rf .git
git init
git add --all
git commit -m "initial"
-heroku create -s cedar -b https://github.com/virtualstaticvoid/heroku-buildpack-r.git
+heroku create -s cedar -b $buildpack_url
app=`heroku apps:info -s | grep ^name=`
app=${app:5}
View
3  test/rserve/install
@@ -1,10 +1,11 @@
#!/bin/bash
+source ../test.config
rm -rf .git
git init
git add --all
git commit -m "initial"
-heroku create -s cedar -b https://github.com/virtualstaticvoid/heroku-buildpack-r.git
+heroku create -s cedar -b $buildpack_url
app=`heroku apps:info -s | grep ^name=`
app=${app:5}
View
2  test/ruby/.buildpacks
@@ -1,2 +1,2 @@
-https://github.com/virtualstaticvoid/heroku-buildpack-r.git
+https://github.com/riebeekn/heroku-buildpack-r.git#r-3.1.0
https://github.com/heroku/heroku-buildpack-ruby.git
View
3  test/test.config
@@ -0,0 +1,3 @@
+# This file contains the url of the buildpack to be used by the tests
+
+buildpack_url="https://github.com/riebeekn/heroku-buildpack-r.git#r-3.1.0"
Something went wrong with that request. Please try again.