Skip to content

Commit

Permalink
clozure-cl: env_script, install docs, better test
Browse files Browse the repository at this point in the history
  • Loading branch information
dunn committed Jul 12, 2016
1 parent 70b1c8f commit da09676
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions Formula/clozure-cl.rb
Expand Up @@ -13,20 +13,18 @@ def install
# Get rid of all the .svn directories
rm_rf Dir["**/.svn"]

libexec.install Dir["*"]
scripts = Dir["#{libexec}/scripts/ccl{,64}"]

inreplace scripts, /CCL_DEFAULT_DIRECTORY=.+$/, %(CCL_DEFAULT_DIRECTORY="#{libexec}")
bin.install_symlink scripts
end
prefix.install "doc/README"
doc.install Dir["doc/*"]

def test_ccl(bit = 32)
ccl = bin + "ccl#{"64" if bit == 64}"
%{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
libexec.install Dir["*"]
bin.install Dir["#{libexec}/scripts/ccl{,64}"]
bin.env_script_all_files(libexec/"bin", :CCL_DEFAULT_DIRECTORY => libexec)
end

test do
system test_ccl
system test_ccl(64)
args = "-n -e '(write-line (write-to-string (* 3 7)))' -e '(quit)'"
%w[ccl ccl64].each do |ccl|
assert_equal "21", shell_output("#{bin}/#{ccl} #{args}").strip
end
end
end

0 comments on commit da09676

Please sign in to comment.