Skip to content

Commit

Permalink
Support Rubinius linking against Homebrew openssl
Browse files Browse the repository at this point in the history
Internally, ruby-build will want to set `--with-openssl-dir` if we try
to detect Homebrew's OpenSSL or build one for the OS X. However,
Rubinius doesn't support that configure flag. So, this translates
`--with-openssl-dir` to a combination of `--with-lib-dir` and
`--with-include-dir`.
  • Loading branch information
mislav committed Dec 26, 2015
1 parent c431c25 commit 3e5c31f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
15 changes: 14 additions & 1 deletion bin/ruby-build
Expand Up @@ -564,7 +564,20 @@ build_package_rbx() {
mkdir -p vendor
ln -s "$RUBY_BUILD_CACHE_PATH" vendor/prebuilt
fi
RUBYOPT="-rubygems $RUBYOPT" ./configure --prefix="$PREFIX_PATH" $RUBY_CONFIGURE_OPTS "${RUBY_CONFIGURE_OPTS_ARRAY[@]}"

local opt
local -a configure_opts
for opt in "${RUBY_CONFIGURE_OPTS_ARRAY[@]}"; do
if [[ $opt == --with-openssl-dir=* ]]; then
local openssl_dir="${opt#*=}"
configure_opts[${#configure_opts[@]}]="--with-lib-dir=${openssl_dir}/lib"
configure_opts[${#configure_opts[@]}]="--with-include-dir=${openssl_dir}/include"
else
configure_opts[${#configure_opts[@]}]="$opt"
fi
done

RUBYOPT="-rubygems $RUBYOPT" ./configure --prefix="$PREFIX_PATH" $RUBY_CONFIGURE_OPTS "${configure_opts[@]}"
rake install
fix_rbx_gem_binstubs "$PREFIX_PATH"
fix_rbx_irb "$PREFIX_PATH"
Expand Down
1 change: 1 addition & 0 deletions share/ruby-build/rbx-2.5.8
@@ -1,2 +1,3 @@
require_llvm 3.5
install_package "openssl-1.0.1q" "https://www.openssl.org/source/openssl-1.0.1q.tar.gz#b3658b84e9ea606a5ded3c972a5517cd785282e7ea86b20c78aa4b773a047fb7" mac_openssl --if has_broken_mac_openssl
install_package "rubinius-2.5.8" "https://s3.amazonaws.com/releases.rubini.us/rubinius-2.5.8.tar.bz2#d6b411732aa035865f2855845abe5405119560f0979062672d576601de89e59a" rbx

0 comments on commit 3e5c31f

Please sign in to comment.