I tried to add hyper as a dependency to a project of mine, and the build blew up on openssl-rust, because it relies on the openssl headers and libraries being part of the OS, which is not true of OS X anymore (the libraries are there but it's a custom build so grabbing the headers elsewhere won't work). I've seen https://github.com/sfackler/rust-openssl/issues/255, https://github.com/sfackler/rust-openssl/issues/316, and https://github.com/alexcrichton/gcc-rs/issues/63 so I know I need to override something to set the equivalent of the following environment variables in cargo's build system:
OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include
OPENSSL_LIB_DIR=/usr/local/opt/openssl/lib
however looking at http://doc.crates.io/build-script.html#overriding-build-scripts I haven't been able to figure out how I do that.
Some things that I've seen but don't think make for acceptable answers:
brew link --force openssl
- setting the environment variables every time I call
cargo build
Note I've seen OpenSSL crate fails compilation on Mac OS X 10.11 (I'd even seen it before posting this, should have said so earlier) but that answer just says to set the env variables every time you compile (one way or another) which I'm not willing to accept as an answer when there's a system for overriding the build script that might work if someone could explain how it works.