Files
jeremy d5bccafe39 Update to JRuby 10.1.0.0
This brings the Ruby version to 4.0. This updates the embedded jffi to
from 1.3.10 to 1.3.15, and the embedded jruby-launcher from 1.1.19 to
2.0.2.

This disables AppCDS usage unless the user has configured a JRUBY_JSA
environment variable, as the default location is not writable results
in a warning.

This ships more of the jruby bin files. There were some hidden files
needed to avoid warnings, as well as some new programs that should be
added. These go in /usr/local/jruby/bin, which is not in PATH, so
conflicts aren't an issue.

One issue with this version is it ships a version of minitest that
doesn't work, as the version it ships depends on a prism library that
it doesn't ship. This should be fixed in the next version, but in the
meantime, comment out a couple minitest files in the PLIST. Users can
use the following to install a usable minitest version:

  jruby -S gem install minitest --version '<6'
2026-05-10 00:13:36 +00:00

103 lines
3.3 KiB
Makefile

# Runtime failures on i386 in IO#pos and IO#rewind
ONLY_FOR_ARCHS = amd64
COMMENT = pure-Java implementation of the Ruby language
V = 10.1.0.0
DISTNAME = jruby-dist-${V}-bin
PKGNAME = jruby-${V}
CATEGORIES = lang lang/ruby
DISTFILES.jffi =jffi-1.3.15.tar.gz
DISTFILES.gem = ${JRUBY_LAUNCHER_GEM}
HOMEPAGE = http://www.jruby.org/
MAINTAINER = Jeremy Evans <jeremy@openbsd.org>
# EPLv1/GPLv2/LGPLv2.1/Ruby/MIT/BSD/Apache/CPL
PERMIT_PACKAGE = Yes
SITES = https://repo1.maven.org/maven2/org/jruby/jruby-dist/${V}/
SITES.jffi = https://github.com/jnr/jffi/archive/refs/tags/
SITES.gem = ${SITE_RUBYGEMS}
MODULES = java gnu
MODGNU_CONFIG_GUESS_DIRS = ${WRKSRC}/jffi/jni/libffi
MODJAVA_VER = 21+
MODJAVA_BUILD = ant
USE_GMAKE = Yes
WANTLIB = c m pthread ${COMPILER_LIBCXX}
COMPILER = base-clang ports-gcc base-gcc
BUILD_DEPENDS = shells/bash
RUN_DEPENDS = java/javaPathHelper
JRUBY_HOME = ${PREFIX}/jruby
MAKE_ENV+= CXX=${CXX} \
ax_enable_builddir_sed=/usr/bin/sed
WRKDIST = ${WRKDIR}/jruby-${V}
JFFI_HOME = ${WRKDIST}/jffi
JFFI_ARCH = ${MACHINE_ARCH:S/amd64/x86_64/}-OpenBSD
FFI_ARCH = ${JFFI_ARCH:L}
JRUBY_LAUNCHER_GEM = jruby-launcher-2.0.2-java.gem
JRUBY_RUBY_VERSION = 4.0
SUBST_VARS = JRUBY_HOME JFFI_ARCH FFI_ARCH RAKE_V RDOC_V JAVA_HOME
MODJAVA_BUILD_DIR = ${JFFI_HOME}
MODJAVA_BUILD_TARGET_NAME = jar
post-extract:
mv ${WRKDIR}/jffi-jffi* ${JFFI_HOME}
# Unpack the jruby-launcher gem, since it needs to be patched
cd ${WRKSRC} && mkdir jruby-launcher \
&& cd jruby-launcher && tar zxf ../../data.tar.gz \
&& rm -f ../../data.tar.gz
do-configure:
${SUBST_CMD} ${WRKSRC}/jruby-launcher/jrubyexe.cpp \
${WRKSRC}/jruby-launcher/unixlauncher.c
cd ${WRKSRC}/jruby-launcher/ && ${SETENV} ${MAKE_ENV} \
../bin/jruby extconf.rb
perl -pi -e '$$. == 1 && s|^.*env j?ruby.*$$|\#!${LOCALBASE}/bin/jruby|;' \
-e '$$. == 1 && s|^.*bin/j?ruby.*$$|\#!${LOCALBASE}/bin/jruby|;' \
-e 'close ARGV if eof;' ${WRKSRC}/bin/!(*.*)
do-build:
${MODJAVA_BUILD_TARGET}
rm -rf ${WRKSRC}/lib/jni
mkdir -p ${WRKSRC}/lib/jni/${JFFI_ARCH}
cp ${JFFI_HOME}/build/jni/libjffi-1.2.so \
${WRKSRC}/lib/jni/${JFFI_ARCH}
cd ${WRKSRC}/lib/ruby/stdlib/ffi/platform && \
rm -r !(${FFI_ARCH}|*.ffi)
cd ${WRKSRC}/jruby-launcher/ && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} \
&& mv jruby ../bin
do-install:
ln -s ${TRUEPREFIX}/jruby/bin/jruby ${PREFIX}/bin/jruby
${INSTALL_DATA_DIR} ${JRUBY_HOME}
${INSTALL_DATA_DIR} ${JRUBY_HOME}/bin
cd ${WRKBUILD}/bin/ && for file in .* ast bundle bundler erb irb gem jgem jirb jirb_swing \
jruby.sh jrubyc lock_jars racc rake rdoc ri syntax_suggest test-unit; \
do ${INSTALL_SCRIPT} $$file ${JRUBY_HOME}/bin/$$file; \
done
${INSTALL_PROGRAM} ${WRKBUILD}/bin/jruby ${JRUBY_HOME}/bin/jruby # not a shell script; used in #! lines
${INSTALL_DATA_DIR} ${JRUBY_HOME}/lib
cd ${WRKBUILD}/lib && tar -cf - * | \
tar -C ${JRUBY_HOME}/lib -xf -
mkdir -p ${JRUBY_HOME}/lib/ruby/${JRUBY_RUBY_VERSION}/site_ruby
find ${JRUBY_HOME}/lib \( -name '*.orig' -o -name '*.beforesubst' \) \
-delete
mv ${JRUBY_HOME}/lib/ruby/gems/{shared,1.8}
ln -s 1.8 ${JRUBY_HOME}/lib/ruby/gems/shared
chown -R ${SHAREOWN}:${SHAREGRP} ${JRUBY_HOME}/lib
rm -f ${PREFIX}/jruby/lib/jruby-java*.jsa # tied to exact jdk build; may need jruby.sh to use?
# JRuby doesn't ship tests in the binary distribution
NO_TEST = Yes
.include <bsd.port.mk>