Skip to content

Commit

Permalink
Don't use pkg-config to learn about libgit2 deps
Browse files Browse the repository at this point in the history
This doesn't work on windows, doesn't work on cross compiles, is a little flaky
in distributions for linking statically, and we need to already do weird things
to not mention libssh2.

Let's keep track of dependencies manually ourselves and express them via the
crates.io resolution graph
  • Loading branch information
alexcrichton committed Jan 12, 2016
1 parent a75b167 commit 4d2b771
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions libgit2-sys/build.rs
Expand Up @@ -105,20 +105,6 @@ fn main() {
return
}

if env::var("HOST") == env::var("TARGET") {
// libssh2 is linked in elsehwere, don't want it reported via pkg-config
let pc = dst.join("lib/pkgconfig/libgit2.pc");
let mut contents = String::new();
t!(t!(File::open(&pc)).read_to_string(&mut contents));
let contents = contents.replace(" -lssh2 ", " ");
t!(t!(File::create(&pc)).write_all(contents.as_bytes()));

prepend("PKG_CONFIG_PATH", dst.join("lib/pkgconfig"));
if pkg_config::Config::new().statik(true).find("libgit2").is_ok() {
return
}
}

println!("cargo:rustc-link-lib=static=git2");
println!("cargo:rustc-link-search=native={}", dst.join("lib").display());
if target.contains("apple") {
Expand Down

0 comments on commit 4d2b771

Please sign in to comment.