diff --git a/bin/ruby-build b/bin/ruby-build index 6fbf5b4d..1da9d5c4 100755 --- a/bin/ruby-build +++ b/bin/ruby-build @@ -634,7 +634,7 @@ build_package_warn_unsupported() { } >&2 } -build_package_standard_build() { +build_package_standard() { local package_name="$1" if [ "${MAKEOPTS+defined}" ]; then @@ -708,13 +708,7 @@ build_package_standard_build() { sed "s:\\([[:space:]]*Check\\) \\(ext/.*\\):\\1 ${PWD}/\\2:" >&2 fi - return $status -} - -build_package_standard_install() { - local package_name="$1" - local package_var_name - package_var_name="$(capitalize "${package_name%%-*}")" + [ $status -eq 0 ] || return $status local PACKAGE_MAKE_INSTALL_OPTS="${package_var_name}_MAKE_INSTALL_OPTS" local PACKAGE_MAKE_INSTALL_OPTS_ARRAY="${package_var_name}_MAKE_INSTALL_OPTS_ARRAY[@]" @@ -724,17 +718,19 @@ build_package_standard_install() { capture_command "$MAKE" ${MAKE_INSTALL_TARGET:-install} "${!PACKAGE_MAKE_INSTALL_OPTS_ARRAY}" $MAKE_INSTALL_OPTS ${!PACKAGE_MAKE_INSTALL_OPTS} } +# Used in place of "standard" step for building development branches of Ruby. build_package_standard_install_with_bundled_gems() { - capture_command "$MAKE" update-gems - capture_command "$MAKE" extract-gems - - build_package_standard_install "$@" + MAKE_INSTALL_TARGET="update-gems extract-gems install" build_package_standard "$@" } -# Backward Compatibility for standard function -build_package_standard() { - build_package_standard_build "$@" - build_package_standard_install "$@" +# Kept for backward compatibility with 3rd-party Ruby definitions. +build_package_standard_build() { + true +} + +# Kept for backward compatibility with 3rd-party Ruby definitions. +build_package_standard_install() { + build_package_standard "$@" } build_package_autoconf() { diff --git a/share/ruby-build/2.2.0-dev b/share/ruby-build/2.2.0-dev index 226ef27c..81b8ce1d 100644 --- a/share/ruby-build/2.2.0-dev +++ b/share/ruby-build/2.2.0-dev @@ -1,2 +1,2 @@ install_package "openssl-1.0.2u" "https://www.openssl.org/source/openssl-1.0.2u.tar.gz#ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16" openssl --if needs_openssl:0.9.6-1.0.x -install_git "ruby-2.2.0-dev" "https://github.com/ruby/ruby.git" "ruby_2_2" warn_eol autoconf standard_build standard_install_with_bundled_gems +install_git "ruby-2.2.0-dev" "https://github.com/ruby/ruby.git" "ruby_2_2" warn_eol autoconf standard_install_with_bundled_gems diff --git a/share/ruby-build/2.3.0-dev b/share/ruby-build/2.3.0-dev index 562325b2..4850d527 100644 --- a/share/ruby-build/2.3.0-dev +++ b/share/ruby-build/2.3.0-dev @@ -1,2 +1,2 @@ install_package "openssl-1.0.2u" "https://www.openssl.org/source/openssl-1.0.2u.tar.gz#ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16" openssl --if needs_openssl:0.9.6-1.0.x -install_git "ruby-2.3.0-dev" "https://github.com/ruby/ruby.git" "ruby_2_3" warn_eol autoconf standard_build standard_install_with_bundled_gems +install_git "ruby-2.3.0-dev" "https://github.com/ruby/ruby.git" "ruby_2_3" warn_eol autoconf standard_install_with_bundled_gems diff --git a/share/ruby-build/2.4.0-dev b/share/ruby-build/2.4.0-dev index 0b866d62..e86e51da 100644 --- a/share/ruby-build/2.4.0-dev +++ b/share/ruby-build/2.4.0-dev @@ -1,2 +1,2 @@ install_package "openssl-1.1.1w" "https://www.openssl.org/source/openssl-1.1.1w.tar.gz#cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8" openssl --if needs_openssl:1.0.1-1.x.x -install_git "ruby-2.4.0-dev" "https://github.com/ruby/ruby.git" "ruby_2_4" warn_eol autoconf standard_build standard_install_with_bundled_gems +install_git "ruby-2.4.0-dev" "https://github.com/ruby/ruby.git" "ruby_2_4" warn_eol autoconf standard_install_with_bundled_gems diff --git a/share/ruby-build/2.5.0-dev b/share/ruby-build/2.5.0-dev index 98fb8cf3..e5ccac51 100644 --- a/share/ruby-build/2.5.0-dev +++ b/share/ruby-build/2.5.0-dev @@ -1,2 +1,2 @@ install_package "openssl-1.1.1w" "https://www.openssl.org/source/openssl-1.1.1w.tar.gz#cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8" openssl --if needs_openssl:1.0.1-1.x.x -install_git "ruby-2.5.0-dev" "https://github.com/ruby/ruby.git" "ruby_2_5" warn_eol autoconf standard_build standard_install_with_bundled_gems +install_git "ruby-2.5.0-dev" "https://github.com/ruby/ruby.git" "ruby_2_5" warn_eol autoconf standard_install_with_bundled_gems diff --git a/share/ruby-build/2.6.0-dev b/share/ruby-build/2.6.0-dev index 52cfea50..42971a6d 100644 --- a/share/ruby-build/2.6.0-dev +++ b/share/ruby-build/2.6.0-dev @@ -1,2 +1,2 @@ install_package "openssl-1.1.1w" "https://www.openssl.org/source/openssl-1.1.1w.tar.gz#cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8" openssl --if needs_openssl:1.0.1-1.x.x -install_git "ruby-2.6.0-dev" "https://github.com/ruby/ruby.git" "ruby_2_6" autoconf standard_build standard_install_with_bundled_gems +install_git "ruby-2.6.0-dev" "https://github.com/ruby/ruby.git" "ruby_2_6" autoconf standard_install_with_bundled_gems diff --git a/share/ruby-build/2.7.0-dev b/share/ruby-build/2.7.0-dev index 291fb263..8b57d031 100644 --- a/share/ruby-build/2.7.0-dev +++ b/share/ruby-build/2.7.0-dev @@ -1,2 +1,2 @@ install_package "openssl-1.1.1w" "https://www.openssl.org/source/openssl-1.1.1w.tar.gz#cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8" openssl --if needs_openssl:1.0.1-1.x.x -install_git "ruby-2.7.0-dev" "https://github.com/ruby/ruby.git" "ruby_2_7" autoconf standard_build standard_install_with_bundled_gems +install_git "ruby-2.7.0-dev" "https://github.com/ruby/ruby.git" "ruby_2_7" autoconf standard_install_with_bundled_gems diff --git a/share/ruby-build/3.0.0-dev b/share/ruby-build/3.0.0-dev index d5fba8d6..08a5c54c 100644 --- a/share/ruby-build/3.0.0-dev +++ b/share/ruby-build/3.0.0-dev @@ -1,2 +1,2 @@ install_package "openssl-1.1.1w" "https://www.openssl.org/source/openssl-1.1.1w.tar.gz#cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8" openssl --if needs_openssl:1.0.1-1.x.x -install_git "ruby-3.0.0-dev" "https://github.com/ruby/ruby.git" "ruby_3_0" autoconf standard_build standard_install_with_bundled_gems +install_git "ruby-3.0.0-dev" "https://github.com/ruby/ruby.git" "ruby_3_0" autoconf standard_install_with_bundled_gems diff --git a/share/ruby-build/3.1.0-dev b/share/ruby-build/3.1.0-dev index f0749998..92cdb22c 100644 --- a/share/ruby-build/3.1.0-dev +++ b/share/ruby-build/3.1.0-dev @@ -1,2 +1,2 @@ install_package "openssl-3.1.4" "https://www.openssl.org/source/openssl-3.1.4.tar.gz#840af5366ab9b522bde525826be3ef0fb0af81c6a9ebd84caa600fea1731eee3" openssl --if needs_openssl:1.0.2-3.x.x -install_git "ruby-3.1.0-dev" "https://github.com/ruby/ruby.git" "ruby_3_1" autoconf standard_build standard_install_with_bundled_gems +install_git "ruby-3.1.0-dev" "https://github.com/ruby/ruby.git" "ruby_3_1" autoconf standard_install_with_bundled_gems diff --git a/share/ruby-build/3.2.0-dev b/share/ruby-build/3.2.0-dev index d24103b6..80ff7838 100644 --- a/share/ruby-build/3.2.0-dev +++ b/share/ruby-build/3.2.0-dev @@ -1,2 +1,2 @@ install_package "openssl-3.1.4" "https://www.openssl.org/source/openssl-3.1.4.tar.gz#840af5366ab9b522bde525826be3ef0fb0af81c6a9ebd84caa600fea1731eee3" openssl --if needs_openssl:1.0.2-3.x.x -install_git "ruby-3.2.0-dev" "https://github.com/ruby/ruby.git" "ruby_3_2" autoconf standard_build standard_install_with_bundled_gems +install_git "ruby-3.2.0-dev" "https://github.com/ruby/ruby.git" "ruby_3_2" autoconf standard_install_with_bundled_gems diff --git a/share/ruby-build/3.3.0-dev b/share/ruby-build/3.3.0-dev index a125fe67..0fef7e85 100644 --- a/share/ruby-build/3.3.0-dev +++ b/share/ruby-build/3.3.0-dev @@ -1,2 +1,2 @@ install_package "openssl-3.1.4" "https://www.openssl.org/source/openssl-3.1.4.tar.gz#840af5366ab9b522bde525826be3ef0fb0af81c6a9ebd84caa600fea1731eee3" openssl --if needs_openssl:1.0.2-3.x.x -install_git "ruby-master" "https://github.com/ruby/ruby.git" "master" autoconf standard_build standard_install_with_bundled_gems +install_git "ruby-master" "https://github.com/ruby/ruby.git" "master" autoconf standard_install_with_bundled_gems diff --git a/share/ruby-build/ruby-dev b/share/ruby-build/ruby-dev index a125fe67..0fef7e85 100644 --- a/share/ruby-build/ruby-dev +++ b/share/ruby-build/ruby-dev @@ -1,2 +1,2 @@ install_package "openssl-3.1.4" "https://www.openssl.org/source/openssl-3.1.4.tar.gz#840af5366ab9b522bde525826be3ef0fb0af81c6a9ebd84caa600fea1731eee3" openssl --if needs_openssl:1.0.2-3.x.x -install_git "ruby-master" "https://github.com/ruby/ruby.git" "master" autoconf standard_build standard_install_with_bundled_gems +install_git "ruby-master" "https://github.com/ruby/ruby.git" "master" autoconf standard_install_with_bundled_gems diff --git a/test/build.bats b/test/build.bats index 838dd7b0..b712aa85 100755 --- a/test/build.bats +++ b/test/build.bats @@ -81,9 +81,10 @@ OUT } stub_make_install() { + local target="${1:-install}" stub "$MAKE" \ " : echo \"$MAKE \$(inspect_args \"\$@\")\" >> build.log" \ - "install* : echo \"$MAKE \$(inspect_args \"\$@\")\" >> build.log && cat build.log >> '$INSTALL_ROOT/build.log'" + "$target : echo \"$MAKE \$(inspect_args \"\$@\")\" >> build.log && cat build.log >> '$INSTALL_ROOT/build.log'" } assert_build_log() { @@ -354,7 +355,7 @@ OUT stub_repeated brew false stub cc '-xc -E - : echo "OpenSSL 1.0.1a 1 Aug 2023"' stub openssl "version -d : echo 'OPENSSLDIR: \"${TMP}/ssl\"'" - stub_make_install + stub_make_install "install_sw" stub_make_install mkdir -p "$INSTALL_ROOT"/openssl/ssl # OPENSSLDIR @@ -645,6 +646,33 @@ OUT assert_success "hello world" } +@test "dev Ruby install strategy" { + cached_tarball "ruby-3.2.0" configure + + stub_repeated uname '-s : echo Linux' + stub_repeated brew false + # shellcheck disable=SC2016 + stub autoreconf ' : echo "autoreconf $(inspect_args "$@")" >> build.log' + stub_make_install "update-gems" + + run_inline_definition <