folly: switch to cmake

Fixes #31959.

Closes #31966.

Signed-off-by: FX Coudert <fxcoudert@gmail.com>
This commit is contained in:
Chongyu Zhu 2018-09-11 13:42:24 +08:00 committed by FX Coudert
parent 8719cd1fc7
commit aea749f195

View file

@ -3,6 +3,7 @@ class Folly < Formula
homepage "https://github.com/facebook/folly"
url "https://github.com/facebook/folly/archive/v2018.09.10.00.tar.gz"
sha256 "86e58bb2642475abb1fd8608ef0d591892670ac7618b290875a8f48c34625f01"
revision 1
head "https://github.com/facebook/folly.git"
bottle do
@ -13,9 +14,7 @@ class Folly < Formula
sha256 "53a76921c9ee9a98638b972e5f6179a3acbe6233bc2276f14f3eb6062fdeea50" => :el_capitan
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "cmake" => :build
depends_on "pkg-config" => :build
depends_on "double-conversion"
depends_on "glog"
@ -39,12 +38,23 @@ class Folly < Formula
def install
ENV.cxx11
cd "folly" do
system "autoreconf", "-fvi"
system "./configure", "--prefix=#{prefix}", "--disable-silent-rules",
"--disable-dependency-tracking"
mkdir "_build" do
args = std_cmake_args + %w[
-DFOLLY_USE_JEMALLOC=OFF
]
# Upstream issue 10 Jun 2018 "Build fails on macOS Sierra"
# See https://github.com/facebook/folly/issues/864
args << "-DCOMPILER_HAS_F_ALIGNED_NEW=OFF" if MacOS.version == :sierra
system "cmake", "..", *args, "-DBUILD_SHARED_LIBS=ON"
system "make"
system "make", "install"
system "make", "clean"
system "cmake", "..", *args, "-DBUILD_SHARED_LIBS=OFF"
system "make"
lib.install "libfolly.a", "folly/libfollybenchmark.a"
end
end