Blob Blame History Raw
From b2a2a074e167993e5ece5219db410be24eea5cef Mon Sep 17 00:00:00 2001
From: Fabio Valentini <decathorpe@gmail.com>
Date: Mon, 29 May 2023 22:43:19 +0200
Subject: [PATCH] build with vendored libgit2 unconditionally

---
 build.rs | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/build.rs b/build.rs
index e888b94..a3ea132 100644
--- a/build.rs
+++ b/build.rs
@@ -10,24 +10,6 @@ fn main() {
     let vendored = env::var("CARGO_FEATURE_VENDORED").is_ok();
     let zlib_ng_compat = env::var("CARGO_FEATURE_ZLIB_NG_COMPAT").is_ok();
 
-    // To use zlib-ng in zlib-compat mode, we have to build libgit2 ourselves.
-    let try_to_use_system_libgit2 = !vendored && !zlib_ng_compat;
-    if try_to_use_system_libgit2 {
-        let mut cfg = pkg_config::Config::new();
-        // These version ranges specifically request a version that includes
-        // the SSH fixes for CVE-2023-22742 (1.5.1+ or 1.4.5+).
-        if let Ok(lib) = cfg
-            .range_version("1.5.1".."1.6.0")
-            .probe("libgit2")
-            .or_else(|_| cfg.range_version("1.4.5".."1.5.0").probe("libgit2"))
-        {
-            for include in &lib.include_paths {
-                println!("cargo:root={}", include.display());
-            }
-            return;
-        }
-    }
-
     println!("cargo:rustc-cfg=libgit2_vendored");
 
     if !Path::new("libgit2/src").exists() {
-- 
2.40.1