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

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

CVSweb <webmaster@jp.NetBSD.org>