pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/ruby lang/ruby: add GEM_PLUGINSDIR support



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ec1a477f8f77
branches:  trunk
changeset: 444639:ec1a477f8f77
user:      taca <taca%pkgsrc.org@localhost>
date:      Mon Jan 11 11:21:31 2021 +0000

description:
lang/ruby: add GEM_PLUGINSDIR support

* Add GEM_PLUGINSDIR support required by rubygems 3.2 and later.
* GEM_EXTSDIR is required unconditonally.

diffstat:

 lang/ruby/gem-vars.mk |  21 +++++++++++++++------
 lang/ruby/gem.mk      |  16 ++++++++++++----
 2 files changed, 27 insertions(+), 10 deletions(-)

diffs (83 lines):

diff -r 66f0ab3b3025 -r ec1a477f8f77 lang/ruby/gem-vars.mk
--- a/lang/ruby/gem-vars.mk     Mon Jan 11 10:32:17 2021 +0000
+++ b/lang/ruby/gem-vars.mk     Mon Jan 11 11:21:31 2021 +0000
@@ -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 @@
 
 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_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 -r 66f0ab3b3025 -r ec1a477f8f77 lang/ruby/gem.mk
--- a/lang/ruby/gem.mk  Mon Jan 11 10:32:17 2021 +0000
+++ b/lang/ruby/gem.mk  Mon Jan 11 11:21:31 2021 +0000
@@ -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 @@
                        { 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}/ \



Home | Main Index | Thread Index | Old Index