aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/yasm.rb
blob: 1519ac056effa702976266c63392de2e7006d1d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
require 'formula'

class Yasm < Formula
  homepage 'http://yasm.tortall.net/'
  url "http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz"
  sha256 "3dce6601b495f5b3d45b59f7d2492a340ee7e84b5beca17e48f862502bd5603f"

  bottle do
    cellar :any
    sha1 "d8d6f7e68d2d0ff8897a9b160e49c5cc4ad3f97d" => :mavericks
    sha1 "94596d8c7b99094001d3313624970070e7d8e920" => :mountain_lion
    sha1 "07116ee2758d99aed65a3aaf59a7f9cbb9a982a8" => :lion
  end

  head do
    url 'https://github.com/yasm/yasm.git'

    depends_on "autoconf" => :build
    depends_on "automake" => :build
    depends_on "gettext"
  end

  resource "cython" do
    url "http://cython.org/release/Cython-0.20.2.tar.gz"
    sha1 "e3fd4c32bdfa4a388cce9538417237172c656d55"
  end

  depends_on :python => :optional

  def install
    args = %W[
      --disable-debug
      --prefix=#{prefix}
    ]

    if build.with? "python"
      ENV.prepend_create_path "PYTHONPATH", buildpath+"lib/python2.7/site-packages"
      resource("cython").stage do
        system "python", "setup.py", "build", "install", "--prefix=#{buildpath}"
      end

      args << '--enable-python'
      args << '--enable-python-bindings'
    end

    # https://github.com/Homebrew/homebrew/pull/19593
    ENV.deparallelize

    system './autogen.sh' if build.head?
    system './configure', *args
    system 'make install'
  end
end