use-vendored-libgit
authorEmilio Pozuelo Monfort <pochu@debian.org>
Wed, 28 Aug 2024 14:44:23 +0000 (16:44 +0200)
committerEmilio Pozuelo Monfort <pochu@debian.org>
Wed, 28 Aug 2024 14:44:23 +0000 (16:44 +0200)
Use vendored libgit

Gbp-Pq: Topic vendor
Gbp-Pq: Name use-vendored-libgit.patch

vendor/libgit2-sys/build.rs

index 88fce00d6e987059aeaaad8851ff9a7212eb0e6c..671afdc0ddeee0092cd53a0f764d5ca4f80d05be 100644 (file)
@@ -49,7 +49,7 @@ The build is now aborting. To disable, unset the variable or use `LIBGIT2_NO_VEN
     }
 
     // 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, unset the variable or use `LIBGIT2_NO_VEN
     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, unset the variable or use `LIBGIT2_NO_VEN
     // 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, unset the variable or use `LIBGIT2_NO_VEN
         .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, unset the variable or use `LIBGIT2_NO_VEN
 
     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");