diff --git a/Cargo.lock b/Cargo.lock index 1d01897..6135203 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -155,7 +155,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cfg-if 1.0.0", + "cfg-if", "libc", "miniz_oxide", "object", @@ -255,12 +255,6 @@ dependencies = [ "shlex", ] -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -317,7 +311,7 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -567,7 +561,7 @@ version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -650,7 +644,7 @@ version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "libredox", "windows-sys 0.59.0", @@ -751,7 +745,7 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", @@ -764,7 +758,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.13.3+wasi-0.2.2", "windows-targets", @@ -807,7 +801,7 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crunchy", ] @@ -829,16 +823,6 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" -[[package]] -name = "home-dir" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572c4f9690c3ac7058775be826d1b508ca20fd6633261435c27ac30ad0598212" -dependencies = [ - "nix", - "thiserror 1.0.69", -] - [[package]] name = "hound" version = "3.5.1" @@ -1331,7 +1315,7 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "windows-targets", ] @@ -1556,18 +1540,6 @@ dependencies = [ "rawpointer", ] -[[package]] -name = "nix" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83450fe6a6142ddd95fb064b746083fc4ef1705fe81f64a64e1d4b39f54a1055" -dependencies = [ - "bitflags 1.3.2", - "cc", - "cfg-if 0.1.10", - "libc", -] - [[package]] name = "nom" version = "7.1.3" @@ -1686,7 +1658,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e14130c6a98cd258fdcb0fb6d744152343ff729cbfcb28c656a9d12b999fbcd" dependencies = [ "bitflags 2.8.0", - "cfg-if 1.0.0", + "cfg-if", "foreign-types", "libc", "once_cell", @@ -1763,7 +1735,7 @@ version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall", "smallvec", @@ -1949,7 +1921,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57fe09249128b3173d092de9523eaa75136bf7ba85e0d69eca241c7939c933cc" dependencies = [ "anyhow", - "cfg-if 1.0.0", + "cfg-if", "indoc", "libc", "memoffset", @@ -2171,7 +2143,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34b5020fcdea098ef7d95e9f89ec15952123a4a039badd09fabebe9e963e839" dependencies = [ "cc", - "cfg-if 1.0.0", + "cfg-if", "getrandom 0.2.15", "libc", "untrusted", @@ -2284,7 +2256,6 @@ dependencies = [ "base64 0.22.1", "dotenvy", "env_logger", - "home-dir", "hound", "jpreprocess", "ndarray", @@ -2425,7 +2396,7 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest", ] @@ -2614,7 +2585,7 @@ version = "3.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22e5a0acb1f3f55f65cc4a866c361b2fb2a0ff6366785ae6fbb5f85df07ba230" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fastrand", "getrandom 0.3.1", "once_cell", @@ -3061,7 +3032,7 @@ version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "rustversion", "wasm-bindgen-macro", @@ -3087,7 +3058,7 @@ version = "0.4.50" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "once_cell", "wasm-bindgen", diff --git a/crates/sbv2_core/Cargo.toml b/crates/sbv2_core/Cargo.toml index 8f6c1d6..852cf32 100644 --- a/crates/sbv2_core/Cargo.toml +++ b/crates/sbv2_core/Cargo.toml @@ -43,5 +43,4 @@ aivmx = ["npyz", "base64"] base64 = ["dep:base64"] [build-dependencies] -ureq = "3.0.6" -home-dir = "0.1.0" \ No newline at end of file +ureq = "3.0.6" \ No newline at end of file diff --git a/crates/sbv2_core/build.rs b/crates/sbv2_core/build.rs index baea560..62e0a65 100644 --- a/crates/sbv2_core/build.rs +++ b/crates/sbv2_core/build.rs @@ -1,17 +1,12 @@ use std::env; -use std::fs::{self, hard_link}; +use std::fs; use std::io::copy; use std::path::PathBuf; -use home_dir::HomeDirExt; - fn main() -> Result<(), Box> { - let out_dir = "~/.cache/sbv2-api-assets".expand_home().unwrap(); + let out_dir = PathBuf::from(&env::var("OUT_DIR").unwrap()); let out_path = out_dir.join("all.bin"); if !out_path.exists() { - if !out_dir.exists() { - fs::create_dir_all(out_dir).unwrap(); - } println!("cargo:warning=Downloading dictionary file..."); let mut response = ureq::get("https://huggingface.co/neody/sbv2-api-assets/resolve/main/dic/all.bin") @@ -20,11 +15,6 @@ fn main() -> Result<(), Box> { let mut file = fs::File::create(&out_path)?; copy(&mut response, &mut file)?; } - hard_link( - out_path, - PathBuf::from(&env::var("OUT_DIR").unwrap()).join("out.bin"), - ) - .unwrap(); println!("cargo:rerun-if-changed=build.rs"); Ok(()) }