lang/ruby35: Add new port

Add preview1 of Ruby 3.5 series.

ReleaseNotes:	https://www.ruby-lang.org/en/news/2025/04/18/ruby-3-5-0-preview1-released/
This commit is contained in:
Yasuhiro Kimura 2025-04-21 11:17:41 +09:00
parent a80d345d47
commit bc358c3cc4
12 changed files with 15280 additions and 2 deletions

View file

@ -166,13 +166,21 @@ RUBY_PORTREVISION= 0
RUBY_DISTVERSION= 3.4.3
RUBY_PORTREVISION= 0
. elif ${RUBY_VER} == 3.5
#
# Ruby 3.5
#
RUBY_DISTVERSION= 3.5.0-preview1
RUBY_PORTREVISION= 0
# When adding a version, please keep the comment in
# Mk/bsd.default-versions.mk in sync.
. else
#
# Other versions
#
IGNORE= Only ruby 3,2, 3.3 and 3.4 are supported
IGNORE= Only ruby 3,2, 3.3, 3.4 and 3.5 are supported
_INVALID_RUBY_VER= 1
. endif
RUBY_PORTEPOCH= 1
@ -184,6 +192,7 @@ RUBY_VERSION= ${RUBY_DISTVERSION:C/^([0-9]+\.[0-9]+\.[0-9]+).*/\1/}
RUBY32?= "@comment "
RUBY33?= "@comment "
RUBY34?= "@comment "
RUBY35?= "@comment "
. if defined(BROKEN_RUBY${RUBY_VER:R}${RUBY_VER:E})
. if ${BROKEN_RUBY${RUBY_VER:R}${RUBY_VER:E}} == "yes"

View file

@ -144,7 +144,7 @@ PYCRYPTOGRAPHY_DEFAULT?= legacy
PYTHON_DEFAULT?= 3.11
# Possible values: 2.7
PYTHON2_DEFAULT?= 2.7
# Possible values: 3.2, 3.3, 3.4
# Possible values: 3.2, 3.3, 3.4, 3.5
RUBY_DEFAULT?= 3.2
# Possible values: rust, rust-nightly
RUST_DEFAULT?= rust

View file

@ -331,6 +331,7 @@
SUBDIR += ruby32
SUBDIR += ruby33
SUBDIR += ruby34
SUBDIR += ruby35
SUBDIR += rubygem-rb_sys
SUBDIR += rubygem-ruby_language_server
SUBDIR += runawk

205
lang/ruby35/Makefile Normal file
View file

@ -0,0 +1,205 @@
PORTNAME= ruby
DISTVERSION= ${RUBY_DISTVERSION}
PORTREVISION= ${RUBY_PORTREVISION}
PORTEPOCH= ${RUBY_PORTEPOCH}
CATEGORIES= lang ruby
MASTER_SITES= RUBY/${MASTER_SITE_SUBDIR_RUBY}
DIST_SUBDIR= ruby
MAINTAINER= ruby@FreeBSD.org
COMMENT= Object-oriented interpreted scripting language
WWW= https://www.ruby-lang.org/en/
LICENSE= BSD2CLAUSE RUBY
LICENSE_COMB= dual
LICENSE_FILE_BSD2CLAUSE= ${WRKSRC}/BSDL
LICENSE_FILE_RUBY= ${WRKSRC}/COPYING
# Using LIB_DEPENDS finds the libffi from gcc which causes problems
BUILD_DEPENDS= libffi>=0:devel/libffi
LIB_DEPENDS= libyaml.so:textproc/libyaml
RUN_DEPENDS= libffi>=0:devel/libffi
USES= autoreconf cpe localbase ruby:none ssl tar:xz
CPE_VENDOR= ruby-lang
CPE_UPDATE= p0
USE_LDCONFIG= yes
GNU_CONFIGURE= yes
# Bug?: With preview1 `./configure --with-ruby-version=minor` sets ruby version string to "3.5+0"
CONFIGURE_ARGS= ${RUBY_CONFIGURE_ARGS} \
--disable-rpath \
--enable-install-static-library \
--enable-pthread \
--enable-shared \
--with-ruby-version="${RUBY_VER}" \
--with-sitedir="${PREFIX}/lib/ruby/site_ruby" \
--with-vendordir="${PREFIX}/lib/ruby/vendor_ruby"
CONFIGURE_ENV= debugflags=
# Keep this, else ruby will fail to load libraries dependent of libpthread.
LIBS+= -lpthread
EXTRACT_AFTER_ARGS= --exclude ${DISTNAME}/bin/gem \
--exclude ${DISTNAME}/ext/win32* \
--exclude ${DISTNAME}/lib/bundler* \
--exclude ${DISTNAME}/lib/irb* \
--exclude ${DISTNAME}/man/erb.1 \
--exclude ${DISTNAME}/man/irb.1 \
--exclude ${DISTNAME}/man/ri.1 \
--exclude ${DISTNAME}/sample/win32ole \
--no-same-owner --no-same-permissions
WRKSRC= ${RUBY_WRKSRC}
RUBY_VER= 3.5
OPTIONS_DEFINE= CAPIDOCS DEBUG DOCS EXAMPLES GMP RDOC YJIT
OPTIONS_DEFAULT= RDOC
OPTIONS_SUB= yes
CAPIDOCS_DESC= Build and install C API documents
GMP_DESC= Use GMP to accelerate Bignum operations
RDOC_DESC= Build and install Rdoc indexes
YJIT_DESC= Enable YJIT (Yet Another Ruby JIT)
CAPIDOCS_BUILD_DEPENDS= dot:graphics/graphviz \
doxygen>=1.8.13,2:devel/doxygen
CAPIDOCS_CONFIGURE_ENABLE= install-capi
GMP_LIB_DEPENDS= libgmp.so:math/gmp
GMP_CONFIGURE_WITH= gmp
RDOC_CONFIGURE_ENABLE= install-rdoc
YJIT_BUILD_DEPENDS= ${RUST_DEFAULT}>=1.58.0:lang/${RUST_DEFAULT}
YJIT_CONFIGURE_ENABLE= yjit
.include <bsd.port.pre.mk>
# PORTREVISION/PORTEPOCH hack
.if ${PORTREVISION} != 0
_SUF1= _${PORTREVISION}
.endif
.if ${PORTEPOCH} != 0
_SUF2= ,${PORTEPOCH}
.endif
#.if ${OPSYS} == "FreeBSD"
#.if exists(/usr/sbin/dtrace) && (${ARCH} == amd64 || ${ARCH} == i386 || ${ARCH} == powerpc64le || ${ARCH} == powerpc64 || ${ARCH} == powerpc)
#CONFIGURE_ARGS+=--enable-dtrace
#.else
#CONFIGURE_ARGS+=--disable-dtrace
#.endif
#.endif
# keep in sync with all platforms where libunwind is available
.if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH} == armv7 || ${ARCH} == \
i386 || ${ARCH} == powerpc || ${ARCH} == powerpc64 || ${ARCH} == powerpc64le
LIB_DEPENDS+= libunwind.so:devel/libunwind
.endif
.if ${ARCH} == armv6 || ${ARCH} == armv7 || ${ARCH} == powerpc
CONFIGURE_ARGS+= --with-setjmp-type=_setjmp
CONFIGURE_ENV+= ac_cv_func__setjmp=yes
.endif
.if ${RUBY_VER} == ${RUBY_DEFAULT_VER}
PLIST_SUB+= IF_DEFAULT=""
.else
PKGNAMESUFFIX= ${RUBY_SUFFIX}
PLIST_SUB+= IF_DEFAULT="@comment "
.endif
INSTALLED_SCRIPTS= ruby
INSTALLED_MANUALS= ruby
EXTDOCS= ripper/README stringio/README.md
# Macros to change variables in rbconfig.rb
# NOTE: The last argument RB_SET_CONF_VAR is a dummy argument. See bug 222872.
RB_SET_CONF_VAR= ${SH} -c \
'${REINPLACE_CMD} -E -e "s,(CONFIG\[\"$$0\"\][[:space:]]*=[[:space:]]*)(\(?)(.*)(\)?),\1\2$$1\4," ${WRKSRC}/rbconfig.rb' \
RB_SET_CONF_VAR
post-extract-DOCS-on:
${MV} ${WRKSRC}/ChangeLog ${WRKSRC}/doc/ChangeLog
post-build:
#
# Hack to allow modules to be installed into separate PREFIX and/or under user
# privileges
#
@${RB_SET_CONF_VAR} "prefix" "ENV['PREFIX'] || \3"
@${RB_SET_CONF_VAR} "INSTALL" "'/usr/bin/install -c'"
@${RB_SET_CONF_VAR} "INSTALL_PROGRAM" "ENV['RB_USER_INSTALL'] ? '${INSTALL} ${COPY} ${STRIP} -m ${BINMODE}' : '${INSTALL_PROGRAM}'"
@${RB_SET_CONF_VAR} "INSTALL_SCRIPT" "ENV['RB_USER_INSTALL'] ? '${INSTALL} ${COPY} -m ${BINMODE}' : '${INSTALL_SCRIPT}'"
@${RB_SET_CONF_VAR} "INSTALL_DATA" "ENV['RB_USER_INSTALL'] ? '${INSTALL} ${COPY} -m ${SHAREMODE}' : '${INSTALL_DATA}'"
post-build-CAPIDOCS-on:
@${FIND} ${WRKSRC}/doc -type d -empty -delete
pre-install:
${MKDIR} ${STAGEDIR}${RUBY_SITEARCHLIBDIR}
${MKDIR} ${STAGEDIR}${RUBY_VENDORARCHLIBDIR}
pre-install-DOCS-on:
${MKDIR} ${STAGEDIR}${RUBY_DOCDIR}
pre-install-EXAMPLES-on:
${MKDIR} ${STAGEDIR}${RUBY_EXAMPLESDIR}
pre-install-RDOC-on:
${MKDIR} ${STAGEDIR}${RUBY_RIDIR}
${MKDIR} ${STAGEDIR}${RUBY_SITERIDIR}
post-install:
.if ${RUBY_VER} == ${RUBY_DEFAULT_VER}
#
# Link just installed "ruby" to "ruby35", etc.
#
. for FILE in ${INSTALLED_SCRIPTS}
${LN} -fs ${FILE}${RUBY_SUFFIX} ${STAGEDIR}${PREFIX}/bin/${FILE}
. endfor
#
# Link "ruby.1.gz" to "ruby35.1.gz", etc.
#
. for FILE in ${INSTALLED_MANUALS}
${LN} -fs ${FILE}${RUBY_SUFFIX}.1.gz ${STAGEDIR}${PREFIX}/share/man/man1/${FILE}.1.gz
. endfor
.endif
post-install-CAPIDOCS-on:
${RM} ${WRKSRC}/doc/capi/.timestamp ${STAGEDIR}${PREFIX}/share/doc/ruby${RUBY_SUFFIX}/capi/.timestamp
cd ${STAGEDIR}${PREFIX} && ${FIND} share/doc/ruby${RUBY_SUFFIX}/capi/ -type f >> ${TMPPLIST}
post-install-DEBUG-off:
#
# XXX: hack to strip ruby binary. Ruby uses its own install script that seems
# bogus to hack.
#
.if defined(STRIP) && ${STRIP} == -s
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/ruby${RUBY_SUFFIX}
${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libruby${RUBY_SHLIBVER}.so.${RUBY_SHLIBVER}
${FIND} ${STAGEDIR}${RUBY_ARCHLIBDIR} -type f -name '*\.so' -exec ${STRIP_CMD} {} \;
.endif
post-install-DOCS-on:
# Create all dirs required (":u" isn't available in STABLE yet :-()
${MKDIR} ${EXTDOCS:C|^([^/]+)/.*|\1|:S|^|${STAGEDIR}${RUBY_DOCDIR}/|}
.for FILE in ${EXTDOCS}
${INSTALL_DATA} ${WRKSRC}/ext/${FILE} \
${STAGEDIR}${RUBY_DOCDIR}/${FILE:C|^([^/]+)/.*|\1|}/
.endfor
@(cd ${WRKSRC}/doc/ && ${COPYTREE_SHARE} \* ${STAGEDIR}${RUBY_DOCDIR}/)
${INSTALL_DATA} ${WRKSRC}/COPYING* \
${WRKSRC}/LEGAL \
${WRKSRC}/README* \
${STAGEDIR}${RUBY_DOCDIR}/
post-install-EXAMPLES-on:
(cd ${WRKSRC}/sample/ && ${COPYTREE_SHARE} . ${STAGEDIR}${RUBY_EXAMPLESDIR}/)
do-test:
cd ${WRKSRC} && ${MAKE_CMD} test
.include <bsd.port.post.mk>

3
lang/ruby35/distinfo Normal file
View file

@ -0,0 +1,3 @@
TIMESTAMP = 1745193802
SHA256 (ruby/ruby-3.5.0-preview1.tar.xz) = c6cc1e9f23fe4719b024b8305345ca0cff4e1bc159f3ebff86cb5b87969863aa
SIZE (ruby/ruby-3.5.0-preview1.tar.xz) = 17443928

View file

@ -0,0 +1,26 @@
--- common.mk.orig 2024-12-12 01:10:13 UTC
+++ common.mk
@@ -487,17 +487,17 @@ install-all: pre-install-all do-install-all post-insta
$(ruby_pc): $(srcdir)/template/ruby.pc.in config.status
install-all: pre-install-all do-install-all post-install-all
-pre-install-all:: all pre-install-local pre-install-ext pre-install-gem pre-install-doc
+pre-install-all:: all pre-install-local pre-install-ext pre-install-doc
do-install-all: pre-install-all $(DOT_WAIT) docs
- $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=all $(INSTALL_DOC_OPTS)
-post-install-all:: post-install-local post-install-ext post-install-gem post-install-doc
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=all --exclude=gem $(INSTALL_DOC_OPTS)
+post-install-all:: post-install-local post-install-ext post-install-doc
@$(NULLCMD)
install-nodoc: pre-install-nodoc do-install-nodoc post-install-nodoc
-pre-install-nodoc:: pre-install-local pre-install-ext pre-install-gem
+pre-install-nodoc:: pre-install-local pre-install-ext
do-install-nodoc: main pre-install-nodoc
- $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=all --exclude=doc
-post-install-nodoc:: post-install-local post-install-ext post-install-gem
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=all --exclude=doc --exclude=gem
+post-install-nodoc:: post-install-local post-install-ext
install-local: pre-install-local do-install-local post-install-local
pre-install-local:: pre-install-bin pre-install-lib pre-install-man

View file

@ -0,0 +1,36 @@
--- configure.ac.orig 2024-12-12 01:10:13 UTC
+++ configure.ac
@@ -1411,7 +1411,7 @@ AC_CHECK_HEADERS(stdatomic.h)
AC_CHECK_HEADERS(stdckdint.h)
AC_CHECK_HEADERS(stdatomic.h)
-AS_CASE("$target_cpu", [x64|x86_64|[i[3-6]86*]], [
+AS_CASE("$target_cpu", [amd64|x64|x86_64|[i[3-6]86*]], [
AC_CHECK_HEADERS(x86intrin.h)
])
RUBY_UNIVERSAL_CHECK_HEADER([x86_64, i386], x86intrin.h)
@@ -3149,7 +3149,7 @@ AC_SUBST(EXTOBJS)
: ${LDSHARED='$(CC) -shared'}
AS_IF([test "$rb_cv_binary_elf" = yes], [
LDFLAGS="$LDFLAGS -rdynamic"
- DLDFLAGS="$DLDFLAGS "'-Wl,-soname,$@'
+ DLDFLAGS="$DLDFLAGS "'-Wl,-E'
], [
test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED='$(LD) -Bshareable'
])
@@ -3611,6 +3611,7 @@ AS_CASE("$enable_shared", [yes], [
[freebsd*|dragonfly*], [
LIBRUBY_SO='lib$(RUBY_SO_NAME).$(SOEXT).$(MAJOR)$(MINOR)'
LIBRUBY_SONAME='$(LIBRUBY_SO)'
+ RUBY_APPEND_OPTIONS(LIBRUBY_DLDFLAGS, ['-Wl,-soname,${LIBRUBY_SO}'])
AS_IF([test "$rb_cv_binary_elf" != "yes" ], [
LIBRUBY_SO="$LIBRUBY_SO.\$(TEENY)"
LIBRUBY_ALIASES=''
@@ -4443,6 +4444,7 @@ AS_IF([test "${universal_binary-no}" = yes ], [
arch="${target_cpu}-mingw-ucrt"
], [
arch="${target_cpu}-${target_os}"
+ AS_CASE(["$target_cpu-$target_os"], [x86_64-freebsd*],[arch=amd64-${target_os}])
])
AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "$arch")

View file

@ -0,0 +1,11 @@
--- lib/mkmf.rb.orig 2024-05-16 04:54:44 UTC
+++ lib/mkmf.rb
@@ -242,7 +242,7 @@ module MakeMakefile
end
$extmk ||= false
if not $extmk and File.exist?(($hdrdir = RbConfig::CONFIG["rubyhdrdir"]) + "/ruby/ruby.h")
- $topdir = $hdrdir
+ $topdir = $hdrdir + "/" + "#{CONFIG['arch']}/ruby/"
$top_srcdir = $hdrdir
$arch_hdrdir = RbConfig::CONFIG["rubyarchhdrdir"]
elsif File.exist?(($hdrdir = ($top_srcdir ||= topdir) + "/include") + "/ruby.h")

View file

@ -0,0 +1,14 @@
--- tool/mkconfig.rb.orig 2024-12-12 01:10:13 UTC
+++ tool/mkconfig.rb
@@ -170,8 +170,9 @@ end
val.replace(newval) unless newval == val
val
end
-prefix = vars.expand(vars["prefix"] ||= +"")
-rubyarchdir = vars.expand(vars["rubyarchdir"] ||= +"")
+prefix = vars.expand(vars["rubyarchdir"])
+major, minor, *rest = RUBY_VERSION.split('.')
+rubyarchdir = "/lib/ruby/#{major}.#{minor}/#{arch}"
relative_archdir = rubyarchdir.rindex(prefix, 0) ? rubyarchdir[prefix.size..-1] : rubyarchdir
puts %[\

17
lang/ruby35/pkg-descr Normal file
View file

@ -0,0 +1,17 @@
Ruby is the interpreted scripting language for quick and
easy object-oriented programming. It has many features to
process text files and to do system management tasks (as in
Perl). It is simple, straight-forward, and extensible.
Features of Ruby are shown below.
+ Simple Syntax
+ *Normal* Object-Oriented features(ex. class, method calls)
+ *Advanced* Object-Oriented features(ex. Mix-in, Singleton-method)
+ Operator Overloading
+ Exception Handling
+ Iterators and Closures
+ Garbage Collection
+ Dynamic Loading of Object files(on some architecture)
+ Highly Portable(works on many UNIX machines, and on DOS,
Windows, Mac, BeOS etc.)

52
lang/ruby35/pkg-message Normal file
View file

@ -0,0 +1,52 @@
[
{ type: install
message: <<EOM
Some of the standard commands and libraries are provided as separate
ports for ease of upgrading:
benchmarks/rubygem-benchmark: benchmark - Performance benchmarking library
converters/rubygem-base64: base64 - Encode and decode binary data using a Base64 representation
devel/ruby-gems: gem - RubyGems package manager
devel/rubygem-csv: csv - Interface to CSV files and data
devel/rubygem-debug: debug - Debugging functionality for Ruby
devel/rubygem-drb: drb - Distributed object system for Ruby
devel/rubygem-erb: erb - Templating system for Ruby
devel/rubygem-fiddle: fiddle - libffi wrapper for Ruby
devel/rubygem-getoptlong: getoptlong -GetoptLong for Ruby
devel/rubygem-irb: irb - Interactive Ruby
devel/rubygem-logger: logger - Simple logging utility for outputting messages
devel/rubygem-minitest: minitest - Complete suite of testing facilities
devel/rubygem-mutex_m: mutex_m - Mixin to extend objects to be handled like a Mutex
devel/rubygem-observer: observer - Implementation of the Observer object-oriented design pattern
devel/rubygem-ostruct: ostruct - Class to build custom data structures, similar to a Hash
devel/rubygem-power_assert: power_assert - Power Assert for Ruby
devel/rubygem-pstore: pstore - Transactional File Storage for Ruby Objects
devel/rubygem-racc: racc - LALR(1) parser generator for Ruby
devel/rubygem-rake: rake - Ruby Make
devel/rubygem-rbs: rbs - Language for type signatures for Ruby and standard library definitions
devel/rubygem-rdoc: rdoc - Ruby Documentation System
devel/rubygem-readline: readline - Loader for readline
devel/rubygem-reline: reline - Alternative GNU Readline or Editline implementation by pure Ruby
devel/rubygem-repl_type_completor: repl_type_completor - Type based completion for REPL
devel/rubygem-rinda: rinda - Linda distributed computing paradigm in Ruby
devel/rubygem-syslog: syslog - Ruby interface for the POSIX system logging facility
devel/rubygem-test-unit: test-unit - Unit testing framework for Ruby
devel/rubygem-typeprof: typeprof - Type analysis tool for Ruby code
dns/rubygem-resolv-replace: resolv-replace - Replace Socket DNS with Resolv
ftp/rubygem-net-ftp: net-ftp - Support for the File Transfer Protocol
mail/rubygem-net-imap: net-imap - Ruby client api for Internet Message Access Protocol
mail/rubygem-net-pop: net-pop - Ruby client library for POP3
mail/rubygem-net-smtp: net-smtp - Simple Mail Transfer Protocol client library for Ruby
math/rubygem-bigdecimal: bigdecimal - Arbitrary-precision decimal floating-point number class
math/rubygem-matrix: matrix - Implementation of Matrix and Vector classes
math/rubygem-prime: prime - Prime numbers and factorization library
net/rubygem-nkf: nkf - Ruby extension for Network Kanji Filter
sysutils/rubygem-bundler: bundler - Tool that manages gem dependencies for ruby applications
textproc/rubygem-abbrev: abbrev - Calculate a set of unique abbreviations for a given set of strings
textproc/rubygem-rexml: rexml - XML toolkit for Ruby
www/rubygem-rss: rss - Family of libraries that support various formats of XML "feeds"
Install them as occasion demands.
EOM
}
]

14904
lang/ruby35/pkg-plist Normal file

File diff suppressed because it is too large Load diff