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

1.185   ! taca        1: # $NetBSD: rubyversion.mk,v 1.184 2017/09/15 00:39:46 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.180     taca       13: #              Possible values: 22 23 24
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.180     taca       44: #              Possible values: 22 23 24
                     45: #              Default: 23 22 24
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.180     taca       72: #              Possible values: 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.180     taca       81: #              Example values: ruby22 ruby23 ruby24
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.180     taca      110: #              Possible values: 22 23 24
1.64      taca      111: #
                    112: # RUBY_VERSION
1.177     taca      113: #      Version of Ruby's version.
1.97      rodent    114: #
1.64      taca      115: # RUBY_BASE
                    116: #      Name of ruby base package's name.
                    117: #
                    118: # RUBY_SRCDIR
1.112     taca      119: #      Relative path to directory of base ruby package.
1.64      taca      120: #
                    121: # RUBY_SHLIBVER
                    122: #      Suffix of libruby shared library's version.
                    123: #
                    124: # RUBY_SHLIB
                    125: #      String after libruby shared library.
                    126: #
                    127: # RUBY_SHLIBALIAS
                    128: #      Symblic link with libruby shared library with major version only.
                    129: #
                    130: # RUBY_STATICLIB
                    131: #      Name of libruby static library.
                    132: #
                    133: # RUBY_VER_DIR
                    134: #      Name of version directory under each library (and more) directories.
                    135: #
                    136: # RUBY_ARCH
                    137: #      Name of architecture-dependent directory name.
                    138: #
                    139: # RUBY_INC
                    140: #      machine independent include directory of ruby.
                    141: #
                    142: # RUBY_ARCHINC
                    143: #      machine dependent include directory of ruby.
                    144: #
                    145: # RUBY_LIB_BASE
                    146: #      common relative path of ruby's library.
                    147: #
                    148: # RUBY_LIB
                    149: #      version specific relative path of ruby's library.
                    150: #
                    151: # RUBY_ARCHLIB
                    152: #      version specific and machine dependent relative path of ruby's library.
                    153: #
                    154: # RUBY_SITELIB_BASE
                    155: #      common site local directory.
                    156: #
                    157: # RUBY_SITELIB
                    158: #      version specific site local directory.
                    159: #
                    160: # RUBY_SITEARCHLIB
                    161: #      version specific and machine dependent site local directory.
                    162: #
                    163: # RUBY_VENDORLIB_BASE
                    164: #      common vendor (pkgsrc) directory.
                    165: #
                    166: # RUBY_VENDORLIB
                    167: #      version specific vendor local directory.
                    168: #
                    169: # RUBY_VENDORARCHLIB
                    170: #      version specific and machine dependent vendor local directory.
                    171: #
                    172: # RUBY_DOC
                    173: #      version specific document direcotry.
                    174: #
                    175: # RUBY_EG
                    176: #      version specific examples direcotry.
                    177: #
                    178: # RUBY_GEM_BASE
                    179: #      common GEM directory.
1.97      rodent    180: #
1.64      taca      181: # GEM_HOME
                    182: #      version specific GEM directory.
                    183: #
                    184: # RUBY_RIDIR
                    185: #      common ri directory.
                    186: #
                    187: # RUBY_BASERIDIR
                    188: #      version specific ri directory.
                    189: #
                    190: # RUBY_SYSRIDIR
                    191: #      version specific system ri directory.
                    192: #
                    193: # RUBY_SITERIDIR
                    194: #      version specific site ri directory.
                    195: #
1.166     taca      196: # === supporting scripts ===
                    197: #
                    198: # UPDATE_GEMSPEC
                    199: #      a tool to modify gemspec file.
                    200: #
1.64      taca      201: # Keywords: ruby
1.1       taca      202: #
                    203: 
1.18      rillig    204: .if !defined(_RUBYVERSION_MK)
1.1       taca      205: _RUBYVERSION_MK=       # defined
                    206: 
                    207: .include "../../mk/bsd.prefs.mk"
                    208: 
1.109     taca      209: .if defined(PKGNAME_REQD)
1.174     taca      210: . if !empty(PKGNAME_REQD:Mruby[0-9][0-9]-*)
                    211: _RUBY_VERSION_REQD:= ${PKGNAME_REQD:C/ruby([0-9][0-9])-.*/\1/}
                    212: RUBY_VERSION_REQD?= ${PKGNAME_REQD:C/ruby([0-9][0-9])-.*/\1/}
1.109     taca      213: . endif
1.108     taca      214: .endif
                    215: 
1.1       taca      216: # current supported Ruby's version
1.182     taca      217: RUBY22_VERSION=                2.2.8
1.185   ! taca      218: RUBY23_VERSION=                2.3.6
1.184     taca      219: RUBY24_VERSION=                2.4.2
1.23      taca      220: 
1.59      taca      221: # current API compatible version; used for version of shared library
1.131     taca      222: RUBY22_API_VERSION=    2.2.0
1.155     taca      223: RUBY23_API_VERSION=    2.3.0
1.179     taca      224: RUBY24_API_VERSION=    2.4.0
1.131     taca      225: 
1.1       taca      226: #
1.169     taca      227: RUBY_VERSION_DEFAULT?= 23
1.64      taca      228: 
1.173     taca      229: # supported Ruby's version
1.180     taca      230: RUBY_VERSIONS_SUPPORTED= 23 22 24
1.173     taca      231: 
1.180     taca      232: RUBY_VERSIONS_ACCEPTED?= 23 22 24
1.165     joerg     233: RUBY_VERSIONS_INCOMPATIBLE?=
                    234: 
1.173     taca      235: .if empty(RUBY_VERSIONS_SUPPORTED:M${RUBY_VERSION_DEFAULT})
                    236: .error Unsuported RUBY_VERSION_DEFAULT: ${RUBY_VERSION_DEFAULT}
                    237: .endif
                    238: 
1.165     joerg     239: .for rv in ${RUBY_VERSIONS_ACCEPTED}
                    240: .  if empty(RUBY_VERSIONS_INCOMPATIBLE:M${rv})
                    241: _RUBY_VERSIONS_ACCEPTED+=      ${rv}
                    242: .  endif
                    243: .endfor
1.64      taca      244: 
1.98      taca      245: .if defined(RUBY_VERSION_REQD)
1.165     joerg     246: . for rv in ${_RUBY_VERSIONS_ACCEPTED}
1.109     taca      247: .  if "${rv}" == ${RUBY_VERSION_REQD}
1.98      taca      248: RUBY_VER=      ${rv}
                    249: .  endif
                    250: . endfor
                    251: .elif !defined(RUBY_VER)
1.165     joerg     252: . for rv in ${_RUBY_VERSIONS_ACCEPTED}
1.109     taca      253: .  if "${rv}" == ${RUBY_VERSION_DEFAULT}
1.98      taca      254: RUBY_VER=      ${rv}
                    255: .  endif
                    256: . endfor
1.64      taca      257: .endif
1.1       taca      258: 
1.98      taca      259: .if !defined(RUBY_VER)
1.165     joerg     260: . for rv in ${_RUBY_VERSIONS_ACCEPTED}
1.98      taca      261: .  if !defined(RUBY_VER)
1.64      taca      262: RUBY_VER=      ${rv}
1.52      joerg     263: .  endif
1.64      taca      264: . endfor
1.1       taca      265: .endif
1.29      taca      266: 
1.81      obache    267: RUBY_VER:=     ${RUBY_VER_MAP.${RUBY_VER}:U${RUBY_VER}}
1.67      joerg     268: 
1.112     taca      269: RUBY_SUFFIX?=  ${_RUBY_VER_MAJOR}${_RUBY_VER_MINOR}${_RUBY_VER_TEENY}
                    270: 
1.180     taca      271: .if ${RUBY_VER} == "22"
1.131     taca      272: RUBY_VERSION=          ${RUBY22_VERSION}
                    273: RUBY_ABI_VERSION=      ${RUBY_VERSION}
                    274: 
1.167     taca      275: RUBY_GEMS_VERSION=     2.4.5.2
1.131     taca      276: RUBY_RDOC_VERSION=     4.2.0
                    277: RUBY_RAKE_VERSION=     10.4.2
1.182     taca      278: RUBY_JSON_VERSION=     1.8.1.1
1.131     taca      279: 
1.156     taca      280: RUBY_BIGDECIMAL_VERSION=       1.2.6
                    281: RUBY_IO_CONSOLE_VERSION=       0.4.3
1.182     taca      282: RUBY_PSYCH_VERSION=            2.0.8.1
1.156     taca      283: RUBY_MINITEST_VERSION=         5.4.3
                    284: RUBY_POWER_ASSERT_VERSION=     0.2.2
                    285: RUBY_TEST_UNIT_VERSION=                3.0.8
                    286: 
1.134     taca      287: RUBY_SUFFIX=   ${_RUBY_VER_MAJOR}${_RUBY_VER_MINOR}
                    288: 
1.155     taca      289: .elif ${RUBY_VER} == "23"
                    290: RUBY_VERSION=          ${RUBY23_VERSION}
                    291: RUBY_ABI_VERSION=      ${RUBY_VERSION}
                    292: 
1.185   ! taca      293: RUBY_GEMS_VERSION=     2.5.2.2
1.155     taca      294: RUBY_RDOC_VERSION=     4.2.1
                    295: RUBY_RAKE_VERSION=     10.4.2
1.183     taca      296: RUBY_JSON_VERSION=     1.8.3.1
1.155     taca      297: 
1.156     taca      298: RUBY_BIGDECIMAL_VERSION=       1.2.8
                    299: RUBY_IO_CONSOLE_VERSION=       0.4.5
1.183     taca      300: RUBY_PSYCH_VERSION=            2.1.0.1
1.156     taca      301: RUBY_DID_YOU_MEAN_VERSION=     1.0.0
1.168     taca      302: RUBY_MINITEST_VERSION=         5.8.5
1.156     taca      303: RUBY_NET_TELNET_VERSION=       0.1.1
                    304: RUBY_POWER_ASSERT_VERSION=     0.2.6
                    305: RUBY_TEST_UNIT_VERSION=                3.1.5
                    306: 
1.155     taca      307: RUBY_SUFFIX=   ${_RUBY_VER_MAJOR}${_RUBY_VER_MINOR}
                    308: 
1.179     taca      309: .elif ${RUBY_VER} == "24"
                    310: RUBY_VERSION=          ${RUBY24_VERSION}
                    311: RUBY_ABI_VERSION=      ${RUBY_VERSION}
                    312: 
                    313: RUBY_GEMS_VERSION=     2.6.11
                    314: RUBY_RDOC_VERSION=     5.0.0
                    315: RUBY_RAKE_VERSION=     12.0.0
1.184     taca      316: RUBY_JSON_VERSION=     2.0.4
1.179     taca      317: 
                    318: RUBY_BIGDECIMAL_VERSION=       1.3.0
                    319: RUBY_IO_CONSOLE_VERSION=       0.4.6
1.184     taca      320: RUBY_OPENSSL_VERSION=          2.0.5
1.179     taca      321: RUBY_PSYCH_VERSION=            2.2.2
                    322: RUBY_DID_YOU_MEAN_VERSION=     1.1.0
                    323: RUBY_MINITEST_VERSION=         5.10.1
                    324: RUBY_NET_TELNET_VERSION=       0.1.1
                    325: RUBY_POWER_ASSERT_VERSION=     0.4.1
                    326: RUBY_TEST_UNIT_VERSION=                3.2.3
                    327: RUBY_XML_RPC_VERSION=          0.2.1
                    328: 
                    329: RUBY_SUFFIX=   ${_RUBY_VER_MAJOR}${_RUBY_VER_MINOR}
                    330: 
1.64      taca      331: .else
                    332: PKG_FAIL_REASON+= "Unknown Ruby version specified: ${RUBY_VER}."
1.32      taca      333: .endif
1.1       taca      334: 
1.98      taca      335: .if !empty(RUBY_VERSION)
1.64      taca      336: RUBY_PATCHLEVEL=       ${RUBY${RUBY_VER}_PATCHLEVEL}
                    337: RUBY_API_VERSION=      ${RUBY${RUBY_VER}_API_VERSION}
1.98      taca      338: .endif
1.64      taca      339: 
1.60      wiz       340: # Variable assignment for multi-ruby packages
1.64      taca      341: MULTI+=        RUBY_VER=${RUBY_VERS:U${RUBY_VERSION_DEFAULT}}
1.4       taca      342: 
1.1       taca      343: # RUBY_NOVERSION should be set to "Yes" if the package dosen't depend on
                    344: #      any specific version of ruby command.  In this case, package's
                    345: #      name begin with "ruby-".
                    346: #      If RUBY_NOVERSION is "No" (default), the package's name is begin
1.174     taca      347: #      with ${RUBY_NAME}; "ruby22", "ruby23",  and so on.
1.1       taca      348: #
1.53      taca      349: #      It also affects to RUBY_DOC, RUBY_EG...
1.1       taca      350: #
                    351: RUBY_NOVERSION?=       No
                    352: 
1.174     taca      353: # _RUBY_VER_MAJOR, _RUBY_VER_MINOR
1.29      taca      354: # is defined from version of Ruby.  It should not be used in packages'
                    355: # Makefile.
                    356: #
1.64      taca      357: _RUBY_VER_MAJOR=       ${RUBY_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\1/}
                    358: _RUBY_VER_MINOR=       ${RUBY_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\2/}
1.1       taca      359: 
1.64      taca      360: RUBY_NAME=             ruby${RUBY_SUFFIX}
                    361: RUBYGEM_NAME=          gem${RUBY_SUFFIX}
                    362: RAKE_NAME=             rake${RUBY_SUFFIX}
1.1       taca      363: 
1.112     taca      364: RUBY_BASE=             ${RUBY_NAME}-base
1.10      taca      365: 
1.1       taca      366: RUBY_PKGPREFIX?=       ${RUBY_NAME}
                    367: 
1.134     taca      368: RUBY_VER_DIR=          ${RUBY_API_VERSION}
1.1       taca      369: 
                    370: .if empty(RUBY_NOVERSION:M[nN][oO])
                    371: RUBY_SUFFIX=
                    372: RUBY_NAME=             ruby
                    373: .endif
                    374: 
1.64      taca      375: RUBY_BUILD_RDOC?=      Yes
                    376: RUBY_BUILD_RI?=                Yes
1.49      taca      377: 
1.15      taca      378: RUBY?=                 ${PREFIX}/bin/${RUBY_NAME}
1.176     taca      379: RAKE?=                 ${PREFIX}/bin/${RAKE_NAME}
1.112     taca      380: RDOC?=                 ${PREFIX}/bin/rdoc${RUBY_SUFFIX}
1.1       taca      381: 
1.132     riastrad  382: RUBY_ARCH?= ${MACHINE_GNU_ARCH}-${LOWER_OPSYS}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX}${APPEND_ABI}
1.1       taca      383: 
1.138     taca      384: RUBY_MAJOR_MINOR=      ${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}
                    385: 
1.1       taca      386: #
1.53      taca      387: # Ruby shared and static library version handling.
1.10      taca      388: #
1.179     taca      389: .if ${RUBY_VER} != "24"
1.49      taca      390: RUBY_SHLIBVER?=                ${RUBY_API_VERSION}
1.179     taca      391: .else
                    392: RUBY_SHLIBVER?=                ${RUBY_VERSION}
                    393: .endif
                    394: 
                    395: _RUBY_SHLIB_MAJOR:=    ${RUBY_SHLIBVER:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\1\2/}
                    396: _RUBY_SHLIB_MINOR:=    ${RUBY_SHLIBVER:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\3/}
                    397: 
1.112     taca      398: RUBY_SHLIB?=           ${RUBY_SUFFIX}.${RUBY_SLEXT}.${RUBY_SHLIBVER}
1.53      taca      399: RUBY_SHLIBALIAS?=      @comment
1.112     taca      400: RUBY_STATICLIB?=       ${RUBY_SUFFIX}-static.a
1.10      taca      401: 
                    402: .if ${OPSYS} == "NetBSD" || ${OPSYS} == "Interix"
1.179     taca      403: RUBY_SHLIBVER=         ${_RUBY_SHLIB_MAJOR}.${_RUBY_SHLIB_MINOR}
                    404: _RUBY_SHLIBALIAS=      ${RUBY_SUFFIX}.${RUBY_SLEXT}.${_RUBY_SHLIB_MAJOR}
1.12      jlam      405: .elif ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly"
1.179     taca      406: RUBY_SHLIBVER=         ${_RUBY_SHLIB_MAJOR}${_RUBY_SHLIB_MINOR}
1.83      bsiegert  407: .elif ${OPSYS} == "OpenBSD" || ${OPSYS} == "MirBSD"
1.102     taca      408: .if ${_RUBY_VER_MINOR} == 0
1.179     taca      409: RUBY_SHLIBVER=         ${_RUBY_VER_MAJOR}.${_RUBY_SHLIB_MINOR}
1.102     taca      410: .else
1.179     taca      411: RUBY_SHLIBVER=         ${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}${_RUBY_SHLIB_MINOR}
1.102     taca      412: .endif
1.53      taca      413: .elif ${OPSYS} == "Darwin"
1.112     taca      414: RUBY_SHLIB=            ${RUBY_SUFFIX}.${RUBY_SHLIBVER}.${RUBY_SLEXT}
1.53      taca      415: _RUBY_SHLIBALIAS=      .${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}.${RUBY_SLEXT}
1.181     jperkin   416: RUBY_STATICLIB=                ${RUBY_SUFFIX}.${RUBY_SHLIBVER}-static.a
1.10      taca      417: .elif ${OPSYS} == "Linux"
1.112     taca      418: _RUBY_SHLIBALIAS=      ${RUBY_SUFFIX}.${RUBY_SLEXT}.${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}
1.56      taca      419: .elif ${OPSYS} == "SunOS"
                    420: RUBY_SHLIBVER=         ${_RUBY_VER_MAJOR}
1.179     taca      421: _RUBY_SHLIBALIAS=      ${RUBY_SUFFIX}.${RUBY_SLEXT}.${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}.${_RUBY_SHLIB_MINOR}
1.96      obache    422: .elif ${OPSYS} == "Cygwin"
1.179     taca      423: RUBY_SHLIB=            ${RUBY_SUFFIX}${_RUBY_SHLIB_MAJOR}${_RUBY_SHLIB_MINOR}.dll.a
                    424: RUBY_SHLIBALIAS=       bin/cygruby${RUBY_SUFFIX}${_RUBY_SHLIB_MAJOR}${_RUBY_SHLIB_MINOR}.dll
                    425: RUBY_STATICLIB=                ${RUBY_SUFFIX}${_RUBY_SHLIB_MAJOR}${_RUBY_SHLIB_MINOR}-static.a
1.10      taca      426: .endif
                    427: 
1.53      taca      428: .if !empty(_RUBY_SHLIBALIAS)
                    429: RUBY_SHLIBALIAS=       lib/libruby${_RUBY_SHLIBALIAS}
1.10      taca      430: .endif
                    431: 
1.178     jlam      432: .if ${SHLIB_TYPE} == "dylib"
1.5       taca      433: RUBY_DLEXT=    bundle
1.53      taca      434: RUBY_SLEXT=    dylib
1.5       taca      435: .else
                    436: RUBY_DLEXT=    so
1.53      taca      437: RUBY_SLEXT=    so
1.5       taca      438: .endif
                    439: 
1.71      taca      440: RUBY_DISTNAME?=                ruby-${RUBY_VERSION}
                    441: 
                    442: #
1.26      taca      443: # Use pthread library with Ruby
                    444: #
1.64      taca      445: .if !empty(MACHINE_PLATFORM:MDarwin-9.*-powerpc)
1.42      minskim   446: # Workaround for Ruby Bug #193
                    447: # http://redmine.ruby-lang.org/issues/show/193
                    448: RUBY_USE_PTHREAD?=     no
1.26      taca      449: .else
                    450: RUBY_USE_PTHREAD?=     yes
                    451: .endif
                    452: 
1.23      taca      453: RUBY_DYNAMIC_DIRS?=    # empty
                    454: 
1.112     taca      455: RUBY_SRCDIR?=  ../../lang/ruby${RUBY_VER}-base
1.10      taca      456: 
                    457: #
1.23      taca      458: # common paths
1.1       taca      459: #
1.49      taca      460: RUBY_INC=              include/ruby-${RUBY_VER_DIR}
                    461: RUBY_ARCHINC=          ${RUBY_INC}/${RUBY_ARCH}
                    462: RUBY_LIB_BASE=         lib/ruby
                    463: RUBY_LIB?=             ${RUBY_LIB_BASE}/${RUBY_VER_DIR}
1.40      taca      464: RUBY_ARCHLIB?=         ${RUBY_LIB}/${RUBY_ARCH}
1.49      taca      465: RUBY_SITELIB_BASE?=    ${RUBY_LIB_BASE}/site_ruby
1.40      taca      466: RUBY_SITELIB?=         ${RUBY_SITELIB_BASE}/${RUBY_VER_DIR}
                    467: RUBY_SITEARCHLIB?=     ${RUBY_SITELIB}/${RUBY_ARCH}
1.49      taca      468: RUBY_VENDORLIB_BASE?=  ${RUBY_LIB_BASE}/vendor_ruby
1.40      taca      469: RUBY_VENDORLIB?=       ${RUBY_VENDORLIB_BASE}/${RUBY_VER_DIR}
                    470: RUBY_VENDORARCHLIB?=   ${RUBY_VENDORLIB}/${RUBY_ARCH}
1.49      taca      471: 
1.40      taca      472: RUBY_DOC?=             share/doc/${RUBY_NAME}
                    473: RUBY_EG?=              share/examples/${RUBY_NAME}
                    474: 
1.64      taca      475: 
1.49      taca      476: RUBY_GEM_BASE?=                ${RUBY_LIB_BASE}/gems
                    477: GEM_HOME?=             ${RUBY_GEM_BASE}/${RUBY_VER_DIR}
1.31      taca      478: 
                    479: #
                    480: # ri database relative path
                    481: #
                    482: RUBY_RIDIR?=           share/ri
1.15      taca      483: RUBY_BASERIDIR?=       ${RUBY_RIDIR}/${RUBY_VER_DIR}
                    484: RUBY_SYSRIDIR?=                ${RUBY_BASERIDIR}/system
                    485: RUBY_SITERIDIR?=       ${RUBY_BASERIDIR}/site
1.1       taca      486: 
                    487: #
                    488: # MAKE_ENV
                    489: #
1.18      rillig    490: MAKE_ENV+=             RUBY=${RUBY:Q} RUBY_VER=${RUBY_VER:Q} \
1.176     taca      491:                        RUBY_VERSION_DEFAULT=${RUBY_VERSION_DEFAULT:Q} \
                    492:                        RAKE=${RAKE:Q}
1.15      taca      493: 
1.122     taca      494: MAKEFLAGS+=            RUBY_VER=${RUBY_VER:Q} \
                    495:                        RUBY_VERSION_DEFAULT=${RUBY_VERSION_DEFAULT:Q}
1.15      taca      496: 
1.49      taca      497: PLIST_RUBY_DIRS=       RUBY_INC=${RUBY_INC:Q} RUBY_ARCHINC=${RUBY_ARCHINC:Q} \
                    498:                        RUBY_LIB_BASE=${RUBY_LIB_BASE:Q} \
                    499:                        RUBY_LIB=${RUBY_LIB:Q} \
                    500:                        RUBY_ARCHLIB=${RUBY_ARCHLIB:Q} \
1.40      taca      501:                        RUBY_SITELIB_BASE=${RUBY_SITELIB_BASE:Q} \
1.49      taca      502:                        RUBY_SITELIB=${RUBY_SITELIB:Q} \
                    503:                        RUBY_SITEARCHLIB=${RUBY_SITEARCHLIB:Q} \
1.40      taca      504:                        RUBY_VENDORLIB_BASE=${RUBY_VENDORLIB_BASE:Q} \
                    505:                        RUBY_VENDORLIB=${RUBY_VENDORLIB:Q} \
                    506:                        RUBY_VENDORARCHLIB=${RUBY_VENDORARCHLIB:Q} \
1.49      taca      507:                        RUBY_DOC=${RUBY_DOC:Q} \
                    508:                        RUBY_EG=${RUBY_EG:Q} \
                    509:                        RUBY_GEM_BASE=${RUBY_GEM_BASE:Q} \
                    510:                        GEM_HOME=${GEM_HOME:Q} \
                    511:                        RUBY_RIDIR=${RUBY_RIDIR:Q} \
                    512:                        RUBY_BASERIDIR=${RUBY_BASERIDIR:Q} \
                    513:                        RUBY_SYSRIDIR=${RUBY_SYSRIDIR:Q} \
                    514:                        RUBY_SITERIDIR=${RUBY_SITERIDIR:Q}
1.1       taca      515: 
1.14      taca      516: #
                    517: # substitutions
                    518: #
1.18      rillig    519: FILES_SUBST+=          RUBY=${RUBY:Q} RUBY_NAME=${RUBY_NAME:Q} \
                    520:                        RUBY_PKGPREFIX=${RUBY_PKGPREFIX:Q} \
1.111     taca      521:                        RUBY_SUFFIX=${RUBY_SUFFIX} \
1.18      rillig    522:                        RUBY_VER=${RUBY_VER:Q} \
1.15      taca      523:                        ${PLIST_RUBY_DIRS}
1.14      taca      524: 
1.15      taca      525: MESSAGE_SUBST+=                RUBY="${RUBY}" RUBY_VER="${RUBY_VER}" \
1.14      taca      526:                        RUBY_VERSION="${RUBY_VERSION}" \
1.15      taca      527:                        RUBY_PKGPREFIX="${RUBY_PKGPREFIX}" \
1.111     taca      528:                        RUBY_SUFFIX=${RUBY_SUFFIX} \
1.15      taca      529:                        ${PLIST_RUBY_DIRS:S,DIR="${PREFIX}/,DIR=",}
1.14      taca      530: 
1.179     taca      531: PLIST_SUBST+=  \
                    532:        RUBY=${RUBY:Q} RUBY_VER=${RUBY_VER:Q} \
                    533:        RUBY_PKGPREFIX=${RUBY_PKGPREFIX} RUBY_SUFFIX=${RUBY_SUFFIX} \
                    534:        RUBY_VERSION=${RUBY_VERSION:Q}  RUBY_VER_DIR=${RUBY_VER_DIR:Q} \
                    535:        RUBY_DLEXT=${RUBY_DLEXT} RUBY_SLEXT=${RUBY_SLEXT} \
                    536:        RUBY_SHLIB=${RUBY_SHLIB:Q} RUBY_SHLIBALIAS=${RUBY_SHLIBALIAS:Q} \
1.181     jperkin   537:        RUBY_STATICLIB=${RUBY_STATICLIB:Q} RUBY_ARCH=${RUBY_ARCH:Q} \
1.179     taca      538:        ${PLIST_RUBY_DIRS:S,DIR="${PREFIX}/,DIR=",} \
                    539:        RUBY_MAJOR_MINOR=${RUBY_MAJOR_MINOR} \
                    540:        RUBY_RAKE_VERSION=${RUBY_RAKE_VERSION} \
                    541:        RUBY_RDOC_VERSION=${RUBY_RDOC_VERSION} \
                    542:        RUBY_JSON_VERSION=${RUBY_JSON_VERSION} \
                    543:        RUBY_BIGDECIMAL_VERSION=${RUBY_BIGDECIMAL_VERSION} \
                    544:        RUBY_IO_CONSOLE_VERSION=${RUBY_IO_CONSOLE_VERSION} \
                    545:        RUBY_OPENSSL_VERSION=${RUBY_OPENSSL_VERSION} \
                    546:        RUBY_PSYCH_VERSION=${RUBY_PSYCH_VERSION} \
                    547:        RUBY_DID_YOU_MEAN_VERSION=${RUBY_DID_YOU_MEAN_VERSION} \
                    548:        RUBY_MINITEST_VERSION=${RUBY_MINITEST_VERSION} \
                    549:        RUBY_NET_TELNET_VERSION=${RUBY_NET_TELNET_VERSION} \
                    550:        RUBY_POWER_ASSERT_VERSION=${RUBY_POWER_ASSERT_VERSION} \
                    551:        RUBY_TEST_UNIT_VERSION=${RUBY_TEST_UNIT_VERSION} \
                    552:        RUBY_XML_RPC_VERSION=${RUBY_XML_RPC_VERSION}
1.1       taca      553: 
1.22      taca      554: #
1.23      taca      555: # make dynamic PLIST
1.22      taca      556: #
1.23      taca      557: .if !empty(RUBY_DYNAMIC_DIRS)
                    558: 
                    559: RUBY_PLIST_DYNAMIC=    ${WRKDIR}/PLIST.work
                    560: 
                    561: .if !defined(PLIST_SRC)
                    562: .  if exists(${PKGDIR}/PLIST.common)
                    563: PLIST_SRC+=            ${PKGDIR}/PLIST.common
                    564: .  elif exists(${PKGDIR}/PLIST)
                    565: PLIST_SRC+=            ${PKGDIR}/PLIST
                    566: .  endif
                    567: 
                    568: PLIST_SRC+=            ${RUBY_PLIST_DYNAMIC}
                    569: 
                    570: .  if exists(${PKGDIR}/PLIST.common_end)
                    571: PLIST_SRC+=            ${PKGDIR}/PLIST.common_end
                    572: .  endif
                    573: 
                    574: .endif
                    575: 
                    576: RUBY_PLIST_COMMENT_CMD= \
                    577:        ${ECHO} "@comment The following lines are automatically generated"
1.37      obache    578: RUBY_PLIST_FILES_CMD= ( cd ${DESTDIR}${PREFIX}; \
1.23      taca      579:        ${FIND} ${RUBY_DYNAMIC_DIRS} \( -type f -o -type l \) -print ) | \
                    580:        ${SORT} -u
1.164     rillig    581: RUBY_GENERATE_PLIST=   ( \
1.23      taca      582:        ${RUBY_PLIST_COMMENT_CMD}; \
1.47      joerg     583:        ${RUBY_PLIST_FILES_CMD} ) > ${RUBY_PLIST_DYNAMIC}
1.22      taca      584: .endif
1.23      taca      585: 
1.53      taca      586: PRINT_PLIST_AWK+=      /lib\/libruby${RUBY_STATICLIB}$$/ \
                    587:                        { sub(/${RUBY_STATICLIB}/, "$${RUBY_STATICLIB}"); }
                    588: PRINT_PLIST_AWK+=      /lib\/libruby${RUBY_VER}\.${RUBY_SLEXT}/ \
                    589:                        { sub(/${RUBY_VER}\.${RUBY_SLEXT}$$/, \
                    590:                        "$${RUBY_VER}.$${RUBY_SLEXT}"); }
                    591: PRINT_PLIST_AWK+=      /${RUBY_SHLIB}$$/ \
                    592:                        { sub(/${RUBY_SHLIB}$$/, "$${RUBY_SHLIB}"); }
                    593: PRINT_PLIST_AWK+=      /${RUBY_SLEXT}\.${RUBY_SHLIBVER}$$/ \
                    594:                        { sub(/${RUBY_SLEXT}\.${RUBY_SHLIBVER}$$/, \
                    595:                        "$${RUBY_SLEXT}.$${RUBY_SHLIBVER}"); }
                    596: .if ${RUBY_SHLIBALIAS} != "@comment"
                    597: PRINT_PLIST_AWK+=      /${RUBY_SHLIBALIAS:S/\//\\\//}$$/ \
                    598:                        { sub(/${RUBY_SHLIBALIAS:S/\//\\\//}$$/, \
                    599:                        "$${RUBY_SHLIBALIAS}"); }
1.49      taca      600: .endif
                    601: PRINT_PLIST_AWK+=      /^${RUBY_ARCHINC:S|/|\\/|g}/ \
                    602:                        { gsub(/${RUBY_ARCHINC:S|/|\\/|g}/, "$${RUBY_ARCHINC}"); \
                    603:                        print; next; }
                    604: PRINT_PLIST_AWK+=      /^${RUBY_INC:S|/|\\/|g}/ \
                    605:                        { gsub(/${RUBY_INC:S|/|\\/|g}/, "$${RUBY_INC}"); \
                    606:                        print; next; }
1.40      taca      607: PRINT_PLIST_AWK+=      /\.${RUBY_DLEXT}$$/ \
                    608:                        { gsub(/${RUBY_DLEXT}$$/, "$${RUBY_DLEXT}") }
1.47      joerg     609: PRINT_PLIST_AWK+=      /^${RUBY_ARCHLIB:S|/|\\/|g}/ \
1.40      taca      610:                        { gsub(/${RUBY_ARCHLIB:S|/|\\/|g}/, "$${RUBY_ARCHLIB}"); \
                    611:                        print; next; }
1.47      joerg     612: PRINT_PLIST_AWK+=      /^${RUBY_VENDORARCHLIB:S|/|\\/|g}/ \
1.40      taca      613:                        { gsub(/${RUBY_VENDORARCHLIB:S|/|\\/|g}/, "$${RUBY_VENDORARCHLIB}"); \
                    614:                        print; next; }
1.47      joerg     615: PRINT_PLIST_AWK+=      /^${RUBY_VENDORLIB:S|/|\\/|g}/ \
1.40      taca      616:                        { gsub(/${RUBY_VENDORLIB:S|/|\\/|g}/, "$${RUBY_VENDORLIB}"); \
                    617:                        print; next; }
1.47      joerg     618: PRINT_PLIST_AWK+=      /^${RUBY_SITEARCHLIB:S|/|\\/|g}/ \
1.40      taca      619:                        { gsub(/${RUBY_SITEARCHLIB:S|/|\\/|g}/, "$${RUBY_SITEARCHLIB}"); \
                    620:                        print; next; }
1.47      joerg     621: PRINT_PLIST_AWK+=      /^${RUBY_SITELIB:S|/|\\/|g}/ \
1.40      taca      622:                        { gsub(/${RUBY_SITELIB:S|/|\\/|g}/, "$${RUBY_SITELIB}"); \
                    623:                        print; next; }
1.49      taca      624: PRINT_PLIST_AWK+=      /^${RUBY_SITELIB_BASE:S|/|\\/|g}/ \
1.40      taca      625:                        { gsub(/${RUBY_SITELIB_BASE:S|/|\\/|g}/, "$${RUBY_SITELIB_BASE}"); \
                    626:                        print; next; }
1.49      taca      627: PRINT_PLIST_AWK+=      /^${RUBY_VENDORLIB_BASE:S|/|\\/|g}/ \
1.40      taca      628:                        { gsub(/${RUBY_VENDORLIB_BASE:S|/|\\/|g}/, "$${RUBY_VENDORLIB_BASE}"); \
                    629:                        print; next; }
1.47      joerg     630: PRINT_PLIST_AWK+=      /^${RUBY_LIB:S|/|\\/|g}/ \
1.40      taca      631:                        { gsub(/${RUBY_LIB:S|/|\\/|g}/, "$${RUBY_LIB}"); \
                    632:                        print; next; }
1.47      joerg     633: PRINT_PLIST_AWK+=      /^${RUBY_DOC:S|/|\\/|g}/ \
1.40      taca      634:                        { gsub(/${RUBY_DOC:S|/|\\/|g}/, "$${RUBY_DOC}"); \
                    635:                        print; next; }
1.47      joerg     636: PRINT_PLIST_AWK+=      /^${RUBY_EG:S|/|\\/|g}/ \
1.40      taca      637:                        { gsub(/${RUBY_EG:S|/|\\/|g}/, "$${RUBY_EG}"); \
                    638:                        print; next; }
1.47      joerg     639: PRINT_PLIST_AWK+=      /^${RUBY_SITERIDIR:S|/|\\/|g}/ \
1.40      taca      640:                        { gsub(/${RUBY_SITERIDIR:S|/|\\/|g}/, "$${RUBY_SITERIDIR}"); \
                    641:                        print; next; }
1.49      taca      642: PRINT_PLIST_AWK+=      /^${RUBY_SYSRIDIR:S|/|\\/|g}\// \
                    643:                        { next; }
1.117     taca      644: 
                    645: # Insert part of PRINT_PLIST_AWK from gem.mk
                    646: PRINT_PLIST_AWK+=      ${_RUBY_PRINT_PLIST_GEM}
                    647: 
1.49      taca      648: PRINT_PLIST_AWK+=      /\/${RUBY_NAME}/ \
                    649:                        { sub(/${RUBY_NAME}/, "$${RUBY_NAME}"); }
1.65      taca      650: PRINT_PLIST_AWK+=      /^${GEM_HOME:S|/|\\/|g:S|.|\\.|g}/ \
                    651:                        { gsub(/${GEM_HOME:S|/|\\/|g}/, "$${GEM_HOME}"); }
1.40      taca      652: 
1.166     taca      653: # supporting scripts
                    654: UPDATE_GEMSPEC=                ../../lang/ruby/files/update-gemspec.rb
                    655: 
1.1       taca      656: .endif # _RUBY_MK

CVSweb <webmaster@jp.NetBSD.org>