diff --git a/Formula/r.rb b/Formula/r.rb index 3c9aa38677..1158109d51 100644 --- a/Formula/r.rb +++ b/Formula/r.rb @@ -22,19 +22,20 @@ class R < Formula depends_on 'libtiff' depends_on 'jpeg' depends_on :x11 - - depends_on 'valgrind' if build.include? 'with-valgrind' + depends_on 'valgrind' => :optional def install - ENV.Og if build.include? 'with-valgrind' - args = [ "--prefix=#{prefix}", "--with-aqua", "--enable-R-framework", "--with-lapack" ] - args << '--with-valgrind-instrumentation=2' if build.include? 'with-valgrind' + + if build.with? 'valgrind' + args << '--with-valgrind-instrumentation=2' + ENV.Og + end # Pull down recommended packages if building from HEAD. system './tools/rsync-recommended' if build.head?