homebrew-core/Formula/folly.rb
2018-04-17 03:38:32 -07:00

68 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/v2018.04.16.00.tar.gz"
sha256 "f24adaf8a63fe5e872d4021f7e9110a49843296059a705348a70b80a87c63adc"
revision 1
head "https://github.com/facebook/folly.git"
bottle do
cellar :any
sha256 "b1637ea30473ac1bfaebdf3cf4a62c653102377150afb308a420f6a03f20b3ce" => :high_sierra
sha256 "3124aea0492817daf4e6ff3af387e3514d80a92f4f7a40f933a56898d428ad89" => :sierra
sha256 "d755baaa82eece094d6a001a378f3da1562a1af29b07ee2cc0e5ea78d08f94cb" => :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
#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