Annotation of pkgsrc/lang/ruby/rubyversion.mk, revision 1.137

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

CVSweb <webmaster@jp.NetBSD.org>