lang/ruby31-base: add package version 3.1.0

Ruby is a dynamic, open source programming language with a focus on
simplicity and productivity.  It has an elegant syntax that is natural to
read and easy to write.

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 Windows, Mac, etc.)

Ruby 3.1 introduces a number of new features and performance improvements,
here are some of them:
  * Performance: YJIT: New experimental in-process JIT compiler
  * Development supports
	- debug gem: A new debugger
	- error_highlight: Fine-grained error location in backtrace
	- IRB Autocomplete and Document Display

This package is Ruby 3.1 release minimum base package.
This commit is contained in:
taca 2022-01-16 13:57:10 +00:00
parent a0072d670c
commit c42bb7a008
25 changed files with 3350 additions and 0 deletions

View file

@ -0,0 +1,15 @@
bin/bundle @PREFIX@/bin/bundle@RUBY_SUFFIX@
bin/bundler @PREFIX@/bin/bundler@RUBY_SUFFIX@
bin/erb @PREFIX@/bin/erb@RUBY_SUFFIX@
bin/gem @PREFIX@/bin/gem@RUBY_SUFFIX@
bin/irb @PREFIX@/bin/irb@RUBY_SUFFIX@
bin/racc @PREFIX@/bin/racc@RUBY_SUFFIX@
bin/rake @PREFIX@/bin/rake@RUBY_SUFFIX@
bin/rbs @PREFIX@/bin/rbs@RUBY_SUFFIX@
bin/rdoc @PREFIX@/bin/rdoc@RUBY_SUFFIX@
bin/ri @PREFIX@/bin/ri@RUBY_SUFFIX@
bin/ruby @PREFIX@/bin/@RUBY_NAME@
bin/typeprof @PREFIX@/bin/typeprof@RUBY_SUFFIX@
@PKGMANDIR@/man1/erb.1 @PREFIX@/@PKGMANDIR@/man1/erb@RUBY_SUFFIX@.1
@PKGMANDIR@/man1/irb.1 @PREFIX@/@PKGMANDIR@/man1/irb@RUBY_SUFFIX@.1
@PKGMANDIR@/man1/ruby.1 @PREFIX@/@PKGMANDIR@/man1/ruby@RUBY_SUFFIX@.1

View file

@ -0,0 +1,14 @@
# $NetBSD: DEINSTALL,v 1.1 2022/01/16 13:57:10 taca Exp $
RUBY_GEM_BASE="${PREFIX}/@RUBY_GEM_BASE@"
RUBY_SITERIDIR="${PREFIX}/@RUBY_SITERIDIR@"
case ${STAGE} in
DEINSTALL)
${RM} -f ${RUBY_SITERIDIR}/created.rid
;;
POST-DEINSTALL)
${RM} -rf ${GEM_HOME}
${RMDIR} ${RUBY_GEM_BASE} 2>/dev/null || true
;;
esac

24
lang/ruby31-base/DESCR Normal file
View file

@ -0,0 +1,24 @@
Ruby is a dynamic, open source programming language with a focus on
simplicity and productivity. It has an elegant syntax that is natural to
read and easy to write.
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 Windows, Mac, etc.)
Ruby 3.1 introduces a number of new features and performance improvements,
here are some of them:
* Performance: YJIT: New experimental in-process JIT compiler
* Development supports
- debug gem: A new debugger
- error_highlight: Fine-grained error location in backtrace
- IRB Autocomplete and Document Display
This package is Ruby 3.1 release minimum base package.

13
lang/ruby31-base/INSTALL Normal file
View file

@ -0,0 +1,13 @@
# $NetBSD: INSTALL,v 1.1 2022/01/16 13:57:10 taca Exp $
DATE="@DATE@"
RUBY_SITERIDIR="${PREFIX}/@RUBY_SITERIDIR@"
rid="${RUBY_SITERIDIR}/created.rid"
case ${STAGE} in
POST-INSTALL)
if [ -d ${RUBY_SITERIDIR} ]; then
${DATE} > ${rid}
fi
;;
esac

12
lang/ruby31-base/MESSAGE Normal file
View file

@ -0,0 +1,12 @@
===========================================================================
$NetBSD: MESSAGE,v 1.1 2022/01/16 13:57:10 taca Exp $
Note that this is a minimal package.
The original ${RUBY_DISTNAME} distribution includes more extension
libraries, some of which are provided as separate packages:
devel/ruby-fiddle: Fiddle module
devel/ruby-readline: readline module
===========================================================================

115
lang/ruby31-base/Makefile Normal file
View file

@ -0,0 +1,115 @@
# $NetBSD: Makefile,v 1.1 2022/01/16 13:57:10 taca Exp $
DISTNAME= ${RUBY_DISTNAME}
PKGNAME= ${RUBY_PKGPREFIX}-base-${RUBY_VERSION}
CATEGORIES= lang ruby
MASTER_SITES= ${MASTER_SITE_RUBY}
MAINTAINER= taca@NetBSD.org
HOMEPAGE= ${RUBY_HOMEPAGE}
COMMENT= Ruby ${RUBY_VERSION} release minimum base package
RUBY_VERSIONS_ACCEPTED= 31
MAKE_JOBS_SAFE= no
USE_GCC_RUNTIME= yes
USE_LANGUAGES= c c++
USE_TOOLS+= pax yacc pkg-config
GNU_CONFIGURE= yes
TEST_TARGET= test
CONFIGURE_ARGS+= --enable-shared --enable-install-static-library
MAKE_ENV+= XDG_DATA_HOME=${WRKDIR}
WRKSRC= ${RUBY_WRKSRC}
.include "options.mk"
.include "../../lang/ruby/platform.mk"
.if !empty(RUBY_SUFFIX)
CONFIGURE_ARGS+= --program-suffix=${RUBY_SUFFIX}
CONFIGURE_ARGS+= --with-soname=${RUBY_NAME}
CONFIGURE_ARGS+= --with-ruby-version=${RUBY_VER_DIR}
CONFIGURE_ARGS+= --with-ruby-pc="ruby-${RUBY_VERSION}.pc"
.endif
CONFIGURE_ENV+= ac_cv_path_MJIT_CC=${CC}
CONFIGURE_ENV.Darwin+= ac_cv_prog_dsymutil=
DOCS= BSDL CONTRIBUTING.md COPYING COPYING.ja ChangeLog GPL \
KNOWNBUGS.rb LEGAL NEWS.md README.ja.md README.md \
README.EXT README.EXT.ja
EXT_DOCS= syslog/syslog.txt
BIGDECIMAL_EXAMPLES= linear.rb nlsolve.rb pi.rb
OPENSSL_EXAMPLES= c_rehash.rb cert2text.rb certstore.rb cipher.rb \
crlstore.rb echo_cli.rb echo_svr.rb gen_csr.rb \
smime_read.rb smime_write.rb wget.rb
REPLACE_RUBY= \
libexec/bundle libexec/bundler libexec/erb libexec/irb \
libexec/racc libexec/rdoc libexec/ri \
.bundle/gems/debug-${RUBY_DEBUG_VER}/exe/rdbg \
.bundle/gems/rake-${RUBY_RAKE_VER}/exe/rake \
.bundle/gems/rbs-${RUBY_RBS_VER}/exe/rbs \
.bundle/gems/typeprof-${RUBY_TYPEPROF_VER}/exe/typeprof
REPLACE_RUBY_DIRS= ext lib sample
INSTALLATION_DIRS+= bin libexec ${PKGMANDIR}/man1 \
${RUBY_DOC}/csv/arguments \
${RUBY_DOC}/csv/options/common \
${RUBY_DOC}/csv/options/generating \
${RUBY_DOC}/csv/options/parsing \
${RUBY_DOC}/csv/recipes \
${RUBY_DOC}/images ${RUBY_DOC}/irb ${RUBY_DOC}/pty \
${RUBY_DOC}/ripper \
${RUBY_DOC}/stringio ${RUBY_DOC}/syntax \
${RUBY_EG}/bigdecimal ${RUBY_EG}/pty
# ${RUBY_ARCHINC} ${RUBY_ARCHLIB}
EMPTY_DIRS= generator/template markup/simple_markup
NOT_PAX_MPROTECT_SAFE+= bin/${RUBY_NAME}
pre-configure:
${RM} -f ${WRKSRC}/ext/readline/extconf.rb
${TOUCH} ${WRKSRC}/prelude.c
${CHMOD} -x ${WRKSRC}/sample/test.rb
pre-install:
# cd ${WRKSRC}/lib; \
# ${FIND} . \( -name '*.orig' -o -name '*.orig_dist' \) \
# -exec ${RM} -f {} \;
.for f in ${EMPTY_DIRS}
${RMDIR} ${WRKSRC}/lib/rdoc/${f} 2>/dev/null || ${TRUE}
.endfor
post-install:
cd ${DESTDIR}${PREFIX}/${GEM_HOME} && \
find . \! -type d \( -name 'Makefile*' -o -name '.*.time' \
-o -name '*.o' -o -name 'gem_make.out' \) -exec rm {} \;
cd ${WRKSRC}/doc && ${PAX} -rw . ${DESTDIR}${PREFIX}/${RUBY_DOC}
.for f in ${DOCS}
${INSTALL_DATA} ${WRKSRC}/${f} ${DESTDIR}${PREFIX}/${RUBY_DOC}
.endfor
.for f in ${EXT_DOCS}
${INSTALL_DATA} ${WRKSRC}/ext/${f} ${DESTDIR}${PREFIX}/${RUBY_DOC}
.endfor
cd ${WRKSRC}/ext/ripper; ${PAX} -rw README ${DESTDIR}${PREFIX}/${RUBY_DOC}/ripper
cd ${WRKSRC}/ext/stringio; ${PAX} -rw README.md ${DESTDIR}${PREFIX}/${RUBY_DOC}/stringio
cd ${WRKSRC}/sample; ${PAX} -rw . ${DESTDIR}${PREFIX}/${RUBY_EG}
.for f in ${BIGDECIMAL_EXAMPLES}
${INSTALL_DATA} ${WRKSRC}/ext/bigdecimal/sample/${f} \
${DESTDIR}${PREFIX}/${RUBY_EG}/bigdecimal
.endfor
.for f in ${OPENSSL_EXAMPLES}
${INSTALL_DATA} ${WRKSRC}/sample/openssl/${f} \
${DESTDIR}${PREFIX}/${RUBY_EG}/openssl
.endfor
${CHMOD} -R g-w ${DESTDIR}${PREFIX}/${GEM_HOME}/gems
${RUBY_GENERATE_PLIST}
.include "../../mk/bdb.buildlink3.mk"
.include "../../converters/libiconv/buildlink3.mk"
.include "../../devel/libffi/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../security/openssl/buildlink3.mk"
.include "../../textproc/libyaml/buildlink3.mk"
.include "../../lang/ruby/Makefile.common"
.include "../../mk/bsd.pkg.mk"

2552
lang/ruby31-base/PLIST Normal file

File diff suppressed because it is too large Load diff

20
lang/ruby31-base/distinfo Normal file
View file

@ -0,0 +1,20 @@
$NetBSD: distinfo,v 1.1 2022/01/16 13:57:10 taca Exp $
BLAKE2s (ruby-3.1.0.tar.xz) = 3f7e1efe8ad9964d3141ec31c7ea0cd1a6d91791ca925c852c34afc260126b41
SHA512 (ruby-3.1.0.tar.xz) = a2bb6b5e62d5fa06dd9c30cf84ddcb2c27cb87fbaaffd2309a44391a6b110e1dde6b7b0d8c659b56387ee3c9b4264003f3532d5a374123a7c187ebba9293f320
Size (ruby-3.1.0.tar.xz) = 14709096 bytes
SHA1 (patch-common.mk) = c23eed58427b2fd4ba8fdb3692f609701a666c6d
SHA1 (patch-configure) = c8a09d995d9d09c1142f22cf59f04fa61b528a2a
SHA1 (patch-ext_openssl_openssl__missing.h) = 3f8d79736fd14806dfaf76e333eec63ff3ff5890
SHA1 (patch-lib_mkmf.rb) = 4a3cd18548dbdf43a13695d4e76f817c0347e335
SHA1 (patch-lib_rdoc_encoding.rb) = 0e82d2942d9bfcb67dc7c994889d7bc5ec2ae85a
SHA1 (patch-lib_rdoc_ri_driver.rb) = f4d3e59e35b608acd4edc17916142c7f033e6198
SHA1 (patch-lib_rubygems.rb) = 5208798483129d1391891ca4af46ed11e072737a
SHA1 (patch-lib_rubygems_commands_setup__command.rb) = 181bb7554d760182588b0e1b0aafb84c317f41ad
SHA1 (patch-lib_rubygems_dependency__installer.rb) = 1776508907f17547ffe93f637d6f18d335061d76
SHA1 (patch-lib_rubygems_install__update__options.rb) = 1e953b5a517a805fd7184e359fbc06e67a5ff9b3
SHA1 (patch-lib_rubygems_installer.rb) = 03fcd57d4e7ea03cf2ffc3d219fd489e30361014
SHA1 (patch-lib_rubygems_platform.rb) = dc4c1073ffe331c06c477ee4b281db7aeb76fa92
SHA1 (patch-test_rubygems_test__gem.rb) = e624da5b9c49f9409160a7b0fdd2efad17986cab
SHA1 (patch-thread__pthread.c) = 7c1231933a2d6ce9d56891ab512371841697fbca
SHA1 (patch-tool_ifchange) = 1814cd41f0b0a93b181799cb117bd1f57068cf33

44
lang/ruby31-base/hacks.mk Normal file
View file

@ -0,0 +1,44 @@
# $NetBSD: hacks.mk,v 1.1 2022/01/16 13:57:10 taca Exp $
.if !defined(RUBY31_BASE_HACKS_MK)
RUBY31_BASE_HACKS_MK= defined
.include "../../mk/compiler.mk"
### [ Sun Jun 5 10:05:39 CEST 2005 : seb ]
### On NetBSD/sparc64, gcc optimisation, at least for version 3.3.3,
### produces segmentation faulting miniruby binary.
### Also note that `-O' level optimisation produces a miniruby
### binary that loops while running the installation scripts.
###
.if !empty(MACHINE_PLATFORM:MNetBSD-*-sparc64)
. if !empty(CC_VERSION:Mgcc-3.3.*)
PKG_HACKS+= optimisation
BUILDLINK_TRANSFORM+= rm:-O[0-9]*
. endif
### ruby193 binary built on NetBSD/sparc64 with gcc 4.5.1 and the default -O2
### dumps core during generating RDocs.
### Using -O1 works around.
. if !empty(CC_VERSION:Mgcc-4.5.*)
PKG_HACKS+= optimisation
BUILDLINK_TRANSFORM+= opt:-O2:-O1
. endif
.endif
# On NetBSD/sh3el 6.0, the default -Os causes an error on compiling node.c:
# {standard input}: Assembler messages: {standard input}:1458: \
# Error: pcrel too far
# and -O1 works around.
.if !empty(MACHINE_PLATFORM:MNetBSD-*-sh3*) && !empty(CC_VERSION:Mgcc-4.5.*)
PKG_HACKS+= optimisation
BUILDLINK_TRANSFORM+= opt:-Os:-O1 rm:-freorder-blocks
.endif
# On NetBSD/aarch64, GCC before GCC 10 optimisation produces segmentation
# faulting miniruby binary.
.if !empty(MACHINE_PLATFORM:MNetBSD-*-aarch64*) && !empty(CC_VERSION:Mgcc-[2-9]*)
PKG_HACKS+= optimisation
BUILDLINK_TRANSFORM+= rm:-fomit-frame-pointer
.endif
.endif # RUBY31_BASE_HACKS_MK

View file

@ -0,0 +1,15 @@
# $NetBSD: options.mk,v 1.1 2022/01/16 13:57:10 taca Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.ruby
PKG_SUPPORTED_OPTIONS= ruby-build-ri-db
PKG_SUGGESTED_OPTIONS= ruby-build-ri-db
.include "../../mk/bsd.options.mk"
.if !empty(PKG_OPTIONS:Mruby-build-ri-db)
RUBY_DYNAMIC_DIRS+= ${RUBY_SYSRIDIR}
# Use huge memory.
UNLIMIT_RESOURCES+= datasize
.else
CONFIGURE_ARGS+= --enable-install-doc=no
.endif

View file

@ -0,0 +1,15 @@
$NetBSD: patch-common.mk,v 1.1 2022/01/16 13:57:10 taca Exp $
* Do not try to download gem files.
--- common.mk.orig 2020-12-08 09:02:31.000000000 +0000
+++ common.mk
@@ -549,7 +549,7 @@ post-install-doc::
@$(NULLCMD)
install-gem: pre-install-gem do-install-gem post-install-gem
-pre-install-gem:: prepare-gems pre-install-bin pre-install-lib pre-install-man
+pre-install-gem:: pre-install-bin pre-install-lib pre-install-man
do-install-gem: $(PROGRAM) pre-install-gem
$(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=gem
post-install-gem::

View file

@ -0,0 +1,150 @@
$NetBSD: patch-configure,v 1.1 2022/01/16 13:57:10 taca Exp $
* Avoid bash specific variable substitution.
* Adding Interix support.
* Ignore doxygen.
* Ignore VCS.
* Handle SSP in pkgsrc.
* Put -std= in CFLAGS not CPPFLAGS.
* Fix argument for pthread_self() on NetBSD.
* Explictly stop display with color.
--- configure.orig 2021-12-25 12:23:16.000000000 +0000
+++ configure
@@ -3316,12 +3316,12 @@ case "$target_cpu-$target_os" in #(
target_cpu=arm64
case "$target_vendor" in #(
unknown) :
- target_vendor=apple target=${target/-unknown-/-apple-} ;; #(
+ target_vendor=apple target=$(echo ${target} | sed -e 's/-unknown-/-apple-/g') ;; #(
*) :
;;
esac
- target="${target/aarch64/arm64}"
- target_alias="${target_alias/aarch64/arm64}"
+ target="$(echo ${target} | sed -e 's/aarch64/arm64/g')"
+ target_alias="$(echo ${target_alias} | sed -e 's/aarch64/arm64/g')"
;; #(
*) :
;;
@@ -8441,7 +8441,7 @@ else
if test x"$target_alias" = x; then :
case "$target_os" in #(
- darwin*) :
+ nodarwin*) :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for real target cpu" >&5
$as_echo_n "checking for real target cpu... " >&6; }
@@ -10262,6 +10262,7 @@ fi
stack_protector=no
;; #(
*) :
+ stack_protector=no
;;
esac
if test -z "${stack_protector+set}"; then :
@@ -12226,6 +12227,10 @@ esac
ac_cv_func___builtin_setjmp=no
;; #(
+ interix*) :
+ LIBS="-lm $LIBS"
+ ac_cv_func_getpgrp_void=yes
+ ;; #(
*) :
;;
esac
@@ -24059,6 +24064,8 @@ else
# ifdef _MSC_VER
# include <malloc.h>
# define alloca _alloca
+# elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)
+# include <stdlib.h>
# else
# ifdef HAVE_ALLOCA_H
# include <alloca.h>
@@ -29499,7 +29506,9 @@ fi
interix*) :
: ${LDSHARED='$(CC) -shared'}
XLDFLAGS="$XLDFLAGS -Wl,-E"
+ DLDFLAGS="$DLDFLAGS "'-Wl,-h,$(.TARGET) -Wl,--image-base,$$(($$RANDOM %4096/2*262144+1342177280))'
LIBPATHFLAG=" -L%1\$-s"
+ RPATHFLAG=' -Wl,-R%1$-s'
rb_cv_dlopen=yes ;; #(
freebsd*|dragonfly*) :
@@ -30700,7 +30709,7 @@ fi
;; #(
freebsd*|dragonfly*) :
- LIBRUBY_SO='lib$(RUBY_SO_NAME).$(SOEXT).$(MAJOR)$(MINOR)'
+ LIBRUBY_SO='lib$(RUBY_SO_NAME).$(SOEXT).$(MAJOR)$(MINOR)$(TEENY)'
LIBRUBY_SONAME='$(LIBRUBY_SO)'
if test "$rb_cv_binary_elf" != "yes" ; then :
@@ -30795,9 +30804,10 @@ esac
;; #(
darwin*) :
+ RUBY_SO_NAME="${RUBY_SO_NAME}"'.$(RUBY_PROGRAM_VERSION)'
LIBRUBY_SO='lib$(RUBY_SO_NAME).$(SOEXT)'
- LIBRUBY_SONAME='$(LIBRUBY_SO)'
- LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).$(SOEXT)'
+ LIBRUBY_SONAME='lib$(RUBY_BASE_NAME).$(RUBY_API_VERSION).$(SOEXT)'
+ LIBRUBY_ALIASES='$(LIBRUBY_SONAME) lib$(RUBY_INSTALL_NAME).$(SOEXT)'
if test "$load_relative" = yes; then :
libprefix="@executable_path/../${libdir_basename}"
@@ -30818,7 +30828,12 @@ fi
;; #(
interix*) :
- LIBRUBYARG_SHARED='-L. -L${libdir} -l$(RUBY_SO_NAME)'
+ SOLIBS='$(LIBS)'
+ LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR).$(TEENY)'
+ # link explicitly to 0x48000000
+ LIBRUBY_DLDFLAGS='-Wl,-h,lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR) -Wl,--image-base,1207959552'
+ LIBRUBYARG_SHARED='-Wl,-R -Wl,${PREFIX}/lib} -L${libdir} -L. -l$(RUBY_SO_NAME)'
+ LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR) lib$(RUBY_SO_NAME).so'
;; #(
cygwin*|msys*|mingw*|mswin*) :
@@ -31000,7 +31015,7 @@ if test "$enable_rpath" = yes; then :
esac
rpathflag=`IFS="$PATH_SEPARATOR"
echo x "$rpathflag" |
- sed "s/^x *//;s${IFS}"'%1\\$-s'"${IFS}${libprefix}${IFS}g;s${IFS}%s${IFS}${libprefix}${IFS}g"
+ sed "s/^x *//;s${IFS}"'%1\\$-s'"${IFS}${libprefix}${IFS}g;s${IFS}%s${IFS}${PREFIX}/lib${IFS}g"
`
LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS${rpathflag}"
LIBRUBYARG_SHARED="$LIBRUBY_RPATHFLAGS $LIBRUBYARG_SHARED"
@@ -32550,7 +32565,7 @@ guard=INCLUDE_RUBY_CONFIG_H
if test "x$CONFIGURE_TTY" = xyes; then :
color=--color
else
- color=
+ color=--color=never
fi
exec ${SHELL} ${tooldir}/ifchange $color "${config_h}" -
) >&6 || as_fn_error $? "failed to create ${config_h}" "$LINENO" 5
@@ -33773,19 +33788,7 @@ which seems to be undefined. Please mak
"Makefile":F)
tmpmk=confmk$$.tmp
{
- if test ${VCS+set}; then :
-
- :
-
-elif git_dir=`$GIT --work-tree="$srcdir" --git-dir="$srcdir/.git" rev-parse --git-dir 2>/dev/null`; then :
-
- VCS='$(GIT)'
-
-else
-
VCS='echo cannot'
-
-fi
case "$VCS" in #(
'$(GIT)'|git) :
VCSUP='$(VCS) pull --rebase $(GITPULLOPTIONS)' ;; #(

View file

@ -0,0 +1,15 @@
$NetBSD: patch-ext_openssl_openssl__missing.h,v 1.1 2022/01/16 13:57:10 taca Exp $
Support OpenSSL 3.
--- ext/openssl/openssl_missing.h.orig 2021-07-07 10:08:35.000000000 +0000
+++ ext/openssl/openssl_missing.h
@@ -235,7 +235,7 @@ IMPL_PKEY_GETTER(EC_KEY, ec)
# define TS_STATUS_INFO_get0_failure_info(a) ((a)->failure_info)
#endif
-#if !defined(HAVE_TS_VERIFY_CTS_SET_CERTS)
+#if !defined(HAVE_TS_VERIFY_CTS_SET_CERTS) && !defined(TS_VERIFY_CTS_set_certs)
# define TS_VERIFY_CTS_set_certs(ctx, crts) ((ctx)->certs=(crts))
#endif

View file

@ -0,0 +1,30 @@
$NetBSD: patch-lib_mkmf.rb,v 1.1 2022/01/16 13:57:10 taca Exp $
* Avoid to generate empty command line on some platforms.
* Make compatible processing dependency output as Ruby 2.6.
$(DLLIB): $(OBJS) Makefile
...
$(Q) $(POSTLINK)
And POSTLINK is empty macro. In such case, GNU make ignore empty command
line but BSD make tries to execute it and causes error.
--- lib/mkmf.rb.orig 2019-12-25 09:50:58.000000000 +0000
+++ lib/mkmf.rb
@@ -2023,6 +2023,7 @@ LDSHARED = #{CONFIG['LDSHARED']}
LDSHAREDXX = #{config_string('LDSHAREDXX') || '$(LDSHARED)'}
AR = #{CONFIG['AR']}
EXEEXT = #{CONFIG['EXEEXT']}
+POSTLINK = #{CONFIG['POSTLINK']}
}
CONFIG.each do |key, val|
@@ -2134,6 +2135,7 @@ RULES
line.gsub!(/\.o\b/, ".#{$OBJEXT}")
line.gsub!(/\{\$\(VPATH\)\}/, "") unless $nmake
line.gsub!(/\$\((?:hdr|top)dir\)\/config.h/, $config_h)
+ line.gsub!(%r"\$\(hdrdir\)/(?!ruby(?![^:;/\s]))(?=[-\w]+\.h)", '\&ruby/')
if $nmake && /\A\s*\$\(RM|COPY\)/ =~ line
line.gsub!(%r"[-\w\./]{2,}"){$&.tr("/", "\\")}
line.gsub!(/(\$\((?!RM|COPY)[^:)]+)(?=\))/, '\1:/=\\')

View file

@ -0,0 +1,15 @@
$NetBSD: patch-lib_rdoc_encoding.rb,v 1.1 2022/01/16 13:57:10 taca Exp $
* Always convert "\r\n" to "\n" since it cause rdoc processing error.
--- lib/rdoc/encoding.rb.orig 2018-03-26 05:56:26.000000000 +0000
+++ lib/rdoc/encoding.rb
@@ -31,7 +31,7 @@ module RDoc::Encoding
def self.read_file filename, encoding, force_transcode = false
content = File.open filename, "rb" do |f| f.read end
- content.gsub!("\r\n", "\n") if RUBY_PLATFORM =~ /mswin|mingw/
+ content.gsub!("\r\n", "\n")
utf8 = content.sub!(/\A\xef\xbb\xbf/, '')

View file

@ -0,0 +1,37 @@
$NetBSD: patch-lib_rdoc_ri_driver.rb,v 1.1 2022/01/16 13:57:10 taca Exp $
* Defer loading readline, when it is really needed.
Some unknown reason:
1. build devel/ruby-readline with editline(3).
2. Execute a ruby script loading readline in background from shell.
3. When the script output something to stdout, it got SIGTSTP and suspends.
There is no such problem when build devel/ruby-readline with GNU's readline.
--- lib/rdoc/ri/driver.rb.orig 2016-11-05 09:18:10.000000000 +0000
+++ lib/rdoc/ri/driver.rb
@@ -3,11 +3,6 @@ require 'abbrev'
require 'optparse'
begin
- require 'readline'
-rescue LoadError
-end
-
-begin
require 'win32console'
rescue LoadError
end
@@ -1057,6 +1052,11 @@ The ri pager can be set with the 'RI_PAG
# Runs ri interactively using Readline if it is available.
def interactive
+ begin
+ require 'readline'
+ rescue LoadError
+ end
+
puts "\nEnter the method name you want to look up."
if defined? Readline then

View file

@ -0,0 +1,44 @@
$NetBSD: patch-lib_rubygems.rb,v 1.1 2022/01/16 13:57:10 taca Exp $
* Add install_root option for pkgsrc's rubygems support.
--- lib/rubygems.rb.orig 2020-12-08 09:02:31.000000000 +0000
+++ lib/rubygems.rb
@@ -315,10 +315,16 @@ module Gem
##
# The path where gem executables are to be installed.
- def self.bindir(install_dir=Gem.dir)
- return File.join install_dir, 'bin' unless
- install_dir.to_s == Gem.default_dir.to_s
- Gem.default_bindir
+ def self.bindir(install_dir=Gem.dir, install_root=nil)
+ if install_dir.to_s == Gem.default_dir.to_s
+ install_dir = Gem.default_bindir
+ else
+ install_dir = File.join install_dir, 'bin'
+ end
+ unless install_root.nil? or install_root.empty?
+ install_dir = File.join install_root, install_dir
+ end
+ install_dir
end
##
@@ -591,7 +597,7 @@ An Array (#{env.inspect}) was passed in
return i if path.instance_variable_defined?(:@gem_prelude_index)
end
- index = $LOAD_PATH.index RbConfig::CONFIG['sitelibdir']
+ index = $LOAD_PATH.index RbConfig::CONFIG['vendorlibdir']
index || 0
end
@@ -775,6 +781,7 @@ An Array (#{env.inspect}) was passed in
prefix = File.dirname RUBYGEMS_DIR
if prefix != File.expand_path(RbConfig::CONFIG['sitelibdir']) and
+ prefix != File.expand_path(RbConfig::CONFIG['vendorlibdir']) and
prefix != File.expand_path(RbConfig::CONFIG['libdir']) and
'lib' == File.basename(RUBYGEMS_DIR)
prefix

View file

@ -0,0 +1,41 @@
$NetBSD: patch-lib_rubygems_commands_setup__command.rb,v 1.1 2022/01/16 13:57:10 taca Exp $
* Make sure to setup under DESTDIR.
--- lib/rubygems/commands/setup_command.rb.orig 2018-12-23 00:20:49.000000000 +0000
+++ lib/rubygems/commands/setup_command.rb
@@ -177,7 +177,7 @@ By default, this RubyGems will install g
uninstall_old_gemcutter
- documentation_success = install_rdoc
+ documentation_success = install_rdoc install_destdir
say
if @verbose
@@ -341,11 +341,15 @@ By default, this RubyGems will install g
end
end
- def install_rdoc
+ def install_rdoc(install_destdir)
gem_doc_dir = File.join Gem.dir, 'doc'
rubygems_name = "rubygems-#{Gem::VERSION}"
rubygems_doc_dir = File.join gem_doc_dir, rubygems_name
+ unless install_destdir.empty?
+ FileUtils.mkdir_p gem_doc_dir unless File.exist?(gem_doc_dir)
+ end
+
begin
Gem.ensure_gem_subdirectories Gem.dir
rescue SystemCallError
@@ -356,7 +360,7 @@ By default, this RubyGems will install g
(not File.exist? rubygems_doc_dir or
File.writable? rubygems_doc_dir)
say "Removing old RubyGems RDoc and ri" if @verbose
- Dir[File.join(Gem.dir, 'doc', 'rubygems-[0-9]*')].each do |dir|
+ Dir[File.join(gem_doc_dir, 'rubygems-[0-9]*')].each do |dir|
rm_rf dir
end

View file

@ -0,0 +1,36 @@
$NetBSD: patch-lib_rubygems_dependency__installer.rb,v 1.1 2022/01/16 13:57:10 taca Exp $
* Add install_root option for pkgsrc's rubygems support.
--- lib/rubygems/dependency_installer.rb.orig 2016-02-01 12:43:26.000000000 +0000
+++ lib/rubygems/dependency_installer.rb
@@ -64,6 +64,7 @@ class Gem::DependencyInstaller
# :format_executable:: See Gem::Installer#initialize.
# :ignore_dependencies:: Don't install any dependencies.
# :install_dir:: See Gem::Installer#install.
+ # :install_root:: See Gem::Installer#install.
# :prerelease:: Allow prerelease versions. See #install.
# :security_policy:: See Gem::Installer::new and Gem::Security.
# :user_install:: See Gem::Installer.new
@@ -102,7 +103,12 @@ class Gem::DependencyInstaller
@installed_gems = []
@toplevel_specs = nil
- @cache_dir = options[:cache_dir] || @install_dir
+ @install_root = options[:install_root] || ""
+ install_dir = @install_dir
+ unless @install_root.nil? or @install_root.empty?
+ install_dir = File.join(@install_root, install_dir)
+ end
+ @cache_dir = options[:cache_dir] || install_dir
@errors = []
end
@@ -393,6 +399,7 @@ class Gem::DependencyInstaller
:force => @force,
:format_executable => @format_executable,
:ignore_dependencies => @ignore_dependencies,
+ :install_root => @install_root,
:prerelease => @prerelease,
:security_policy => @security_policy,
:user_install => @user_install,

View file

@ -0,0 +1,20 @@
$NetBSD: patch-lib_rubygems_install__update__options.rb,v 1.1 2022/01/16 13:57:10 taca Exp $
* Add install_root option for pkgsrc's rubygems support.
* Tweak build_info directory with destdir to store build_args.
--- lib/rubygems/install_update_options.rb.orig 2017-10-08 01:32:18.000000000 +0000
+++ lib/rubygems/install_update_options.rb
@@ -18,6 +18,12 @@ module Gem::InstallUpdateOptions
# Add the install/update options to the option parser.
def add_install_update_options
+ add_option(:"Install/Update", '-B', '--install-root DIR',
+ 'Root directory for gem files on install') do |value, options|
+ options[:install_root] = File.expand_path(value)
+ Gem.ensure_gem_subdirectories File.join options[:install_root], Gem.dir
+ end
+
add_option(:"Install/Update", '-i', '--install-dir DIR',
'Gem repository directory to get installed',
'gems') do |value, options|

View file

@ -0,0 +1,42 @@
$NetBSD: patch-lib_rubygems_installer.rb,v 1.1 2022/01/16 13:57:10 taca Exp $
* Add install_root option for pkgsrc's rubygems support.
* Tweak build_info directory with destdir to store build_args.
--- lib/rubygems/installer.rb.orig 2021-11-24 11:12:15.000000000 +0000
+++ lib/rubygems/installer.rb
@@ -166,6 +166,9 @@ class Gem::Installer
# foo_exec18.
# :ignore_dependencies:: Don't raise if a dependency is missing.
# :install_dir:: The directory to install the gem into.
+ # :install_root:: The directory to use as a buildroot for "destdir"-style
+ # installation. All paths during installation are relative
+ # to the buildroot.
# :security_policy:: Use the specified security policy. See Gem::Security
# :user_install:: Indicate that the gem should be unpacked into the users
# personal gem directory.
@@ -680,7 +683,13 @@ class Gem::Installer
# If the user has asked for the gem to be installed in a directory that is
# the system gem directory, then use the system bin directory, else create
# (or use) a new bin dir under the gem_home.
- @bin_dir = options[:bin_dir] || Gem.bindir(gem_home)
+ install_root = options[:install_root]
+ @bin_dir = options[:bin_dir] || Gem.bindir(gem_home, install_root)
+ unless install_root.nil? or install_root.empty?
+ @install_root = File.expand_path install_root
+ @gem_home = File.join(@install_root, @gem_home)
+ @plugins_dir = Gem.plugindir(@gem_home)
+ end
@development = options[:development]
@build_root = options[:build_root]
@@ -930,6 +939,9 @@ TEXT
return if build_args.empty?
build_info_dir = File.join gem_home, 'build_info'
+ unless @install_root.nil? or @install_root.empty?
+ build_info_dir = File.join @gem_home, "build_info"
+ end
dir_mode = options[:dir_mode]
FileUtils.mkdir_p build_info_dir, :mode => dir_mode && 0755

View file

@ -0,0 +1,29 @@
$NetBSD: patch-lib_rubygems_platform.rb,v 1.1 2022/01/16 13:57:10 taca Exp $
* Don't replace "i486" to "x86".
* Allow simple "netbsd" as Gem::Platform.
--- lib/rubygems/platform.rb.orig 2020-12-08 09:02:31.000000000 +0000
+++ lib/rubygems/platform.rb
@@ -71,12 +71,7 @@ class Gem::Platform
arch.last << "-#{extra}"
end
- cpu = arch.shift
-
- @cpu = case cpu
- when /i\d86/ then 'x86'
- else cpu
- end
+ @cpu = arch.shift
if arch.length == 2 and arch.last =~ /^\d+(\.\d+)?$/ # for command-line
@os, @version = arch
@@ -105,6 +100,7 @@ class Gem::Platform
@cpu = 'x86' if @cpu.nil? and os =~ /32$/
[os, version]
when /netbsdelf/ then [ 'netbsdelf', nil ]
+ when /netbsd/ then [ 'netbsd', nil ]
when /openbsd(\d+\.\d+)?/ then [ 'openbsd', $1 ]
when /bitrig(\d+\.\d+)?/ then [ 'bitrig', $1 ]
when /solaris(\d+\.\d+)?/ then [ 'solaris', $1 ]

View file

@ -0,0 +1,21 @@
$NetBSD: patch-test_rubygems_test__gem.rb,v 1.1 2022/01/16 13:57:10 taca Exp $
* Use vendordir instead of sitedir.
--- test/rubygems/test_gem.rb.orig 2019-12-17 15:08:43.000000000 +0000
+++ test/rubygems/test_gem.rb
@@ -957,12 +957,12 @@ class TestGem < Gem::TestCase
end
def test_self_prefix_sitelibdir
- orig_sitelibdir = RbConfig::CONFIG['sitelibdir']
+ orig_sitelibdir = RbConfig::CONFIG['vendorlibdir']
RbConfig::CONFIG['sitelibdir'] = PROJECT_DIR
assert_nil Gem.prefix
ensure
- RbConfig::CONFIG['sitelibdir'] = orig_sitelibdir
+ RbConfig::CONFIG['vendorlibdir'] = orig_sitelibdir
end
def test_self_read_binary

View file

@ -0,0 +1,16 @@
$NetBSD: patch-thread__pthread.c,v 1.1 2022/01/16 13:57:10 taca Exp $
* Avoid pass "const char *" to SET_ANOTHER_THREAD_NAME();
pthread_setname_np().
--- thread_pthread.c.orig 2020-12-08 09:02:31.000000000 +0000
+++ thread_pthread.c
@@ -1648,7 +1648,7 @@ native_set_another_thread_name(rb_native
{
#if defined SET_ANOTHER_THREAD_NAME || defined SET_CURRENT_THREAD_NAME
char buf[THREAD_NAME_MAX];
- const char *s = "";
+ char *s = "";
# if !defined SET_ANOTHER_THREAD_NAME
if (!pthread_equal(pthread_self(), thread_id)) return;
# endif

View file

@ -0,0 +1,15 @@
$NetBSD: patch-tool_ifchange,v 1.1 2022/01/16 13:57:10 taca Exp $
Do not show color default.
--- tool/ifchange.orig 2021-12-25 12:23:14.000000000 +0000
+++ tool/ifchange
@@ -19,7 +19,7 @@ set -e
timestamp=
keepsuffix=
empty=
-color=auto
+color=never
until [ $# -eq 0 ]; do
case "$1" in
--)