2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
Yasm formula
Yasm is a complete rewrite of the NASM assembler under the "new" BSD License.
Yasm currently supports the x86 and AMD64 instruction sets, accepts NASM and
GAS assembler syntaxes, outputs binary, ELF32, ELF64, 32 and 64-bit Mach-O,
RDOFF2, COFF, Win32, and Win64 object formats, and generates source debugging
information in STABS, DWARF 2, and CodeView 8 formats.
2009-09-11 12:12:20 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Yasm < Formula
|
2012-03-30 14:16:53 +00:00
|
|
|
homepage 'http://yasm.tortall.net/'
|
|
|
|
url 'http://tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz'
|
|
|
|
sha256 '768ffab457b90a20a6d895c39749adb547c1b7cb5c108e84b151a838a23ccf31'
|
|
|
|
|
|
|
|
head 'https://github.com/yasm/yasm.git'
|
|
|
|
|
|
|
|
def options
|
|
|
|
[['--enable-python', 'Enable Python bindings support.']]
|
|
|
|
end
|
|
|
|
|
|
|
|
if ARGV.build_head?
|
|
|
|
depends_on 'gettext'
|
2012-07-07 18:08:22 +00:00
|
|
|
depends_on :automake
|
2012-03-30 14:16:53 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
depends_on 'Cython' => :python if ARGV.include? '--enable-python'
|
Yasm formula
Yasm is a complete rewrite of the NASM assembler under the "new" BSD License.
Yasm currently supports the x86 and AMD64 instruction sets, accepts NASM and
GAS assembler syntaxes, outputs binary, ELF32, ELF64, 32 and 64-bit Mach-O,
RDOFF2, COFF, Win32, and Win64 object formats, and generates source debugging
information in STABS, DWARF 2, and CodeView 8 formats.
2009-09-11 12:12:20 +00:00
|
|
|
|
|
|
|
def install
|
2012-03-30 14:16:53 +00:00
|
|
|
args = %W[--prefix=#{prefix} --disable-debug]
|
|
|
|
|
|
|
|
if ARGV.include? '--enable-python'
|
|
|
|
args << '--enable-python'
|
|
|
|
args << '--enable-python-bindings'
|
|
|
|
end
|
|
|
|
|
2012-05-26 13:28:14 +00:00
|
|
|
# Avoid "ld: library not found for -lcrt1.10.6.o" on Xcode without CLT
|
|
|
|
ENV['LIBS'] = ENV.ldflags
|
|
|
|
ENV['INCLUDES'] = ENV.cppflags
|
2012-03-30 14:16:53 +00:00
|
|
|
system './autogen.sh' if ARGV.build_head?
|
|
|
|
system './configure', *args
|
|
|
|
system 'make install'
|
|
|
|
end
|
|
|
|
|
|
|
|
def caveats
|
|
|
|
if ARGV.include? '--enable-python' then <<-EOS.undent
|
|
|
|
Python bindings installed to:
|
|
|
|
#{HOMEBREW_PREFIX}/lib/#{which_python}/site-packages
|
|
|
|
|
|
|
|
For non-homebrew Python, you need to amend your PYTHONPATH like so:
|
|
|
|
export PYTHONPATH=#{HOMEBREW_PREFIX}/lib/#{which_python}/site-packages:$PYTHONPATH
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def which_python
|
|
|
|
'python' + `python -c 'import sys;print(sys.version[:3])'`.strip
|
Yasm formula
Yasm is a complete rewrite of the NASM assembler under the "new" BSD License.
Yasm currently supports the x86 and AMD64 instruction sets, accepts NASM and
GAS assembler syntaxes, outputs binary, ELF32, ELF64, 32 and 64-bit Mach-O,
RDOFF2, COFF, Win32, and Win64 object formats, and generates source debugging
information in STABS, DWARF 2, and CodeView 8 formats.
2009-09-11 12:12:20 +00:00
|
|
|
end
|
|
|
|
end
|