2021-09-04 03:36:35 +00:00
|
|
|
use std::env;
|
|
|
|
use std::path::Path;
|
2022-01-16 19:06:30 +00:00
|
|
|
use std::process::Command;
|
2021-09-04 03:36:35 +00:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let out_dir = env::var_os("OUT_DIR").unwrap();
|
|
|
|
println!("cargo:rustc-flags=-L {}", out_dir.to_str().unwrap());
|
|
|
|
println!("cargo:rustc-link-lib=Cwtch");
|
|
|
|
|
|
|
|
println!("cargo:rerun-if-changed=build.rs");
|
|
|
|
println!("cargo:rerun-if-changed=libCwtch.h");
|
|
|
|
|
|
|
|
let lib_cwtch_path = Path::new(&out_dir).join("libCwtch.so");
|
2022-01-16 19:00:21 +00:00
|
|
|
// https://git.openprivacy.ca/cwtch.im/libcwtch-go/releases v1.5.4
|
2022-01-16 19:06:30 +00:00
|
|
|
Command::new("wget")
|
|
|
|
.arg("https://git.openprivacy.ca/attachments/dd3c6b41-98e4-4e7b-81af-d21893bfe389")
|
|
|
|
.arg("-O")
|
|
|
|
.arg(lib_cwtch_path)
|
|
|
|
.output()
|
|
|
|
.expect("failed to download libCwtch.so");
|
|
|
|
}
|