2013-08-30 15:42:39 +00:00
|
|
|
class Hamsterdb < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Database for embedded devices"
|
2014-12-26 16:53:37 +00:00
|
|
|
homepage "http://hamsterdb.com"
|
2015-04-26 00:30:38 +00:00
|
|
|
url "http://files.hamsterdb.com/dl/hamsterdb-2.1.10.tar.gz"
|
|
|
|
sha256 "8fced5607847e234133b2baa379e7ff3d763ffa51546b27f1e3c5f1aef33493e"
|
|
|
|
|
|
|
|
head do
|
|
|
|
url "https://github.com/cruppstahl/hamsterdb.git"
|
|
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "libtool" => :build
|
|
|
|
end
|
2013-08-30 15:42:39 +00:00
|
|
|
|
2014-12-27 18:26:01 +00:00
|
|
|
bottle do
|
2015-04-26 20:19:02 +00:00
|
|
|
sha256 "27151089e42c383b22ddf599b0d9f42498e8b30564b8306f80ceab16ea79741f" => :yosemite
|
|
|
|
sha256 "ae81107767d2954c978573edc85e0b50b84ba1b829d016d5ca898ce64fdd1046" => :mavericks
|
|
|
|
sha256 "5c2645a8d1f51613bfa0aa05f1045836f5b0117d674af297878ca5e78bb136a6" => :mountain_lion
|
2014-12-27 18:26:01 +00:00
|
|
|
end
|
|
|
|
|
2014-12-26 16:53:37 +00:00
|
|
|
option "without-java", "Do not build the Java wrapper"
|
|
|
|
option "without-remote", "Disable access to remote databases"
|
2013-09-15 19:57:10 +00:00
|
|
|
|
2014-12-26 16:53:37 +00:00
|
|
|
depends_on "boost"
|
|
|
|
depends_on "gnutls"
|
2015-02-24 05:27:54 +00:00
|
|
|
depends_on :java => :recommended
|
2014-12-26 16:53:37 +00:00
|
|
|
depends_on "protobuf" if build.with? "remote"
|
|
|
|
|
|
|
|
resource "libuv" do
|
2015-04-26 00:30:38 +00:00
|
|
|
url "https://github.com/libuv/libuv/archive/v0.10.36.tar.gz"
|
|
|
|
sha256 "421087044cab642f038c190f180d96d6a1157be89adb4630881930495b8f5228"
|
2014-07-19 03:36:50 +00:00
|
|
|
end
|
|
|
|
|
2014-12-26 16:53:37 +00:00
|
|
|
fails_with :clang do
|
|
|
|
build 503
|
2015-04-26 00:30:38 +00:00
|
|
|
cause "error: member access into incomplete type 'const std::type_info"
|
|
|
|
end
|
|
|
|
fails_with :llvm do
|
|
|
|
build 2336
|
|
|
|
cause "error: forward declaration of 'const struct std::type_info'"
|
2013-08-30 15:42:39 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
2015-04-26 00:30:38 +00:00
|
|
|
system "./bootstrap.sh" if build.head?
|
2013-08-30 15:42:39 +00:00
|
|
|
|
2015-04-26 00:30:38 +00:00
|
|
|
args = %W[
|
|
|
|
--disable-debug
|
|
|
|
--disable-dependency-tracking
|
|
|
|
--prefix=#{prefix}
|
|
|
|
]
|
2013-08-30 15:42:39 +00:00
|
|
|
|
2014-12-26 16:53:37 +00:00
|
|
|
if build.with? "java"
|
2015-04-26 00:30:38 +00:00
|
|
|
args << "JDK=#{ENV["JAVA_HOME"]}"
|
2013-09-15 19:57:10 +00:00
|
|
|
else
|
2015-04-26 00:30:38 +00:00
|
|
|
args << "--disable-java"
|
2014-12-26 16:53:37 +00:00
|
|
|
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
|
2015-04-26 00:30:38 +00:00
|
|
|
args << "--disable-remote"
|
2013-09-15 19:57:10 +00:00
|
|
|
end
|
|
|
|
|
2015-04-26 00:30:38 +00:00
|
|
|
system "./configure", *args
|
2013-08-30 15:42:39 +00:00
|
|
|
system "make", "install"
|
2015-04-26 00:30:38 +00:00
|
|
|
|
|
|
|
share.install "samples"
|
2013-08-30 15:42:39 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2015-04-26 00:30:38 +00:00
|
|
|
system bin/"ham_info", "-h"
|
|
|
|
system ENV.cc, "-I#{include}", "-L#{lib}", "-lhamsterdb",
|
|
|
|
share/"samples/db1.c", "-o", "test"
|
|
|
|
system "./test"
|
2013-08-30 15:42:39 +00:00
|
|
|
end
|
|
|
|
end
|