pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/lang/ruby Overhaul framework of Ruby on Rails to suppo...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/db5d2b2f6d1f
branches:  trunk
changeset: 364134:db5d2b2f6d1f
user:      taca <taca%pkgsrc.org@localhost>
date:      Wed Jun 21 13:11:19 2017 +0000

description:
Overhaul framework of Ruby on Rails to support coexistence of rails32
and rails42.

* Rename RUBY_RAILS_VERSION to RAILS_VERSION.
* Remove detection of installed Ruby on Rails.
* Add ${RUBY_RAILS} to PKGBASE of each Ruby on Rails' pacakge.

diffstat:

 lang/ruby/rails.mk |  101 ++++++++++++----------------------------------------
 1 files changed, 24 insertions(+), 77 deletions(-)

diffs (147 lines):

diff -r 6829b628a8cb -r db5d2b2f6d1f lang/ruby/rails.mk
--- a/lang/ruby/rails.mk        Wed Jun 21 11:45:57 2017 +0000
+++ b/lang/ruby/rails.mk        Wed Jun 21 13:11:19 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: rails.mk,v 1.59 2017/04/22 10:46:18 minskim Exp $
+# $NetBSD: rails.mk,v 1.60 2017/06/21 13:11:19 taca Exp $
 
 .if !defined(_RUBY_RAILS_MK)
 _RUBY_RAILS_MK=        # defined
@@ -50,33 +50,20 @@
 RUBY_RAILS=                    ${RUBY_RAILS_SUPPORTED}
 .endif
 
-.if empty(RUBY_RAILS)
-_RUBY_INSTALLED_RAILS!= \
-       if ${PKG_INFO} -qe "${RUBY_PKGPREFIX}-rack>=1.4" || \
-               ${PKG_INFO} -qe "${RUBY_PKGPREFIX}-activesupport>=3.2"; then \
-               ${ECHO} 32; \
-       else \
-               ${ECHO} "none"; \
-       fi
-. if ${_RUBY_INSTALLED_RAILS} != "none"
-RUBY_RAILS:=   ${_RUBY_INSTALLED_RAILS}
-. else
-RUBY_RAILS:=   ${RUBY_RAILS_DEFAULT}
-. endif
-.endif
+RUBY_RAILS?=   ${RUBY_RAILS_DEFAULT}
 
 .if ${RUBY_RAILS} == "42"
-RUBY_RAILS_VERSION:=   ${RUBY_RAILS42_VERSION}
+RAILS_VERSION:=        ${RUBY_RAILS42_VERSION}
 .else
-RUBY_RAILS_VERSION:=   ${RUBY_RAILS32_VERSION}
+RAILS_VERSION:=        ${RUBY_RAILS32_VERSION}
 .endif
 
 #
 # Components of Ruby's version.
 #
-_RAILS_MAJOR=  ${RUBY_RAILS_VERSION:C/([0-9]+)\..*/\1/}
-_RAILS_MINOR=  ${RUBY_RAILS_VERSION:C/([0-9]+)\.([0-9]+)\..*/\2/}
-_RAILS_TEENY=  ${RUBY_RAILS_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+).*/\3/}
+_RAILS_MAJOR=  ${RAILS_VERSION:C/([0-9]+)\..*/\1/}
+_RAILS_MINOR=  ${RAILS_VERSION:C/([0-9]+)\.([0-9]+)\..*/\2/}
+_RAILS_TEENY=  ${RAILS_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+).*/\3/}
 
 #
 # If RUBY_RAILS_STRICT_DEP is defined, match exact current Ruby no Rails
@@ -86,10 +73,10 @@
 .if !empty(RUBY_RAILS_STRICT_DEP:M[yY][eE][sS])
 _RAILS_NEXT!=  ${EXPR} ${_RAILS_TEENY} + 1
 _RAILS_DEP=    \
-       >=${RUBY_RAILS_VERSION}<${_RAILS_MAJOR}.${_RAILS_MINOR}.${_RAILS_NEXT}
+       ${RUBY_RAILS}>=${RAILS_VERSION}<${_RAILS_MAJOR}.${_RAILS_MINOR}.${_RAILS_NEXT}
 .else
 _RAILS_NEXT!=  ${EXPR} ${_RAILS_MINOR} + 1
-_RAILS_DEP=    >=${RUBY_RAILS_VERSION}<${_RAILS_MAJOR}.${_RAILS_NEXT}
+_RAILS_DEP=    ${RUBY_RAILS}>=${RAILS_VERSION}<${_RAILS_MAJOR}.${_RAILS_NEXT}
 .endif
 
 #
@@ -99,69 +86,29 @@
 MULTI+=                        RUBY_RAILS_DEFAULT=${RUBY_RAILS} \
                        RUBY_RAILS_SUPPORTED=${RUBY_RAILS}
 
-RUBY_ACTIVESUPPORT?=   ${RUBY_RAILS_VERSION}
-RUBY_ACTIONPACK?=      ${RUBY_RAILS_VERSION}
-RUBY_ACTIONVIEW?=      ${RUBY_RAILS_VERSION}
-RUBY_ACTIVERECORD?=    ${RUBY_RAILS_VERSION}
-RUBY_ACTIVERESOURCE?=  ${RUBY_RAILS_VERSION}
-RUBY_ACTIONMAILER?=    ${RUBY_RAILS_VERSION}
-RUBY_RAILTIES?=                ${RUBY_RAILS_VERSION}
-
-RUBY_RAILS32_ACTIVESUPPORT=    ../../devel/ruby-activesupport32
-RUBY_RAILS32_ACTIVEMODEL=      ../../devel/ruby-activemodel32
-RUBY_RAILS32_ACTIONPACK=       ../../www/ruby-actionpack32
-RUBY_RAILS32_ACTIVERECORD=     ../../databases/ruby-activerecord32
-RUBY_RAILS32_ACTIVERESOURCE=   ../../www/ruby-activeresource32
-RUBY_RAILS32_ACTIONMAILER=     ../../mail/ruby-actionmailer32
-RUBY_RAILS32_RAILTIES=         ../../devel/ruby-railties32
-RUBY_RAILS32_RAILS=            ../../www/ruby-rails32
-
-RUBY_RAILS42_ACTIVEJOB=                ../../devel/ruby-activejob42
-RUBY_RAILS42_ACTIVESUPPORT=    ../../devel/ruby-activesupport42
-RUBY_RAILS42_ACTIVEMODEL=      ../../devel/ruby-activemodel42
-RUBY_RAILS42_ACTIONPACK=       ../../www/ruby-actionpack42
-RUBY_RAILS42_ACTIVERECORD=     ../../databases/ruby-activerecord42
-RUBY_RAILS42_ACTIONMAILER=     ../../mail/ruby-actionmailer42
-RUBY_RAILS42_RAILTIES=         ../../devel/ruby-railties42
-RUBY_RAILS42_RAILS=            ../../www/ruby-rails42
-RUBY_RAILS42_ACTIONVIEW=       ../../www/ruby-actionview42
-
-.if ${RUBY_RAILS} == "42"
 RUBY_ACTIVESUPPORT_DEPENDS= \
-       ${RUBY_PKGPREFIX}-activesupport${_RAILS_DEP}:${RUBY_RAILS42_ACTIVESUPPORT}
+       ${RUBY_PKGPREFIX}-activesupport${_RAILS_DEP}:../../devel/ruby-activesupport${RUBY_RAILS}
 RUBY_ACTIVEMODEL_DEPENDS= \
-       ${RUBY_PKGPREFIX}-activemodel${_RAILS_DEP}:${RUBY_RAILS42_ACTIVEMODEL}
+       ${RUBY_PKGPREFIX}-activemodel${_RAILS_DEP}:../../devel/ruby-activemodel${RUBY_RAILS}
 RUBY_ACTIONPACK_DEPENDS= \
-       ${RUBY_PKGPREFIX}-actionpack${_RAILS_DEP}:${RUBY_RAILS42_ACTIONPACK}
-RUBY_ACTIONVIEW_DEPENDS= \
-       ${RUBY_PKGPREFIX}-actionview${_RAILS_DEP}:${RUBY_RAILS42_ACTIONVIEW}
-RUBY_ACTIVEJOB_DEPENDS= \
-       ${RUBY_PKGPREFIX}-activejob${_RAILS_DEP}:${RUBY_RAILS42_ACTIVEJOB}
+       ${RUBY_PKGPREFIX}-actionpack${_RAILS_DEP}:../../www/ruby-actionpack${RUBY_RAILS}
 RUBY_ACTIVERECORD_DEPENDS= \
-       ${RUBY_PKGPREFIX}-activerecord${_RAILS_DEP}:${RUBY_RAILS42_ACTIVERECORD}
+       ${RUBY_PKGPREFIX}-activerecord${_RAILS_DEP}:../../databases/ruby-activerecord${RUBY_RAILS}
 RUBY_ACTIONMAILER_DEPENDS= \
-       ${RUBY_PKGPREFIX}-actionmailer${_RAILS_DEP}:${RUBY_RAILS42_ACTIONMAILER}
+       ${RUBY_PKGPREFIX}-actionmailer${_RAILS_DEP}:../../mail/ruby-actionmailer${RUBY_RAILS}
 RUBY_RAILTIES_DEPENDS= \
-       ${RUBY_PKGPREFIX}-railties${_RAILS_DEP}:${RUBY_RAILS42_RAILTIES}
+       ${RUBY_PKGPREFIX}-railties${_RAILS_DEP}:../../devel/ruby-railties${RUBY_RAILS}
 RUBY_RAILS_DEPENDS= \
-       ${RUBY_PKGPREFIX}-rails${_RAILS_DEP}:${RUBY_RAILS42_RAILS}
-.else
-RUBY_ACTIVESUPPORT_DEPENDS= \
-       ${RUBY_PKGPREFIX}-activesupport${_RAILS_DEP}:${RUBY_RAILS32_ACTIVESUPPORT}
-RUBY_ACTIVEMODEL_DEPENDS= \
-       ${RUBY_PKGPREFIX}-activemodel${_RAILS_DEP}:${RUBY_RAILS32_ACTIVEMODEL}
-RUBY_ACTIONPACK_DEPENDS= \
-       ${RUBY_PKGPREFIX}-actionpack${_RAILS_DEP}:${RUBY_RAILS32_ACTIONPACK}
-RUBY_ACTIVERECORD_DEPENDS= \
-       ${RUBY_PKGPREFIX}-activerecord${_RAILS_DEP}:${RUBY_RAILS32_ACTIVERECORD}
+       ${RUBY_PKGPREFIX}-rails${_RAILS_DEP}:../../www/ruby-rails${RUBY_RAILS}
+
+.if ${RUBY_RAILS} == "32"
 RUBY_ACTIVERESOURCE_DEPENDS= \
-       ${RUBY_PKGPREFIX}-activeresource${_RAILS_DEP}:${RUBY_RAILS32_ACTIVERESOURCE}
-RUBY_ACTIONMAILER_DEPENDS= \
-       ${RUBY_PKGPREFIX}-actionmailer${_RAILS_DEP}:${RUBY_RAILS32_ACTIONMAILER}
-RUBY_RAILTIES_DEPENDS= \
-       ${RUBY_PKGPREFIX}-railties${_RAILS_DEP}:${RUBY_RAILS32_RAILTIES}
-RUBY_RAILS_DEPENDS= \
-       ${RUBY_PKGPREFIX}-rails${_RAILS_DEP}:${RUBY_RAILS32_RAILS}
+       ${RUBY_PKGPREFIX}-activeresource${_RAILS_DEP}:../../www/ruby-activeresource${RUBY_RAILS}
+.elif ${RUBY_RAILS} == "42"
+RUBY_ACTIONVIEW_DEPENDS= \
+       ${RUBY_PKGPREFIX}-actionview${_RAILS_DEP}:../../www/ruby-actionview${RUBY_RAILS}
+RUBY_ACTIVEJOB_DEPENDS= \
+       ${RUBY_PKGPREFIX}-activejob${_RAILS_DEP}:../../devel/ruby-activejob${RUBY_RAILS}
 .endif
 
 .endif



Home | Main Index | Thread Index | Old Index