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

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

CVSweb <webmaster@jp.NetBSD.org>