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'
|
|
|
|
url 'https://github.com/D-Programming-Language/dmd/archive/v2.064.2.tar.gz'
|
|
|
|
sha1 '8f88af77aab4c206841d93d7f4cfd399cbe3fdd6'
|
|
|
|
|
|
|
|
resource 'druntime' do
|
|
|
|
url 'https://github.com/D-Programming-Language/druntime/archive/v2.064.2.tar.gz'
|
|
|
|
sha1 '42bc0f252bbb0c71de6789bdf2697b5daf41dd43'
|
|
|
|
end
|
|
|
|
|
|
|
|
resource 'phobos' do
|
|
|
|
url 'https://github.com/D-Programming-Language/phobos/archive/v2.064.2.tar.gz'
|
|
|
|
sha1 'e39489a6c7c60c947559a084cc7619e373d3c464'
|
|
|
|
end
|
|
|
|
|
|
|
|
resource 'tools' do
|
|
|
|
url 'https://github.com/D-Programming-Language/tools/archive/v2.064.2.tar.gz'
|
|
|
|
sha1 '590dfb8cd4b6fea74d03ddf230ec2734e7c71c99'
|
|
|
|
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"]
|
|
|
|
|
|
|
|
system "make", "install", "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-01-03 16:41:47 +00:00
|
|
|
rm 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"
|
|
|
|
|
|
|
|
resource('druntime').stage do
|
|
|
|
system "make", "install", *make_args
|
|
|
|
end
|
|
|
|
|
|
|
|
resource('phobos').stage do
|
|
|
|
system "make", "install", "DRUNTIME_PATH=#{prefix}", "VERSION=#{buildpath}/VERSION", *make_args
|
|
|
|
end
|
|
|
|
|
|
|
|
(bin/'dmd.conf').open('w+') do |f|
|
2013-06-22 13:31:07 +00:00
|
|
|
f.puts "[Environment]"
|
2014-01-03 16:41:47 +00:00
|
|
|
f.puts "DFLAGS=-I#{prefix}/import -L-L#{lib}"
|
|
|
|
end
|
|
|
|
|
|
|
|
resource('tools').stage do
|
|
|
|
inreplace 'posix.mak' do |s|
|
|
|
|
s.gsub! 'install: $(TOOLS) $(CURL_TOOLS)', 'install: $(TOOLS)'
|
|
|
|
#Remove on next release
|
|
|
|
s.gsub! 'install -t $(DESTDIR)$(PREFIX) $(^)', 'cp $^ $(INSTALL_DIR)/bin'
|
|
|
|
end
|
|
|
|
system "make", "install", *make_args
|
2013-06-22 13:31:07 +00:00
|
|
|
end
|
|
|
|
end
|
2014-01-03 16:41:47 +00:00
|
|
|
|
2013-06-22 13:31:07 +00:00
|
|
|
def test
|
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
|