Replace `directories` dependency with `home, known-folders, xdg`
`directories 5.0.1` added a dependency on `option-ext`, which is licensed as MPL (a copyleft license). The replacement dependencies are all licensed as `MIT OR Apache-2.0`.
This commit is contained in:
parent
fa67d9a645
commit
3de60c7b91
|
@ -6,6 +6,9 @@ and this library adheres to Rust's notion of
|
|||
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
### Changed
|
||||
- Replaced internal `directories` dependency which now transitively depends on
|
||||
MPL-licensed code.
|
||||
|
||||
## [0.12.0] - 2023-06-06
|
||||
### Changed
|
||||
|
|
|
@ -34,9 +34,11 @@ tracing = "0.1"
|
|||
# Dependencies used internally:
|
||||
# (Breaking upgrades to these are usually backwards-compatible, but check MSRVs.)
|
||||
blake2b_simd = "1"
|
||||
directories = { version = "5", optional = true }
|
||||
home = { version = "0.5", optional = true }
|
||||
known-folders = { version = "1", optional = true }
|
||||
redjubjub = "0.7"
|
||||
wagyu-zcash-parameters = { version = "0.2", optional = true }
|
||||
xdg = { version = "2.5", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
byteorder = "1"
|
||||
|
@ -49,6 +51,7 @@ pprof = { version = "0.11", features = ["criterion", "flamegraph"] } # MSRV 1.56
|
|||
[features]
|
||||
default = ["local-prover", "multicore"]
|
||||
bundled-prover = ["wagyu-zcash-parameters"]
|
||||
directories = ["dep:home", "dep:known-folders", "dep:xdg"]
|
||||
download-params = ["minreq", "directories"]
|
||||
local-prover = ["directories"]
|
||||
multicore = ["bellman/multicore", "zcash_primitives/multicore"]
|
||||
|
|
|
@ -15,8 +15,6 @@ use std::fs::File;
|
|||
use std::io::{self, BufReader};
|
||||
use std::path::Path;
|
||||
|
||||
#[cfg(feature = "directories")]
|
||||
use directories::BaseDirs;
|
||||
#[cfg(feature = "directories")]
|
||||
use std::path::PathBuf;
|
||||
|
||||
|
@ -77,13 +75,23 @@ pub struct SaplingParameterPaths {
|
|||
#[cfg(feature = "directories")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "directories")))]
|
||||
pub fn default_params_folder() -> Option<PathBuf> {
|
||||
BaseDirs::new().map(|base_dirs| {
|
||||
if cfg!(any(windows, target_os = "macos")) {
|
||||
base_dirs.data_dir().join("ZcashParams")
|
||||
} else {
|
||||
base_dirs.home_dir().join(".zcash-params")
|
||||
}
|
||||
})
|
||||
#[cfg(windows)]
|
||||
{
|
||||
use known_folders::{get_known_folder_path, KnownFolder};
|
||||
get_known_folder_path(KnownFolder::RoamingAppData).map(|base| base.join("ZcashParams"))
|
||||
}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
xdg::BaseDirectories::new()
|
||||
.ok()
|
||||
.map(|base_dirs| base_dirs.get_data_home().join("ZcashParams"))
|
||||
}
|
||||
|
||||
#[cfg(not(any(windows, target_os = "macos")))]
|
||||
{
|
||||
home::home_dir().map(|base| base.join(".zcash-params"))
|
||||
}
|
||||
}
|
||||
|
||||
/// Download the Zcash Sapling parameters if needed, and store them in the default location.
|
||||
|
|
Loading…
Reference in New Issue