homebrew-core/Formula/libcouchbase.rb
2015-02-16 23:07:19 -05:00

50 lines
1.5 KiB
Ruby

class Libcouchbase < Formula
homepage 'http://docs.couchbase.com/developer/c-2.4/c-intro.html'
url 'http://packages.couchbase.com/clients/c/libcouchbase-2.4.7.tar.gz'
sha1 '62c68ccc269099cdc1fd624324107131347aad45'
head "https://github.com/couchbase/libcouchbase", :using => :git
bottle do
sha1 "796da9a16f9fa8ec0cdf57cb372f7c6f7375ef50" => :yosemite
sha1 "5f6912141e3147fc9f14fae0d28da7bbcec71c37" => :mavericks
sha1 "3a8ca2387248b127802a16ff0b575154a414e4d4" => :mountain_lion
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