homebrew-core/Formula/folly.rb
2017-10-09 21:57:51 +00:00

67 lines
1.9 KiB
Ruby

class Folly < Formula
desc "Collection of reusable C++ library artifacts developed at Facebook"
homepage "https://github.com/facebook/folly"
url "https://github.com/facebook/folly/archive/v2017.10.09.00.tar.gz"
sha256 "b5667269c3c7d33b9a9feb860f4ed160f78e5cd46814cc69cd3c950df3d0e483"
head "https://github.com/facebook/folly.git"
bottle do
cellar :any
sha256 "c7bd70cc2cc10027fb22d88686f7f3e1a5900592daf39a7305f095389fb25c5a" => :high_sierra
sha256 "1cbcfcd4ce4da04cbeb3b99cd7084f767d8e5786e3f73a0d00a034768e08551c" => :sierra
sha256 "cc6f779834a1cc995d9c1ebb74efe9da54f4b1df22c2856d32c999113fd0b001" => :el_capitan
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "pkg-config" => :build
depends_on "double-conversion"
depends_on "glog"
depends_on "gflags"
depends_on "boost"
depends_on "libevent"
depends_on "xz"
depends_on "snappy"
depends_on "lz4"
depends_on "openssl"
# https://github.com/facebook/folly/issues/451
depends_on :macos => :el_capitan
needs :cxx11
# Known issue upstream. They're working on it:
# https://github.com/facebook/folly/pull/445
fails_with :gcc => "6"
def install
ENV.cxx11
cd "folly" do
system "autoreconf", "-fvi"
system "./configure", "--prefix=#{prefix}", "--disable-silent-rules",
"--disable-dependency-tracking"
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", "-I#{include}", "-L#{lib}",
"-lfolly", "-o", "test"
system "./test"
end
end