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

class Libplist < Formula
  homepage 'http://cgit.sukimashita.com/libplist.git/'
  url 'http://cgit.sukimashita.com/libplist.git/snapshot/libplist-1.10.tar.bz2'
  sha1 'a642bb37eaa4bec428d0b2a4fa8399d80ee73a18'

  head 'http://git.sukimashita.com/libplist.git'

  bottle do
    cellar :any
    sha1 "65760247ede6c7a4ea469ebf823f146c244b303a" => :mavericks
    sha1 "fbb4c635fa731899b746e94984e29d1cb8d1b971" => :mountain_lion
    sha1 "8cd023361cea5865fd8e523b2db5f4b643c73b1c" => :lion
  end

  # Improve the default option descr. generated by `depends_on :python => :optional`
  option 'with-python', 'Enable Cython Python bindings'

  depends_on 'cmake' => :build
  depends_on :python => :optional
  depends_on 'Cython' => :python if build.with? 'python'

  # Upstream patch for compilation on 10.9
  patch do
    url "https://github.com/libimobiledevice/libplist/commit/c56c8103f51c20c6fcf99e8bc9d83c380f503a1b.diff"
    sha1 "fd9d0f4c15ee81ea589f826fd603281954f01df5"
  end

  def install
    ENV.deparallelize # make fails on an 8-core Mac Pro

    args = std_cmake_args

    # Disable Swig Python bindings
    args << "-DENABLE_SWIG='OFF'"

    # Also disable Cython Python bindings if we're not building --with-python
    args << "-DENABLE_CYTHON='OFF'" if build.without? 'python'

    system "cmake", ".", "-DCMAKE_INSTALL_NAME_DIR=#{lib}", *args
    system "make install"
  end
end