homebrew-core/Formula/folly.rb
2017-11-20 03:17:44 -08: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.11.20.00.tar.gz"
sha256 "c65ceea74b0b3f895fe3999484145c10c721e4ee8601d58d3b592f8db10d3318"
head "https://github.com/facebook/folly.git"
bottle do
cellar :any
sha256 "0667068d5ce77c95e8ae2a1f578482aebd5de6b71b1a79cc5a07987eede0a318" => :high_sierra
sha256 "6be4c866c5e8fade3d3d3787a2adc6e8be2b20c2f1148865fec43c1deb99bfdb" => :sierra
sha256 "35ecb943cbeaf08ee7592df88ffecc9551ff5451650d77c41385610e71713f60" => :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