Utilize PKGNAME_REQD to determine required Ruby version. Address to PR pkg/48509.diff -r1.23 -r1.24 pkgsrc/lang/ruby/gem.mk
(taca)
@@ -1,26 +1,27 @@ | @@ -1,26 +1,27 @@ | |||
1 | # $NetBSD: gem.mk,v 1.23 2013/09/11 13:22:15 taca Exp $ | 1 | # $NetBSD: gem.mk,v 1.24 2014/02/02 07:46:16 taca Exp $ | |
2 | # | 2 | # | |
3 | # This Makefile fragment is intended to be included by packages that build | 3 | # This Makefile fragment is intended to be included by packages that build | |
4 | # and install Ruby gems. | 4 | # and install Ruby gems. | |
5 | # | 5 | # | |
6 | # Package-settable variables: | 6 | # Package-settable variables: | |
7 | # | 7 | # | |
8 | # RUBYGEMS_REQD | 8 | # RUBYGEMS_REQD | |
9 | # Minimum version of required rubygems. Ruby base packages contain: | 9 | # Minimum version of required rubygems. Ruby base packages contain: | |
10 | # | 10 | # | |
11 | # ruby18-base: none | 11 | # ruby18-base: none | |
12 | # ruby193-base: 1.8.23 | 12 | # ruby193-base: 1.8.23 | |
13 | # ruby200-base: 2.0.3 | 13 | # ruby200-base: 2.0.3 | |
14 | # ruby210-base: 2.2.0 | |||
14 | # | 15 | # | |
15 | # If newer version of rubygems is resuiqred, set RUBYGEMS_REQD to | 16 | # If newer version of rubygems is resuiqred, set RUBYGEMS_REQD to | |
16 | # minimum version. | 17 | # minimum version. | |
17 | # | 18 | # | |
18 | # Default: not defined | 19 | # Default: not defined | |
19 | # | 20 | # | |
20 | # OVERRIDE_GEMSPEC | 21 | # OVERRIDE_GEMSPEC | |
21 | # Fix version of depending gem or modify files in gemspec. | 22 | # Fix version of depending gem or modify files in gemspec. | |
22 | # | 23 | # | |
23 | # (1) Specify as gem and dependency pattern as usual pkgsrc's one. | 24 | # (1) Specify as gem and dependency pattern as usual pkgsrc's one. | |
24 | # | 25 | # | |
25 | # Example: | 26 | # Example: | |
26 | # When gemspec contains "json~>1.4.7" as runtime dependency | 27 | # When gemspec contains "json~>1.4.7" as runtime dependency | |
@@ -167,36 +168,40 @@ PRINT_PLIST_AWK+= /^${RUBY_GEM_BASE:S|/| | @@ -167,36 +168,40 @@ PRINT_PLIST_AWK+= /^${RUBY_GEM_BASE:S|/| | |||
167 | # | 168 | # | |
168 | # If we're using rake to build the local gem, then include it as a | 169 | # If we're using rake to build the local gem, then include it as a | |
169 | # build tool. | 170 | # build tool. | |
170 | # | 171 | # | |
171 | 172 | |||
172 | .if ${RUBY_VER} == "18" | 173 | .if ${RUBY_VER} == "18" | |
173 | BUILD_DEPENDS+= ${RUBY_PKGPREFIX}-rubygems>=1.1.0:../../misc/rubygems | 174 | BUILD_DEPENDS+= ${RUBY_PKGPREFIX}-rubygems>=1.1.0:../../misc/rubygems | |
174 | DEPENDS+= ${RUBY_PKGPREFIX}-rubygems>=1.0.1:../../misc/rubygems | 175 | DEPENDS+= ${RUBY_PKGPREFIX}-rubygems>=1.0.1:../../misc/rubygems | |
175 | .else # !ruby18 | 176 | .else # !ruby18 | |
176 | . if defined(RUBYGEMS_REQD) | 177 | . if defined(RUBYGEMS_REQD) | |
177 | 178 | |||
178 | RUBY193_RUBYGEMS_VERS= 1.8.11 | 179 | RUBY193_RUBYGEMS_VERS= 1.8.11 | |
179 | RUBY200_RUBYGEMS_VERS= 2.0.0 | 180 | RUBY200_RUBYGEMS_VERS= 2.0.0 | |
181 | RUBY210_RUBYGEMS_VERS= 2.1.0 | |||
180 | 182 | |||
181 | _RUBYGEMS_REQD_MAJOR= ${RUBYGEMS_REQD:C/\.[0-9\.]+$//} | 183 | _RUBYGEMS_REQD_MAJOR= ${RUBYGEMS_REQD:C/\.[0-9\.]+$//} | |
182 | _RUBYGEMS_REQD_MINORS= ${RUBYGEMS_REQD:C/^([0-9]+)\.*//} | 184 | _RUBYGEMS_REQD_MINORS= ${RUBYGEMS_REQD:C/^([0-9]+)\.*//} | |
183 | 185 | |||
184 | . if ${RUBY_VER} == "193" | 186 | . if ${RUBY_VER} == "193" | |
185 | _RUBYGEMS_MAJOR= ${RUBY193_RUBYGEMS_VERS:C/\.[0-9\.]+$//} | 187 | _RUBYGEMS_MAJOR= ${RUBY193_RUBYGEMS_VERS:C/\.[0-9\.]+$//} | |
186 | _RUBYGEMS_MINORS= ${RUBY193_RUBYGEMS_VERS:C/^([0-9]+)\.*//} | 188 | _RUBYGEMS_MINORS= ${RUBY193_RUBYGEMS_VERS:C/^([0-9]+)\.*//} | |
187 | . elif ${RUBY_VER} == "200" | 189 | . elif ${RUBY_VER} == "200" | |
188 | _RUBYGEMS_MAJOR= ${RUBY200_RUBYGEMS_VERS:C/\.[0-9\.]+$//} | 190 | _RUBYGEMS_MAJOR= ${RUBY200_RUBYGEMS_VERS:C/\.[0-9\.]+$//} | |
189 | _RUBYGEMS_MINORS= ${RUBY200_RUBYGEMS_VERS:C/^([0-9]+)\.*//} | 191 | _RUBYGEMS_MINORS= ${RUBY200_RUBYGEMS_VERS:C/^([0-9]+)\.*//} | |
192 | . elif ${RUBY_VER} == "210" | |||
193 | _RUBYGEMS_MAJOR= ${RUBY210_RUBYGEMS_VERS:C/\.[0-9\.]+$//} | |||
194 | _RUBYGEMS_MINORS= ${RUBY210_RUBYGEMS_VERS:C/^([0-9]+)\.*//} | |||
190 | . else | 195 | . else | |
191 | PKG_FAIL_REASON+= "Unknown Ruby version specified: ${RUBY_VER}." | 196 | PKG_FAIL_REASON+= "Unknown Ruby version specified: ${RUBY_VER}." | |
192 | . endif | 197 | . endif | |
193 | 198 | |||
194 | _RUBYGEMS_REQD= NO | 199 | _RUBYGEMS_REQD= NO | |
195 | 200 | |||
196 | . if ${_RUBYGEMS_REQD_MAJOR} > ${_RUBYGEMS_MAJOR} | 201 | . if ${_RUBYGEMS_REQD_MAJOR} > ${_RUBYGEMS_MAJOR} | |
197 | _RUBYGEMS_REQD= YES | 202 | _RUBYGEMS_REQD= YES | |
198 | . elif ${_RUBYGEMS_REQD_MAJOR} == ${_RUBYGEMS_MAJOR} | 203 | . elif ${_RUBYGEMS_REQD_MAJOR} == ${_RUBYGEMS_MAJOR} | |
199 | . if !empty(_RUBYGEMS_MINORS) && ${_RUBYGEMS_REQD_MINORS} > ${_RUBYGEMS_MINORS} | 204 | . if !empty(_RUBYGEMS_MINORS) && ${_RUBYGEMS_REQD_MINORS} > ${_RUBYGEMS_MINORS} | |
200 | _RUBYGEMS_REQD= YES | 205 | _RUBYGEMS_REQD= YES | |
201 | . endif | 206 | . endif | |
202 | . endif | 207 | . endif |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: json.mk,v 1.3 2013/11/24 14:05:08 taca Exp $ | 1 | # $NetBSD: json.mk,v 1.4 2014/02/02 07:46:16 taca Exp $ | |
2 | 2 | |||
3 | # This file handles appropriate dependency to ruby-json pacakge. | 3 | # This file handles appropriate dependency to ruby-json pacakge. | |
4 | # | 4 | # | |
5 | 5 | |||
6 | # === Package-settable variables === | 6 | # === Package-settable variables === | |
7 | # | 7 | # | |
8 | # RUBY_JSON_REQD | 8 | # RUBY_JSON_REQD | |
9 | # Specify required version of ruby-json. | 9 | # Specify required version of ruby-json. | |
10 | # | 10 | # | |
11 | # Default: (empty) | 11 | # Default: (empty) | |
12 | # | 12 | # | |
13 | # RUBY_JSON_TYPE | 13 | # RUBY_JSON_TYPE | |
14 | # Specify depending packages: ruby-json, ruby-json-pure or both. | 14 | # Specify depending packages: ruby-json, ruby-json-pure or both. | |
@@ -26,26 +26,28 @@ RUBY_JSON_TYPE?= json | @@ -26,26 +26,28 @@ RUBY_JSON_TYPE?= json | |||
26 | WARNINGS+= "[lang/ruby/json.mk] No needs to include ../../lang/ruby/json.mk" | 26 | WARNINGS+= "[lang/ruby/json.mk] No needs to include ../../lang/ruby/json.mk" | |
27 | .else # !empty(RUBY_JSON_REQD) | 27 | .else # !empty(RUBY_JSON_REQD) | |
28 | 28 | |||
29 | .include "../../lang/ruby/rubyversion.mk" | 29 | .include "../../lang/ruby/rubyversion.mk" | |
30 | 30 | |||
31 | . if ${RUBY_VER} == "18" | 31 | . if ${RUBY_VER} == "18" | |
32 | _RUBY_JSON_REQD= true | 32 | _RUBY_JSON_REQD= true | |
33 | . else | 33 | . else | |
34 | 34 | |||
35 | . if ${RUBY_VER} == "193" | 35 | . if ${RUBY_VER} == "193" | |
36 | RUBY_JSON_VERSION= 1.5.5 | 36 | RUBY_JSON_VERSION= 1.5.5 | |
37 | . elif ${RUBY_VER} == "200" | 37 | . elif ${RUBY_VER} == "200" | |
38 | RUBY_JSON_VERSION= 1.7.7 | 38 | RUBY_JSON_VERSION= 1.7.7 | |
39 | . elif ${RUBY_VER} == "210" | |||
40 | RUBY_JSON_VERSION= 1.8.1 | |||
39 | . endif | 41 | . endif | |
40 | 42 | |||
41 | _RUBY_JSON_MAJOR= ${RUBY_JSON_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\1/} | 43 | _RUBY_JSON_MAJOR= ${RUBY_JSON_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\1/} | |
42 | _RUBY_JSON_MINOR= ${RUBY_JSON_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\2/} | 44 | _RUBY_JSON_MINOR= ${RUBY_JSON_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\2/} | |
43 | _RUBY_JSON_TEENY= ${RUBY_JSON_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\3/} | 45 | _RUBY_JSON_TEENY= ${RUBY_JSON_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\3/} | |
44 | 46 | |||
45 | _RUBY_JSON_REQD_MAJOR= ${RUBY_JSON_REQD:C/^([0-9]+).*/\1/} | 47 | _RUBY_JSON_REQD_MAJOR= ${RUBY_JSON_REQD:C/^([0-9]+).*/\1/} | |
46 | _RUBY_JSON_REQD_MINOR= \ | 48 | _RUBY_JSON_REQD_MINOR= \ | |
47 | ${RUBY_JSON_REQD:C/^${_RUBY_JSON_REQD_MAJOR}\.?//:C/^([0-9]+).*/\1/} | 49 | ${RUBY_JSON_REQD:C/^${_RUBY_JSON_REQD_MAJOR}\.?//:C/^([0-9]+).*/\1/} | |
48 | . if empty(_RUBY_JSON_REQD_MINOR) | 50 | . if empty(_RUBY_JSON_REQD_MINOR) | |
49 | _RUBY_JSON_REQD_MINOR= 0 | 51 | _RUBY_JSON_REQD_MINOR= 0 | |
50 | _RUBY_JSON_REQD_TEENY= 0 | 52 | _RUBY_JSON_REQD_TEENY= 0 | |
51 | . else | 53 | . else |
@@ -1,50 +1,54 @@ | @@ -1,50 +1,54 @@ | |||
1 | # $NetBSD: rdoc.mk,v 1.16 2014/01/19 12:57:42 taca Exp $ | 1 | # $NetBSD: rdoc.mk,v 1.17 2014/02/02 07:46:16 taca Exp $ | |
2 | 2 | |||
3 | .if !defined(_RUBY_RDOC_MK) | 3 | .if !defined(_RUBY_RDOC_MK) | |
4 | _RUBY_RDOC_MK= # defined | 4 | _RUBY_RDOC_MK= # defined | |
5 | 5 | |||
6 | # | 6 | # | |
7 | # === Package-settable variables === | 7 | # === Package-settable variables === | |
8 | # | 8 | # | |
9 | # RUBY_RDOC_REQD | 9 | # RUBY_RDOC_REQD | |
10 | # Specify later version of rdoc. Ruby base packages contain: | 10 | # Specify later version of rdoc. Ruby base packages contain: | |
11 | # | 11 | # | |
12 | # ruby18-base: rdoc 1.0.1 - 20041108 | 12 | # ruby18-base: rdoc 1.0.1 - 20041108 | |
13 | # ruby193-base: rdoc 3.9.4 | 13 | # ruby193-base: rdoc 3.9.4 | |
14 | # ruby200-base: rdoc 4.0.0 | 14 | # ruby200-base: rdoc 4.0.0 | |
15 | # | 15 | # | |
16 | # If a package has a trouble with these version, please specify the | 16 | # If a package has a trouble with these version, please specify the | |
17 | # version of rdoc to RDOC_REQD. | 17 | # version of rdoc to RDOC_REQD. | |
18 | # | 18 | # | |
19 | 19 | |||
20 | .if !empty(RUBY_RDOC_REQD) | 20 | .if !empty(RUBY_RDOC_REQD) | |
21 | 21 | |||
22 | RUBY18_RDOC_VERS= 1.0.1 | 22 | RUBY18_RDOC_VERS= 1.0.1 | |
23 | RUBY193_RDOC_VERS= 3.9.4 | 23 | RUBY193_RDOC_VERS= 3.9.4 | |
24 | RUBY200_RDOC_VERS= 4.0.0 | 24 | RUBY200_RDOC_VERS= 4.0.0 | |
25 | RUBY210_RDOC_VERS= 4.1.0 | |||
25 | 26 | |||
26 | _RDOC_REQD_MAJOR= ${RUBY_RDOC_REQD:C/\.[0-9\.]+$//} | 27 | _RDOC_REQD_MAJOR= ${RUBY_RDOC_REQD:C/\.[0-9\.]+$//} | |
27 | _RDOC_REQD_MINORS= ${RUBY_RDOC_REQD:C/^([0-9]+)\.*//} | 28 | _RDOC_REQD_MINORS= ${RUBY_RDOC_REQD:C/^([0-9]+)\.*//} | |
28 | 29 | |||
29 | . if ${RUBY_VER} == "18" | 30 | . if ${RUBY_VER} == "18" | |
30 | _RUBY_RDOC_MAJOR= ${RUBY18_RDOC_VERS:C/\.[0-9\.]+$//} | 31 | _RUBY_RDOC_MAJOR= ${RUBY18_RDOC_VERS:C/\.[0-9\.]+$//} | |
31 | _RUBY_RDOC_MINORS= ${RUBY18_RDOC_VERS:C/^([0-9]+)\.*//} | 32 | _RUBY_RDOC_MINORS= ${RUBY18_RDOC_VERS:C/^([0-9]+)\.*//} | |
32 | .elif ${RUBY_VER} == "193" | 33 | .elif ${RUBY_VER} == "193" | |
33 | _RUBY_RDOC_MAJOR= ${RUBY193_RDOC_VERS:C/\.[0-9\.]+$//} | 34 | _RUBY_RDOC_MAJOR= ${RUBY193_RDOC_VERS:C/\.[0-9\.]+$//} | |
34 | _RUBY_RDOC_MINORS= ${RUBY193_RDOC_VERS:C/^([0-9]+)\.*//} | 35 | _RUBY_RDOC_MINORS= ${RUBY193_RDOC_VERS:C/^([0-9]+)\.*//} | |
35 | .elif ${RUBY_VER} == "200" | 36 | .elif ${RUBY_VER} == "200" | |
36 | _RUBY_RDOC_MAJOR= ${RUBY200_RDOC_VERS:C/\.[0-9\.]+$//} | 37 | _RUBY_RDOC_MAJOR= ${RUBY200_RDOC_VERS:C/\.[0-9\.]+$//} | |
37 | _RUBY_RDOC_MINORS= ${RUBY200_RDOC_VERS:C/^([0-9]+)\.*//} | 38 | _RUBY_RDOC_MINORS= ${RUBY200_RDOC_VERS:C/^([0-9]+)\.*//} | |
39 | .elif ${RUBY_VER} == "210" | |||
40 | _RUBY_RDOC_MAJOR= ${RUBY210_RDOC_VERS:C/\.[0-9\.]+$//} | |||
41 | _RUBY_RDOC_MINORS= ${RUBY210_RDOC_VERS:C/^([0-9]+)\.*//} | |||
38 | .else | 42 | .else | |
39 | PKG_FAIL_REASON+= "Unknown Ruby version specified: ${RUBY_VER}." | 43 | PKG_FAIL_REASON+= "Unknown Ruby version specified: ${RUBY_VER}." | |
40 | . endif | 44 | . endif | |
41 | 45 | |||
42 | _RUBY_RDOC_REQD= NO | 46 | _RUBY_RDOC_REQD= NO | |
43 | 47 | |||
44 | . if ${_RDOC_REQD_MAJOR} > ${_RUBY_RDOC_MAJOR} | 48 | . if ${_RDOC_REQD_MAJOR} > ${_RUBY_RDOC_MAJOR} | |
45 | _RUBY_RDOC_REQD= YES | 49 | _RUBY_RDOC_REQD= YES | |
46 | . elif ${_RDOC_REQD_MAJOR} == ${_RUBY_RDOC_MAJOR} | 50 | . elif ${_RDOC_REQD_MAJOR} == ${_RUBY_RDOC_MAJOR} | |
47 | . if !empty(_RUBY_RDOC_MINORS) && ${_RDOC_REQD_MINORS} > ${_RUBY_RDOC_MINORS} | 51 | . if !empty(_RUBY_RDOC_MINORS) && ${_RDOC_REQD_MINORS} > ${_RUBY_RDOC_MINORS} | |
48 | _RUBY_RDOC_REQD= YES | 52 | _RUBY_RDOC_REQD= YES | |
49 | . endif | 53 | . endif | |
50 | . endif | 54 | . endif |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: rubyversion.mk,v 1.107 2014/01/14 11:14:07 obache Exp $ | 1 | # $NetBSD: rubyversion.mk,v 1.108 2014/02/02 07:46:16 taca Exp $ | |
2 | # | 2 | # | |
3 | 3 | |||
4 | # This file determines which Ruby version is used as a dependency for | 4 | # This file determines which Ruby version is used as a dependency for | |
5 | # a package. | 5 | # a package. | |
6 | # | 6 | # | |
7 | # | 7 | # | |
8 | # === User-settable variables === | 8 | # === User-settable variables === | |
9 | # | 9 | # | |
10 | # RUBY_VERSION_DEFAULT | 10 | # RUBY_VERSION_DEFAULT | |
11 | # The preferered Ruby version to use. | 11 | # The preferered Ruby version to use. | |
12 | # | 12 | # | |
13 | # Possible values: 18 193 200 | 13 | # Possible values: 18 193 200 | |
14 | # Default: 193 | 14 | # Default: 193 | |
@@ -190,26 +190,30 @@ | @@ -190,26 +190,30 @@ | |||
190 | # version specific system ri directory. | 190 | # version specific system ri directory. | |
191 | # | 191 | # | |
192 | # RUBY_SITERIDIR | 192 | # RUBY_SITERIDIR | |
193 | # version specific site ri directory. | 193 | # version specific site ri directory. | |
194 | # | 194 | # | |
195 | # Keywords: ruby | 195 | # Keywords: ruby | |
196 | # | 196 | # | |
197 | 197 | |||
198 | .if !defined(_RUBYVERSION_MK) | 198 | .if !defined(_RUBYVERSION_MK) | |
199 | _RUBYVERSION_MK= # defined | 199 | _RUBYVERSION_MK= # defined | |
200 | 200 | |||
201 | .include "../../mk/bsd.prefs.mk" | 201 | .include "../../mk/bsd.prefs.mk" | |
202 | 202 | |||
203 | .if defined(PKGNAME_REQD) && (!empty(PKGNAME_REQD:Mruby[0-9][0-9][0-9]-*) || !empty(PKGNAME_REQD:Mruby[0-9][0-9]-*)) | |||
204 | RUBY_VERSION_REQD?= ${PKGNAME_REQD:C/ruby([0-9][0-9]+)-.*/\1/} | |||
205 | .endif | |||
206 | ||||
203 | # current supported Ruby's version | 207 | # current supported Ruby's version | |
204 | RUBY18_VERSION= 1.8.7 | 208 | RUBY18_VERSION= 1.8.7 | |
205 | RUBY193_VERSION= 1.9.3 | 209 | RUBY193_VERSION= 1.9.3 | |
206 | RUBY200_VERSION= 2.0.0 | 210 | RUBY200_VERSION= 2.0.0 | |
207 | 211 | |||
208 | # patch | 212 | # patch | |
209 | RUBY18_PATCHLEVEL= pl374 | 213 | RUBY18_PATCHLEVEL= pl374 | |
210 | RUBY193_PATCHLEVEL= p484 | 214 | RUBY193_PATCHLEVEL= p484 | |
211 | RUBY200_PATCHLEVEL= p353 | 215 | RUBY200_PATCHLEVEL= p353 | |
212 | 216 | |||
213 | # current API compatible version; used for version of shared library | 217 | # current API compatible version; used for version of shared library | |
214 | RUBY18_API_VERSION= 1.8.7 | 218 | RUBY18_API_VERSION= 1.8.7 | |
215 | RUBY193_API_VERSION= 1.9.1 | 219 | RUBY193_API_VERSION= 1.9.1 |