diff options
author | taca <taca@pkgsrc.org> | 2021-01-11 11:21:31 +0000 |
---|---|---|
committer | taca <taca@pkgsrc.org> | 2021-01-11 11:21:31 +0000 |
commit | 9be6f377eeb700adf9519e40ea39818d3a5422eb (patch) | |
tree | cc0610c5a8492ffbfa2b9cc5a8fe79bf61455e45 /lang/ruby | |
parent | 6838121b78fe8b19e9e2c9273acd8c469ab32b5c (diff) | |
download | pkgsrc-9be6f377eeb700adf9519e40ea39818d3a5422eb.tar.gz |
lang/ruby: add GEM_PLUGINSDIR support
* Add GEM_PLUGINSDIR support required by rubygems 3.2 and later.
* GEM_EXTSDIR is required unconditonally.
Diffstat (limited to 'lang/ruby')
-rw-r--r-- | lang/ruby/gem-vars.mk | 21 | ||||
-rw-r--r-- | lang/ruby/gem.mk | 16 |
2 files changed, 27 insertions, 10 deletions
diff --git a/lang/ruby/gem-vars.mk b/lang/ruby/gem-vars.mk index 074d8b5b18f..dbda300fbb3 100644 --- a/lang/ruby/gem-vars.mk +++ b/lang/ruby/gem-vars.mk @@ -1,4 +1,4 @@ -# $NetBSD: gem-vars.mk,v 1.11 2021/01/11 06:51:27 taca Exp $ +# $NetBSD: gem-vars.mk,v 1.12 2021/01/11 11:21:31 taca Exp $ # # This Makefile fragment defines various make(1) variables for Ruby gems # support. @@ -21,10 +21,15 @@ 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} @@ -32,11 +37,15 @@ GEM_EXTSDIR= ${GEM_EXTSBASE}/${RUBY_GEM_ARCH}/${RUBY_VER_DIR} GEM_EXTSDIR= ${GEM_EXTSBASE}/${RUBY_GEM_ARCH}/${RUBY_VER_DIR}/${GEM_NAME} . endif -. if !empty(GEM_EXTSDIR) -PLIST_SUBST+= GEM_EXTSDIR=${GEM_EXTSDIR} -. else -PLIST_SUBST+= GEM_EXTSDIR="@comment " -. endif +_RUBY_GEM_MAJOR= ${RUBY_GEM_VER:C/([0-9]+)\..*/\1/} +_RUBY_GEM_MINOR= ${RUBY_GEM_VER:C/[0-9]+\.([0-9]+)\..*/\1/} + +PLIST_VARS+= ruby_plugins + +.if ${_RUBY_GEM_MAJOR} >= 3 && ${_RUBY_GEM_MINOR} >= 2 +PLIST.ruby_plugins= YES +.endif + .endif .endif diff --git a/lang/ruby/gem.mk b/lang/ruby/gem.mk index 2f4191fdcb8..2c2dd335e10 100644 --- a/lang/ruby/gem.mk +++ b/lang/ruby/gem.mk @@ -1,4 +1,4 @@ -# $NetBSD: gem.mk,v 1.44 2021/01/11 06:51:27 taca Exp $ +# $NetBSD: gem.mk,v 1.45 2021/01/11 11:21:31 taca Exp $ # # This Makefile fragment is intended to be included by packages that build # and install Ruby gems. @@ -121,9 +121,12 @@ # repository that holds the contents of the installed gem. # # GEM_EXTSDIR -# "extensions" directory under ${GEM_HOME}. It is generated by -# rubygems 2.2 and later. -# In PLIST file, it will be replace to "${GEM_HOME}/extensions" or +# "extensions" directory under ${GEM_HOME}. +# +# GEM_PLUGINSDIR +# "plguins" direcotry under ${GEM_HOME}. It is generated by +# rubygems 3.2 and later. +# In PLIST file, it will be replace to "${GEM_HOME}/plugins" or # "@comment ..." depends on the version of rubygems. # # RUBYGEM @@ -200,6 +203,11 @@ _RUBY_PRINT_PLIST_GEM+= /^${GEM_EXTSDIR:S|/|\\/|g}/ \ { gsub(/${GEM_EXTSDIR:S|/|\\/|g}/, "$${GEM_EXTSDIR}"); \ print; next; } .endif +.if !empty(GEM_PLUGINSDIR) +_RUBY_PRINT_PLIST_GEM+= /^${GEM_PLUGINSDIR:S|/|\\/|g}/ \ + { gsub(/${GEM_PLUGINSDIR:S|/|\\/|g}/, "$${PLIST.ruby_plugins}$${GEM_PLUGINSDIR}"); \ + print; next; } +.endif _RUBY_PRINT_PLIST_GEM+= /^${GEM_LIBDIR:S|/|\\/|g}/ \ { gsub(/${GEM_LIBDIR:S|/|\\/|g}/, "$${GEM_LIBDIR}"); print; next; } _RUBY_PRINT_PLIST_GEM+= /^${GEM_DOCDIR:S|/|\\/|g}/ \ |