blob: 8077cf8b49a996fa3fa267e9c075f41a8cc9cc11 (
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
  | 
require 'formula'
class Luabind < Formula
  homepage 'http://www.rasterbar.com/products/luabind.html'
  url 'https://downloads.sourceforge.net/project/luabind/luabind/0.9.1/luabind-0.9.1.tar.gz'
  sha1 '2e92a18b8156d2e2948951d429cd3482e7347550'
  depends_on 'lua'
  depends_on 'boost'
  depends_on 'boost-build' => :build
  # patch Jamroot to perform lookup for shared objects with .dylib suffix
  patch do
    url "https://gist.githubusercontent.com/DennisOSRM/3728987/raw/052251fcdc23602770f6c543be9b3e12f0cac50a/Jamroot.diff"
    sha1 "5e7660e00e4189e42b8d79fbd2d6da21feb2259b"
  end
  # apply upstream commit to enable building with clang
  patch do
    url "https://github.com/luabind/luabind/commit/3044a9053ac50977684a75c4af42b2bddb853fad.diff"
    sha1 "49ecf2060a691abcdf4b3e07f1de450a2858f14f"
  end
  # include C header that is not pulled in automatically on OS X 10.9 anymore
  # submitted https://github.com/luabind/luabind/pull/20
  patch do
    url "https://gist.githubusercontent.com/DennisOSRM/a246514bf7d01631dda8/raw/0e83503dbf862ebfb6ac063338a6d7bca793f94d/object_rep.diff"
    sha1 "482693598edcde3d4c04fef3dfa35ea23f8e6bb4"
  end if MacOS.version >= :mavericks
  def install
    ENV["LUA_PATH"] = Formula["lua"].opt_prefix
    args = [
      "release",
      "install",
    ]
    if ENV.compiler == :clang
      args << "--toolset=clang"
    elsif ENV.compiler == :llvm
      args << "--toolset=llvm"
    elsif ENV.compiler == :gcc
      args << "--toolset=darwin"
    end
    args << "--prefix=#{prefix}"
    system "bjam", *args
  end
end
  |