Author: Emilio Pozuelo Monfort <pochu@debian.org>

Use vendored libgit

--- a/vendor/libgit2-sys/build.rs
+++ b/vendor/libgit2-sys/build.rs
@@ -49,7 +49,7 @@ The build is now aborting. To disable, u
     }
 
     // To use zlib-ng in zlib-compat mode, we have to build libgit2 ourselves.
-    let try_to_use_system_libgit2 = !vendored && !zlib_ng_compat;
+    let try_to_use_system_libgit2 = false;
     if try_to_use_system_libgit2 && try_system_libgit2().is_ok() {
         // using system libgit2 has worked
         return;
@@ -90,8 +90,8 @@ The build is now aborting. To disable, u
     add_c_files(&mut cfg, "libgit2/src/libgit2/streams");
 
     // Always use bundled http-parser for now
-    cfg.include("libgit2/deps/http-parser")
-        .file("libgit2/deps/http-parser/http_parser.c");
+    //cfg.include("libgit2/deps/http-parser")
+    //    .file("libgit2/deps/http-parser/http_parser.c");
 
     // external/system xdiff is not yet supported
     cfg.include("libgit2/deps/xdiff");
@@ -104,7 +104,7 @@ The build is now aborting. To disable, u
     // reasons, just define on the command-line for everything. Perhaps there
     // is some way with cc to have different instructions per-file?
     cfg.define("GIT_REGEX_BUILTIN", "1")
-        .include("libgit2/deps/pcre")
+        //.include("libgit2/deps/pcre")
         .define("HAVE_STDINT_H", Some("1"))
         .define("HAVE_MEMMOVE", Some("1"))
         .define("NO_RECURSE", Some("1"))
@@ -118,7 +118,8 @@ The build is now aborting. To disable, u
         .define("MAX_NAME_COUNT", Some("10000"));
     // "no symbols" warning on pcre_string_utils.c is because it is only used
     // when when COMPILE_PCRE8 is not defined, which is the default.
-    add_c_files(&mut cfg, "libgit2/deps/pcre");
+    //add_c_files(&mut cfg, "libgit2/deps/pcre");
+    println!("cargo:rustc-link-lib=pcre");
 
     cfg.file("libgit2/src/util/allocators/failalloc.c");
     cfg.file("libgit2/src/util/allocators/stdalloc.c");
@@ -238,6 +239,8 @@ The build is now aborting. To disable, u
 
     println!("cargo:root={}", dst.display());
 
+    println!("cargo:rustc-link-lib=http_parser");
+
     if target.contains("windows") {
         println!("cargo:rustc-link-lib=winhttp");
         println!("cargo:rustc-link-lib=rpcrt4");
