Fix compiling Ruby < 2.5 by omitting --with-ext

Using `--with-ext=+` only has the indended effect (compiling all extensions that would normally get compiled) on Ruby 2.5+. On older versions, it causes none of the default extensions to get compiled, resulting in a defunct installation.
This commit is contained in:
Mislav Marohnić 2023-11-24 22:08:28 +01:00
parent 62ec07af2a
commit efe73b4841
No known key found for this signature in database
7 changed files with 81 additions and 58 deletions

View file

@ -674,8 +674,11 @@ build_package_standard_build() {
fi
fi
if [[ "$RUBY_CONFIGURE_OPTS ${RUBY_CONFIGURE_OPTS_ARRAY[*]}" != *--with-ext* &&
"$RUBY_CONFIGURE_OPTS ${RUBY_CONFIGURE_OPTS_ARRAY[*]}" != *--without-ext* ]]; then
# Fail the `make` step if any of these extensions were not compiled.
"$RUBY_CONFIGURE_OPTS ${RUBY_CONFIGURE_OPTS_ARRAY[*]}" != *--without-ext* &&
"$(normalize_semver "${package_name#ruby-}")" -ge 200500 ]]; then
# For Ruby 2.5+, fail the `make` step if any of these extensions were not compiled.
# Otherwise, the build would have succeeded, but Ruby would be useless at runtime.
# https://github.com/ruby/ruby/commit/b58a30e1c14e971adba4096104274d5d692492e9
package_option ruby configure --with-ext=openssl,psych,+
fi
fi