From 6c937c819c3dc8960ce182e9555cf5f8a04a9e7d Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sat, 9 Nov 2024 17:21:11 +0100 Subject: [PATCH] Add an environment variable to always build openssl/libssl * This is useful when one wants to avoid depending e.g. on which openssl version is installed in Homebrew, notably for https://github.com/ruby/setup-ruby/issues/668 --- README.md | 1 + bin/ruby-build | 2 ++ 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 7b9443f8..28fc8f38 100644 --- a/README.md +++ b/README.md @@ -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. | diff --git a/bin/ruby-build b/bin/ruby-build index 8ab9b7ae..3d8103a0 100755 --- a/bin/ruby-build +++ b/bin/ruby-build @@ -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