folly 0.47.0 (new formula)

Closes Homebrew/homebrew#40947.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
master
Mike Arpaia 2015-06-21 12:20:41 -04:00 committed by Dominyk Tiller
parent b3cd93dc07
commit 02eddb44b1
1 changed files with 46 additions and 0 deletions

46
Formula/folly.rb Normal file
View File

@ -0,0 +1,46 @@
class Folly < Formula
desc "A collection of reusable C++ library artifacts developed at Facebook"
homepage "https://github.com/facebook/folly"
url "https://github.com/facebook/folly/archive/v0.47.0.tar.gz"
sha256 "7d3309088cae1817d60996611e5fc0825c5c8df36d244f247c1d49ebc38c35fb"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "double-conversion"
depends_on "glog"
depends_on "gflags"
depends_on "boost"
depends_on "libevent"
needs :cxx11
depends_on :macos => :mavericks
def install
ENV.cxx11
cd "folly" do
system "autoreconf", "-i"
system "./configure", "--prefix=#{prefix}"
system "make"
system "make", "install"
end
end
test do
(testpath/"test.cc").write <<-EOS.undent
#include <folly/FBVector.h>
int main() {
folly::fbvector<int> numbers({0, 1, 2, 3});
numbers.reserve(10);
for (int i = 4; i < 10; i++) {
numbers.push_back(i * 2);
}
assert(numbers[6] == 12);
return 0;
}
EOS
system ENV.cxx, "-std=c++11", "test.cc", "-L#{lib}", "-lfolly", "-o", "test"
system "./test"
end
end