diff options
author | David Bailey <davidbailey00@outlook.com> | 2021-02-10 10:36:58 +0000 |
---|---|---|
committer | David Bailey <davidbailey00@outlook.com> | 2021-02-10 11:52:27 +0000 |
commit | 32e6746e4a9e4926e00ca1c112e48d45864292c9 (patch) | |
tree | 0e1df493a2fee9dc0eb47f24a4d358c915f72c05 | |
parent | cce48ac7d25d83e1a320370a674a7794721d1596 (diff) | |
download | rust-openssl-32e6746e4a9e4926e00ca1c112e48d45864292c9.zip |
remove unnecessary homebrew path checks
-rw-r--r-- | openssl-sys/build/find_normal.rs | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/openssl-sys/build/find_normal.rs b/openssl-sys/build/find_normal.rs index 873dc671..b598aab6 100644 --- a/openssl-sys/build/find_normal.rs +++ b/openssl-sys/build/find_normal.rs @@ -25,16 +25,11 @@ fn resolve_with_wellknown_homebrew_location(dir: &str) -> Option<PathBuf> { // Check up default aarch 64 Homebrew installation location first // for quick resolution if possible. // `pkg-config` on brew doesn't necessarily contain settings for openssl apparently. - let mut version_dir = dir.to_owned(); - version_dir.push_str("@1.1"); - let homebrew = Path::new(&version_dir); - if homebrew.exists() { - return Some(homebrew.to_path_buf()); - } - let homebrew = Path::new(dir); + let homebrew = Path::new(dir).join("opt/openssl@1.1"); if homebrew.exists() { return Some(homebrew.to_path_buf()); } + // Calling `brew --prefix <package>` command usually slow and // takes seconds, and will be used only as a last resort. let output = execute_command_and_get_output("brew", &["--prefix", "openssl@1.1"]); @@ -45,14 +40,6 @@ fn resolve_with_wellknown_homebrew_location(dir: &str) -> Option<PathBuf> { } } - let output = execute_command_and_get_output("brew", &["--prefix", "openssl"]); - if let Some(ref output) = output { - let homebrew = Path::new(&output); - if homebrew.exists() { - return Some(homebrew.to_path_buf()); - } - } - None } @@ -71,8 +58,8 @@ fn find_openssl_dir(target: &str) -> OsString { if host == target && target.ends_with("-apple-darwin") { let homebrew_dir = match target { - "aarch64-apple-darwin" => "/opt/homebrew/opt/openssl", - _ => "/usr/local/opt/openssl", + "aarch64-apple-darwin" => "/opt/homebrew", + _ => "/usr/local", }; if let Some(dir) = resolve_with_wellknown_homebrew_location(homebrew_dir) { |