Skip to content

Commit

Permalink
Merge branch 'master' into feature/temp-output
Browse files Browse the repository at this point in the history
  • Loading branch information
HerrMuellerluedenscheid authored May 18, 2021
2 parents 5ec1d90 + f699d4b commit c22c846
Show file tree
Hide file tree
Showing 4 changed files with 131 additions and 93 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
**/*.rs.bk
/Cargo.lock
/src/libmseed

# pycharm
.idea
13 changes: 4 additions & 9 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@


extern crate git2;
extern crate bindgen;
extern crate git2;

use std::path::{Path, PathBuf};
use git2::Repository;
use std::env;
use std::path::{Path, PathBuf};
use std::process::Command;

const REPO_URL: &str = "https://github.com/iris-edu/libmseed";
Expand All @@ -15,7 +13,7 @@ const GIT_REF: &str = "refs/remotes/origin/2.x"; // libmseed v3 broke the ABI
fn fetch_libmseed(dir: &str) {
println!("fetching libmseed");
let repo = match Repository::clone(REPO_URL, dir) {
Ok( creepo ) => { creepo },
Ok(creepo) => creepo,
Err(e) => panic!("Failed to update/clone repo: {}", e),
};

Expand All @@ -33,7 +31,6 @@ fn make_libmseed(dir: &str) {
}

fn main() {

if !Path::new(BUILD_DIR).is_dir() {
fetch_libmseed(BUILD_DIR);
}
Expand All @@ -51,7 +48,7 @@ fn main() {
let path = env::current_dir().unwrap();
println!("The current directory is {}", path.display());

let path : PathBuf = [BUILD_DIR, "libmseed.h"].iter().collect();
let path: PathBuf = [BUILD_DIR, "libmseed.h"].iter().collect();
if !path.exists() {
panic!("libmseed header file: libmseed.h does not exist");
}
Expand All @@ -76,5 +73,3 @@ fn main() {
.write_to_file(out_path.join("bindings.rs"))
.expect("couldn't write bindings");
}


Loading

0 comments on commit c22c846

Please sign in to comment.