homebrew-core/Formula/dmd.rb

39 lines
1,000 B
Ruby
Raw Normal View History

require 'formula'
2011-03-10 05:11:03 +00:00
class Dmd < Formula
homepage 'http://www.digitalmars.com/d/'
url 'http://downloads.dlang.org/releases/2013/dmd.2.064.2.zip'
sha1 'c09a7787b9137409a2169268b57655ce29c9f0d3'
2009-06-26 11:58:32 +00:00
def install
2009-07-23 03:12:36 +00:00
# clean it up a little first
rm Dir['src/*.mak']
mv 'license.txt', 'COPYING'
mv 'README.TXT', 'README'
2009-07-23 03:12:36 +00:00
cd 'osx/bin' do
rm 'dmdx.conf'
rm 'dmd.conf'
end
rmtree 'src/dmd'
libexec.install 'osx/bin', 'osx/lib', 'src'
2009-07-23 03:12:36 +00:00
man.install 'man/man1'
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']
(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'
bin.write_exec_script libexec/'bin/rdmd'
bin.write_exec_script libexec/'bin/dman'
end
def test
2013-06-28 16:06:27 +00:00
system "dmd", "#{share}/d/examples/hello.d"
system "./hello"
end
2011-03-10 05:11:03 +00:00
end