patch submodule urls
This commit is contained in:
parent
297af89ca2
commit
be9d784a84
1 changed files with 11 additions and 2 deletions
|
@ -14,8 +14,8 @@ fn main() {
|
|||
use std::path::PathBuf;
|
||||
|
||||
// fetch libsnark source
|
||||
const LIBSNARK_URL: &'static str = "https://github.com/dark64/libsnark.git";
|
||||
const LIBSNARK_COMMIT: &'static str = "a38294cf04e80de32c2fb8b312557188315605cb";
|
||||
const LIBSNARK_URL: &'static str = "https://github.com/scipr-lab/libsnark.git";
|
||||
const LIBSNARK_COMMIT: &'static str = "f7c87b88744ecfd008126d415494d9b34c4c1b20";
|
||||
|
||||
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
|
||||
let libsnark_source_path = &out_path.join("libsnark");
|
||||
|
@ -25,6 +25,15 @@ fn main() {
|
|||
Repository::clone(LIBSNARK_URL, libsnark_source_path).unwrap()
|
||||
});
|
||||
|
||||
// Unencrypted `git://` protocol is no longer supported on GitHub
|
||||
// so we replace all submodule urls to use `https://`
|
||||
let gitmodules_path = libsnark_source_path.join(".gitmodules");
|
||||
let gitmodules = std::fs::read_to_string(&gitmodules_path)
|
||||
.unwrap()
|
||||
.replace("git://", "https://");
|
||||
|
||||
std::fs::write(&gitmodules_path, gitmodules).unwrap();
|
||||
|
||||
let object = repo.revparse_single(LIBSNARK_COMMIT).unwrap();
|
||||
repo.checkout_tree(&object, None).unwrap();
|
||||
|
||||
|
|
Loading…
Reference in a new issue