Add support for pkg-config #2547
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When pkg-config is installed and finds the libraries, use those rather than relying on Homebrew or bundling OpenSSL.
Fixes #2544
A few comments about package managers
/opt/homebrew/Cellar/
. However, those have their version number in the path, so I decided to ignore any library in*/Cellar/*
to avoid breaking Ruby when runningbrew upgrade
.Alternatives considered
Skip
--with-xyz-dir=
pkg-config is used internally by Ruby build scripts. So my initial idea was to skip the
--with-xyz-dir=
option when a library is discovered by pkg-config and let the build scripts do their job. However:--with-xyz-dir=
options appear in the output is helpful to make sure that the correct libraries are used.Do nothing
My goal was to write a simple fix to have ruby-build work well with MacPorts (and other package managers). But doing so without breaking things turned out a little more complex than anticipated. Maybe it's just not worth it.