From a1607acc7438fbc0e32322b51f4adb8c28901152 Mon Sep 17 00:00:00 2001
From: Jeremy Soller <jackpot51@gmail.com>
Date: Fri, 11 Nov 2022 11:22:12 -0700
Subject: [PATCH] Use system curl and nghttp2 for cargo

---
 recipes/cargo/recipe.toml | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/recipes/cargo/recipe.toml b/recipes/cargo/recipe.toml
index db4243964..dc922a7f6 100644
--- a/recipes/cargo/recipe.toml
+++ b/recipes/cargo/recipe.toml
@@ -6,12 +6,26 @@ branch = "redox-2022-03-18"
 [build]
 template = "custom"
 dependencies = [
+    "curl",
     "libssh2",
+    "nghttp2",
     "openssl",
     "zlib",
 ]
 script = """
 export LIBSSH2_SYS_USE_PKG_CONFIG=1
 export LIBZ_SYS_STATIC=1
-cookbook_cargo
+export DEP_NGHTTP2_ROOT="${COOKBOOK_SYSROOT}"
+export DEP_OPENSSL_ROOT="${COOKBOOK_SYSROOT}"
+export DEP_Z_ROOT="${COOKBOOK_SYSROOT}"
+# Force linking system nghttp2
+"${COOKBOOK_CARGO}" rustc \
+    --manifest-path "${COOKBOOK_SOURCE}/Cargo.toml" \
+    --release \
+    --bin cargo \
+    -- \
+    -L "${COOKBOOK_SYSROOT}/lib" \
+    -C link-arg="-lnghttp2"
+mkdir -pv "${COOKBOOK_STAGE}/bin"
+cp -v "target/${TARGET}/release/cargo" "${COOKBOOK_STAGE}/bin/cargo"
 """
-- 
GitLab