Annotation of pkgsrc/lang/ruby/rubyversion.mk, revision 1.122
1.122 ! taca 1: # $NetBSD: rubyversion.mk,v 1.121 2014/05/21 03:19:57 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.116 taca 13: # Possible values: 18 193 200 21
14: # Default: 200
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: #
36: # Possible values: ${RUBY_VERSION_SUPPORTED}
37: # Default: ${RUBY_VERSION_DEFAULT}
1.64 taca 38: #
39: # === Package-settable variables ===
40: #
41: # RUBY_VERSION_SUPPORTED
42: # The Ruby versions that are acceptable for the package.
43: #
1.116 taca 44: # Possible values: 18 193 200 21
45: # Default: 200 193 18 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.118 obache 51: # ${RUBY_PKGPREFIX}; "ruby18", "ruby193" , "ruby200" or "ruby21".
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.118 obache 72: # Possible values: 18 193 200 21
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.
80: #
81: # RUBY_ABI_VERSION
82: # Ruby's ABI version.
83: #
84: # RUBY_DLEXT
85: # Suffix of extention library.
86: #
87: # RUBY_SLEXT
88: # Suffix of shared library.
89: #
90: # RUBY
91: # Full path of ruby command.
92: #
93: # RDOC
94: # Full path of rdoc command.
95: #
96: # RUBY_NAME
97: # Name of ruby command.
98: #
99: # RUBYGEM_NAME
100: # Name of gem command.
101: #
102: # RAKE_NAME
103: # Name of rake command.
104: #
105: # RUBY_SUFFIX
106: # Extra string for each ruby commands; ruby, irb and so on.
107: #
108: # RUBY_VERSION
109: # Version of real Ruby's version excluding patchlevel.
110: #
111: # RUBY_VERSION_FULL
112: # Version of Ruby including patchlevel.
1.97 rodent 113: #
1.64 taca 114: # RUBY_BASE
115: # Name of ruby base package's name.
116: #
117: # RUBY_SRCDIR
1.112 taca 118: # Relative path to directory of base ruby package.
1.64 taca 119: #
120: # RUBY_SHLIBVER
121: # Suffix of libruby shared library's version.
122: #
123: # RUBY_SHLIB
124: # String after libruby shared library.
125: #
126: # RUBY_SHLIBALIAS
127: # Symblic link with libruby shared library with major version only.
128: #
129: # RUBY_STATICLIB
130: # Name of libruby static library.
131: #
132: # RUBY_VER_DIR
133: # Name of version directory under each library (and more) directories.
134: #
135: # RUBY_ARCH
136: # Name of architecture-dependent directory name.
137: #
138: # RUBY_INC
139: # machine independent include directory of ruby.
140: #
141: # RUBY_ARCHINC
142: # machine dependent include directory of ruby.
143: #
144: # RUBY_LIB_BASE
145: # common relative path of ruby's library.
146: #
147: # RUBY_LIB
148: # version specific relative path of ruby's library.
149: #
150: # RUBY_ARCHLIB
151: # version specific and machine dependent relative path of ruby's library.
152: #
153: # RUBY_SITELIB_BASE
154: # common site local directory.
155: #
156: # RUBY_SITELIB
157: # version specific site local directory.
158: #
159: # RUBY_SITEARCHLIB
160: # version specific and machine dependent site local directory.
161: #
162: # RUBY_VENDORLIB_BASE
163: # common vendor (pkgsrc) directory.
164: #
165: # RUBY_VENDORLIB
166: # version specific vendor local directory.
167: #
168: # RUBY_VENDORARCHLIB
169: # version specific and machine dependent vendor local directory.
170: #
171: # RUBY_DOC
172: # version specific document direcotry.
173: #
174: # RUBY_EG
175: # version specific examples direcotry.
176: #
177: # RUBY_GEM_BASE
178: # common GEM directory.
1.97 rodent 179: #
1.64 taca 180: # GEM_HOME
181: # version specific GEM directory.
182: #
183: # RUBY_RIDIR
184: # common ri directory.
185: #
186: # RUBY_BASERIDIR
187: # version specific ri directory.
188: #
189: # RUBY_SYSRIDIR
190: # version specific system ri directory.
191: #
192: # RUBY_SITERIDIR
193: # version specific site ri directory.
194: #
195: # Keywords: ruby
1.1 taca 196: #
197:
1.18 rillig 198: .if !defined(_RUBYVERSION_MK)
1.1 taca 199: _RUBYVERSION_MK= # defined
200:
201: .include "../../mk/bsd.prefs.mk"
202:
1.109 taca 203: .if defined(PKGNAME_REQD)
204: . if !empty(PKGNAME_REQD:Mruby[0-9][0-9][0-9]-*) || !empty(PKGNAME_REQD:Mruby[0-9][0-9]-*)
1.112 taca 205: _RUBY_VERSION_REQD:= ${PKGNAME_REQD:C/ruby([0-9][0-9]+)-.*/\1/}
1.119 taca 206: . if ${_RUBY_VERSION_REQD} == "18" || ${_RUBY_VERSION_REQD} == "193"
207: RUBY_VERSION_REQD?= ${PKGNAME_REQD:C/ruby([0-9][0-9])[0-9]-.*/\1/}
208: . else
1.108 taca 209: RUBY_VERSION_REQD?= ${PKGNAME_REQD:C/ruby([0-9][0-9]+)-.*/\1/}
1.112 taca 210: . endif
1.109 taca 211: . endif
1.108 taca 212: .endif
213:
1.1 taca 214: # current supported Ruby's version
1.40 taca 215: RUBY18_VERSION= 1.8.7
1.64 taca 216: RUBY193_VERSION= 1.9.3
1.101 taca 217: RUBY200_VERSION= 2.0.0
1.121 taca 218: RUBY21_VERSION= 2.1.2
1.23 taca 219:
1.32 taca 220: # patch
1.100 taca 221: RUBY18_PATCHLEVEL= pl374
1.113 taca 222: RUBY193_PATCHLEVEL= p545
1.120 taca 223: RUBY200_PATCHLEVEL= p481
1.122 ! taca 224: #RUBY21_PATCHLEVEL= p95
1.49 taca 225:
1.59 taca 226: # current API compatible version; used for version of shared library
1.49 taca 227: RUBY18_API_VERSION= 1.8.7
1.64 taca 228: RUBY193_API_VERSION= 1.9.1
1.101 taca 229: RUBY200_API_VERSION= 2.0.0
1.112 taca 230: RUBY21_API_VERSION= 2.1.0
1.1 taca 231:
232: #
1.116 taca 233: RUBY_VERSION_DEFAULT?= 200
1.64 taca 234:
1.115 taca 235: RUBY_VERSION_SUPPORTED?= 200 193 18 21
1.64 taca 236:
1.98 taca 237: .if defined(RUBY_VERSION_REQD)
238: . for rv in ${RUBY_VERSION_SUPPORTED}
1.109 taca 239: . if "${rv}" == ${RUBY_VERSION_REQD}
1.98 taca 240: RUBY_VER= ${rv}
241: . endif
242: . endfor
243: .elif !defined(RUBY_VER)
244: . for rv in ${RUBY_VERSION_SUPPORTED}
1.109 taca 245: . if "${rv}" == ${RUBY_VERSION_DEFAULT}
1.98 taca 246: RUBY_VER= ${rv}
247: . endif
248: . endfor
1.64 taca 249: .endif
1.1 taca 250:
1.98 taca 251: .if !defined(RUBY_VER)
1.64 taca 252: . for rv in ${RUBY_VERSION_SUPPORTED}
1.98 taca 253: . if !defined(RUBY_VER)
1.64 taca 254: RUBY_VER= ${rv}
1.52 joerg 255: . endif
1.64 taca 256: . endfor
1.1 taca 257: .endif
1.29 taca 258:
1.81 obache 259: RUBY_VER:= ${RUBY_VER_MAP.${RUBY_VER}:U${RUBY_VER}}
1.67 joerg 260:
1.112 taca 261: RUBY_SUFFIX?= ${_RUBY_VER_MAJOR}${_RUBY_VER_MINOR}${_RUBY_VER_TEENY}
262:
1.64 taca 263: .if ${RUBY_VER} == "18"
264: RUBY_VERSION= ${RUBY18_VERSION}
265: RUBY_VERSION_FULL= ${RUBY_VERSION}${RUBY_PATCHLEVEL:S/pl/./}
266: RUBY_ABI_VERSION= ${RUBY18_API_VERSION}
1.110 taca 267:
268: RUBY_RDOC_VERSION= 1.0.1
269:
1.112 taca 270: RUBY_SUFFIX= ${RUBY_VER}
271:
1.64 taca 272: .elif ${RUBY_VER} == "193"
273: RUBY_VERSION= ${RUBY193_VERSION}
274: RUBY_VERSION_FULL= ${RUBY_VERSION}${RUBY_PATCHLEVEL}
275: RUBY_ABI_VERSION= ${RUBY_VERSION}
1.110 taca 276:
277: RUBY_GEMS_VERSION= 1.8.23
278: RUBY_RDOC_VERSION= 3.9.4
279: RUBY_RAKE_VERSION= 0.9.2.2
280: RUBY_JSON_VERSION= 1.5.5
281:
1.101 taca 282: .elif ${RUBY_VER} == "200"
283: RUBY_VERSION= ${RUBY200_VERSION}
284: RUBY_VERSION_FULL= ${RUBY_VERSION}${RUBY_PATCHLEVEL}
285: RUBY_ABI_VERSION= ${RUBY_VERSION}
1.110 taca 286:
287: RUBY_GEMS_VERSION= 2.0.3
288: RUBY_RDOC_VERSION= 4.1.0
289: RUBY_RAKE_VERSION= 0.9.6
290: RUBY_JSON_VERSION= 1.7.7
291:
1.112 taca 292: .elif ${RUBY_VER} == "21"
293: RUBY_VERSION= ${RUBY21_VERSION}
294: RUBY_VERSION_FULL= ${RUBY_VERSION}
1.110 taca 295: RUBY_ABI_VERSION= ${RUBY_VERSION}
296:
1.112 taca 297: RUBY_GEMS_VERSION= 2.2.2
1.110 taca 298: RUBY_RDOC_VERSION= 4.1.0
299: RUBY_RAKE_VERSION= 10.1.0
300: RUBY_JSON_VERSION= 1.8.1
301:
1.64 taca 302: .else
303: PKG_FAIL_REASON+= "Unknown Ruby version specified: ${RUBY_VER}."
1.32 taca 304: .endif
1.1 taca 305:
1.98 taca 306: .if !empty(RUBY_VERSION)
1.64 taca 307: RUBY_PATCHLEVEL= ${RUBY${RUBY_VER}_PATCHLEVEL}
308: RUBY_API_VERSION= ${RUBY${RUBY_VER}_API_VERSION}
1.98 taca 309: .endif
1.64 taca 310:
1.60 wiz 311: # Variable assignment for multi-ruby packages
1.64 taca 312: MULTI+= RUBY_VER=${RUBY_VERS:U${RUBY_VERSION_DEFAULT}}
1.4 taca 313:
1.1 taca 314: # RUBY_NOVERSION should be set to "Yes" if the package dosen't depend on
315: # any specific version of ruby command. In this case, package's
316: # name begin with "ruby-".
317: # If RUBY_NOVERSION is "No" (default), the package's name is begin
1.87 taca 318: # with ${RUBY_NAME}; "ruby18", "ruby193", and so on.
1.1 taca 319: #
1.53 taca 320: # It also affects to RUBY_DOC, RUBY_EG...
1.1 taca 321: #
322: RUBY_NOVERSION?= No
323:
1.29 taca 324: # _RUBY_VER_MAJOR, _RUBY_VER_MINOR, _RUBY_VER_TEENY and _RUBY_PATCHLEVEL
325: # is defined from version of Ruby. It should not be used in packages'
326: # Makefile.
327: #
1.64 taca 328: _RUBY_VER_MAJOR= ${RUBY_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\1/}
329: _RUBY_VER_MINOR= ${RUBY_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\2/}
330: _RUBY_VER_TEENY= ${RUBY_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\3/}
1.1 taca 331:
1.64 taca 332: _RUBY_API_MAJOR= ${RUBY_API_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\1\2/}
333: _RUBY_API_MINOR= ${RUBY_API_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\3/}
1.1 taca 334:
1.64 taca 335: RUBY_NAME= ruby${RUBY_SUFFIX}
336: RUBYGEM_NAME= gem${RUBY_SUFFIX}
337: RAKE_NAME= rake${RUBY_SUFFIX}
1.1 taca 338:
1.49 taca 339: RUBY_ENCODING_ARG?=
340:
1.112 taca 341: RUBY_BASE= ${RUBY_NAME}-base
1.10 taca 342:
1.1 taca 343: RUBY_PKGPREFIX?= ${RUBY_NAME}
344:
1.87 taca 345: .if ${RUBY_VER} == "18"
1.64 taca 346: RUBY_VER_DIR= ${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}
347: .else
348: RUBY_VER_DIR= ${RUBY_VERSION}
1.1 taca 349: .endif
350:
351: .if empty(RUBY_NOVERSION:M[nN][oO])
352: RUBY_SUFFIX=
353: RUBY_NAME= ruby
354: .endif
355:
1.64 taca 356: RUBY_BUILD_RDOC?= Yes
357: RUBY_BUILD_RI?= Yes
1.49 taca 358:
1.15 taca 359: RUBY?= ${PREFIX}/bin/${RUBY_NAME}
1.112 taca 360: RDOC?= ${PREFIX}/bin/rdoc${RUBY_SUFFIX}
1.1 taca 361:
1.104 taca 362: RUBY_ARCH?= ${MACHINE_GNU_ARCH}-${LOWER_OPSYS}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX}
1.1 taca 363:
364: #
1.53 taca 365: # Ruby shared and static library version handling.
1.10 taca 366: #
1.49 taca 367: RUBY_SHLIBVER?= ${RUBY_API_VERSION}
1.112 taca 368: RUBY_SHLIB?= ${RUBY_SUFFIX}.${RUBY_SLEXT}.${RUBY_SHLIBVER}
1.53 taca 369: RUBY_SHLIBALIAS?= @comment
1.112 taca 370: RUBY_STATICLIB?= ${RUBY_SUFFIX}-static.a
1.10 taca 371:
372: .if ${OPSYS} == "NetBSD" || ${OPSYS} == "Interix"
1.64 taca 373: RUBY_SHLIBVER= ${_RUBY_API_MAJOR}.${_RUBY_API_MINOR}
1.112 taca 374: _RUBY_SHLIBALIAS= ${RUBY_SUFFIX}.${RUBY_SLEXT}.${_RUBY_API_MAJOR}
1.12 jlam 375: .elif ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly"
1.87 taca 376: .if ${RUBY_VER} == "18"
1.112 taca 377: RUBY_SHLIBVER= ${RUBY_SUFFIX}
1.75 marino 378: .else
379: RUBY_SHLIBVER= ${_RUBY_VER_MAJOR}${_RUBY_VER_MINOR}${_RUBY_API_MINOR}
380: .endif
1.83 bsiegert 381: .elif ${OPSYS} == "OpenBSD" || ${OPSYS} == "MirBSD"
1.102 taca 382: .if ${_RUBY_VER_MINOR} == 0
383: RUBY_SHLIBVER= ${_RUBY_VER_MAJOR}.${_RUBY_API_MINOR}
384: .else
1.64 taca 385: RUBY_SHLIBVER= ${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}${_RUBY_API_MINOR}
1.102 taca 386: .endif
1.53 taca 387: .elif ${OPSYS} == "Darwin"
1.112 taca 388: RUBY_SHLIB= ${RUBY_SUFFIX}.${RUBY_SHLIBVER}.${RUBY_SLEXT}
1.53 taca 389: .if ${RUBY_VER} == "18"
1.112 taca 390: _RUBY_SHLIBALIAS= ${RUBY_SUFFIX}.${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}.${RUBY_SLEXT}
1.53 taca 391: .else
392: _RUBY_SHLIBALIAS= .${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}.${RUBY_SLEXT}
1.112 taca 393: RUBY_STATICLIB= ${RUBY_SUFFIX}.${RUBY_API_VERSION}-static.a
1.53 taca 394: .endif
1.10 taca 395: .elif ${OPSYS} == "Linux"
1.112 taca 396: _RUBY_SHLIBALIAS= ${RUBY_SUFFIX}.${RUBY_SLEXT}.${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}
1.56 taca 397: .elif ${OPSYS} == "SunOS"
398: RUBY_SHLIBVER= ${_RUBY_VER_MAJOR}
1.112 taca 399: _RUBY_SHLIBALIAS= ${RUBY_SUFFIX}.${RUBY_SLEXT}.${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}.${_RUBY_API_MINOR}
1.96 obache 400: .elif ${OPSYS} == "Cygwin"
1.112 taca 401: RUBY_SHLIB= ${RUBY_SUFFIX}${_RUBY_API_MAJOR}${_RUBY_API_MINOR}.dll.a
402: RUBY_SHLIBALIAS= bin/cygruby${RUBY_SUFFIX}${_RUBY_API_MAJOR}${_RUBY_API_MINOR}.dll
403: RUBY_STATICLIB= ${RUBY_SUFFIX}${_RUBY_API_MAJOR}${_RUBY_API_MINOR}-static.a
1.10 taca 404: .endif
405:
1.53 taca 406: .if !empty(_RUBY_SHLIBALIAS)
407: RUBY_SHLIBALIAS= lib/libruby${_RUBY_SHLIBALIAS}
1.10 taca 408: .endif
409:
1.64 taca 410: .if ${_OPSYS_SHLIB_TYPE} == "dylib"
1.5 taca 411: RUBY_DLEXT= bundle
1.53 taca 412: RUBY_SLEXT= dylib
1.5 taca 413: .else
414: RUBY_DLEXT= so
1.53 taca 415: RUBY_SLEXT= so
1.5 taca 416: .endif
417:
418: #
1.71 taca 419: # Ruby distribution file, few package need it.
420: #
421: _RUBY_PATCHLEVEL= ${RUBY_PATCHLEVEL:S/pl/p/:S/pre/preview/}
422:
423: .if !empty(_RUBY_PATCHLEVEL)
424: RUBY_DISTNAME?= ruby-${RUBY_VERSION}-${_RUBY_PATCHLEVEL}
425: .else
426: RUBY_DISTNAME?= ruby-${RUBY_VERSION}
427: .endif
428:
429: #
1.26 taca 430: # Use pthread library with Ruby
431: #
1.64 taca 432: .if !empty(MACHINE_PLATFORM:MDarwin-9.*-powerpc)
1.42 minskim 433: # Workaround for Ruby Bug #193
434: # http://redmine.ruby-lang.org/issues/show/193
435: RUBY_USE_PTHREAD?= no
1.26 taca 436: .else
437: RUBY_USE_PTHREAD?= yes
438: .endif
439:
1.23 taca 440: RUBY_DYNAMIC_DIRS?= # empty
441:
1.112 taca 442: RUBY_SRCDIR?= ../../lang/ruby${RUBY_VER}-base
1.10 taca 443:
444: #
1.23 taca 445: # common paths
1.1 taca 446: #
1.49 taca 447: RUBY_INC= include/ruby-${RUBY_VER_DIR}
448: RUBY_ARCHINC= ${RUBY_INC}/${RUBY_ARCH}
449: RUBY_LIB_BASE= lib/ruby
450: RUBY_LIB?= ${RUBY_LIB_BASE}/${RUBY_VER_DIR}
1.40 taca 451: RUBY_ARCHLIB?= ${RUBY_LIB}/${RUBY_ARCH}
1.49 taca 452: RUBY_SITELIB_BASE?= ${RUBY_LIB_BASE}/site_ruby
1.40 taca 453: RUBY_SITELIB?= ${RUBY_SITELIB_BASE}/${RUBY_VER_DIR}
454: RUBY_SITEARCHLIB?= ${RUBY_SITELIB}/${RUBY_ARCH}
1.49 taca 455: RUBY_VENDORLIB_BASE?= ${RUBY_LIB_BASE}/vendor_ruby
1.40 taca 456: RUBY_VENDORLIB?= ${RUBY_VENDORLIB_BASE}/${RUBY_VER_DIR}
457: RUBY_VENDORARCHLIB?= ${RUBY_VENDORLIB}/${RUBY_ARCH}
1.49 taca 458:
1.40 taca 459: RUBY_DOC?= share/doc/${RUBY_NAME}
460: RUBY_EG?= share/examples/${RUBY_NAME}
461:
1.64 taca 462:
1.49 taca 463: RUBY_GEM_BASE?= ${RUBY_LIB_BASE}/gems
464: GEM_HOME?= ${RUBY_GEM_BASE}/${RUBY_VER_DIR}
1.31 taca 465:
466: #
467: # ri database relative path
468: #
469: RUBY_RIDIR?= share/ri
1.15 taca 470: RUBY_BASERIDIR?= ${RUBY_RIDIR}/${RUBY_VER_DIR}
471: RUBY_SYSRIDIR?= ${RUBY_BASERIDIR}/system
472: RUBY_SITERIDIR?= ${RUBY_BASERIDIR}/site
1.1 taca 473:
474: #
475: # MAKE_ENV
476: #
1.18 rillig 477: MAKE_ENV+= RUBY=${RUBY:Q} RUBY_VER=${RUBY_VER:Q} \
478: RUBY_VERSION_DEFAULT=${RUBY_VERSION_DEFAULT:Q}
1.15 taca 479:
1.122 ! taca 480: MAKEFLAGS+= RUBY_VER=${RUBY_VER:Q} \
! 481: RUBY_VERSION_DEFAULT=${RUBY_VERSION_DEFAULT:Q}
1.15 taca 482:
1.49 taca 483: #
1.98 taca 484: # PLIST_VARS for x11/ruby-tk package.
1.1 taca 485: #
1.101 taca 486: PLIST_VARS+= ruby19 ruby200
1.98 taca 487: .if ${RUBY_VER} != "18"
1.64 taca 488: PLIST.ruby19= yes
1.101 taca 489: . if ${RUBY_VER} != "193"
490: PLIST.ruby200= yes
491: . endif
1.49 taca 492: .endif
493:
494: PLIST_RUBY_DIRS= RUBY_INC=${RUBY_INC:Q} RUBY_ARCHINC=${RUBY_ARCHINC:Q} \
495: RUBY_LIB_BASE=${RUBY_LIB_BASE:Q} \
496: RUBY_LIB=${RUBY_LIB:Q} \
497: RUBY_ARCHLIB=${RUBY_ARCHLIB:Q} \
1.40 taca 498: RUBY_SITELIB_BASE=${RUBY_SITELIB_BASE:Q} \
1.49 taca 499: RUBY_SITELIB=${RUBY_SITELIB:Q} \
500: RUBY_SITEARCHLIB=${RUBY_SITEARCHLIB:Q} \
1.40 taca 501: RUBY_VENDORLIB_BASE=${RUBY_VENDORLIB_BASE:Q} \
502: RUBY_VENDORLIB=${RUBY_VENDORLIB:Q} \
503: RUBY_VENDORARCHLIB=${RUBY_VENDORARCHLIB:Q} \
1.49 taca 504: RUBY_DOC=${RUBY_DOC:Q} \
505: RUBY_EG=${RUBY_EG:Q} \
506: RUBY_GEM_BASE=${RUBY_GEM_BASE:Q} \
507: GEM_HOME=${GEM_HOME:Q} \
508: RUBY_RIDIR=${RUBY_RIDIR:Q} \
509: RUBY_BASERIDIR=${RUBY_BASERIDIR:Q} \
510: RUBY_SYSRIDIR=${RUBY_SYSRIDIR:Q} \
511: RUBY_SITERIDIR=${RUBY_SITERIDIR:Q}
1.1 taca 512:
1.14 taca 513: #
514: # substitutions
515: #
1.18 rillig 516: FILES_SUBST+= RUBY=${RUBY:Q} RUBY_NAME=${RUBY_NAME:Q} \
517: RUBY_PKGPREFIX=${RUBY_PKGPREFIX:Q} \
1.111 taca 518: RUBY_SUFFIX=${RUBY_SUFFIX} \
1.18 rillig 519: RUBY_VER=${RUBY_VER:Q} \
1.15 taca 520: ${PLIST_RUBY_DIRS}
1.14 taca 521:
1.15 taca 522: MESSAGE_SUBST+= RUBY="${RUBY}" RUBY_VER="${RUBY_VER}" \
1.14 taca 523: RUBY_VERSION="${RUBY_VERSION}" \
1.15 taca 524: RUBY_PKGPREFIX="${RUBY_PKGPREFIX}" \
1.111 taca 525: RUBY_SUFFIX=${RUBY_SUFFIX} \
1.15 taca 526: ${PLIST_RUBY_DIRS:S,DIR="${PREFIX}/,DIR=",}
1.14 taca 527:
1.18 rillig 528: PLIST_SUBST+= RUBY=${RUBY:Q} RUBY_VER=${RUBY_VER:Q} \
1.49 taca 529: RUBY_PKGPREFIX=${RUBY_PKGPREFIX} \
1.111 taca 530: RUBY_SUFFIX=${RUBY_SUFFIX} \
1.18 rillig 531: RUBY_VERSION=${RUBY_VERSION:Q} \
532: RUBY_VER_DIR=${RUBY_VER_DIR:Q} \
1.53 taca 533: RUBY_DLEXT=${RUBY_DLEXT:Q} RUBY_SLEXT=${RUBY_SLEXT:Q} \
534: RUBY_SHLIB=${RUBY_SHLIB:Q} \
535: RUBY_SHLIBALIAS=${RUBY_SHLIBALIAS:Q} \
536: RUBY_STATICLIB=${RUBY_STATICLIB:Q} \
1.39 jlam 537: RUBY_ARCH=${RUBY_ARCH:Q} \
1.58 taca 538: ${PLIST_RUBY_DIRS:S,DIR="${PREFIX}/,DIR=",}
1.1 taca 539:
1.22 taca 540: #
1.23 taca 541: # make dynamic PLIST
1.22 taca 542: #
1.23 taca 543: .if !empty(RUBY_DYNAMIC_DIRS)
544:
545: RUBY_PLIST_DYNAMIC= ${WRKDIR}/PLIST.work
546:
547: .if !defined(PLIST_SRC)
548: . if exists(${PKGDIR}/PLIST.common)
549: PLIST_SRC+= ${PKGDIR}/PLIST.common
550: . elif exists(${PKGDIR}/PLIST)
551: PLIST_SRC+= ${PKGDIR}/PLIST
552: . endif
553:
554: PLIST_SRC+= ${RUBY_PLIST_DYNAMIC}
555:
556: . if exists(${PKGDIR}/PLIST.common_end)
557: PLIST_SRC+= ${PKGDIR}/PLIST.common_end
558: . endif
559:
560: .endif
561:
562: RUBY_PLIST_COMMENT_CMD= \
563: ${ECHO} "@comment The following lines are automatically generated"
1.37 obache 564: RUBY_PLIST_FILES_CMD= ( cd ${DESTDIR}${PREFIX}; \
1.23 taca 565: ${FIND} ${RUBY_DYNAMIC_DIRS} \( -type f -o -type l \) -print ) | \
566: ${SORT} -u
567: RUBY_GENERATE_PLIST = ( \
568: ${RUBY_PLIST_COMMENT_CMD}; \
1.47 joerg 569: ${RUBY_PLIST_FILES_CMD} ) > ${RUBY_PLIST_DYNAMIC}
1.22 taca 570: .endif
1.23 taca 571:
1.53 taca 572: PRINT_PLIST_AWK+= /lib\/libruby${RUBY_STATICLIB}$$/ \
573: { sub(/${RUBY_STATICLIB}/, "$${RUBY_STATICLIB}"); }
574: PRINT_PLIST_AWK+= /lib\/libruby${RUBY_VER}\.${RUBY_SLEXT}/ \
575: { sub(/${RUBY_VER}\.${RUBY_SLEXT}$$/, \
576: "$${RUBY_VER}.$${RUBY_SLEXT}"); }
577: PRINT_PLIST_AWK+= /${RUBY_SHLIB}$$/ \
578: { sub(/${RUBY_SHLIB}$$/, "$${RUBY_SHLIB}"); }
579: PRINT_PLIST_AWK+= /${RUBY_SLEXT}\.${RUBY_SHLIBVER}$$/ \
580: { sub(/${RUBY_SLEXT}\.${RUBY_SHLIBVER}$$/, \
581: "$${RUBY_SLEXT}.$${RUBY_SHLIBVER}"); }
582: .if ${RUBY_SHLIBALIAS} != "@comment"
583: PRINT_PLIST_AWK+= /${RUBY_SHLIBALIAS:S/\//\\\//}$$/ \
584: { sub(/${RUBY_SHLIBALIAS:S/\//\\\//}$$/, \
585: "$${RUBY_SHLIBALIAS}"); }
1.49 taca 586: .endif
587: PRINT_PLIST_AWK+= /^${RUBY_ARCHINC:S|/|\\/|g}/ \
588: { gsub(/${RUBY_ARCHINC:S|/|\\/|g}/, "$${RUBY_ARCHINC}"); \
589: print; next; }
590: PRINT_PLIST_AWK+= /^${RUBY_INC:S|/|\\/|g}/ \
591: { gsub(/${RUBY_INC:S|/|\\/|g}/, "$${RUBY_INC}"); \
592: print; next; }
1.40 taca 593: PRINT_PLIST_AWK+= /\.${RUBY_DLEXT}$$/ \
594: { gsub(/${RUBY_DLEXT}$$/, "$${RUBY_DLEXT}") }
1.47 joerg 595: PRINT_PLIST_AWK+= /^${RUBY_ARCHLIB:S|/|\\/|g}/ \
1.40 taca 596: { gsub(/${RUBY_ARCHLIB:S|/|\\/|g}/, "$${RUBY_ARCHLIB}"); \
597: print; next; }
1.47 joerg 598: PRINT_PLIST_AWK+= /^${RUBY_VENDORARCHLIB:S|/|\\/|g}/ \
1.40 taca 599: { gsub(/${RUBY_VENDORARCHLIB:S|/|\\/|g}/, "$${RUBY_VENDORARCHLIB}"); \
600: print; next; }
1.47 joerg 601: PRINT_PLIST_AWK+= /^${RUBY_VENDORLIB:S|/|\\/|g}/ \
1.40 taca 602: { gsub(/${RUBY_VENDORLIB:S|/|\\/|g}/, "$${RUBY_VENDORLIB}"); \
603: print; next; }
1.47 joerg 604: PRINT_PLIST_AWK+= /^${RUBY_SITEARCHLIB:S|/|\\/|g}/ \
1.40 taca 605: { gsub(/${RUBY_SITEARCHLIB:S|/|\\/|g}/, "$${RUBY_SITEARCHLIB}"); \
606: print; next; }
1.47 joerg 607: PRINT_PLIST_AWK+= /^${RUBY_SITELIB:S|/|\\/|g}/ \
1.40 taca 608: { gsub(/${RUBY_SITELIB:S|/|\\/|g}/, "$${RUBY_SITELIB}"); \
609: print; next; }
1.49 taca 610: PRINT_PLIST_AWK+= /^${RUBY_SITELIB_BASE:S|/|\\/|g}/ \
1.40 taca 611: { gsub(/${RUBY_SITELIB_BASE:S|/|\\/|g}/, "$${RUBY_SITELIB_BASE}"); \
612: print; next; }
1.49 taca 613: PRINT_PLIST_AWK+= /^${RUBY_VENDORLIB_BASE:S|/|\\/|g}/ \
1.40 taca 614: { gsub(/${RUBY_VENDORLIB_BASE:S|/|\\/|g}/, "$${RUBY_VENDORLIB_BASE}"); \
615: print; next; }
1.47 joerg 616: PRINT_PLIST_AWK+= /^${RUBY_LIB:S|/|\\/|g}/ \
1.40 taca 617: { gsub(/${RUBY_LIB:S|/|\\/|g}/, "$${RUBY_LIB}"); \
618: print; next; }
1.47 joerg 619: PRINT_PLIST_AWK+= /^${RUBY_DOC:S|/|\\/|g}/ \
1.40 taca 620: { gsub(/${RUBY_DOC:S|/|\\/|g}/, "$${RUBY_DOC}"); \
621: print; next; }
1.47 joerg 622: PRINT_PLIST_AWK+= /^${RUBY_EG:S|/|\\/|g}/ \
1.40 taca 623: { gsub(/${RUBY_EG:S|/|\\/|g}/, "$${RUBY_EG}"); \
624: print; next; }
1.47 joerg 625: PRINT_PLIST_AWK+= /^${RUBY_SITERIDIR:S|/|\\/|g}/ \
1.40 taca 626: { gsub(/${RUBY_SITERIDIR:S|/|\\/|g}/, "$${RUBY_SITERIDIR}"); \
627: print; next; }
1.49 taca 628: PRINT_PLIST_AWK+= /^${RUBY_SYSRIDIR:S|/|\\/|g}\// \
629: { next; }
1.117 taca 630:
631: # Insert part of PRINT_PLIST_AWK from gem.mk
632: PRINT_PLIST_AWK+= ${_RUBY_PRINT_PLIST_GEM}
633:
1.49 taca 634: PRINT_PLIST_AWK+= /\/${RUBY_NAME}/ \
635: { sub(/${RUBY_NAME}/, "$${RUBY_NAME}"); }
1.65 taca 636: PRINT_PLIST_AWK+= /^${GEM_HOME:S|/|\\/|g:S|.|\\.|g}/ \
637: { gsub(/${GEM_HOME:S|/|\\/|g}/, "$${GEM_HOME}"); }
1.40 taca 638:
1.1 taca 639: .endif # _RUBY_MK
CVSweb <webmaster@jp.NetBSD.org>