2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-06-04 18:21:19 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Dmd < Formula
|
2014-01-03 16:41:47 +00:00
|
|
|
homepage 'http://dlang.org'
|
2014-02-24 16:22:32 +00:00
|
|
|
url 'https://github.com/D-Programming-Language/dmd/archive/v2.065.0.tar.gz'
|
|
|
|
sha1 '15f67e9b088d599c4091f1844676d107e873e850'
|
2014-01-03 16:41:47 +00:00
|
|
|
|
2014-02-24 16:27:07 +00:00
|
|
|
bottle do
|
|
|
|
sha1 "581cd8093ffe9fca493f06996e1d95e538fbb99e" => :mavericks
|
|
|
|
sha1 "3dfec90ecfc970e05efea17d6f786a0a1fbbb322" => :mountain_lion
|
|
|
|
sha1 "68d88b84a7f3407e867a83d093bf649f99830e23" => :lion
|
|
|
|
end
|
|
|
|
|
2014-01-03 16:41:47 +00:00
|
|
|
resource 'druntime' do
|
2014-02-24 16:22:32 +00:00
|
|
|
url 'https://github.com/D-Programming-Language/druntime/archive/v2.065.0.tar.gz'
|
|
|
|
sha1 '0118d9386b2d5f006381a5e4802f295132c8717b'
|
2014-01-03 16:41:47 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
resource 'phobos' do
|
2014-02-24 16:22:32 +00:00
|
|
|
url 'https://github.com/D-Programming-Language/phobos/archive/v2.065.0.tar.gz'
|
|
|
|
sha1 '2af606451ee5d651fea91f252e09411714f779df'
|
2014-01-03 16:41:47 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
resource 'tools' do
|
2014-02-24 16:22:32 +00:00
|
|
|
url 'https://github.com/D-Programming-Language/tools/archive/v2.065.0.tar.gz'
|
|
|
|
sha1 '54b5855599e64d0efbfc1cb21f1a31ef9939f8be'
|
2014-01-03 16:41:47 +00:00
|
|
|
end
|
2009-06-26 11:58:32 +00:00
|
|
|
|
2009-06-04 18:21:19 +00:00
|
|
|
def install
|
2014-01-03 16:41:47 +00:00
|
|
|
make_args = ["INSTALL_DIR=#{prefix}", "MODEL=#{Hardware::bits}", "-f", "posix.mak"]
|
|
|
|
|
2014-02-24 16:22:32 +00:00
|
|
|
system "make", "install", "SYSCONFDIR=#{etc}", "TARGET_CPU=X86", "RELEASE=1", *make_args
|
2013-03-04 02:00:44 +00:00
|
|
|
|
2014-01-03 16:41:47 +00:00
|
|
|
share.install prefix/'man'
|
2013-03-04 02:00:44 +00:00
|
|
|
|
2014-02-24 16:22:32 +00:00
|
|
|
inreplace bin/'dmd.conf', "DFLAGS=-I%@P%/../../src/phobos -I%@P%/../../src/druntime/import -L-L%@P%/../lib",
|
|
|
|
"DFLAGS=-I#{prefix}/import -L-L#{lib}"
|
|
|
|
|
|
|
|
etc.install bin/'dmd.conf'
|
2009-07-23 03:12:36 +00:00
|
|
|
|
2014-01-03 16:41:47 +00:00
|
|
|
make_args.unshift "DMD=#{bin}/dmd"
|
|
|
|
|
2014-02-24 16:22:32 +00:00
|
|
|
|
2014-04-17 04:19:51 +00:00
|
|
|
system "make", "-C", "druntime", "install", *make_args
|
|
|
|
system "make", "-C", "phobos", "install", "VERSION=#{buildpath}/VERSION", *make_args
|
2014-01-03 16:41:47 +00:00
|
|
|
|
2014-04-17 04:19:51 +00:00
|
|
|
(buildpath/'druntime').install resource('druntime')
|
2014-02-24 16:22:32 +00:00
|
|
|
(buildpath/'phobos').install resource('phobos')
|
2014-01-03 16:41:47 +00:00
|
|
|
|
|
|
|
resource('tools').stage do
|
2014-02-24 16:22:32 +00:00
|
|
|
inreplace 'posix.mak', 'install: $(TOOLS) $(CURL_TOOLS)', 'install: $(TOOLS)'
|
2014-01-03 16:41:47 +00:00
|
|
|
system "make", "install", *make_args
|
2013-06-22 13:31:07 +00:00
|
|
|
end
|
|
|
|
end
|
2014-01-03 16:41:47 +00:00
|
|
|
|
2014-02-23 21:31:41 +00:00
|
|
|
test do
|
2014-01-03 16:41:47 +00:00
|
|
|
system "dmd", "#{prefix}/samples/hello.d"
|
2013-06-22 13:31:07 +00:00
|
|
|
system "./hello"
|
2009-06-04 18:21:19 +00:00
|
|
|
end
|
2011-03-10 05:11:03 +00:00
|
|
|
end
|