Attempt to update to libmongoc 1.13.1

pull/54/head
Thijs Cadier 6 years ago
parent 1539d8f3b8
commit 5fa7efea10

@ -30,8 +30,8 @@ brew install openssl@1.1
Export these env vars the before you make a clean build: Export these env vars the before you make a clean build:
``` ```
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib" export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include" export CPPFLAGS="-I/usr/local/opt/openssl/include"
``` ```
## Logging ## Logging

@ -1,6 +1,6 @@
[package] [package]
name = "mongoc-sys" name = "mongoc-sys"
version = "1.8.2-1" version = "1.13.1"
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"

@ -4,7 +4,6 @@ use std::env;
use std::path::Path; use std::path::Path;
use std::process::Command; use std::process::Command;
fn main() { fn main() {
let mongoc_version = env!("CARGO_PKG_VERSION") let mongoc_version = env!("CARGO_PKG_VERSION")
.split('-') .split('-')
@ -29,38 +28,27 @@ fn main() {
mongoc_version, mongoc_version,
mongoc_version mongoc_version
); );
assert!(
Command::new("curl").arg("-O") // Save to disk Command::new("curl").arg("-O") // Save to disk
.arg("-L") // Follow redirects .arg("-L") // Follow redirects
.arg(url) .arg(url)
.status() .status()
.expect("Could not run curl") .expect("Could not run curl");
.success()
);
let archive_name = format!("mongo-c-driver-{}.tar.gz", mongoc_version); let archive_name = format!("mongo-c-driver-{}.tar.gz", mongoc_version);
assert!(
Command::new("tar") Command::new("tar")
.arg("xzf") .arg("xzf")
.arg(&archive_name) .arg(&archive_name)
.status() .status()
.expect("Could not run tar") .expect("Could not unarchive tar");
.success()
);
// Configure and install // Configure
let mut command = Command::new("sh"); let mut command = Command::new("cmake");
command.arg("configure"); command.arg("");
command.arg("--enable-ssl=openssl"); command.arg("-DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF");
command.arg("--enable-sasl=no"); command.arg("-DENABLE_STATIC=ON");
command.arg("--enable-static=yes"); command.arg("-DENABLE_BSON=ON");
command.arg("--enable-shared=no"); command.arg("-DENABLE_SSL=openssl");
command.arg("--enable-shm-counters=no"); command.arg(format!("-DCMAKE_INSTALL_PREFIX:PATH={}", &out_dir));
command.arg("--with-libbson=bundled");
command.arg("--with-pic=yes");
command.arg("--with-snappy=no");
command.arg("--with-zlib=no");
command.arg(format!("--prefix={}", &out_dir));
command.current_dir(&driver_src_path); command.current_dir(&driver_src_path);
// Enable debug symbols if configured for this profile // Enable debug symbols if configured for this profile
@ -73,23 +61,16 @@ fn main() {
command.arg(format!("--build={}", target)); command.arg(format!("--build={}", target));
} }
assert!(command.status().expect("Could not run configure").success()); command.status().expect("cmake failed");
assert!(
Command::new("make") Command::new("make")
.current_dir(&driver_src_path) .current_dir(&driver_src_path)
.env("CFLAGS", "-DMONGOC_TRACE")
.status() .status()
.expect("Could not run make") .expect("Make failed");
.success()
);
assert!(
Command::new("make") Command::new("make")
.arg("install") .arg("install")
.current_dir(&driver_src_path) .current_dir(&driver_src_path)
.status() .status()
.expect("Could not run make install") .expect("make install failed");
.success()
);
} }
// Output to Cargo // Output to Cargo

Loading…
Cancel
Save