67 lines
1.9 KiB
Ruby
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/v2018.07.23.00.tar.gz"
|
|
sha256 "9083153336efb7160fa8c38709968bd30716587a814bca8e5b53d97fa6e37f08"
|
|
head "https://github.com/facebook/folly.git"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "c43b2937f94bc3243c7eb0d3a6e8f42a1d4ad8fb1253082e94a199b6f9c071e0" => :high_sierra
|
|
sha256 "0eb67c0ff85b18ac31bfd7bbcfb655e9bd28b0966c2fec47c60139c61817300e" => :sierra
|
|
sha256 "9da90555a0ebd1c3485d3c53aa5e03f8a47dbf25a740924426dc120b8e620eee" => :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
|