Bump mongo c driver to 1.8.0

pull/33/head
Thijs Cadier 7 years ago
parent e028d5f2d3
commit 5e1449df0d

@ -25,7 +25,7 @@ bson = "^0.9"
[dependencies.mongoc-sys] [dependencies.mongoc-sys]
path = "mongoc-sys" path = "mongoc-sys"
version = "1.6.4" version = "1.8.0"
[dev-dependencies] [dev-dependencies]
chrono = "^0.4" chrono = "^0.4"

@ -1,6 +1,6 @@
[package] [package]
name = "mongoc-sys" name = "mongoc-sys"
version = "1.6.4" version = "1.8.0"
description = "Sys package with installer and bindings for mongoc" description = "Sys package with installer and bindings for mongoc"
authors = ["Thijs Cadier <thijs@appsignal.com>"] authors = ["Thijs Cadier <thijs@appsignal.com>"]
build = "build.rs" build = "build.rs"

@ -2,10 +2,10 @@ use std::env;
use std::path::Path; use std::path::Path;
use std::process::Command; use std::process::Command;
static VERSION: &'static str = "1.6.3"; // Should be the same major version as in the manifest static VERSION: &'static str = "1.8.0"; // Should be the same major version as in the manifest
fn main() { fn main() {
let out_dir_var = env::var("OUT_DIR").unwrap(); let out_dir_var = env::var("OUT_DIR").expect("No out dir");
let out_dir = format!("{}/{}", out_dir_var, VERSION); let out_dir = format!("{}/{}", out_dir_var, VERSION);
let driver_src_path = format!("mongo-c-driver-{}", VERSION); let driver_src_path = format!("mongo-c-driver-{}", VERSION);
@ -21,7 +21,7 @@ fn main() {
.arg("-L") // Follow redirects .arg("-L") // Follow redirects
.arg(url) .arg(url)
.status() .status()
.unwrap() .expect("Could not run curl")
.success()); .success());
let archive_name = format!( let archive_name = format!(
@ -31,7 +31,7 @@ fn main() {
assert!(Command::new("tar").arg("xzf") assert!(Command::new("tar").arg("xzf")
.arg(&archive_name) .arg(&archive_name)
.status() .status()
.unwrap() .expect("Could not run tar")
.success()); .success());
// Configure and install // Configure and install
@ -44,6 +44,8 @@ fn main() {
command.arg("--enable-shm-counters=no"); command.arg("--enable-shm-counters=no");
command.arg("--with-libbson=bundled"); command.arg("--with-libbson=bundled");
command.arg("--with-pic=yes"); command.arg("--with-pic=yes");
command.arg("--with-snappy=no");
command.arg("--with-zlib=no");
command.arg(format!("--prefix={}", &out_dir)); command.arg(format!("--prefix={}", &out_dir));
command.current_dir(&driver_src_path); command.current_dir(&driver_src_path);
@ -57,18 +59,18 @@ fn main() {
command.arg(format!("--build={}", target)); command.arg(format!("--build={}", target));
} }
assert!(command.status().unwrap().success()); assert!(command.status().expect("Could not run configure").success());
assert!(Command::new("make"). assert!(Command::new("make").
current_dir(&driver_src_path). current_dir(&driver_src_path).
env("CFLAGS", "-DMONGOC_TRACE"). env("CFLAGS", "-DMONGOC_TRACE").
status(). status().
unwrap(). expect("Could not run make").
success()); success());
assert!(Command::new("make"). assert!(Command::new("make").
arg("install"). arg("install").
current_dir(&driver_src_path). current_dir(&driver_src_path).
status(). status().
unwrap(). expect("Could not run make install").
success()); success());
} }

Loading…
Cancel
Save