aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorBaptiste Fontaine2015-03-14 21:31:42 +0100
committerBrett Koonce2015-03-14 19:36:22 -0700
commite98883db5192759ee1576a84d78651748e99498a (patch)
tree063ce751e77e892cf6434b34a7dee87a11792108 /Library/Formula
parenta0ab5057449b486f285d5aa5183b01fc295d3093 (diff)
downloadhomebrew-e98883db5192759ee1576a84d78651748e99498a.tar.bz2
simh: add test, simplify install
Closes #37721. Signed-off-by: Brett Koonce <koonce@gmail.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/simh.rb37
1 files changed, 17 insertions, 20 deletions
diff --git a/Library/Formula/simh.rb b/Library/Formula/simh.rb
index f5a2ac367..3d7e848f1 100644
--- a/Library/Formula/simh.rb
+++ b/Library/Formula/simh.rb
@@ -1,13 +1,10 @@
-require 'formula'
-require 'set'
-
class Simh < Formula
- homepage 'http://simh.trailing-edge.com/'
- url 'http://simh.trailing-edge.com/sources/simhv39-0.zip'
- sha1 '1de3938f0dcb51d55b0e53aea8ae9769ccc57bdb'
- version '3.9-0'
+ homepage "http://simh.trailing-edge.com/"
+ url "http://simh.trailing-edge.com/sources/simhv39-0.zip"
+ sha256 "e49b259b66ad6311ca9066dee3d3693cd915106a6938a52ed685cdbada8eda3b"
+ version "3.9-0"
- head 'https://github.com/simh/simh.git'
+ head "https://github.com/simh/simh.git"
# After 3.9-0 the project moves to https://github.com/simh/simh
# It doesn't actually fail, but the makefile queries llvm-gcc -v --help a lot
@@ -15,22 +12,22 @@ class Simh < Formula
# Remove at the next revision that will support clang (see github site).
fails_with :clang do
build 421
- cause 'The program is closely tied to gcc & llvm-gcc in this revision.'
+ cause "The program is closely tied to gcc & llvm-gcc in this revision."
end
def install
ENV.deparallelize unless build.head?
- inreplace 'makefile', 'GCC = gcc', "GCC = #{ENV.cc}"
- inreplace 'makefile', 'CFLAGS_O = -O2', "CFLAGS_O = #{ENV.cflags}"
- system "make USE_NETWORK=1 all"
- bin.install Dir['BIN/*']
- docs = Dir['**/*.txt']
- Set.new(docs.map {|f| File.dirname(f) }).each do |d|
- mkpath doc+d
- end
- docs.each do |f|
- cp f, doc+f
+ inreplace "makefile", "GCC = gcc", "GCC = #{ENV.cc}"
+ inreplace "makefile", "CFLAGS_O = -O2", "CFLAGS_O = #{ENV.cflags}"
+ system "make", "USE_NETWORK=1", "all"
+ bin.install Dir["BIN/*"]
+ Dir["**/*.txt"].each do |f|
+ (doc/File.dirname(f)).install f
end
- (share+'simh/vax').install Dir['VAX/*.{bin,exe}']
+ (share/"simh/vax").install Dir["VAX/*.{bin,exe}"]
+ end
+
+ test do
+ assert_match(/Goodbye/, pipe_output("#{bin}/altair", "exit\n", 0))
end
end