Annotation of pkgsrc/lang/ruby/rubyversion.mk, revision 1.173
1.173 ! taca 1: # $NetBSD: rubyversion.mk,v 1.172 2017/04/09 15:57:00 taca Exp $
1.64 taca 2: #
3:
4: # This file determines which Ruby version is used as a dependency for
5: # a package.
6: #
7: #
8: # === User-settable variables ===
9: #
10: # RUBY_VERSION_DEFAULT
11: # The preferered Ruby version to use.
12: #
1.160 taca 13: # Possible values: 18 21 22 23
1.169 taca 14: # Default: 23
1.64 taca 15: #
16: # RUBY_BUILD_RDOC
17: # Build rdoc of this package and so that install formated
18: # documentation. It is also used in each package.
19: #
20: # Possible values: Yes No
21: # Default: Yes
22: #
23: # RUBY_BUILD_RI
24: # Build ri format of this package so that ri command would be
25: # display class/module definitions. It is also used in each package.
26: #
27: # Possible values: Yes No
28: # Default: Yes
29: #
1.89 cheusov 30: # === Infrastructure variables ===
31: #
1.88 cheusov 32: # RUBY_VERSION_REQD
1.89 cheusov 33: # Ruby version to use. This variable should not be set in
34: # packages. Normally it is used by bulk build tools.
1.88 cheusov 35: #
1.165 joerg 36: # Possible values: ${RUBY_VERSIONS_ACCEPTED}
1.88 cheusov 37: # Default: ${RUBY_VERSION_DEFAULT}
1.64 taca 38: #
39: # === Package-settable variables ===
40: #
1.165 joerg 41: # RUBY_VERSIONS_ACCEPTED
1.64 taca 42: # The Ruby versions that are acceptable for the package.
43: #
1.160 taca 44: # Possible values: 18 21 22 23
1.173 ! taca 45: # Default: 23 22 21
1.64 taca 46: #
47: # RUBY_NOVERSION
48: # If "Yes", the package dosen't depend on any version of Ruby, such
49: # as editing mode for emacs. In this case, package's name would begin
50: # with "ruby-". Otherwise, the package's name is begin with
1.124 taca 51: # ${RUBY_PKGPREFIX}.
1.64 taca 52: #
53: # Possible values: Yes No
54: # Default: No
55: #
56: # RUBY_DYNAMIC_DIRS
57: # Build dynamic PLIST from directories.
58: #
59: # Default: (empty)
60: #
61: # RUBY_ENCODING_ARG
62: #
63: # Optional encoding argument for shbang line.
64: #
65: # Default: (empty)
66: #
67: # === Defined variables ===
68: #
69: # RUBY_VER
1.87 taca 70: # Really selected version of ruby.
1.64 taca 71: #
1.160 taca 72: # Possible values: 18 21 22 23
1.64 taca 73: #
74: # Use this variable in pkgsrc's Makefile
75: #
76: # RUBY_PKGPREFIX
77: # Prefix part for ruby based packages. It is recommended that to
78: # use RUBY_PKGPREFIX with ruby related packages since you can supply
79: # different binary packages as each version of Ruby.
1.124 taca 80: #
1.160 taca 81: # Example values: ruby18 ruby21 ruby22 ruby23
1.64 taca 82: #
83: # RUBY_ABI_VERSION
84: # Ruby's ABI version.
85: #
86: # RUBY_DLEXT
87: # Suffix of extention library.
88: #
89: # RUBY_SLEXT
90: # Suffix of shared library.
91: #
92: # RUBY
93: # Full path of ruby command.
94: #
95: # RDOC
96: # Full path of rdoc command.
97: #
98: # RUBY_NAME
99: # Name of ruby command.
100: #
101: # RUBYGEM_NAME
102: # Name of gem command.
103: #
104: # RAKE_NAME
105: # Name of rake command.
106: #
107: # RUBY_SUFFIX
108: # Extra string for each ruby commands; ruby, irb and so on.
1.124 taca 109: #
1.160 taca 110: # Possible values: 18 21 22 23
1.64 taca 111: #
112: # RUBY_VERSION
113: # Version of real Ruby's version excluding patchlevel.
114: #
115: # RUBY_VERSION_FULL
116: # Version of Ruby including patchlevel.
1.97 rodent 117: #
1.131 taca 118: # RUBY_GEMS_PKGSRC_VERS
119: # Version of rubygems provided by misc/rubygems.
120: #
121: # RUBY_RDOC_PKGSRC_VERS
122: # Version of rdoc provided by devel/rdoc.
123: #
1.64 taca 124: # RUBY_BASE
125: # Name of ruby base package's name.
126: #
127: # RUBY_SRCDIR
1.112 taca 128: # Relative path to directory of base ruby package.
1.64 taca 129: #
130: # RUBY_SHLIBVER
131: # Suffix of libruby shared library's version.
132: #
133: # RUBY_SHLIB
134: # String after libruby shared library.
135: #
136: # RUBY_SHLIBALIAS
137: # Symblic link with libruby shared library with major version only.
138: #
139: # RUBY_STATICLIB
140: # Name of libruby static library.
141: #
142: # RUBY_VER_DIR
143: # Name of version directory under each library (and more) directories.
144: #
145: # RUBY_ARCH
146: # Name of architecture-dependent directory name.
147: #
148: # RUBY_INC
149: # machine independent include directory of ruby.
150: #
151: # RUBY_ARCHINC
152: # machine dependent include directory of ruby.
153: #
154: # RUBY_LIB_BASE
155: # common relative path of ruby's library.
156: #
157: # RUBY_LIB
158: # version specific relative path of ruby's library.
159: #
160: # RUBY_ARCHLIB
161: # version specific and machine dependent relative path of ruby's library.
162: #
163: # RUBY_SITELIB_BASE
164: # common site local directory.
165: #
166: # RUBY_SITELIB
167: # version specific site local directory.
168: #
169: # RUBY_SITEARCHLIB
170: # version specific and machine dependent site local directory.
171: #
172: # RUBY_VENDORLIB_BASE
173: # common vendor (pkgsrc) directory.
174: #
175: # RUBY_VENDORLIB
176: # version specific vendor local directory.
177: #
178: # RUBY_VENDORARCHLIB
179: # version specific and machine dependent vendor local directory.
180: #
181: # RUBY_DOC
182: # version specific document direcotry.
183: #
184: # RUBY_EG
185: # version specific examples direcotry.
186: #
187: # RUBY_GEM_BASE
188: # common GEM directory.
1.97 rodent 189: #
1.64 taca 190: # GEM_HOME
191: # version specific GEM directory.
192: #
193: # RUBY_RIDIR
194: # common ri directory.
195: #
196: # RUBY_BASERIDIR
197: # version specific ri directory.
198: #
199: # RUBY_SYSRIDIR
200: # version specific system ri directory.
201: #
202: # RUBY_SITERIDIR
203: # version specific site ri directory.
204: #
1.166 taca 205: # === supporting scripts ===
206: #
207: # UPDATE_GEMSPEC
208: # a tool to modify gemspec file.
209: #
1.64 taca 210: # Keywords: ruby
1.1 taca 211: #
212:
1.18 rillig 213: .if !defined(_RUBYVERSION_MK)
1.1 taca 214: _RUBYVERSION_MK= # defined
215:
216: .include "../../mk/bsd.prefs.mk"
217:
1.109 taca 218: .if defined(PKGNAME_REQD)
219: . if !empty(PKGNAME_REQD:Mruby[0-9][0-9][0-9]-*) || !empty(PKGNAME_REQD:Mruby[0-9][0-9]-*)
1.112 taca 220: _RUBY_VERSION_REQD:= ${PKGNAME_REQD:C/ruby([0-9][0-9]+)-.*/\1/}
1.150 taca 221: . if ${_RUBY_VERSION_REQD} == "18"
1.119 taca 222: RUBY_VERSION_REQD?= ${PKGNAME_REQD:C/ruby([0-9][0-9])[0-9]-.*/\1/}
223: . else
1.108 taca 224: RUBY_VERSION_REQD?= ${PKGNAME_REQD:C/ruby([0-9][0-9]+)-.*/\1/}
1.112 taca 225: . endif
1.109 taca 226: . endif
1.108 taca 227: .endif
228:
1.1 taca 229: # current supported Ruby's version
1.40 taca 230: RUBY18_VERSION= 1.8.7
1.162 taca 231: RUBY21_VERSION= 2.1.10
1.170 taca 232: RUBY22_VERSION= 2.2.7
1.172 taca 233: RUBY23_VERSION= 2.3.4
1.23 taca 234:
1.155 taca 235: # patch level
1.100 taca 236: RUBY18_PATCHLEVEL= pl374
1.162 taca 237: #RUBY21_PATCHLEVEL= p492
1.170 taca 238: #RUBY22_PATCHLEVEL= p470
1.172 taca 239: #RUBY23_PATCHLEVEL= p301
1.49 taca 240:
1.59 taca 241: # current API compatible version; used for version of shared library
1.49 taca 242: RUBY18_API_VERSION= 1.8.7
1.112 taca 243: RUBY21_API_VERSION= 2.1.0
1.131 taca 244: RUBY22_API_VERSION= 2.2.0
1.155 taca 245: RUBY23_API_VERSION= 2.3.0
1.131 taca 246:
247: # pkgsrc's rubygems's version
1.143 taca 248: RUBY_GEMS_PKGSRC_VERS= 2.4.8
1.131 taca 249:
250: # pkgsrc's rdoc's version
1.158 taca 251: RUBY_RDOC_PKGSRC_VERS= 4.2.2
1.1 taca 252:
253: #
1.169 taca 254: RUBY_VERSION_DEFAULT?= 23
1.64 taca 255:
1.173 ! taca 256: # supported Ruby's version
! 257: RUBY_VERSIONS_SUPPORTED= 23 22 21 18
! 258:
1.169 taca 259: RUBY_VERSIONS_ACCEPTED?= 23 22 21
1.165 joerg 260: RUBY_VERSIONS_INCOMPATIBLE?=
261:
1.173 ! taca 262: .if empty(RUBY_VERSIONS_SUPPORTED:M${RUBY_VERSION_DEFAULT})
! 263: .error Unsuported RUBY_VERSION_DEFAULT: ${RUBY_VERSION_DEFAULT}
! 264: .endif
! 265:
1.165 joerg 266: .for rv in ${RUBY_VERSIONS_ACCEPTED}
267: . if empty(RUBY_VERSIONS_INCOMPATIBLE:M${rv})
268: _RUBY_VERSIONS_ACCEPTED+= ${rv}
269: . endif
270: .endfor
1.64 taca 271:
1.98 taca 272: .if defined(RUBY_VERSION_REQD)
1.165 joerg 273: . for rv in ${_RUBY_VERSIONS_ACCEPTED}
1.109 taca 274: . if "${rv}" == ${RUBY_VERSION_REQD}
1.98 taca 275: RUBY_VER= ${rv}
276: . endif
277: . endfor
278: .elif !defined(RUBY_VER)
1.165 joerg 279: . for rv in ${_RUBY_VERSIONS_ACCEPTED}
1.109 taca 280: . if "${rv}" == ${RUBY_VERSION_DEFAULT}
1.98 taca 281: RUBY_VER= ${rv}
282: . endif
283: . endfor
1.64 taca 284: .endif
1.1 taca 285:
1.98 taca 286: .if !defined(RUBY_VER)
1.165 joerg 287: . for rv in ${_RUBY_VERSIONS_ACCEPTED}
1.98 taca 288: . if !defined(RUBY_VER)
1.64 taca 289: RUBY_VER= ${rv}
1.52 joerg 290: . endif
1.64 taca 291: . endfor
1.1 taca 292: .endif
1.29 taca 293:
1.81 obache 294: RUBY_VER:= ${RUBY_VER_MAP.${RUBY_VER}:U${RUBY_VER}}
1.67 joerg 295:
1.112 taca 296: RUBY_SUFFIX?= ${_RUBY_VER_MAJOR}${_RUBY_VER_MINOR}${_RUBY_VER_TEENY}
297:
1.64 taca 298: .if ${RUBY_VER} == "18"
299: RUBY_VERSION= ${RUBY18_VERSION}
300: RUBY_VERSION_FULL= ${RUBY_VERSION}${RUBY_PATCHLEVEL:S/pl/./}
301: RUBY_ABI_VERSION= ${RUBY18_API_VERSION}
1.110 taca 302:
303: RUBY_RDOC_VERSION= 1.0.1
304:
1.112 taca 305: RUBY_SUFFIX= ${RUBY_VER}
306:
307: .elif ${RUBY_VER} == "21"
308: RUBY_VERSION= ${RUBY21_VERSION}
309: RUBY_VERSION_FULL= ${RUBY_VERSION}
1.110 taca 310: RUBY_ABI_VERSION= ${RUBY_VERSION}
311:
1.112 taca 312: RUBY_GEMS_VERSION= 2.2.2
1.110 taca 313: RUBY_RDOC_VERSION= 4.1.0
314: RUBY_RAKE_VERSION= 10.1.0
315: RUBY_JSON_VERSION= 1.8.1
316:
1.156 taca 317: RUBY_BIGDECIMAL_VERSION= 1.2.4
318: RUBY_IO_CONSOLE_VERSION= 0.4.3
319: RUBY_PSYCH_VERSION= 2.0.5
320: RUBY_MINITEST_VERSION= 4.7.5
321: RUBY_TEST_UNIT_VERSION= 2.1.8.0
322:
1.134 taca 323: RUBY_SUFFIX= ${_RUBY_VER_MAJOR}${_RUBY_VER_MINOR}
324:
1.131 taca 325: .elif ${RUBY_VER} == "22"
326: RUBY_VERSION= ${RUBY22_VERSION}
327: RUBY_VERSION_FULL= ${RUBY_VERSION}
328: RUBY_ABI_VERSION= ${RUBY_VERSION}
329:
1.167 taca 330: RUBY_GEMS_VERSION= 2.4.5.2
1.131 taca 331: RUBY_RDOC_VERSION= 4.2.0
332: RUBY_RAKE_VERSION= 10.4.2
333: RUBY_JSON_VERSION= 1.8.1
334:
1.156 taca 335: RUBY_BIGDECIMAL_VERSION= 1.2.6
336: RUBY_IO_CONSOLE_VERSION= 0.4.3
337: RUBY_PSYCH_VERSION= 2.0.8
338: RUBY_MINITEST_VERSION= 5.4.3
339: RUBY_POWER_ASSERT_VERSION= 0.2.2
340: RUBY_TEST_UNIT_VERSION= 3.0.8
341:
1.134 taca 342: RUBY_SUFFIX= ${_RUBY_VER_MAJOR}${_RUBY_VER_MINOR}
343:
1.155 taca 344: .elif ${RUBY_VER} == "23"
345: RUBY_VERSION= ${RUBY23_VERSION}
346: RUBY_VERSION_FULL= ${RUBY_VERSION}
347: RUBY_ABI_VERSION= ${RUBY_VERSION}
348:
1.168 taca 349: RUBY_GEMS_VERSION= 2.5.2
1.155 taca 350: RUBY_RDOC_VERSION= 4.2.1
351: RUBY_RAKE_VERSION= 10.4.2
352: RUBY_JSON_VERSION= 1.8.3
353:
1.156 taca 354: RUBY_BIGDECIMAL_VERSION= 1.2.8
355: RUBY_IO_CONSOLE_VERSION= 0.4.5
1.168 taca 356: RUBY_PSYCH_VERSION= 2.1.0
1.156 taca 357: RUBY_DID_YOU_MEAN_VERSION= 1.0.0
1.168 taca 358: RUBY_MINITEST_VERSION= 5.8.5
1.156 taca 359: RUBY_NET_TELNET_VERSION= 0.1.1
360: RUBY_POWER_ASSERT_VERSION= 0.2.6
361: RUBY_TEST_UNIT_VERSION= 3.1.5
362:
1.155 taca 363: RUBY_SUFFIX= ${_RUBY_VER_MAJOR}${_RUBY_VER_MINOR}
364:
1.64 taca 365: .else
366: PKG_FAIL_REASON+= "Unknown Ruby version specified: ${RUBY_VER}."
1.32 taca 367: .endif
1.1 taca 368:
1.98 taca 369: .if !empty(RUBY_VERSION)
1.64 taca 370: RUBY_PATCHLEVEL= ${RUBY${RUBY_VER}_PATCHLEVEL}
371: RUBY_API_VERSION= ${RUBY${RUBY_VER}_API_VERSION}
1.98 taca 372: .endif
1.64 taca 373:
1.60 wiz 374: # Variable assignment for multi-ruby packages
1.64 taca 375: MULTI+= RUBY_VER=${RUBY_VERS:U${RUBY_VERSION_DEFAULT}}
1.4 taca 376:
1.1 taca 377: # RUBY_NOVERSION should be set to "Yes" if the package dosen't depend on
378: # any specific version of ruby command. In this case, package's
379: # name begin with "ruby-".
380: # If RUBY_NOVERSION is "No" (default), the package's name is begin
1.160 taca 381: # with ${RUBY_NAME}; "ruby18", "ruby21", and so on.
1.1 taca 382: #
1.53 taca 383: # It also affects to RUBY_DOC, RUBY_EG...
1.1 taca 384: #
385: RUBY_NOVERSION?= No
386:
1.29 taca 387: # _RUBY_VER_MAJOR, _RUBY_VER_MINOR, _RUBY_VER_TEENY and _RUBY_PATCHLEVEL
388: # is defined from version of Ruby. It should not be used in packages'
389: # Makefile.
390: #
1.64 taca 391: _RUBY_VER_MAJOR= ${RUBY_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\1/}
392: _RUBY_VER_MINOR= ${RUBY_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\2/}
393: _RUBY_VER_TEENY= ${RUBY_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\3/}
1.1 taca 394:
1.64 taca 395: _RUBY_API_MAJOR= ${RUBY_API_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\1\2/}
396: _RUBY_API_MINOR= ${RUBY_API_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\3/}
1.1 taca 397:
1.64 taca 398: RUBY_NAME= ruby${RUBY_SUFFIX}
399: RUBYGEM_NAME= gem${RUBY_SUFFIX}
400: RAKE_NAME= rake${RUBY_SUFFIX}
1.1 taca 401:
1.49 taca 402: RUBY_ENCODING_ARG?=
403:
1.112 taca 404: RUBY_BASE= ${RUBY_NAME}-base
1.10 taca 405:
1.1 taca 406: RUBY_PKGPREFIX?= ${RUBY_NAME}
407:
1.87 taca 408: .if ${RUBY_VER} == "18"
1.64 taca 409: RUBY_VER_DIR= ${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}
1.134 taca 410: .else
411: RUBY_VER_DIR= ${RUBY_API_VERSION}
1.1 taca 412: .endif
413:
414: .if empty(RUBY_NOVERSION:M[nN][oO])
415: RUBY_SUFFIX=
416: RUBY_NAME= ruby
417: .endif
418:
1.64 taca 419: RUBY_BUILD_RDOC?= Yes
420: RUBY_BUILD_RI?= Yes
1.49 taca 421:
1.15 taca 422: RUBY?= ${PREFIX}/bin/${RUBY_NAME}
1.112 taca 423: RDOC?= ${PREFIX}/bin/rdoc${RUBY_SUFFIX}
1.1 taca 424:
1.132 riastrad 425: RUBY_ARCH?= ${MACHINE_GNU_ARCH}-${LOWER_OPSYS}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX}${APPEND_ABI}
1.1 taca 426:
1.138 taca 427: RUBY_MAJOR_MINOR= ${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}
428:
1.1 taca 429: #
1.53 taca 430: # Ruby shared and static library version handling.
1.10 taca 431: #
1.49 taca 432: RUBY_SHLIBVER?= ${RUBY_API_VERSION}
1.112 taca 433: RUBY_SHLIB?= ${RUBY_SUFFIX}.${RUBY_SLEXT}.${RUBY_SHLIBVER}
1.53 taca 434: RUBY_SHLIBALIAS?= @comment
1.112 taca 435: RUBY_STATICLIB?= ${RUBY_SUFFIX}-static.a
1.10 taca 436:
437: .if ${OPSYS} == "NetBSD" || ${OPSYS} == "Interix"
1.64 taca 438: RUBY_SHLIBVER= ${_RUBY_API_MAJOR}.${_RUBY_API_MINOR}
1.112 taca 439: _RUBY_SHLIBALIAS= ${RUBY_SUFFIX}.${RUBY_SLEXT}.${_RUBY_API_MAJOR}
1.12 jlam 440: .elif ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly"
1.87 taca 441: .if ${RUBY_VER} == "18"
1.112 taca 442: RUBY_SHLIBVER= ${RUBY_SUFFIX}
1.75 marino 443: .else
444: RUBY_SHLIBVER= ${_RUBY_VER_MAJOR}${_RUBY_VER_MINOR}${_RUBY_API_MINOR}
445: .endif
1.83 bsiegert 446: .elif ${OPSYS} == "OpenBSD" || ${OPSYS} == "MirBSD"
1.102 taca 447: .if ${_RUBY_VER_MINOR} == 0
448: RUBY_SHLIBVER= ${_RUBY_VER_MAJOR}.${_RUBY_API_MINOR}
449: .else
1.64 taca 450: RUBY_SHLIBVER= ${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}${_RUBY_API_MINOR}
1.102 taca 451: .endif
1.53 taca 452: .elif ${OPSYS} == "Darwin"
1.112 taca 453: RUBY_SHLIB= ${RUBY_SUFFIX}.${RUBY_SHLIBVER}.${RUBY_SLEXT}
1.53 taca 454: .if ${RUBY_VER} == "18"
1.112 taca 455: _RUBY_SHLIBALIAS= ${RUBY_SUFFIX}.${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}.${RUBY_SLEXT}
1.53 taca 456: .else
457: _RUBY_SHLIBALIAS= .${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}.${RUBY_SLEXT}
1.112 taca 458: RUBY_STATICLIB= ${RUBY_SUFFIX}.${RUBY_API_VERSION}-static.a
1.53 taca 459: .endif
1.10 taca 460: .elif ${OPSYS} == "Linux"
1.112 taca 461: _RUBY_SHLIBALIAS= ${RUBY_SUFFIX}.${RUBY_SLEXT}.${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}
1.56 taca 462: .elif ${OPSYS} == "SunOS"
463: RUBY_SHLIBVER= ${_RUBY_VER_MAJOR}
1.154 rillig 464: _RUBY_SHLIBALIAS= ${RUBY_SUFFIX}.${RUBY_SLEXT}.${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}.${_RUBY_API_MINOR}
1.96 obache 465: .elif ${OPSYS} == "Cygwin"
1.112 taca 466: RUBY_SHLIB= ${RUBY_SUFFIX}${_RUBY_API_MAJOR}${_RUBY_API_MINOR}.dll.a
467: RUBY_SHLIBALIAS= bin/cygruby${RUBY_SUFFIX}${_RUBY_API_MAJOR}${_RUBY_API_MINOR}.dll
468: RUBY_STATICLIB= ${RUBY_SUFFIX}${_RUBY_API_MAJOR}${_RUBY_API_MINOR}-static.a
1.10 taca 469: .endif
470:
1.53 taca 471: .if !empty(_RUBY_SHLIBALIAS)
472: RUBY_SHLIBALIAS= lib/libruby${_RUBY_SHLIBALIAS}
1.10 taca 473: .endif
474:
1.64 taca 475: .if ${_OPSYS_SHLIB_TYPE} == "dylib"
1.5 taca 476: RUBY_DLEXT= bundle
1.53 taca 477: RUBY_SLEXT= dylib
1.5 taca 478: .else
479: RUBY_DLEXT= so
1.53 taca 480: RUBY_SLEXT= so
1.5 taca 481: .endif
482:
483: #
1.71 taca 484: # Ruby distribution file, few package need it.
485: #
486: _RUBY_PATCHLEVEL= ${RUBY_PATCHLEVEL:S/pl/p/:S/pre/preview/}
487:
488: .if !empty(_RUBY_PATCHLEVEL)
489: RUBY_DISTNAME?= ruby-${RUBY_VERSION}-${_RUBY_PATCHLEVEL}
490: .else
491: RUBY_DISTNAME?= ruby-${RUBY_VERSION}
492: .endif
493:
494: #
1.26 taca 495: # Use pthread library with Ruby
496: #
1.64 taca 497: .if !empty(MACHINE_PLATFORM:MDarwin-9.*-powerpc)
1.42 minskim 498: # Workaround for Ruby Bug #193
499: # http://redmine.ruby-lang.org/issues/show/193
500: RUBY_USE_PTHREAD?= no
1.26 taca 501: .else
502: RUBY_USE_PTHREAD?= yes
503: .endif
504:
1.23 taca 505: RUBY_DYNAMIC_DIRS?= # empty
506:
1.112 taca 507: RUBY_SRCDIR?= ../../lang/ruby${RUBY_VER}-base
1.10 taca 508:
509: #
1.23 taca 510: # common paths
1.1 taca 511: #
1.49 taca 512: RUBY_INC= include/ruby-${RUBY_VER_DIR}
513: RUBY_ARCHINC= ${RUBY_INC}/${RUBY_ARCH}
514: RUBY_LIB_BASE= lib/ruby
515: RUBY_LIB?= ${RUBY_LIB_BASE}/${RUBY_VER_DIR}
1.40 taca 516: RUBY_ARCHLIB?= ${RUBY_LIB}/${RUBY_ARCH}
1.49 taca 517: RUBY_SITELIB_BASE?= ${RUBY_LIB_BASE}/site_ruby
1.40 taca 518: RUBY_SITELIB?= ${RUBY_SITELIB_BASE}/${RUBY_VER_DIR}
519: RUBY_SITEARCHLIB?= ${RUBY_SITELIB}/${RUBY_ARCH}
1.49 taca 520: RUBY_VENDORLIB_BASE?= ${RUBY_LIB_BASE}/vendor_ruby
1.40 taca 521: RUBY_VENDORLIB?= ${RUBY_VENDORLIB_BASE}/${RUBY_VER_DIR}
522: RUBY_VENDORARCHLIB?= ${RUBY_VENDORLIB}/${RUBY_ARCH}
1.49 taca 523:
1.40 taca 524: RUBY_DOC?= share/doc/${RUBY_NAME}
525: RUBY_EG?= share/examples/${RUBY_NAME}
526:
1.64 taca 527:
1.49 taca 528: RUBY_GEM_BASE?= ${RUBY_LIB_BASE}/gems
529: GEM_HOME?= ${RUBY_GEM_BASE}/${RUBY_VER_DIR}
1.31 taca 530:
531: #
532: # ri database relative path
533: #
534: RUBY_RIDIR?= share/ri
1.15 taca 535: RUBY_BASERIDIR?= ${RUBY_RIDIR}/${RUBY_VER_DIR}
536: RUBY_SYSRIDIR?= ${RUBY_BASERIDIR}/system
537: RUBY_SITERIDIR?= ${RUBY_BASERIDIR}/site
1.1 taca 538:
539: #
540: # MAKE_ENV
541: #
1.18 rillig 542: MAKE_ENV+= RUBY=${RUBY:Q} RUBY_VER=${RUBY_VER:Q} \
543: RUBY_VERSION_DEFAULT=${RUBY_VERSION_DEFAULT:Q}
1.15 taca 544:
1.122 taca 545: MAKEFLAGS+= RUBY_VER=${RUBY_VER:Q} \
546: RUBY_VERSION_DEFAULT=${RUBY_VERSION_DEFAULT:Q}
1.15 taca 547:
1.49 taca 548: #
1.98 taca 549: # PLIST_VARS for x11/ruby-tk package.
1.1 taca 550: #
1.150 taca 551: PLIST_VARS+= ruby200
1.98 taca 552: .if ${RUBY_VER} != "18"
1.101 taca 553: PLIST.ruby200= yes
1.49 taca 554: .endif
555:
556: PLIST_RUBY_DIRS= RUBY_INC=${RUBY_INC:Q} RUBY_ARCHINC=${RUBY_ARCHINC:Q} \
557: RUBY_LIB_BASE=${RUBY_LIB_BASE:Q} \
558: RUBY_LIB=${RUBY_LIB:Q} \
559: RUBY_ARCHLIB=${RUBY_ARCHLIB:Q} \
1.40 taca 560: RUBY_SITELIB_BASE=${RUBY_SITELIB_BASE:Q} \
1.49 taca 561: RUBY_SITELIB=${RUBY_SITELIB:Q} \
562: RUBY_SITEARCHLIB=${RUBY_SITEARCHLIB:Q} \
1.40 taca 563: RUBY_VENDORLIB_BASE=${RUBY_VENDORLIB_BASE:Q} \
564: RUBY_VENDORLIB=${RUBY_VENDORLIB:Q} \
565: RUBY_VENDORARCHLIB=${RUBY_VENDORARCHLIB:Q} \
1.49 taca 566: RUBY_DOC=${RUBY_DOC:Q} \
567: RUBY_EG=${RUBY_EG:Q} \
568: RUBY_GEM_BASE=${RUBY_GEM_BASE:Q} \
569: GEM_HOME=${GEM_HOME:Q} \
570: RUBY_RIDIR=${RUBY_RIDIR:Q} \
571: RUBY_BASERIDIR=${RUBY_BASERIDIR:Q} \
572: RUBY_SYSRIDIR=${RUBY_SYSRIDIR:Q} \
573: RUBY_SITERIDIR=${RUBY_SITERIDIR:Q}
1.1 taca 574:
1.14 taca 575: #
576: # substitutions
577: #
1.18 rillig 578: FILES_SUBST+= RUBY=${RUBY:Q} RUBY_NAME=${RUBY_NAME:Q} \
579: RUBY_PKGPREFIX=${RUBY_PKGPREFIX:Q} \
1.111 taca 580: RUBY_SUFFIX=${RUBY_SUFFIX} \
1.18 rillig 581: RUBY_VER=${RUBY_VER:Q} \
1.15 taca 582: ${PLIST_RUBY_DIRS}
1.14 taca 583:
1.15 taca 584: MESSAGE_SUBST+= RUBY="${RUBY}" RUBY_VER="${RUBY_VER}" \
1.14 taca 585: RUBY_VERSION="${RUBY_VERSION}" \
1.15 taca 586: RUBY_PKGPREFIX="${RUBY_PKGPREFIX}" \
1.111 taca 587: RUBY_SUFFIX=${RUBY_SUFFIX} \
1.15 taca 588: ${PLIST_RUBY_DIRS:S,DIR="${PREFIX}/,DIR=",}
1.14 taca 589:
1.18 rillig 590: PLIST_SUBST+= RUBY=${RUBY:Q} RUBY_VER=${RUBY_VER:Q} \
1.49 taca 591: RUBY_PKGPREFIX=${RUBY_PKGPREFIX} \
1.111 taca 592: RUBY_SUFFIX=${RUBY_SUFFIX} \
1.18 rillig 593: RUBY_VERSION=${RUBY_VERSION:Q} \
594: RUBY_VER_DIR=${RUBY_VER_DIR:Q} \
1.53 taca 595: RUBY_DLEXT=${RUBY_DLEXT:Q} RUBY_SLEXT=${RUBY_SLEXT:Q} \
596: RUBY_SHLIB=${RUBY_SHLIB:Q} \
597: RUBY_SHLIBALIAS=${RUBY_SHLIBALIAS:Q} \
598: RUBY_STATICLIB=${RUBY_STATICLIB:Q} \
1.144 rodent 599: RUBY_API_VERSION=${RUBY_API_VERSION:Q} \
1.39 jlam 600: RUBY_ARCH=${RUBY_ARCH:Q} \
1.138 taca 601: ${PLIST_RUBY_DIRS:S,DIR="${PREFIX}/,DIR=",} \
602: RUBY_MAJOR_MINOR=${RUBY_MAJOR_MINOR}
1.1 taca 603:
1.22 taca 604: #
1.23 taca 605: # make dynamic PLIST
1.22 taca 606: #
1.23 taca 607: .if !empty(RUBY_DYNAMIC_DIRS)
608:
609: RUBY_PLIST_DYNAMIC= ${WRKDIR}/PLIST.work
610:
611: .if !defined(PLIST_SRC)
612: . if exists(${PKGDIR}/PLIST.common)
613: PLIST_SRC+= ${PKGDIR}/PLIST.common
614: . elif exists(${PKGDIR}/PLIST)
615: PLIST_SRC+= ${PKGDIR}/PLIST
616: . endif
617:
618: PLIST_SRC+= ${RUBY_PLIST_DYNAMIC}
619:
620: . if exists(${PKGDIR}/PLIST.common_end)
621: PLIST_SRC+= ${PKGDIR}/PLIST.common_end
622: . endif
623:
624: .endif
625:
626: RUBY_PLIST_COMMENT_CMD= \
627: ${ECHO} "@comment The following lines are automatically generated"
1.37 obache 628: RUBY_PLIST_FILES_CMD= ( cd ${DESTDIR}${PREFIX}; \
1.23 taca 629: ${FIND} ${RUBY_DYNAMIC_DIRS} \( -type f -o -type l \) -print ) | \
630: ${SORT} -u
1.164 rillig 631: RUBY_GENERATE_PLIST= ( \
1.23 taca 632: ${RUBY_PLIST_COMMENT_CMD}; \
1.47 joerg 633: ${RUBY_PLIST_FILES_CMD} ) > ${RUBY_PLIST_DYNAMIC}
1.22 taca 634: .endif
1.23 taca 635:
1.53 taca 636: PRINT_PLIST_AWK+= /lib\/libruby${RUBY_STATICLIB}$$/ \
637: { sub(/${RUBY_STATICLIB}/, "$${RUBY_STATICLIB}"); }
638: PRINT_PLIST_AWK+= /lib\/libruby${RUBY_VER}\.${RUBY_SLEXT}/ \
639: { sub(/${RUBY_VER}\.${RUBY_SLEXT}$$/, \
640: "$${RUBY_VER}.$${RUBY_SLEXT}"); }
641: PRINT_PLIST_AWK+= /${RUBY_SHLIB}$$/ \
642: { sub(/${RUBY_SHLIB}$$/, "$${RUBY_SHLIB}"); }
643: PRINT_PLIST_AWK+= /${RUBY_SLEXT}\.${RUBY_SHLIBVER}$$/ \
644: { sub(/${RUBY_SLEXT}\.${RUBY_SHLIBVER}$$/, \
645: "$${RUBY_SLEXT}.$${RUBY_SHLIBVER}"); }
646: .if ${RUBY_SHLIBALIAS} != "@comment"
647: PRINT_PLIST_AWK+= /${RUBY_SHLIBALIAS:S/\//\\\//}$$/ \
648: { sub(/${RUBY_SHLIBALIAS:S/\//\\\//}$$/, \
649: "$${RUBY_SHLIBALIAS}"); }
1.49 taca 650: .endif
651: PRINT_PLIST_AWK+= /^${RUBY_ARCHINC:S|/|\\/|g}/ \
652: { gsub(/${RUBY_ARCHINC:S|/|\\/|g}/, "$${RUBY_ARCHINC}"); \
653: print; next; }
654: PRINT_PLIST_AWK+= /^${RUBY_INC:S|/|\\/|g}/ \
655: { gsub(/${RUBY_INC:S|/|\\/|g}/, "$${RUBY_INC}"); \
656: print; next; }
1.40 taca 657: PRINT_PLIST_AWK+= /\.${RUBY_DLEXT}$$/ \
658: { gsub(/${RUBY_DLEXT}$$/, "$${RUBY_DLEXT}") }
1.47 joerg 659: PRINT_PLIST_AWK+= /^${RUBY_ARCHLIB:S|/|\\/|g}/ \
1.40 taca 660: { gsub(/${RUBY_ARCHLIB:S|/|\\/|g}/, "$${RUBY_ARCHLIB}"); \
661: print; next; }
1.47 joerg 662: PRINT_PLIST_AWK+= /^${RUBY_VENDORARCHLIB:S|/|\\/|g}/ \
1.40 taca 663: { gsub(/${RUBY_VENDORARCHLIB:S|/|\\/|g}/, "$${RUBY_VENDORARCHLIB}"); \
664: print; next; }
1.47 joerg 665: PRINT_PLIST_AWK+= /^${RUBY_VENDORLIB:S|/|\\/|g}/ \
1.40 taca 666: { gsub(/${RUBY_VENDORLIB:S|/|\\/|g}/, "$${RUBY_VENDORLIB}"); \
667: print; next; }
1.47 joerg 668: PRINT_PLIST_AWK+= /^${RUBY_SITEARCHLIB:S|/|\\/|g}/ \
1.40 taca 669: { gsub(/${RUBY_SITEARCHLIB:S|/|\\/|g}/, "$${RUBY_SITEARCHLIB}"); \
670: print; next; }
1.47 joerg 671: PRINT_PLIST_AWK+= /^${RUBY_SITELIB:S|/|\\/|g}/ \
1.40 taca 672: { gsub(/${RUBY_SITELIB:S|/|\\/|g}/, "$${RUBY_SITELIB}"); \
673: print; next; }
1.49 taca 674: PRINT_PLIST_AWK+= /^${RUBY_SITELIB_BASE:S|/|\\/|g}/ \
1.40 taca 675: { gsub(/${RUBY_SITELIB_BASE:S|/|\\/|g}/, "$${RUBY_SITELIB_BASE}"); \
676: print; next; }
1.49 taca 677: PRINT_PLIST_AWK+= /^${RUBY_VENDORLIB_BASE:S|/|\\/|g}/ \
1.40 taca 678: { gsub(/${RUBY_VENDORLIB_BASE:S|/|\\/|g}/, "$${RUBY_VENDORLIB_BASE}"); \
679: print; next; }
1.47 joerg 680: PRINT_PLIST_AWK+= /^${RUBY_LIB:S|/|\\/|g}/ \
1.40 taca 681: { gsub(/${RUBY_LIB:S|/|\\/|g}/, "$${RUBY_LIB}"); \
682: print; next; }
1.47 joerg 683: PRINT_PLIST_AWK+= /^${RUBY_DOC:S|/|\\/|g}/ \
1.40 taca 684: { gsub(/${RUBY_DOC:S|/|\\/|g}/, "$${RUBY_DOC}"); \
685: print; next; }
1.47 joerg 686: PRINT_PLIST_AWK+= /^${RUBY_EG:S|/|\\/|g}/ \
1.40 taca 687: { gsub(/${RUBY_EG:S|/|\\/|g}/, "$${RUBY_EG}"); \
688: print; next; }
1.47 joerg 689: PRINT_PLIST_AWK+= /^${RUBY_SITERIDIR:S|/|\\/|g}/ \
1.40 taca 690: { gsub(/${RUBY_SITERIDIR:S|/|\\/|g}/, "$${RUBY_SITERIDIR}"); \
691: print; next; }
1.49 taca 692: PRINT_PLIST_AWK+= /^${RUBY_SYSRIDIR:S|/|\\/|g}\// \
693: { next; }
1.117 taca 694:
695: # Insert part of PRINT_PLIST_AWK from gem.mk
696: PRINT_PLIST_AWK+= ${_RUBY_PRINT_PLIST_GEM}
697:
1.49 taca 698: PRINT_PLIST_AWK+= /\/${RUBY_NAME}/ \
699: { sub(/${RUBY_NAME}/, "$${RUBY_NAME}"); }
1.65 taca 700: PRINT_PLIST_AWK+= /^${GEM_HOME:S|/|\\/|g:S|.|\\.|g}/ \
701: { gsub(/${GEM_HOME:S|/|\\/|g}/, "$${GEM_HOME}"); }
1.40 taca 702:
1.166 taca 703: # supporting scripts
704: UPDATE_GEMSPEC= ../../lang/ruby/files/update-gemspec.rb
705:
1.1 taca 706: .endif # _RUBY_MK
CVSweb <webmaster@jp.NetBSD.org>