Skip to content

Instantly share code, notes, and snippets.

@nausher
Forked from cstrahan/scala.rb
Last active December 10, 2015 01:38
Show Gist options
  • Save nausher/4360521 to your computer and use it in GitHub Desktop.
Save nausher/4360521 to your computer and use it in GitHub Desktop.
# to install the latest stable version:
brew install scala --with-docs
#unlink version to allow new
brew unlink scala
# to install scala-2.10.0-RC5:
brew install https://gist.github.com/raw/4360521/scala.rb --with-docs
# to switch versions (from https://github.com/mxcl/homebrew/wiki/External-Commands):
brew switch scala 2.9.2
brew switch scala 2.10.0-RC5
# to see which scala you're currently using:
brew which scala
# Recipe for scala-2.10.0-RC1
require 'formula'
class ScalaDocs < Formula
homepage 'http://www.scala-lang.org/'
url 'http://www.scala-lang.org/downloads/distrib/files/scala-2.10.0-RC5.zip'
sha1 '2d01b1f03c8e5bdb5227a0a6cbc4258096fe2830'
end
class ScalaCompletion < Formula
homepage 'http://www.scala-lang.org/'
url 'https://raw.github.com/scala/scala-dist/27bc0c25145a83691e3678c7dda602e765e13413/completion.d/2.9.1/scala'
version '2.9.1'
sha1 'e2fd99fe31a9fb687a2deaf049265c605692c997'
end
class Scala < Formula
homepage 'http://www.scala-lang.org/'
url 'http://www.scala-lang.org/downloads/distrib/files/scala-2.10.0-RC5.tgz'
sha1 'd016fd118a82e25ea649753cea122994f946a237'
version '2.10.0-RC5'
option 'with-docs', 'Also install library documentation'
def install
rm_f Dir["bin/*.bat"]
doc.install Dir['doc/*']
man1.install Dir['man/man1/*']
libexec.install Dir['*']
bin.install_symlink Dir["#{libexec}/bin/*"]
#ScalaCompletion.new.brew { (prefix/'etc/bash_completion.d').install 'scala' }
ScalaDocs.new.brew { doc.install Dir['*'] } if build.include? 'with-docs'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment