Skip to content

Instantly share code, notes, and snippets.

@DarrenBishop
Last active August 29, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DarrenBishop/c906f3e895e48bfaf6fa to your computer and use it in GitHub Desktop.
Save DarrenBishop/c906f3e895e48bfaf6fa to your computer and use it in GitHub Desktop.
# to install the latest stable version:
brew install scala --with-docs
# to install scala-2.10:
brew install https://gist.github.com/DarrenBishop/c906f3e895e48bfaf6fa/raw/a7b7ac28d4febc656995e2e58913ab4ea354ed8b/scala.rb --with-docs
# to switch versions (from https://github.com/mxcl/homebrew/wiki/External-Commands):
brew switch scala 2.11.7
brew switch scala 2.10.5
# to see which scala you're currently using:
brew which scala
# Recipe for scala-2.10.0-RC5
require 'formula'
class ScalaDocs < Formula
homepage 'http://www.scala-lang.org/'
url 'http://downloads.typesafe.com/scala/2.10.5/scala-docs-2.10.5.txz'
sha1 '8c17219f6641a4baf37020896fc49f66c2b0b212'
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://downloads.typesafe.com/scala/2.10.5/scala-2.10.5.tgz'
sha1 'e981301c06e3d06f4b24c0b983fe0bc3ca86b850'
version '2.10.5'
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