blob: a889dee0ae476677f4ce8f3f66bdc302ffaa0e78 (
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
 | class Hamsterdb < Formula
  homepage "http://hamsterdb.com"
  url "http://files.hamsterdb.com/dl/hamsterdb-2.1.9.tar.gz"
  sha1 "036817e4ccc9c4b23affb987c149ebd04696f1d0"
  bottle do
    cellar :any
    sha1 "b4b9b5642f17f3fd22f435309c6bfdb3eb4be13a" => :yosemite
    sha1 "d8766c2c04563e2e471bed85e43945bcd402c4dc" => :mavericks
    sha1 "f08ff2613c4caaba89d21d8bb3ddc5be332847c1" => :mountain_lion
  end
  option "without-java", "Do not build the Java wrapper"
  option "without-remote", "Disable access to remote databases"
  head do
    url "https://github.com/cruppstahl/hamsterdb.git"
    depends_on "autoconf" => :build
    depends_on "automake" => :build
    depends_on "libtool" => :build
  end
  depends_on "boost"
  depends_on "gnutls"
  depends_on :java => :recommended
  depends_on "protobuf" if build.with? "remote"
  resource "libuv" do
    url "https://github.com/libuv/libuv/archive/v0.10.31.tar.gz"
    sha1 "9ab8ecb10f90ce13404ff58ff85cb774472e2cb9"
  end
  stable do
    # patch upstream commits:
    # https://github.com/cruppstahl/hamsterdb/commit/6a8dd20ec9bd2ec718d1136db7667e0e58911003
    # https://github.com/cruppstahl/hamsterdb/commit/1447ba4eb217532e8fb49c4a84a0dc3b982a3ffe
    patch do
      url "https://gist.githubusercontent.com/xu-cheng/0d5fa0b6b81426f68271/raw/47ff326c43a1865cda8e9fa9d00434c68efa7e13/hamsterdb.diff"
      sha1 "e83346c3afc92d6450ceef1c34adce1a515b245e"
    end
  end
  fails_with :clang do
    build 503
    cause "error: member access into incomplete type 'const std::type_info'"
  end
  def install
    system "/bin/sh", "bootstrap.sh" if build.head?
    features = []
    if build.with? "java"
      features << "JDK=#{ENV["JAVA_HOME"]}"
    else
      features << "--disable-java"
    end
    if build.with? "remote"
      resource("libuv").stage do
        system "make", "libuv.dylib"
        (libexec/"libuv/lib").install "libuv.dylib"
        (libexec/"libuv").install "include"
      end
      ENV.prepend "LDFLAGS", "-L#{libexec}/libuv/lib"
      ENV.prepend "CFLAGS", "-I#{libexec}/libuv/include"
      ENV.prepend "CPPFLAGS", "-I#{libexec}/libuv/include"
    else
      features << "--disable-remote"
    end
    system "./configure", "--disable-debug", "--disable-dependency-tracking",
                          "--prefix=#{prefix}",
                          *features
    system "make", "install"
  end
  test do
    system "#{bin}/ham_info -h"
  end
end
 |