From 1a53eb2dd3d44e958a3fff09a8b70d1c7f94e0c5 Mon Sep 17 00:00:00 2001 From: raccoman Date: Fri, 2 Dec 2022 11:54:22 +0100 Subject: [PATCH] fixed windows msvc dowload and install libsodium in build.rs --- Cargo.toml | 2 +- build.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 98ffca8..0f3b2a8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -107,7 +107,7 @@ cc = "1.0.70" [target.'cfg(target_os = "windows")'.build-dependencies] libflate = "1.1.1" -reqwest = { version = "0.11.4", default-features = false, features = ["rustls-tls"] } +reqwest = { version = "0.11.4", default-features = false, features = ["rustls-tls", "blocking"] } tar = "0.4.37" tempfile = "3.2.0" zip = "0.5.13" diff --git a/build.rs b/build.rs index f7e6e5d..d224c0c 100644 --- a/build.rs +++ b/build.rs @@ -214,18 +214,18 @@ fn download_and_install_libsodium() { let sodium_lib_file_path = sodium_lib_dir.join("libsodium.lib"); if !sodium_lib_file_path.exists() { let mut tmpfile = tempfile::tempfile().unwrap(); - reqwest::get(LIBSODIUM_ZIP) + reqwest::blocking::get(LIBSODIUM_ZIP) .unwrap() .copy_to(&mut tmpfile) .unwrap(); let mut zip = zip::ZipArchive::new(tmpfile).unwrap(); #[cfg(target_arch = "x86_64")] let mut lib = zip - .by_name("x64/Release/v142/static/libsodium.lib") + .by_name("libsodium/x64/Release/v142/static/libsodium.lib") .unwrap(); #[cfg(target_arch = "x86")] let mut lib = zip - .by_name("Win32/Release/v142/static/libsodium.lib") + .by_name("libsodium/Win32/Release/v142/static/libsodium.lib") .unwrap(); #[cfg(not(any(target_arch = "x86_64", target_arch = "x86")))] compile_error!("Bundled libsodium is only supported on x86 or x86_64 target architecture.");