Skip to content

Commit 4a2f2b6

Browse files
committed
Install openssl 1 when openssl is 3
1 parent c0d87ea commit 4a2f2b6

File tree

294 files changed

+327
-299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

294 files changed

+327
-299
lines changed

bin/ruby-build

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,16 @@ has_broken_mac_openssl() {
10811081
[[ "$RUBY_CONFIGURE_OPTS" != *--with-openssl-dir=* ]]
10821082
}
10831083

1084+
has_openssl_3() {
1085+
local openssl_version="$(/usr/bin/openssl version 2>/dev/null || true)"
1086+
[[ $openssl_version = "OpenSSL 3"?* ]] &&
1087+
[[ "$RUBY_CONFIGURE_OPTS" != *--with-openssl-dir=* ]]
1088+
}
1089+
1090+
has_openssl_3_or_broken_mac_openssl() {
1091+
has_openssl_3 || has_broken_mac_openssl
1092+
}
1093+
10841094
use_homebrew_openssl() {
10851095
local ssldir="$(brew --prefix [email protected] 2>/dev/null || true)"
10861096
if [ -d "$ssldir" ]; then
@@ -1093,6 +1103,10 @@ use_homebrew_openssl() {
10931103
}
10941104

10951105
build_package_mac_openssl() {
1106+
build_package_openssl
1107+
}
1108+
1109+
build_package_openssl() {
10961110
# Install to a subdirectory since we don't want shims for bin/openssl.
10971111
OPENSSL_PREFIX_PATH="${PREFIX_PATH}/openssl"
10981112

@@ -1119,13 +1133,27 @@ build_package_mac_openssl() {
11191133
# gives precedence to the last -j option, so we can override that.
11201134
package_option openssl make -j 1
11211135

1122-
# Use install_sw instead of install to skip building docs which is slow
1123-
MAKE_INSTALL_TARGET=install_sw build_package_standard "$@"
1136+
if is_mac; then
1137+
# Use install_sw instead of install to skip building docs which is slow
1138+
MAKE_INSTALL_TARGET=install_sw build_package_standard "$@"
1139+
else
1140+
build_package_standard "$@"
1141+
fi
11241142

1125-
# Extract root certs from the system keychain in .pem format and rehash.
1126-
local pem_file="$OPENSSLDIR/cert.pem"
1127-
security find-certificate -a -p /Library/Keychains/System.keychain > "$pem_file"
1128-
security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain >> "$pem_file"
1143+
if is_mac; then
1144+
# Extract root certs from the system keychain in .pem format and rehash.
1145+
local pem_file="$OPENSSLDIR/cert.pem"
1146+
security find-certificate -a -p /Library/Keychains/System.keychain > "$pem_file"
1147+
security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain >> "$pem_file"
1148+
else
1149+
# symlink to the system openssl certs
1150+
local SYSTEM_OPENSSLDIR
1151+
SYSTEM_OPENSSLDIR=$(openssl version -d | sed -e 's/.*: "//' -e 's/"$//' || true)
1152+
if [ -n "$SYSTEM_OPENSSLDIR" ]; then
1153+
ln -sf "$SYSTEM_OPENSSLDIR/cert.pem" "$OPENSSLDIR/cert.pem"
1154+
ln -snf "$SYSTEM_OPENSSLDIR/certs" "$OPENSSLDIR/certs"
1155+
fi
1156+
fi
11291157
}
11301158

11311159
# Post-install check that the openssl extension was built.

share/ruby-build/1.9.3-dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
install_package "openssl-1.0.2u" "https://www.openssl.org/source/openssl-1.0.2u.tar.gz#ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16" mac_openssl --if has_broken_mac_openssl
1+
install_package "openssl-1.0.2u" "https://www.openssl.org/source/openssl-1.0.2u.tar.gz#ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16" openssl --if has_openssl_3_or_broken_mac_openssl
22
install_package "yaml-0.1.6" "http://pyyaml.org/download/libyaml/yaml-0.1.6.tar.gz#7da6971b4bd08a986dd2a61353bc422362bd0edcc67d7ebaac68c95f74182749" --if needs_yaml
33
install_git "ruby-1.9.3-dev" "https://github.com/ruby/ruby.git" "ruby_1_9_3" warn_eol autoconf standard

share/ruby-build/1.9.3-p0

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
require_gcc
2-
install_package "openssl-1.0.2u" "https://www.openssl.org/source/openssl-1.0.2u.tar.gz#ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16" mac_openssl --if has_broken_mac_openssl
2+
install_package "openssl-1.0.2u" "https://www.openssl.org/source/openssl-1.0.2u.tar.gz#ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16" openssl --if has_openssl_3_or_broken_mac_openssl
33
install_package "yaml-0.1.6" "http://pyyaml.org/download/libyaml/yaml-0.1.6.tar.gz#7da6971b4bd08a986dd2a61353bc422362bd0edcc67d7ebaac68c95f74182749" --if needs_yaml
44
install_package "ruby-1.9.3-p0" "https://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p0.tar.bz2#ca8ba4e564fc5f98b210a5784e43dfffef9471222849e46f8e848b37e9f38acf" warn_eol standard
55
install_package "rubygems-1.8.23" "https://rubygems.org/rubygems/rubygems-1.8.23.tgz#e4a1c6bbaac411eaab94deae78228b7584033a1f10a022f52bffa9613aa29061" ruby

share/ruby-build/1.9.3-p105

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[ -n "$CC" ] || export CC=cc
2-
install_package "openssl-1.0.2u" "https://www.openssl.org/source/openssl-1.0.2u.tar.gz#ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16" mac_openssl --if has_broken_mac_openssl
2+
install_package "openssl-1.0.2u" "https://www.openssl.org/source/openssl-1.0.2u.tar.gz#ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16" openssl --if has_openssl_3_or_broken_mac_openssl
33
install_package "yaml-0.1.6" "http://pyyaml.org/download/libyaml/yaml-0.1.6.tar.gz#7da6971b4bd08a986dd2a61353bc422362bd0edcc67d7ebaac68c95f74182749" --if needs_yaml
44
install_package "ruby-1.9.3-p105" "https://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p105.tar.bz2#8a149dee6498553fe5d25618ccce8002ca076affca57c857503235d00a35f9d1" warn_eol standard
55
install_package "rubygems-1.8.23" "https://rubygems.org/rubygems/rubygems-1.8.23.tgz#e4a1c6bbaac411eaab94deae78228b7584033a1f10a022f52bffa9613aa29061" ruby

share/ruby-build/1.9.3-p125

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[ -n "$CC" ] || export CC=cc
2-
install_package "openssl-1.0.2u" "https://www.openssl.org/source/openssl-1.0.2u.tar.gz#ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16" mac_openssl --if has_broken_mac_openssl
2+
install_package "openssl-1.0.2u" "https://www.openssl.org/source/openssl-1.0.2u.tar.gz#ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16" openssl --if has_openssl_3_or_broken_mac_openssl
33
install_package "yaml-0.1.6" "http://pyyaml.org/download/libyaml/yaml-0.1.6.tar.gz#7da6971b4bd08a986dd2a61353bc422362bd0edcc67d7ebaac68c95f74182749" --if needs_yaml
44
install_package "ruby-1.9.3-p125" "https://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.bz2#c67a59443052b5a9219eb4cee3892bdfbc6f250f0c8e214e02256a4cc7ef5526" warn_eol standard
55
install_package "rubygems-1.8.23" "https://rubygems.org/rubygems/rubygems-1.8.23.tgz#e4a1c6bbaac411eaab94deae78228b7584033a1f10a022f52bffa9613aa29061" ruby

share/ruby-build/1.9.3-p194

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
install_package "openssl-1.0.2u" "https://www.openssl.org/source/openssl-1.0.2u.tar.gz#ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16" mac_openssl --if has_broken_mac_openssl
1+
install_package "openssl-1.0.2u" "https://www.openssl.org/source/openssl-1.0.2u.tar.gz#ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16" openssl --if has_openssl_3_or_broken_mac_openssl
22
install_package "yaml-0.1.6" "http://pyyaml.org/download/libyaml/yaml-0.1.6.tar.gz#7da6971b4bd08a986dd2a61353bc422362bd0edcc67d7ebaac68c95f74182749" --if needs_yaml
33
install_package "ruby-1.9.3-p194" "https://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.bz2#a9d1ea9eaea075c60048369a63b35b3b5a06a30aa214a3d990e0bb71212db8fa" warn_eol standard

share/ruby-build/1.9.3-p286

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
install_package "openssl-1.0.2u" "https://www.openssl.org/source/openssl-1.0.2u.tar.gz#ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16" mac_openssl --if has_broken_mac_openssl
1+
install_package "openssl-1.0.2u" "https://www.openssl.org/source/openssl-1.0.2u.tar.gz#ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16" openssl --if has_openssl_3_or_broken_mac_openssl
22
install_package "yaml-0.1.6" "http://pyyaml.org/download/libyaml/yaml-0.1.6.tar.gz#7da6971b4bd08a986dd2a61353bc422362bd0edcc67d7ebaac68c95f74182749" --if needs_yaml
33
install_package "ruby-1.9.3-p286" "https://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p286.tar.bz2#5281656c7a0ae48b64f28d845a96b4dfa16ba1357a911265752787585fb5ea64" warn_eol standard

share/ruby-build/1.9.3-p327

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
install_package "openssl-1.0.2u" "https://www.openssl.org/source/openssl-1.0.2u.tar.gz#ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16" mac_openssl --if has_broken_mac_openssl
1+
install_package "openssl-1.0.2u" "https://www.openssl.org/source/openssl-1.0.2u.tar.gz#ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16" openssl --if has_openssl_3_or_broken_mac_openssl
22
install_package "yaml-0.1.6" "http://pyyaml.org/download/libyaml/yaml-0.1.6.tar.gz#7da6971b4bd08a986dd2a61353bc422362bd0edcc67d7ebaac68c95f74182749" --if needs_yaml
33
install_package "ruby-1.9.3-p327" "https://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p327.tar.bz2#d989465242f9b11a8a3aa8cbd2c75a9b3a8c0ec2f14a087a0c7b51abf164e488" warn_eol standard

share/ruby-build/1.9.3-p362

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
install_package "openssl-1.0.2u" "https://www.openssl.org/source/openssl-1.0.2u.tar.gz#ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16" mac_openssl --if has_broken_mac_openssl
1+
install_package "openssl-1.0.2u" "https://www.openssl.org/source/openssl-1.0.2u.tar.gz#ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16" openssl --if has_openssl_3_or_broken_mac_openssl
22
install_package "yaml-0.1.6" "http://pyyaml.org/download/libyaml/yaml-0.1.6.tar.gz#7da6971b4bd08a986dd2a61353bc422362bd0edcc67d7ebaac68c95f74182749" --if needs_yaml
33
install_package "ruby-1.9.3-p362" "https://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p362.tar.bz2#9ed456711a4c0fb2969d9144a81a706d2d506070a35a6d5bc98bb5c8407f9985" warn_eol standard

share/ruby-build/1.9.3-p374

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
install_package "openssl-1.0.2u" "https://www.openssl.org/source/openssl-1.0.2u.tar.gz#ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16" mac_openssl --if has_broken_mac_openssl
1+
install_package "openssl-1.0.2u" "https://www.openssl.org/source/openssl-1.0.2u.tar.gz#ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16" openssl --if has_openssl_3_or_broken_mac_openssl
22
install_package "yaml-0.1.6" "http://pyyaml.org/download/libyaml/yaml-0.1.6.tar.gz#7da6971b4bd08a986dd2a61353bc422362bd0edcc67d7ebaac68c95f74182749" --if needs_yaml
33
install_package "ruby-1.9.3-p374" "https://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p374.tar.bz2#712944f691b79f22f655547826400c26b13bc8c9e7bdc73a4abea45d5e766d85" warn_eol standard

0 commit comments

Comments
 (0)