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
|
2010-08-16 23:24:11 +00:00
|
|
|
homepage 'http://www.digitalmars.com/d/'
|
2013-05-30 17:16:21 +00:00
|
|
|
url 'http://downloads.dlang.org.s3-website-us-east-1.amazonaws.com/releases/2013/dmd.2.063.zip'
|
|
|
|
sha1 '589e6d87e10fb7a9bbfbcadb702ba7c05000d0bf'
|
2009-06-26 11:58:32 +00:00
|
|
|
|
2009-06-04 18:21:19 +00:00
|
|
|
def install
|
2009-07-23 03:12:36 +00:00
|
|
|
# clean it up a little first
|
2012-02-16 13:15:11 +00:00
|
|
|
rm Dir['src/*.mak']
|
2010-04-07 05:58:35 +00:00
|
|
|
mv 'license.txt', 'COPYING'
|
|
|
|
mv 'README.TXT', 'README'
|
2009-07-23 03:12:36 +00:00
|
|
|
|
2013-03-04 02:00:44 +00:00
|
|
|
cd 'osx/bin' do
|
2013-06-22 13:31:07 +00:00
|
|
|
rm 'dmdx.conf'
|
|
|
|
rm 'dmd.conf'
|
2013-03-04 02:00:44 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
rmtree 'src/dmd'
|
2013-06-22 13:31:07 +00:00
|
|
|
libexec.install 'osx/bin', 'osx/lib', 'src'
|
2013-03-04 02:00:44 +00:00
|
|
|
|
2009-07-23 03:12:36 +00:00
|
|
|
man.install 'man/man1'
|
2013-03-04 02:00:44 +00:00
|
|
|
man5.install man1/'dmd.conf.5'
|
2009-07-23 03:12:36 +00:00
|
|
|
|
2010-08-08 17:20:15 +00:00
|
|
|
(share+'d/examples').install Dir['samples/d/*.d']
|
2013-06-22 13:31:07 +00:00
|
|
|
(libexec+'bin/dmd.conf').open('w') do |f|
|
|
|
|
f.puts "[Environment]"
|
|
|
|
f.puts "DFLAGS=-I#{libexec}/src/phobos -I#{libexec}/src/druntime/import -L-L#{libexec}/lib"
|
|
|
|
end
|
|
|
|
bin.write_exec_script libexec/'bin/dmd'
|
|
|
|
end
|
|
|
|
def test
|
2013-06-28 16:06:27 +00:00
|
|
|
system "dmd", "#{share}/d/examples/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
|