How to get homebrew to stop resetting PKG_CONFIG_LIBDIR #5991
-
Output of
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
It's doing so to avoid accidentally including things on the system that your formula doesn't depend on. Dependencies of the formula should automatically be added to it. |
Beta Was this translation helpful? Give feedback.
Homebrew aims for reproducible builds so it is expected that environment variables will be sanitized12 as they can result in non-reproducible/broken behavior3. This is similar to build systems like Bazel. Other repositories (e.g. Debian & NixOS) should do something similar as they prioritize reproducible builds.
For your specific formula,
depends_on "openssl@3"
is required to use OpenSSL.If you want pkg-config detection, then
depends_on "pkgconf" => :build
will be necessary. If you want to bypass pkg-config in openssl-sys, thenENV["OPENSSL_DIR"] = Formula["openssl@3"].opt_prefix
.These dependencies need to be explicit so they work no matter what machine is used (e.g. could be a minimal…