mirror of
https://github.com/rbenv/ruby-build.git
synced 2026-09-16 15:52:07 -04:00
Compare commits
7 changed files with 8 additions and 101 deletions
|
|
@ -137,7 +137,7 @@ The build process may be configured through the following environment variables:
|
||||||
| `RUBY_BUILD_ROOT` | The path prefix to search for build definitions files. *Deprecated:* use `RUBY_BUILD_DEFINITIONS`|
|
| `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 |
|
| `RUBY_BUILD_VENDOR_OPENSSL` | Build and vendor openssl even if the system openssl is compatible |
|
||||||
| `CC` | Path to the C compiler. |
|
| `CC` | Path to the C compiler. |
|
||||||
| `RUBY_CFLAGS` | Overrides Ruby's default `CFLAGS`, including `-O3` (beware: without a `-O` flag Ruby is built unoptimized). To add flags, use `RUBY_CONFIGURE_OPTS=cflags=...` instead |
|
| `RUBY_CFLAGS` | Additional `CFLAGS` options (_e.g.,_ to override `-O3`). |
|
||||||
| `CONFIGURE_OPTS` | Additional `./configure` options. |
|
| `CONFIGURE_OPTS` | Additional `./configure` options. |
|
||||||
| `MAKE` | Custom `make` command (_e.g.,_ `gmake`). |
|
| `MAKE` | Custom `make` command (_e.g.,_ `gmake`). |
|
||||||
| `MAKE_OPTS` / `MAKEOPTS` | Additional `make` options. |
|
| `MAKE_OPTS` / `MAKEOPTS` | Additional `make` options. |
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
# -6, --ipv6 Resolve names to IPv6 addresses only
|
# -6, --ipv6 Resolve names to IPv6 addresses only
|
||||||
#
|
#
|
||||||
|
|
||||||
RUBY_BUILD_VERSION="20260916"
|
RUBY_BUILD_VERSION="20260716"
|
||||||
|
|
||||||
OLDIFS="$IFS"
|
OLDIFS="$IFS"
|
||||||
|
|
||||||
|
|
@ -748,18 +748,7 @@ build_package_standard() {
|
||||||
#
|
#
|
||||||
# TODO: Consider changing this to check for GCC v15 specifically
|
# TODO: Consider changing this to check for GCC v15 specifically
|
||||||
# rather than inspecting the OS itself.
|
# rather than inspecting the OS itself.
|
||||||
|
export CFLAGS="-std=gnu17 $CFLAGS"
|
||||||
# Use the cflags configure variable, which Ruby's configure appends to
|
|
||||||
# its default optflags/debugflags/warnflags, unlike CFLAGS which would
|
|
||||||
# override them and notably lose the -O3, producing a -O0 Ruby.
|
|
||||||
export cflags="-std=gnu17 $cflags"
|
|
||||||
fi
|
|
||||||
if [ "$package_var_name" = "RUBY" ] && is_mac && ! is_mac 2700; then
|
|
||||||
# The macOS 27 SDK declares dup3() and pipe2() as available since macOS 27.0.
|
|
||||||
# Ruby's configure detects them even when building for an older macOS, where
|
|
||||||
# they are only weakly linked and are NULL at runtime, which makes miniruby
|
|
||||||
# crash during the build: https://bugs.ruby-lang.org/issues/22311
|
|
||||||
export ac_cv_func_dup3=no ac_cv_func_pipe2=no
|
|
||||||
fi
|
fi
|
||||||
# ./configure --prefix=/path/to/ruby
|
# ./configure --prefix=/path/to/ruby
|
||||||
# shellcheck disable=SC2086,SC2153
|
# shellcheck disable=SC2086,SC2153
|
||||||
|
|
@ -1180,11 +1169,7 @@ homebrew_openssl_versions() {
|
||||||
# Example: 3.1.23 -> 30123
|
# Example: 3.1.23 -> 30123
|
||||||
# See also osx_version, require_java
|
# See also osx_version, require_java
|
||||||
normalize_semver() {
|
normalize_semver() {
|
||||||
if [ "$1" = "dev" ]; then
|
awk -F. '{print $1 * 10000 + $2 * 100 + $3}' <<<"$1"
|
||||||
echo 99999999
|
|
||||||
else
|
|
||||||
awk -F. '{print $1 * 10000 + $2 * 100 + $3}' <<<"$1"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Checks if system OpenSSL does NOT satisfy the version requirement
|
# Checks if system OpenSSL does NOT satisfy the version requirement
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
# - creates a new Release on GitHub
|
# - creates a new Release on GitHub
|
||||||
# - [automated] a GitHub Action will create a Homebrew PR for the new release
|
# - [automated] a GitHub Action will create a Homebrew PR for the new release
|
||||||
|
|
||||||
set -ex
|
set -e
|
||||||
|
|
||||||
git fetch -q --tags origin master
|
git fetch -q --tags origin master
|
||||||
git checkout -q master
|
git checkout -q master
|
||||||
|
|
|
||||||
4
share/man/man1/ruby-build.1
generated
4
share/man/man1/ruby-build.1
generated
|
|
@ -4,10 +4,10 @@
|
||||||
.\" Generator: Asciidoctor 2.0.26
|
.\" Generator: Asciidoctor 2.0.26
|
||||||
.\" Date: 2026-05-07
|
.\" Date: 2026-05-07
|
||||||
.\" Manual: ruby-build Manual
|
.\" Manual: ruby-build Manual
|
||||||
.\" Source: ruby-build 20260916
|
.\" Source: ruby-build 20260716
|
||||||
.\" Language: English
|
.\" Language: English
|
||||||
.\"
|
.\"
|
||||||
.TH "RUBY\-BUILD" "1" "2026-05-07" "ruby\-build 20260916" "ruby\-build Manual"
|
.TH "RUBY\-BUILD" "1" "2026-05-07" "ruby\-build 20260716" "ruby\-build Manual"
|
||||||
.ie \n(.g .ds Aq \(aq
|
.ie \n(.g .ds Aq \(aq
|
||||||
.el .ds Aq '
|
.el .ds Aq '
|
||||||
.ss \n[.ss] 0
|
.ss \n[.ss] 0
|
||||||
|
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
install_package "openssl-3.0.22" "https://github.com/openssl/openssl/releases/download/openssl-3.0.22/openssl-3.0.22.tar.gz#67ebca7e50d17383028045486653492195b83db95f8558709701bb47b5c1ef81" openssl --if needs_openssl:1.1.1-3.x.x
|
|
||||||
install_package "ruby-4.0.7" "https://cache.ruby-lang.org/pub/ruby/4.0/ruby-4.0.7.tar.gz#911ace20f90d068ca0e4dda6d0e4f0f81e52e52f2dd4f4004c721e253412e82d" enable_shared standard
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
require_java 21
|
|
||||||
install_package "jruby-10.1.1.0" "https://repo1.maven.org/maven2/org/jruby/jruby-dist/10.1.1.0/jruby-dist-10.1.1.0-bin.tar.gz#1e08bff6a7f0134a4774fba37d8cf88b9dd4a7317bd49fca5af696a327450148" jruby
|
|
||||||
|
|
@ -12,7 +12,7 @@ export -n RUBY_CONFIGURE_OPTS
|
||||||
cd "$INSTALL_ROOT"
|
cd "$INSTALL_ROOT"
|
||||||
|
|
||||||
stub_repeated uname '-s : echo Darwin'
|
stub_repeated uname '-s : echo Darwin'
|
||||||
stub_repeated sw_vers '-productVersion : echo 10.10'
|
stub sw_vers '-productVersion : echo 10.10'
|
||||||
stub_repeated brew 'false'
|
stub_repeated brew 'false'
|
||||||
# shellcheck disable=SC2016
|
# shellcheck disable=SC2016
|
||||||
stub_repeated make 'echo "make $(inspect_args "$@")" >> build.log'
|
stub_repeated make 'echo "make $(inspect_args "$@")" >> build.log'
|
||||||
|
|
@ -43,77 +43,3 @@ OUT
|
||||||
unstub brew
|
unstub brew
|
||||||
unstub make
|
unstub make
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "dup3 and pipe2 are hidden from configure when building on older macOS" {
|
|
||||||
mkdir -p "$INSTALL_ROOT"
|
|
||||||
cd "$INSTALL_ROOT"
|
|
||||||
|
|
||||||
stub_repeated uname '-s : echo Darwin'
|
|
||||||
stub_repeated sw_vers '-productVersion : echo 26.6.2'
|
|
||||||
stub_repeated brew 'false'
|
|
||||||
# shellcheck disable=SC2016
|
|
||||||
stub_repeated make 'echo "make $(inspect_args "$@")" >> build.log'
|
|
||||||
|
|
||||||
cat > ./configure <<CON
|
|
||||||
#!${BASH}
|
|
||||||
echo ./configure "\$@" > build.log
|
|
||||||
echo dup3=\${ac_cv_func_dup3-unset} >> build.log
|
|
||||||
echo pipe2=\${ac_cv_func_pipe2-unset} >> build.log
|
|
||||||
CON
|
|
||||||
chmod +x ./configure
|
|
||||||
|
|
||||||
run_inline_definition <<DEF
|
|
||||||
build_package_standard ruby-3.4.0
|
|
||||||
DEF
|
|
||||||
assert_success
|
|
||||||
run cat build.log
|
|
||||||
assert_output <<OUT
|
|
||||||
./configure --prefix=$INSTALL_ROOT --with-ext=openssl,psych,+
|
|
||||||
dup3=no
|
|
||||||
pipe2=no
|
|
||||||
make -j 2
|
|
||||||
make install
|
|
||||||
OUT
|
|
||||||
|
|
||||||
unstub uname
|
|
||||||
unstub sw_vers
|
|
||||||
unstub brew
|
|
||||||
unstub make
|
|
||||||
}
|
|
||||||
|
|
||||||
@test "dup3 and pipe2 are left to configure on macOS 27" {
|
|
||||||
mkdir -p "$INSTALL_ROOT"
|
|
||||||
cd "$INSTALL_ROOT"
|
|
||||||
|
|
||||||
stub_repeated uname '-s : echo Darwin'
|
|
||||||
stub_repeated sw_vers '-productVersion : echo 27.0'
|
|
||||||
stub_repeated brew 'false'
|
|
||||||
# shellcheck disable=SC2016
|
|
||||||
stub_repeated make 'echo "make $(inspect_args "$@")" >> build.log'
|
|
||||||
|
|
||||||
cat > ./configure <<CON
|
|
||||||
#!${BASH}
|
|
||||||
echo ./configure "\$@" > build.log
|
|
||||||
echo dup3=\${ac_cv_func_dup3-unset} >> build.log
|
|
||||||
echo pipe2=\${ac_cv_func_pipe2-unset} >> build.log
|
|
||||||
CON
|
|
||||||
chmod +x ./configure
|
|
||||||
|
|
||||||
run_inline_definition <<DEF
|
|
||||||
build_package_standard ruby-3.4.0
|
|
||||||
DEF
|
|
||||||
assert_success
|
|
||||||
run cat build.log
|
|
||||||
assert_output <<OUT
|
|
||||||
./configure --prefix=$INSTALL_ROOT --with-ext=openssl,psych,+
|
|
||||||
dup3=unset
|
|
||||||
pipe2=unset
|
|
||||||
make -j 2
|
|
||||||
make install
|
|
||||||
OUT
|
|
||||||
|
|
||||||
unstub uname
|
|
||||||
unstub sw_vers
|
|
||||||
unstub brew
|
|
||||||
unstub make
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue