homebrew-core/Formula/libcouchbase.rb
2016-01-14 01:21:16 +01:00

51 lines
1.6 KiB
Ruby

class Libcouchbase < Formula
desc "C library for Couchbase"
homepage "http://docs.couchbase.com/developer/c-2.4/c-intro.html"
url "https://s3.amazonaws.com/packages.couchbase.com/clients/c/libcouchbase-2.5.5.tar.gz"
sha256 "cc2fb1844107f20e7276b071d87a275b08d1813e229ab144016edfd13b4df5a9"
head "https://github.com/couchbase/libcouchbase.git"
bottle do
sha256 "cfd89ba55951629a3b8b54340c48ecbacc6ea3a2447b4cefceccbfb0bd78a2b9" => :el_capitan
sha256 "5d74a182a2129427bc2281b22be0b83289976d72cf62fba91976ea7e42d284d4" => :yosemite
sha256 "14496e839c28a369ad5328428331052431580a007fc18f83e74cfab9ee62832c" => :mavericks
end
option :universal
option "with-libev", "Build libev plugin"
option "without-libevent", "Do not build libevent plugin"
deprecated_option "with-libev-plugin" => "with-libev"
deprecated_option "without-libevent-plugin" => "without-libevent"
depends_on "libev" => :optional
depends_on "libuv" => :optional
depends_on "libevent" => :recommended
depends_on "openssl"
depends_on "cmake" => :build
def install
args = std_cmake_args
args << "-DLCB_NO_TESTS=1"
["libev", "libevent", "libuv"].each do |pname|
args << "-DLCB_BUILD_#{pname.upcase}=" + (build.with?("#{pname}") ? "ON" : "OFF")
end
if build.universal?
args << "-DLCB_UNIVERSAL_BINARY=1"
ENV.universal_binary
end
if build.without?("libev") && build.without?("libuv") && build.without?("libevent")
args << "-DLCB_NO_PLUGINS=1"
end
mkdir "LCB-BUILD" do
system "cmake", "..", *args
system "make", "install"
end
end
test do
system "#{bin}/cbc", "version"
end
end