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

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

CVSweb <webmaster@jp.NetBSD.org>