Skip to content

Commit 2429f55

Browse files
committed
add ruby 3.4
1 parent bebae08 commit 2429f55

File tree

7 files changed

+152
-0
lines changed

7 files changed

+152
-0
lines changed

build/ruby/build-34.sh

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/usr/bin/bash
2+
#
3+
# {{{ CDDL HEADER
4+
#
5+
# This file and its contents are supplied under the terms of the
6+
# Common Development and Distribution License ("CDDL"), version 1.0.
7+
# You may only use this file in accordance with the terms of version
8+
# 1.0 of the CDDL.
9+
#
10+
# A full copy of the text of the CDDL should have accompanied this
11+
# source. A copy of the CDDL is also available via the Internet at
12+
# http://www.illumos.org/license/CDDL.
13+
# }}}
14+
15+
# Copyright 2025 OmniOS Community Edition (OmniOSce) Association.
16+
17+
. ../../lib/build.sh
18+
19+
PROG=ruby
20+
VER=3.4.1
21+
PKG=ooce/runtime/ruby-34
22+
SUMMARY="Ruby"
23+
DESC="A dynamic, open source programming language "
24+
DESC+="with a focus on simplicity and productivity."
25+
26+
MAJVER=${VER%.*}
27+
sMAJVER=${MAJVER//./}
28+
set_patchdir patches-$sMAJVER
29+
30+
OPREFIX=$PREFIX
31+
PREFIX+=/$PROG-$MAJVER
32+
33+
# does not yet build with gcc 14
34+
((GCCVER > 13)) && set_gccver 13
35+
36+
set_arch 64
37+
38+
NO_SONAME_EXPECTED=1
39+
40+
XFORM_ARGS="
41+
-DPREFIX=${PREFIX#/}
42+
-DOPREFIX=${OPREFIX#/}
43+
-DPROG=$PROG
44+
-DPKGROOT=$PROG-$MAJVER
45+
-DMEDIATOR=$PROG -DMEDIATOR_VERSION=$MAJVER
46+
-DVERSION=$MAJVER
47+
-DsVERSION=$sMAJVER
48+
"
49+
50+
CONFIGURE_OPTS[amd64]+="
51+
--disable-install-doc
52+
--libdir=$PREFIX/lib
53+
"
54+
55+
CPPFLAGS+=" -I/usr/include/gmp"
56+
LDFLAGS[amd64]+=" -R$OPREFIX/lib/amd64"
57+
58+
subsume_arch $BUILDARCH PKG_CONFIG_PATH
59+
60+
init
61+
download_source $PROG $PROG $VER
62+
patch_source
63+
prep_build
64+
run_autoconf -f
65+
build
66+
make_package
67+
clean_up
68+
69+
# Vim hints
70+
# vim:ts=4:sw=4:et:fdm=marker

build/ruby/patches-34/02-config.patch

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Ensure we correctly identify a 64-bit build and
2+
# use "amd64" and "sparcv9" for the 64-bit cpu string.
3+
# Changes were developed in-house, are Solaris specific,
4+
# and are not suitable for upstream.
5+
6+
diff -wpruN --no-dereference '--exclude=*.orig' a~/tool/config.guess a/tool/config.guess
7+
--- a~/tool/config.guess 1970-01-01 00:00:00
8+
+++ a/tool/config.guess 1970-01-01 00:00:00
9+
@@ -409,19 +409,9 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAM
10+
echo i386-pc-auroraux"$UNAME_RELEASE"
11+
exit ;;
12+
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
13+
- set_cc_for_build
14+
- SUN_ARCH=i386
15+
- # If there is a compiler, see if it is configured for 64-bit objects.
16+
- # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
17+
- # This test works for both compilers.
18+
- if test "$CC_FOR_BUILD" != no_compiler_found; then
19+
- if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
20+
- (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
21+
- grep IS_64BIT_ARCH >/dev/null
22+
- then
23+
- SUN_ARCH=x86_64
24+
- fi
25+
- fi
26+
+ SUN_ARCH="i386"
27+
+ # Check CFLAGS for the 64-bit compile option to set the arch
28+
+ echo $CFLAGS | /usr/gnu/bin/grep -q -w '\-m64' && SUN_ARCH="amd64"
29+
echo "$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
30+
exit ;;
31+
sun4*:SunOS:6*:*)
32+
diff -wpruN --no-dereference '--exclude=*.orig' a~/tool/config.sub a/tool/config.sub
33+
--- a~/tool/config.sub 1970-01-01 00:00:00
34+
+++ a/tool/config.sub 1970-01-01 00:00:00
35+
@@ -1028,7 +1028,7 @@ case $cpu-$vendor in
36+
37+
# Here we normalize CPU types irrespective of the vendor
38+
amd64-*)
39+
- cpu=x86_64
40+
+ # don't change basic_machine
41+
;;
42+
blackfin-*)
43+
cpu=bfin
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff -wpruN --no-dereference '--exclude=*.orig' a~/configure.ac a/configure.ac
2+
--- a~/configure.ac 1970-01-01 00:00:00
3+
+++ a/configure.ac 1970-01-01 00:00:00
4+
@@ -1192,8 +1192,6 @@ main()
5+
AC_MSG_RESULT($define_xopen_source)
6+
AS_IF([test x"$define_xopen_source" != xno], [
7+
RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE=$define_xopen_source)
8+
- # _XOPEN_SOURCE should not be defined for C++ on Solaris.
9+
- RUBY_APPEND_OPTIONS(CXXFLAGS, -U_XOPEN_SOURCE)
10+
])
11+
])
12+
AC_CHECK_TYPES([caddr_t],[],[],[@%:@include <sys/types.h>])
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff -wpruN --no-dereference '--exclude=*.orig' a~/ext/openssl/ossl_ssl.c a/ext/openssl/ossl_ssl.c
2+
--- a~/ext/openssl/ossl_ssl.c 1970-01-01 00:00:00
3+
+++ a/ext/openssl/ossl_ssl.c 1970-01-01 00:00:00
4+
@@ -1988,6 +1988,7 @@ ossl_ssl_read_internal(int argc, VALUE *
5+
io_wait_writable(io);
6+
continue;
7+
case SSL_ERROR_WANT_READ:
8+
+wantread:
9+
if (nonblock) {
10+
rb_str_unlocktmp(str);
11+
if (no_exception_p(opts)) { return sym_wait_readable; }
12+
@@ -1998,7 +1999,9 @@ ossl_ssl_read_internal(int argc, VALUE *
13+
case SSL_ERROR_SYSCALL:
14+
if (!ERR_peek_error()) {
15+
rb_str_unlocktmp(str);
16+
- if (errno)
17+
+ if (errno == EAGAIN)
18+
+ goto wantread;
19+
+ else if (errno)
20+
rb_sys_fail(0);
21+
else {
22+
/*

build/ruby/patches-34/series

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
02-config.patch
2+
openssl-EAGAIN.patch
3+
no-_XOPEN_SOURCE-undefine.patch

doc/baseline

+1
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ extra.omnios ooce/runtime/ruby-30
242242
extra.omnios ooce/runtime/ruby-31
243243
extra.omnios ooce/runtime/ruby-32
244244
extra.omnios ooce/runtime/ruby-33
245+
extra.omnios ooce/runtime/ruby-34
245246
extra.omnios ooce/runtime/tcl
246247
extra.omnios ooce/security/gnupg
247248
extra.omnios ooce/security/minisign

doc/packages.md

+1
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@
196196
| ooce/runtime/ruby-31 | 3.1.6 | https://www.ruby-lang.org/en/downloads/ | [omniosorg](https://github.com/omniosorg)
197197
| ooce/runtime/ruby-32 | 3.2.6 | https://www.ruby-lang.org/en/downloads/ | [omniosorg](https://github.com/omniosorg)
198198
| ooce/runtime/ruby-33 | 3.3.7 | https://www.ruby-lang.org/en/downloads/ | [omniosorg](https://github.com/omniosorg)
199+
| ooce/runtime/ruby-34 | 3.4.1 | https://www.ruby-lang.org/en/downloads/ | [omniosorg](https://github.com/omniosorg)
199200
| ooce/runtime/tcl | 8.6.14 | https://sourceforge.net/projects/tcl/files/Tcl/ https://www.tcl.tk/software/tcltk/download.html | [omniosorg](https://github.com/omniosorg)
200201
| ooce/security/gnupg | 2.4.7 | https://gnupg.org/download/ | [omniosorg](https://github.com/omniosorg)
201202
| ooce/security/minisign | 0.12 | https://github.com/jedisct1/minisign/releases | [omniosorg](https://github.com/omniosorg)

0 commit comments

Comments
 (0)