Skip to content

Commit

Permalink
Add an environment variable to always build openssl/libssl
Browse files Browse the repository at this point in the history
* This is useful when one wants to avoid depending e.g. on which openssl version
  is installed in Homebrew, notably for ruby/setup-ruby#668
  • Loading branch information
eregon committed Nov 13, 2024
1 parent 20496b5 commit 6c937c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ The build process may be configured through the following environment variables:
| `RUBY_BUILD_TARBALL_OVERRIDE` | Override the URL to fetch the ruby tarball from, optionally followed by `#checksum`. |
| `RUBY_BUILD_DEFINITIONS` | Colon-separated list of paths to search for build definition files. |
| `RUBY_BUILD_ROOT` | The path prefix to search for build definitions files. *Deprecated:* use `RUBY_BUILD_DEFINITIONS`|
| `RUBY_BUILD_VENDOR_OPENSSL` | Build and vendor openssl even if the system openssl is compatible |
| `CC` | Path to the C compiler. |
| `RUBY_CFLAGS` | Additional `CFLAGS` options (_e.g.,_ to override `-O3`). |
| `CONFIGURE_OPTS` | Additional `./configure` options. |
Expand Down
2 changes: 2 additions & 0 deletions bin/ruby-build
Original file line number Diff line number Diff line change
Expand Up @@ -1122,6 +1122,8 @@ normalize_semver() {
# If a compatible Homebrew-installed OpenSSL version is found during
# checking, Ruby will be linked to it and the check will return false.
needs_openssl() {
[ -z "$RUBY_BUILD_VENDOR_OPENSSL" ] || return 0

[[ "$RUBY_CONFIGURE_OPTS ${RUBY_CONFIGURE_OPTS_ARRAY[*]}" != *--with-openssl-dir=* ]] || return 1

local system_version
Expand Down

0 comments on commit 6c937c8

Please sign in to comment.