diff options
| author | Birger J. Nordølum | 2012-03-30 16:16:53 +0200 |
|---|---|---|
| committer | Jack Nagel | 2012-04-26 21:39:11 -0500 |
| commit | 557387b7a3d55952d4beb941bc11ecd98ca97882 (patch) | |
| tree | da8e66ad2a8bca68c971969c9dfb5c8baf5372d0 /Library | |
| parent | 025522f5802b417d2508b046764906be82d336f1 (diff) | |
| download | homebrew-557387b7a3d55952d4beb941bc11ecd98ca97882.tar.bz2 | |
yasm: add head and optional python bindings
Added option for --HEAD and --enable-python.
Closes #11314.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/yasm.rb | 46 |
1 files changed, 41 insertions, 5 deletions
diff --git a/Library/Formula/yasm.rb b/Library/Formula/yasm.rb index 527cc8d06..07b5da792 100644 --- a/Library/Formula/yasm.rb +++ b/Library/Formula/yasm.rb @@ -1,12 +1,48 @@ require 'formula' class Yasm < Formula - url 'http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz' - homepage 'http://www.tortall.net/projects/yasm/' - md5 '4cfc0686cf5350dd1305c4d905eb55a6' + 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' + depends_on 'automake' => :build if MacOS.xcode_version.to_f >= 4.3 + end + + depends_on 'Cython' => :python if ARGV.include? '--enable-python' def install - system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking" - system "make install" + args = %W[--prefix=#{prefix} --disable-debug] + + if ARGV.include? '--enable-python' + args << '--enable-python' + args << '--enable-python-bindings' + end + + 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 end end |
