mongo-cxx-driver: rename from libmongoclient, cleanup.
Closes #7352. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
90ea2367d2
commit
8ebbece488
4 changed files with 48 additions and 52 deletions
1
Aliases/libmongoclient
Symbolic link
1
Aliases/libmongoclient
Symbolic link
|
@ -0,0 +1 @@
|
|||
../Formula/mongo-cxx-driver.rb
|
|
@ -1,52 +0,0 @@
|
|||
class Libmongoclient < Formula
|
||||
desc "C and C++ driver for MongoDB"
|
||||
homepage "https://www.mongodb.org"
|
||||
url "https://github.com/mongodb/mongo-cxx-driver/archive/legacy-0.0-26compat-2.6.12.tar.gz"
|
||||
sha256 "e4245210a8fdc9282b1d48eae6ef7448557f9e325b7d1d5c3ac9ba89120839ab"
|
||||
head "https://github.com/mongodb/mongo-cxx-driver.git", :branch => "26compat"
|
||||
|
||||
bottle do
|
||||
sha256 "4907896f59be2159c14c5d113e7bd5aed8bd5e53b9b8d9f8bfc033179e3f15a4" => :sierra
|
||||
sha256 "52a5b6ac0764be74eea200b9e3012982622762cc2f45e31896819750b1fa4a8d" => :el_capitan
|
||||
sha256 "b86a75b625b28a5378c23678a0d02d42b0bfeb01f64d16a7eee111bfa97284b0" => :yosemite
|
||||
end
|
||||
|
||||
option :cxx11
|
||||
|
||||
depends_on "scons" => :build
|
||||
|
||||
if build.cxx11?
|
||||
depends_on "boost" => "c++11"
|
||||
else
|
||||
depends_on "boost"
|
||||
end
|
||||
|
||||
def install
|
||||
ENV.cxx11 if build.cxx11?
|
||||
|
||||
args = %W[
|
||||
--prefix=#{prefix}
|
||||
-j#{ENV.make_jobs}
|
||||
--cc=#{ENV.cc}
|
||||
--cxx=#{ENV.cxx}
|
||||
--extrapath=#{Formula["boost"].opt_prefix}
|
||||
--full
|
||||
--use-system-all
|
||||
--sharedclient
|
||||
]
|
||||
|
||||
# --osx-version-min is required to override --osx-version-min=10.6 added
|
||||
# by SConstruct which causes "invalid deployment target for -stdlib=libc++"
|
||||
# when using libc++
|
||||
if MacOS.version >= :sierra
|
||||
# no 10.12; reported 4 Oct 2016 https://jira.mongodb.org/browse/CXX-1067
|
||||
args << "--osx-version-min=10.11"
|
||||
else
|
||||
args << "--osx-version-min=#{MacOS.version}"
|
||||
end
|
||||
|
||||
args << "--libc++" if MacOS.version >= :mavericks
|
||||
|
||||
scons *args
|
||||
end
|
||||
end
|
46
Formula/mongo-cxx-driver.rb
Normal file
46
Formula/mongo-cxx-driver.rb
Normal file
|
@ -0,0 +1,46 @@
|
|||
class MongoCxxDriver < Formula
|
||||
desc "C++ driver for MongoDB"
|
||||
homepage "https://github.com/mongodb/mongo-cxx-driver"
|
||||
url "https://github.com/mongodb/mongo-cxx-driver/archive/r3.0.3.tar.gz"
|
||||
sha256 "297957788ed6f8d32ff05cf1a92f022aa4e3cd4398b0c2a0d4a2434363fbde6d"
|
||||
head "https://github.com/mongodb/mongo-cxx-driver.git"
|
||||
|
||||
bottle do
|
||||
sha256 "4907896f59be2159c14c5d113e7bd5aed8bd5e53b9b8d9f8bfc033179e3f15a4" => :sierra
|
||||
sha256 "52a5b6ac0764be74eea200b9e3012982622762cc2f45e31896819750b1fa4a8d" => :el_capitan
|
||||
sha256 "b86a75b625b28a5378c23678a0d02d42b0bfeb01f64d16a7eee111bfa97284b0" => :yosemite
|
||||
end
|
||||
|
||||
needs :cxx11
|
||||
|
||||
depends_on "cmake" => :build
|
||||
depends_on "mongo-c-driver"
|
||||
|
||||
def install
|
||||
mongo_c_prefix = Formula["mongo-c-driver"].opt_prefix
|
||||
system "cmake", ".", *std_cmake_args,
|
||||
"-DLIBBSON_DIR=#{mongo_c_prefix}", "-DLIBMONGOC_DIR=#{mongo_c_prefix}"
|
||||
system "make"
|
||||
system "make", "install"
|
||||
pkgshare.install "examples"
|
||||
end
|
||||
|
||||
test do
|
||||
mongo_c_include = Formula["mongo-c-driver"]
|
||||
|
||||
system ENV.cc, "-o", "test", pkgshare/"examples/bsoncxx/builder_basic.cpp",
|
||||
"-I#{include}/bsoncxx/v_noabi",
|
||||
"-I#{mongo_c_include}/libbson-1.0",
|
||||
"-L#{lib}", "-lbsoncxx", "-std=c++11", "-lstdc++"
|
||||
system "./test"
|
||||
|
||||
system ENV.cc, "-o", "test", pkgshare/"examples/mongocxx/connect.cpp",
|
||||
"-I#{include}/mongocxx/v_noabi",
|
||||
"-I#{include}/bsoncxx/v_noabi",
|
||||
"-I#{mongo_c_include}/libmongoc-1.0",
|
||||
"-I#{mongo_c_include}/libbson-1.0",
|
||||
"-L#{lib}", "-lmongocxx", "-lbsoncxx", "-std=c++11", "-lstdc++"
|
||||
assert_match "No suitable servers",
|
||||
shell_output("./test mongodb://0.0.0.0 2>&1", 1)
|
||||
end
|
||||
end
|
|
@ -20,6 +20,7 @@
|
|||
"juju": "juju@1.25",
|
||||
"letsencrypt": "certbot",
|
||||
"libcppa": "caf",
|
||||
"libmongoclient": "mongo-cxx-driver",
|
||||
"mongo-c": "mongo-c-driver",
|
||||
"mpich2": "mpich",
|
||||
"nimrod": "nim",
|
||||
|
|
Loading…
Reference in a new issue