From e16148f9bab7a71032bbf245c8fc1dcafa2efd62 Mon Sep 17 00:00:00 2001
From: "Kirill A. Korinsky" <kirill@korins.ky>
Date: Thu, 10 Feb 2022 02:07:33 +0100
Subject: [PATCH] `libgit2-sys`: recovered `LIBGIT2_SYS_USE_PKG_CONFIG`

---
 vendor/libgit2-sys/build.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vendor/libgit2-sys/build.rs b/vendor/libgit2-sys/build.rs
index 9ea69e171c..e30a09b44a 100644
--- a/vendor/libgit2-sys/build.rs
+++ b/vendor/libgit2-sys/build.rs
@@ -10,7 +10,7 @@ fn main() {
     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.
-    if !zlib_ng_compat {
+    if !zlib_ng_compat && env::var("LIBGIT2_SYS_USE_PKG_CONFIG").is_ok() {
         let mut cfg = pkg_config::Config::new();
         if let Ok(lib) = cfg.atleast_version("1.1.0").probe("libgit2") {
             for include in &lib.include_paths {
-- 
2.37.2

