aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/yajl.rb
blob: d88b3d67e1225ecc8bdf4720a8d73d42b2b2c1b7 (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
require 'formula'

class Yajl < Formula
  homepage 'http://lloyd.github.io/yajl/'
  url 'https://github.com/lloyd/yajl/archive/2.1.0.tar.gz'
  sha256 '3fb73364a5a30efe615046d07e6db9d09fd2b41c763c5f7d3bfb121cd5c5ac5a'

  bottle do
    cellar :any
    sha1 "418941bfd0684cf14ae0bebc65324e99b76a3aa4" => :mavericks
    sha1 "f59aa705d9324e1c4a47bbba7ba50b74b3649ca3" => :mountain_lion
    sha1 "1bea5088df669781cc1835a97ae991773ad7b36b" => :lion
  end

  # Configure uses cmake internally
  depends_on 'cmake' => :build

  def install
    ENV.deparallelize

    system "cmake", ".", *std_cmake_args
    system "make install"
    (include/'yajl').install Dir['src/api/*.h']
  end

  test do
    output = pipe_output("#{bin}/json_verify", "[0,1,2,3]").strip
    assert_equal "JSON is valid", output
  end
end