aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorChristian Köstlin2013-06-22 15:31:07 +0200
committerAdam Vandenberg2013-06-27 22:06:30 -0700
commitb8c7e203d1a3b779db699e4b6a3ea622b75f6dd7 (patch)
treea45441b4e438dd2b7cd77302fe09e449d8fb051e /Library/Formula
parent9c1bafe53f78af1cb7d46ad1fe309f63f9b4f611 (diff)
downloadhomebrew-b8c7e203d1a3b779db699e4b6a3ea622b75f6dd7.tar.bz2
dmd: add a conf and test
Closes #20687. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/dmd.rb15
1 files changed, 12 insertions, 3 deletions
diff --git a/Library/Formula/dmd.rb b/Library/Formula/dmd.rb
index 5fecee1ba..e92ef6863 100644
--- a/Library/Formula/dmd.rb
+++ b/Library/Formula/dmd.rb
@@ -12,16 +12,25 @@ class Dmd < Formula
mv 'README.TXT', 'README'
cd 'osx/bin' do
- mv 'dmdx.conf', 'dmd.conf'
- inreplace 'dmd.conf', '~/dmd2', prefix
+ rm 'dmdx.conf'
+ rm 'dmd.conf'
end
rmtree 'src/dmd'
- prefix.install 'osx/bin', 'osx/lib', 'src'
+ libexec.install 'osx/bin', 'osx/lib', 'src'
man.install 'man/man1'
man5.install man1/'dmd.conf.5'
(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'
+ end
+ def test
+ system "dmd", "#{prefix}/share/d/examples/hello.d"
+ system "./hello"
end
end