2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-04 01:26:09 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Scala < Formula
|
2010-07-14 16:52:07 +00:00
|
|
|
homepage 'http://www.scala-lang.org/'
|
2013-10-02 00:13:02 +00:00
|
|
|
url 'http://www.scala-lang.org/files/archive/scala-2.10.3.tgz'
|
|
|
|
sha1 '04cd6237f164940e1e993a127e7cb21297f3b7ae'
|
2012-11-09 12:44:38 +00:00
|
|
|
|
2013-05-23 22:06:58 +00:00
|
|
|
devel do
|
2013-11-16 14:33:18 +00:00
|
|
|
url 'http://www.scala-lang.org/files/archive/scala-2.11.0-M5.tgz'
|
|
|
|
sha1 '6933737190288476ce6751a6302c990713963e82'
|
|
|
|
version '2.11.0-M5'
|
2013-09-18 02:25:42 +00:00
|
|
|
|
|
|
|
resource 'docs' do
|
2013-11-16 14:33:18 +00:00
|
|
|
url 'http://www.scala-lang.org/files/archive/scala-docs-2.11.0-M5.zip'
|
|
|
|
sha1 '9eb42cb7703602133b23fc67d622ec916d1030ff'
|
|
|
|
version '2.11.0-M5'
|
2013-09-18 02:25:42 +00:00
|
|
|
end
|
2013-05-23 22:06:58 +00:00
|
|
|
end
|
|
|
|
|
2012-08-27 05:05:48 +00:00
|
|
|
option 'with-docs', 'Also install library documentation'
|
2010-12-31 03:53:13 +00:00
|
|
|
|
2013-09-18 02:25:42 +00:00
|
|
|
resource 'docs' do
|
2013-10-02 00:13:02 +00:00
|
|
|
url 'http://www.scala-lang.org/files/archive/scala-docs-2.10.3.zip'
|
|
|
|
sha1 '43bab3ceb8215dad9caefb07eac5c24edc36c605'
|
2013-09-18 02:25:42 +00:00
|
|
|
end
|
|
|
|
|
2013-08-07 05:38:12 +00:00
|
|
|
resource 'completion' do
|
|
|
|
url 'https://raw.github.com/scala/scala-dist/27bc0c25145a83691e3678c7dda602e765e13413/completion.d/2.9.1/scala'
|
|
|
|
sha1 'e2fd99fe31a9fb687a2deaf049265c605692c997'
|
|
|
|
end
|
|
|
|
|
2009-09-04 01:26:09 +00:00
|
|
|
def install
|
2010-04-07 05:58:35 +00:00
|
|
|
rm_f Dir["bin/*.bat"]
|
2010-08-08 15:49:45 +00:00
|
|
|
doc.install Dir['doc/*']
|
2010-02-18 18:22:20 +00:00
|
|
|
man1.install Dir['man/man1/*']
|
2010-08-08 15:49:45 +00:00
|
|
|
libexec.install Dir['*']
|
2012-02-12 19:16:05 +00:00
|
|
|
bin.install_symlink Dir["#{libexec}/bin/*"]
|
2013-07-28 22:35:05 +00:00
|
|
|
|
2013-08-07 05:38:12 +00:00
|
|
|
bash_completion.install resource('completion')
|
2013-07-28 22:35:05 +00:00
|
|
|
|
2013-09-18 02:25:42 +00:00
|
|
|
if build.with? 'docs'
|
2013-07-01 16:52:30 +00:00
|
|
|
branch = build.stable? ? 'scala-2.10' : 'scala-2.11'
|
2013-09-18 02:25:42 +00:00
|
|
|
(share/'doc'/branch).install resource('docs')
|
|
|
|
end
|
2013-07-28 22:35:05 +00:00
|
|
|
|
2013-08-07 05:38:32 +00:00
|
|
|
# Set up an IntelliJ compatible symlink farm in 'idea'
|
2013-07-28 22:35:05 +00:00
|
|
|
idea = prefix/'idea'
|
|
|
|
idea.install_symlink libexec/'src', libexec/'lib'
|
|
|
|
(idea/'doc/scala-devel-docs').install_symlink doc => 'api'
|
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
To use with IntelliJ, set the Scala home to:
|
2013-08-07 07:06:29 +00:00
|
|
|
#{opt_prefix}/idea
|
2013-07-28 22:35:05 +00:00
|
|
|
EOS
|
2012-03-11 16:44:26 +00:00
|
|
|
end
|
2009-09-04 01:26:09 +00:00
|
|
|
end
|