pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/lang lang/ruby: clean up some macro handling
details: https://anonhg.NetBSD.org/pkgsrc/rev/aee32e218fc6
branches: trunk
changeset: 371803:aee32e218fc6
user: taca <taca%pkgsrc.org@localhost>
date: Fri Jan 14 15:42:08 2022 +0000
description:
lang/ruby: clean up some macro handling
1. Move some variables from gem-vars.mk to rubyversion.mk:
GEM_EXTSBASE
GEM_PATH
GEM_PLUGINSDIR
RUBYGEM
RUBY_GEM_ARCH
2. Drop unused GEM_EXTSDIR_NEEDS_SUBDIR (it is always true).
3. Define bundled module's version as "MODULE_VER".
4. Generate PLIST_SUBST and PRINT_PLIST_AWK from bundled module's name
if corresponding MODULE_VER is defined.
5. Do not run ${RUBYGEM} for RUYB_GEM_ARCH and RUBY_GEM_VER.
NFCI.
diffstat:
lang/ruby/gem-vars.mk | 38 +-
lang/ruby/platform.mk | 21 +-
lang/ruby/rubyversion.mk | 411 ++++----
lang/ruby26-base/Makefile | 8 +-
lang/ruby26-base/PLIST | 704 +++++++-------
lang/ruby27-base/Makefile | 20 +-
lang/ruby27-base/PLIST | 640 ++++++------
lang/ruby30-base/Makefile | 22 +-
lang/ruby30-base/PLIST | 2168 ++++++++++++++++++++++----------------------
9 files changed, 2024 insertions(+), 2008 deletions(-)
diffs (truncated from 4227 to 300 lines):
diff -r 5f90d2f480d0 -r aee32e218fc6 lang/ruby/gem-vars.mk
--- a/lang/ruby/gem-vars.mk Fri Jan 14 15:38:25 2022 +0000
+++ b/lang/ruby/gem-vars.mk Fri Jan 14 15:42:08 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: gem-vars.mk,v 1.12 2021/01/11 11:21:31 taca Exp $
+# $NetBSD: gem-vars.mk,v 1.13 2022/01/14 15:42:08 taca Exp $
#
# This Makefile fragment defines various make(1) variables for Ruby gems
# support.
@@ -8,44 +8,20 @@
RUBYGEM_VERBOSE?= No
-# Specify GEM_PATH
-GEM_PATH?= ${PREFIX}/${GEM_HOME}
-
-# Base directory for Gems
-MAKE_ENV+= GEM_PATH=${GEM_PATH}
-
RUBYGEM_LANG?= en_US.UTF-8
RUBYGEM_ENV?= LANG=${RUBYGEM_LANG} LC_CTYPE=${RUBYGEM_LANG}
-RUBYGEM= ${LOCALBASE}/bin/${RUBYGEM_NAME}
-
-GEM_EXTSDIR_NEEDS_SUBDIR?= yes
-
-GEM_PLUGINSDIR= ${GEM_HOME}/plugins
-
-.if exists(${RUBYGEM})
-RUBY_GEM_ARCH!= ${RUBYGEM} environment platform | ${SED} -e 's|.*:||'
-RUBY_GEM_VER!= ${RUBYGEM} --version
-
-GEM_EXTSBASE= ${GEM_HOME}/extensions
-PLIST_SUBST+= GEM_EXTSDIR=${GEM_EXTSDIR}
-PLIST_SUBST+= GEM_PLUGINSDIR=${GEM_PLUGINSDIR}
-
-. if !empty(GEM_EXTSDIR_NEEDS_SUBDIR:M[nN][oO])
-GEM_EXTSDIR= ${GEM_EXTSBASE}/${RUBY_GEM_ARCH}/${RUBY_VER_DIR}
-. else
-GEM_EXTSDIR= ${GEM_EXTSBASE}/${RUBY_GEM_ARCH}/${RUBY_VER_DIR}/${GEM_NAME}
-. endif
-
-_RUBY_GEM_MAJOR= ${RUBY_GEM_VER:C/([0-9]+)\..*/\1/}
-_RUBY_GEM_MINOR= ${RUBY_GEM_VER:C/[0-9]+\.([0-9]+)\..*/\1/}
+_RUBY_GEM_MAJOR= ${RUBY_RUBYGEMS_VER:C/([0-9]+)\..*/\1/}
+_RUBY_GEM_MINOR= ${RUBY_RUBYGEMS_VER:C/[0-9]+\.([0-9]+)\..*/\1/}
PLIST_VARS+= ruby_plugins
+GEM_EXTSDIR= ${GEM_EXTSBASE}/${GEM_NAME}
+
+PLIST_SUBST+= GEM_EXTSDIR=${GEM_EXTSDIR}
+
.if ${_RUBY_GEM_MAJOR} >= 3 && ${_RUBY_GEM_MINOR} >= 2
PLIST.ruby_plugins= YES
.endif
.endif
-
-.endif
diff -r 5f90d2f480d0 -r aee32e218fc6 lang/ruby/platform.mk
--- a/lang/ruby/platform.mk Fri Jan 14 15:38:25 2022 +0000
+++ b/lang/ruby/platform.mk Fri Jan 14 15:42:08 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: platform.mk,v 1.8 2020/05/04 04:53:53 rillig Exp $
+# $NetBSD: platform.mk,v 1.9 2022/01/14 15:42:08 taca Exp $
#
#
@@ -11,6 +11,25 @@
.include "../../lang/ruby/rubyversion.mk"
.include "../../mk/compiler.mk"
+#
+# sort by length of module's name for PLIST_AWK
+#
+_RUBY_BUNDLE_MODULES!= \
+ echo ${RUBY_BUNDLE_MODULES} | tr ' ' '\012' | \
+ awk '{print length(), $$0}' | sort -nr | awk '{print $$2}'
+
+.for s in ${_RUBY_BUNDLE_MODULES}
+t:=RUBY_${s:tu:S/-/_/g}_VER
+v:=${${t}}
+. if !empty(v)
+_RUBY_PLIST_SUBST:= ${_RUBY_PLIST_SUBST} ${t}=${v}
+_RUBY_PLIST_AWK:= ${_RUBY_PLIST_AWK} { sub(/${s}-${v}/, "${s}-$${${t}}"); }
+. endif
+.endfor
+
+PLIST_SUBST+= ${_RUBY_PLIST_SUBST}
+PRINT_PLIST_AWK+= ${_RUBY_PLIST_AWK}
+
MAKE_DIRS+= ${RUBY_SITEARCHLIB} ${RUBY_VENDORARCHLIB} ${RUBY_SITERIDIR}
FILES_SUBST+= DATE=${DATE:Q}
diff -r 5f90d2f480d0 -r aee32e218fc6 lang/ruby/rubyversion.mk
--- a/lang/ruby/rubyversion.mk Fri Jan 14 15:38:25 2022 +0000
+++ b/lang/ruby/rubyversion.mk Fri Jan 14 15:42:08 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: rubyversion.mk,v 1.240 2021/11/25 16:35:52 taca Exp $
+# $NetBSD: rubyversion.mk,v 1.241 2022/01/14 15:42:08 taca Exp $
#
# This file determines which Ruby version is used as a dependency for
@@ -270,162 +270,208 @@
.if ${RUBY_VER} == "26"
RUBY_VERSION= ${RUBY26_VERSION}
RUBY_ABI_VERSION= ${RUBY_VERSION}
-
-RUBY_RDOC_VERSION= 6.1.2.1
-
-RUBY_DID_YOU_MEAN_VERSION= 1.3.0
-RUBY_IRB_VERSION= 1.0.0
-RUBY_MINITEST_VERSION= 5.11.3
-RUBY_NET_TELNET_VERSION= 0.2.0
-RUBY_POWER_ASSERT_VERSION= 1.1.3
-RUBY_RAKE_VERSION= 12.3.3
-RUBY_TEST_UNIT_VERSION= 3.2.9
-RUBY_XML_RPC_VERSION= 0.3.0
+RUBY_SUFFIX= ${_RUBY_VER_MAJOR}${_RUBY_VER_MINOR}
-RUBY_BIGDECIMAL_VERSION= 1.4.1
-RUBY_BUNDLER_VERSION= 1.17.2
-RUBY_CMATH_VERSION= 1.0.0
-RUBY_CSV_VERSION= 3.0.9
-RUBY_DATE_VERSION= 2.0.2
-RUBY_DBM_VERSION= 1.0.0
-RUBY_E2MMAP_VERSION= 0.1.0
-RUBY_ETC_VERSION= 1.0.1
-RUBY_FCNTL_VERSION= 1.0.0
-RUBY_FIDDLE_VERSION= 1.0.0
-RUBY_FILEUTILS_VERSION= 1.1.0
-RUBY_FORWARDABLE_VERSION= 1.2.0
-RUBY_IO_CONSOLE_VERSION= 0.4.7
-RUBY_IPADDR_VERSION= 1.2.2
-RUBY_JSON_VERSION= 2.1.0
-RUBY_LOGGER_VERSION= 1.3.0
-RUBY_MATRIX_VERSION= 0.1.0
-RUBY_MUTEX_M_VERSION= 0.1.0
-RUBY_OPENSSL_VERSION= 2.1.2
-RUBY_OSTRUCT_VERSION= 0.1.0
-RUBY_PRIME_VERSION= 0.1.0
-RUBY_PSYCH_VERSION= 3.1.0
-RUBY_REXML_VERSION= 3.1.9.1
-RUBY_RSS_VERSION= 0.2.7
-RUBY_SCANF_VERSION= 1.0.0
-RUBY_SDBM_VERSION= 1.0.0
-RUBY_SHELL_VERSION= 0.7
-RUBY_STRINGIO_VERSION= 0.0.2
-RUBY_STRSCAN_VERSION= 1.0.0
-RUBY_SYNC_VERSION= 0.5.0
-RUBY_THWAIT_VERSION= 0.1.0
-RUBY_TRACER_VERSION= 0.1.0
-RUBY_WEBRICK_VERSION= 1.4.4
-RUBY_ZLIB_VERSION= 1.0.0
-
-RUBY_SUFFIX= ${_RUBY_VER_MAJOR}${_RUBY_VER_MINOR}
+# bundled gems
+RUBY_RUBYGEMS_VER= 3.0.3.1
+RUBY_BIGDECIMAL_VER= 1.4.1
+RUBY_BUNDLER_VER= 1.17.2
+RUBY_CMATH_VER= 1.0.0
+RUBY_CSV_VER= 3.0.9
+RUBY_DATE_VER= 2.0.2
+RUBY_DBM_VER= 1.0.0
+RUBY_DID_YOU_MEAN_VER= 1.3.0
+RUBY_E2MMAP_VER= 0.1.0
+RUBY_ETC_VER= 1.0.1
+RUBY_FCNTL_VER= 1.0.0
+RUBY_FIDDLE_VER= 1.0.0
+RUBY_FILEUTILS_VER= 1.1.0
+RUBY_FORWARDABLE_VER= 1.2.0
+RUBY_IO_CONSOLE_VER= 0.4.7
+RUBY_IPADDR_VER= 1.2.2
+RUBY_IRB_VER= 1.0.0
+RUBY_JSON_VER= 2.1.0
+RUBY_LOGGER_VER= 1.3.0
+RUBY_MATRIX_VER= 0.1.0
+RUBY_MINITEST_VER= 5.11.3
+RUBY_MUTEX_M_VER= 0.1.0
+RUBY_NET_TELNET_VER= 0.2.0
+RUBY_OPENSSL_VER= 2.1.2
+RUBY_OSTRUCT_VER= 0.1.0
+RUBY_POWER_ASSERT_VER= 1.1.3
+RUBY_PRIME_VER= 0.1.0
+RUBY_PSYCH_VER= 3.1.0
+RUBY_RAKE_VER= 12.3.3
+RUBY_RDOC_VER= 6.1.2.1
+RUBY_REXML_VER= 3.1.9.1
+RUBY_RSS_VER= 0.2.7
+RUBY_SCANF_VER= 1.0.0
+RUBY_SDBM_VER= 1.0.0
+RUBY_SHELL_VER= 0.7
+RUBY_STRINGIO_VER= 0.0.2
+RUBY_STRSCAN_VER= 1.0.0
+RUBY_SYNC_VER= 0.5.0
+RUBY_TEST_UNIT_VER= 3.2.9
+RUBY_THWAIT_VER= 0.1.0
+RUBY_TRACER_VER= 0.1.0
+RUBY_SYNC_VER= 0.5.0
+RUBY_WEBRICK_VER= 1.4.4
+RUBY_XMLRPC_VER= 0.3.0
+RUBY_ZLIB_VER= 1.0.0
.elif ${RUBY_VER} == "27"
RUBY_VERSION= ${RUBY27_VERSION}
RUBY_ABI_VERSION= ${RUBY_VERSION}
-
-RUBY_RDOC_VERSION= 6.2.1.1
-
-RUBY_DID_YOU_MEAN_VERSION= 1.4.0
-RUBY_IRB_VERSION= 1.2.6
+RUBY_SUFFIX= ${_RUBY_VER_MAJOR}${_RUBY_VER_MINOR}
# bundled gems
-RUBY_MINITEST_VERSION= 5.13.0
-RUBY_NET_TELNET_VERSION= 0.2.0
-RUBY_POWER_ASSERT_VERSION= 1.1.7
-RUBY_RACC_VERSION= 1.4.16
-RUBY_RAKE_VERSION= 13.0.1
-RUBY_TEST_UNIT_VERSION= 3.3.4
-RUBY_XML_RPC_VERSION= 0.3.0
-
-# bundled extensions
-RUBY_DATE_VERSION= 3.0.3
-RUBY_DBM_VERSION= 1.1.0
-RUBY_ETC_VERSION= 1.1.0
-RUBY_FCNTL_VERSION= 1.0.0
-RUBY_FIDDLE_VERSION= 1.0.0
-RUBY_IPADDR_VERSION= 1.2.2
+RUBY_RUBYGEMS_VER= 3.1.6
+RUBY_BENCHMARK_VER= 0.1.0
+RUBY_BIGDECIMAL_VER= 2.0.0
+RUBY_BUNDLER_VER= 2.1.4
+RUBY_CGI_VER= 0.1.0.1
+RUBY_CSV_VER= 3.1.2
+RUBY_DATE_VER= 3.0.3
+RUBY_DBM_VER= 1.1.0
+RUBY_DELEGATE_VER= 0.1.0
+RUBY_DID_YOU_MEAN_VER= 1.4.0
+RUBY_ETC_VER= 1.1.0
+RUBY_FCNTL_VER= 1.0.0
+RUBY_FIDDLE_VER= 1.0.0
+RUBY_FILEUTILS_VER= 1.4.1
+RUBY_FORWARDABLE_VER= 1.3.1
+RUBY_GETOPTLONG_VER= 0.1.0
+RUBY_IO_CONSOLE_VER= 0.5.6
+RUBY_IPADDR_VER= 1.2.2
+RUBY_IRB_VER= 1.2.6
+RUBY_JSON_VER= 2.3.0
+RUBY_LOGGER_VER= 1.4.2
+RUBY_MATRIX_VER= 0.2.0
+RUBY_MINITEST_VER= 5.13.0
+RUBY_MUTEX_M_VER= 0.1.0
+RUBY_NET_POP_VER= 0.1.0
+RUBY_NET_SMTP_VER= 0.1.0
+RUBY_NET_TELNET_VER= 0.2.0
+RUBY_OBSERVER_VER= 0.1.0
+RUBY_OPEN3_VER= 0.1.0
+RUBY_OPENSSL_VER= 2.1.3
+RUBY_OSTRUCT_VER= 0.2.0
+RUBY_POWER_ASSERT_VER= 1.1.7
+RUBY_PRIME_VER= 0.1.1
+RUBY_PSTORE_VER= 0.1.0
+RUBY_PSYCH_VER= 3.1.0
+RUBY_RACC_VER= 1.4.16
+RUBY_RAKE_VER= 13.0.1
+RUBY_RDOC_VER= 6.2.1.1
+RUBY_READLINE_VER= 0.0.2
+RUBY_RELINE_VER= 0.1.5
+RUBY_REXML_VER= 3.2.3.1
+RUBY_RSS_VER= 0.2.8
+RUBY_SDBM_VER= 1.0.0
+RUBY_SINGLETON_VER= 0.1.0
+RUBY_STRINGIO_VER= 0.1.0
+RUBY_STRSCAN_VER= 1.0.3
+RUBY_TEST_UNIT_VER= 3.3.4
+RUBY_TIMEOUT_VER= 0.1.0
+RUBY_TRACER_VER= 0.1.0
+RUBY_URI_VER= 0.10.0
+RUBY_WEBRICK_VER= 1.6.1
+RUBY_XMLRPC_VER= 0.3.0
+RUBY_YAML_VER= 0.1.0
+RUBY_ZLIB_VER= 1.1.0
-# bundled libraries
-RUBY_BIGDECIMAL_VERSION= 2.0.0
-RUBY_BUNDLER_VERSION= 2.1.4
-RUBY_CSV_VERSION= 3.1.2
-RUBY_FILEUTILS_VERSION= 1.4.1
-RUBY_FORWARDABLE_VERSION= 1.3.1
-RUBY_GETOPTLONG_VERSION= 0.1.0
-RUBY_IO_CONSOLE_VERSION= 0.5.6
-
-RUBY_JSON_VERSION= 2.3.0
-RUBY_LOGGER_VERSION= 1.4.2
-RUBY_MATRIX_VERSION= 0.2.0
-RUBY_MUTEX_M_VERSION= 0.1.0
-RUBY_OPENSSL_VERSION= 2.1.3
-RUBY_OSTRUCT_VERSION= 0.2.0
Home |
Main Index |
Thread Index |
Old Index