Bump to 0.11, use pkg version in build of sys package

pull/38/merge
Thijs Cadier 7 years ago
parent b90a142d1e
commit ed49b0067e

@ -1,3 +1,7 @@
# 0.11.0
* Update bson dependency to 0.10
* Use installed libmongoc if it right version is present on the system (thanks to Matrix-Zhang)
# 0.10.0
* Initial upgrade to mongo c driver 1.8.0, no support for new features yet

@ -1,6 +1,6 @@
[package]
name = "mongo_driver"
version = "0.10.0"
version = "0.11.0"
authors = ["Thijs Cadier <thijs@appsignal.com>"]
description = "Mongo Rust driver built on top of the Mongo C driver"
readme = "README.md"
@ -25,7 +25,7 @@ bson = "^0.10"
[dependencies.mongoc-sys]
path = "mongoc-sys"
version = "1.8.0"
version = "1.8.0-0"
[dev-dependencies]
chrono = "^0.4"

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

@ -4,26 +4,30 @@ use std::env;
use std::path::Path;
use std::process::Command;
static VERSION: &'static str = "1.8.0"; // Should be the same major version as in the manifest
fn main() {
let mongoc_version = env!("CARGO_PKG_VERSION")
.split('-')
.next()
.expect("Crate version is not valid");
if pkg_config::Config::new()
.atleast_version(VERSION)
.atleast_version(mongoc_version)
.statik(true)
.probe("libmongoc-1.0")
.is_err()
{
let out_dir_var = env::var("OUT_DIR").expect("No out dir");
let out_dir = format!("{}/{}", out_dir_var, VERSION);
let driver_src_path = format!("mongo-c-driver-{}", VERSION);
let out_dir = format!("{}/{}", out_dir_var, mongoc_version);
let driver_src_path = format!("mongo-c-driver-{}", mongoc_version);
let libmongoc_path = Path::new(&out_dir).join("lib/libmongoc-1.0.a");
if !libmongoc_path.exists() {
// Download and extract driver archive
let url = format!(
"https://github.com/mongodb/mongo-c-driver/releases/download/{}/mongo-c-driver-{}.tar.gz",
VERSION,
VERSION
mongoc_version,
mongoc_version
);
assert!(
Command::new("curl").arg("-O") // Save to disk
@ -34,7 +38,7 @@ fn main() {
.success()
);
let archive_name = format!("mongo-c-driver-{}.tar.gz", VERSION);
let archive_name = format!("mongo-c-driver-{}.tar.gz", mongoc_version);
assert!(
Command::new("tar")
.arg("xzf")

Loading…
Cancel
Save