mongo-c-driver 1.10.0

depend on cmake at build time
remove Autotools dependencies

Closes #28103.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
This commit is contained in:
ilovezfs 2018-05-21 21:52:34 -07:00
parent 16d228e82e
commit 27fa38cdef

View file

@ -1,8 +1,8 @@
class MongoCDriver < Formula
desc "C driver for MongoDB"
homepage "https://github.com/mongodb/mongo-c-driver"
url "https://github.com/mongodb/mongo-c-driver/releases/download/1.9.5/mongo-c-driver-1.9.5.tar.gz"
sha256 "4a4bd0b0375450250a3da50c050b84b9ba8950ce32e16555714e75ebae0b8019"
url "https://github.com/mongodb/mongo-c-driver/releases/download/1.10.0/mongo-c-driver-1.10.0.tar.gz"
sha256 "65bec96b37333046679252d607a6bde7629854356f9a314666392a1d809abf12"
bottle do
cellar :any
@ -11,29 +11,15 @@ class MongoCDriver < Formula
sha256 "fb9688c0c130589d978caf63b4cc9943d2c288a0a3ee1240a4601ad243127037" => :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 "sphinx-doc" => :build
def install
system "autoreconf", "-fiv"
args = %W[
--disable-debug
--disable-dependency-tracking
--disable-silent-rules
--prefix=#{prefix}
--enable-man-pages
--with-libbson=bundled
--enable-ssl=darwin
]
system "./configure", *args
system "cmake", ".", *std_cmake_args
system "make", "install"
(pkgshare/"libbson").install "src/libbson/examples"
(pkgshare/"mongoc").install "examples"
(pkgshare/"libmongoc").install "src/libmongoc/examples"
end
test do
@ -42,7 +28,7 @@ class MongoCDriver < Formula
(testpath/"test.json").write('{"name": "test"}')
assert_match "\u0000test\u0000", shell_output("./test test.json")
system ENV.cc, "-o", "test", pkgshare/"mongoc/examples/mongoc-ping.c",
system ENV.cc, "-o", "test", pkgshare/"libmongoc/examples/mongoc-ping.c",
"-I#{include}/libmongoc-1.0", "-I#{include}/libbson-1.0",
"-L#{lib}", "-lmongoc-1.0", "-lbson-1.0"
assert_match "No suitable servers", shell_output("./test mongodb://0.0.0.0 2>&1", 3)