homebrew-core/Formula/nasm.rb
David Christenson bf82b72d50 nasm 2.11.04
Update to latest stable release.

Closes Homebrew/homebrew#29187.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2014-05-12 07:08:55 -07:00

29 lines
758 B
Ruby

require 'formula'
class Nasm < Formula
homepage 'http://www.nasm.us/'
url 'http://www.nasm.us/pub/nasm/releasebuilds/2.11.04/nasm-2.11.04.tar.xz'
sha256 '4f07059a080883cd99f58da837a6504f1e0aa2757cbb0bb3064aca24a58da0f7'
option :universal
def install
ENV.universal_binary if build.universal?
system "./configure", "--prefix=#{prefix}"
system "make install install_rdf"
end
test do
(testpath/"foo.s").write <<-EOS
mov eax, 0
mov ebx, 0
int 0x80
EOS
system "#{bin}/nasm", "foo.s"
code = File.open("foo", "rb") { |f| f.read.unpack("C*") }
expected = [0x66, 0xb8, 0x00, 0x00, 0x00, 0x00, 0x66, 0xbb,
0x00, 0x00, 0x00, 0x00, 0xcd, 0x80]
assert_equal expected, code
end
end