From 4d2b77171cf7001a4fc5821031e029ab10e4bba9 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 12 Jan 2016 14:31:18 -0800 Subject: [PATCH] Don't use pkg-config to learn about libgit2 deps 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 --- libgit2-sys/build.rs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/libgit2-sys/build.rs b/libgit2-sys/build.rs index dc7ec9d14e..c1b2a91e0b 100644 --- a/libgit2-sys/build.rs +++ b/libgit2-sys/build.rs @@ -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") {