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.)
===> The following configuration options are available for ruby33-3.3.12,1:
CAPIDOCS=off: Build and install C API documents
DEBUG=off: Build with debugging support
DOCS=on: Build and/or install documentation
EXAMPLES=on: Build and/or install examples
GMP=off: Use GMP to accelerate Bignum operations
RDOC=on: Build and install Rdoc indexes
YJIT=off: Enable YJIT (Yet Another Ruby JIT)
===> Use 'make config' to modify these settings
Some of the standard commands and libraries are provided as separate
ports for ease of upgrading:
devel/ruby-gems: gem - RubyGems package manager
devel/rubygem-debug: debug - Debugging functionality for Ruby
devel/rubygem-erb: erb - Templating system for Ruby
devel/rubygem-irb: irb - Interactive Ruby
devel/rubygem-minitest: minitest - Complete suite of testing facilities
devel/rubygem-power_assert: power_assert - Power Assert for Ruby
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-test-unit: test-unit - Unit testing framework for Ruby
devel/rubygem-typeprof: typeprof - Type analysis tool for Ruby code
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-matrix: matrix - Implementation of Matrix and Vector classes
math/rubygem-prime: prime - Prime numbers and factorization library
sysutils/rubygem-bundler: bundler - Tool that manages gem dependencies for ruby applications
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.
lang/ruby*: fix coroutines on armv7
Two ports, devel/rubygem-glib2 and graphics/rubygem-cairo, have been
broken on armv7 for a long time. Recently, pkubaj fixed a problem with
Ruby's coroutine code on ppc64* (see 3bb0a9335) affecting the very same
ports. This naturally raises the question if the armv7 problems are
related.
Turns out that due to an oversight, we use the generic ucontext.h-based
coroutine code on armv7. Switching to the assembly-based code fixes
the ports! Further digging suggests that there may be a problem in the
freebsd32 support for these calls on aarch64 causing the observed
issues. We will investigate those separately.
Tested by: fuz
Approved by: portmgr (build fix blanket)
MFH: 2026Q2
lang/ruby33: revert partially 3bb0a93351df3e8d1d7263c39e49e228ff388123
The patch doesn't apply and ruby33 anyway uses ucontext coroutines
for powerpc64* so the issue doesn't appear there. Since the port didn't
build, it's safe to remove PORTREVISION.
Reported by: zi
lang/ruby*: fix runtime on powerpc64*
The hand-written `coroutine_transfer` in `coroutine/ppc64le/Context.S`
lacks the ELFv2 ABI global entry prologue. When the function is reached
via the PLT (lazy resolution path), r2 (TOC pointer) is left pointing
at whatever the resolver had loaded — typically the dynamic linker's
own TOC — instead of libruby's TOC.
The wrong r2 propagates through the fiber switch into `fiber_entry`,
which jumps into `fiber_restore_thread` → `rb_current_ec_set`. The
first PLT thunk inside the new fiber (`__plt___tls_get_addr` for the
`ruby_current_ec` thread-local) computes its GOT entry as
`r2 + offset` and segfaults dereferencing the bogus address.
Fixes build of textproc/rubygem-nokogiri and devel/rubygem-glib2.
Mk/Uses/ruby.mk: Remove RUBY_WRKSRC
Currently it is only used to set WRKSRC in ruby
ports (lang/ruby3[2-5]). But it is unnecessary to set it explicitly as
default value of WRKSRC is same as that of RUBY_WRKSRC.
lang/ruby3{1,2,3}: Fix build with POSIX-compliant `sh -c`
This chanes nothing in the built package, so bumping PORTREVISION is not
required.
PR: 222872
Reported by: jilles
Tested by: John Hein
Approved by: meta (myself, with ruby hat)
Sponsored by: Cybertrust Japan
lang/ruby33: Fix CPE_STR
RUBY_RELVERSION and RUBY_PATCHLEVEL have been removed in
a1a91e4c937a8664ae4b4bedca114e40c46e3d14.
This commit fixes the CPE_STR.
For example:
- Before:
cpe:2.3:a:ruby-lang:ruby::p::::freebsd14:x64
- After:
cpe:2.3:a:ruby-lang:ruby:3.3.7:p0::::freebsd14:x64
lang/ruby3[1-3]: Update pkg-message
* Remove description about DBM and GDBM libraries. Ruby 3.1 and later
don't distribute them any more.
* Update list of standard commands and libraries that are included in
distribution source archive but provided as separate ports.
lang/ruby3[1-3]: Refine ports
* Skip extracting unnecessary files by setting EXTRACT_AFTER_ARGS
instead of removing them with post-patch target after they are
extracted.
* Use 'USES=localbase' to set path of header and library files.
PR: 278764
lang/ruby33: Fix build with latest -CURRENT
post-install-DOCS-on copies all files/directories under ${WRKSRC}/doc/
into ${STAGEDIR}${RUBY_DOCDIR}/, then installs ${WRKSRC}/ChangeLog to
same directory. But there is ChangeLog directory under ${WRKSRC}/doc/.
As a result there is already ${STAGEDIR}${RUBY_DOCDIR}/ChangeLog
directory when ${WRKSRC}/ChangeLog is tried to be installed as
${WRKSRC}/doc/ChangeLog. Previously install(1) regards it as non-fatal
and build continues. But on latest -CURRENT the command regards it as
fatal and results in build error. So fix it by moving
${WRKSRC}/ChangeLog to ${WRKSRC}/doc/ChangeLog/ChangeLog at extract
phase.
Bump PORTREVISION as plist is changed.
PR: 278554
Reported by: Siva Mahadevan
MFH: 2024Q2