From 5fa7efea103cc92880ee360ec8d9bc89211f6026 Mon Sep 17 00:00:00 2001 From: Thijs Cadier Date: Wed, 30 Jan 2019 20:08:37 +0100 Subject: [PATCH] Attempt to update to libmongoc 1.13.1 --- README.md | 4 +-- mongoc-sys/Cargo.toml | 2 +- mongoc-sys/build.rs | 75 ++++++++++++++++--------------------------- 3 files changed, 31 insertions(+), 50 deletions(-) diff --git a/README.md b/README.md index 9091bd0..5ac511d 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,8 @@ brew install openssl@1.1 Export these env vars the before you make a clean build: ``` -export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib" -export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include" +export LDFLAGS="-L/usr/local/opt/openssl/lib" +export CPPFLAGS="-I/usr/local/opt/openssl/include" ``` ## Logging diff --git a/mongoc-sys/Cargo.toml b/mongoc-sys/Cargo.toml index f9a4046..409a895 100644 --- a/mongoc-sys/Cargo.toml +++ b/mongoc-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mongoc-sys" -version = "1.8.2-1" +version = "1.13.1" description = "Sys package with installer and bindings for mongoc" authors = ["Thijs Cadier "] build = "build.rs" diff --git a/mongoc-sys/build.rs b/mongoc-sys/build.rs index a57ccae..0bb2a92 100644 --- a/mongoc-sys/build.rs +++ b/mongoc-sys/build.rs @@ -4,7 +4,6 @@ use std::env; use std::path::Path; use std::process::Command; - fn main() { let mongoc_version = env!("CARGO_PKG_VERSION") .split('-') @@ -29,38 +28,27 @@ fn main() { mongoc_version, mongoc_version ); - assert!( - Command::new("curl").arg("-O") // Save to disk - .arg("-L") // Follow redirects - .arg(url) - .status() - .expect("Could not run curl") - .success() - ); + Command::new("curl").arg("-O") // Save to disk + .arg("-L") // Follow redirects + .arg(url) + .status() + .expect("Could not run curl"); let archive_name = format!("mongo-c-driver-{}.tar.gz", mongoc_version); - assert!( - Command::new("tar") - .arg("xzf") - .arg(&archive_name) - .status() - .expect("Could not run tar") - .success() - ); + Command::new("tar") + .arg("xzf") + .arg(&archive_name) + .status() + .expect("Could not unarchive tar"); - // Configure and install - let mut command = Command::new("sh"); - command.arg("configure"); - command.arg("--enable-ssl=openssl"); - command.arg("--enable-sasl=no"); - command.arg("--enable-static=yes"); - command.arg("--enable-shared=no"); - command.arg("--enable-shm-counters=no"); - 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)); + // Configure + let mut command = Command::new("cmake"); + command.arg(""); + command.arg("-DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF"); + command.arg("-DENABLE_STATIC=ON"); + command.arg("-DENABLE_BSON=ON"); + command.arg("-DENABLE_SSL=openssl"); + command.arg(format!("-DCMAKE_INSTALL_PREFIX:PATH={}", &out_dir)); command.current_dir(&driver_src_path); // Enable debug symbols if configured for this profile @@ -73,23 +61,16 @@ fn main() { command.arg(format!("--build={}", target)); } - assert!(command.status().expect("Could not run configure").success()); - assert!( - Command::new("make") - .current_dir(&driver_src_path) - .env("CFLAGS", "-DMONGOC_TRACE") - .status() - .expect("Could not run make") - .success() - ); - assert!( - Command::new("make") - .arg("install") - .current_dir(&driver_src_path) - .status() - .expect("Could not run make install") - .success() - ); + command.status().expect("cmake failed"); + Command::new("make") + .current_dir(&driver_src_path) + .status() + .expect("Make failed"); + Command::new("make") + .arg("install") + .current_dir(&driver_src_path) + .status() + .expect("make install failed"); } // Output to Cargo