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

1.87    ! taca        1: # $NetBSD: rubyversion.mk,v 1.86 2012/09/16 15:17:12 taca Exp $
1.64      taca        2: #
                      3: 
                      4: # This file determines which Ruby version is used as a dependency for
                      5: # a package.
                      6: #
                      7: #
                      8: # === User-settable variables ===
                      9: #
                     10: # RUBY_VERSION_DEFAULT
                     11: #      The preferered Ruby version to use.
                     12: #
1.87    ! taca       13: #              Possible values: 18 193
1.77      taca       14: #              Default: 193
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: #
                     30: #
                     31: # === Package-settable variables ===
                     32: #
                     33: # RUBY_VERSION_SUPPORTED
                     34: #      The Ruby versions that are acceptable for the package.
                     35: #
1.87    ! taca       36: #              Possible values: 18 193
        !            37: #              Default: 18 193
1.64      taca       38: #
                     39: # RUBY_VERSION_REQD
1.66      joerg      40: #      The Ruby versions force to build (for pbulk).
1.64      taca       41: #
                     42: # RUBY_NOVERSION
                     43: #      If "Yes", the package dosen't depend on any version of Ruby, such
                     44: #      as editing mode for emacs.  In this case, package's name would begin
                     45: #      with "ruby-".  Otherwise, the package's name is begin with
1.87    ! taca       46: #      ${RUBY_PKGPREFIX}; "ruby18" or "ruby193".
1.64      taca       47: #
                     48: #              Possible values: Yes No
                     49: #              Default: No
                     50: #
                     51: # RUBY_DYNAMIC_DIRS
                     52: #      Build dynamic PLIST from directories.
                     53: #
                     54: #      Default: (empty)
                     55: #
                     56: # RUBY_ENCODING_ARG
                     57: #
                     58: #      Optional encoding argument for shbang line.
                     59: #
                     60: #      Default: (empty)
                     61: #
                     62: # === Defined variables ===
                     63: #
                     64: # RUBY_VER
1.87    ! taca       65: #      Really selected version of ruby.
1.64      taca       66: #
1.87    ! taca       67: #              Possible values: 18 193
1.64      taca       68: #
                     69: #      Use this variable in pkgsrc's Makefile
                     70: #
                     71: # RUBY_PKGPREFIX
                     72: #      Prefix part for ruby based packages.  It is recommended that to
                     73: #      use RUBY_PKGPREFIX with ruby related packages since you can supply
                     74: #      different binary packages as each version of Ruby.
                     75: #
                     76: # RUBY_ABI_VERSION
                     77: #      Ruby's ABI version.
                     78: #
                     79: # RUBY_DLEXT
                     80: #      Suffix of extention library.
                     81: #
                     82: # RUBY_SLEXT
                     83: #      Suffix of shared library.
                     84: #
                     85: # RUBY
                     86: #      Full path of ruby command.
                     87: #
                     88: # RDOC
                     89: #      Full path of rdoc command.
                     90: #
                     91: # RUBY_NAME
                     92: #      Name of ruby command.
                     93: #
                     94: # RUBYGEM_NAME
                     95: #      Name of gem command.
                     96: #
                     97: # RAKE_NAME
                     98: #      Name of rake command.
                     99: #
                    100: # RUBY_SUFFIX
                    101: #      Extra string for each ruby commands; ruby, irb and so on.
                    102: #
                    103: # RUBY_VERSION
                    104: #      Version of real Ruby's version excluding patchlevel.
                    105: #
                    106: # RUBY_VERSION_FULL
                    107: #      Version of Ruby including patchlevel.
                    108: #      
                    109: # RUBY_BASE
                    110: #      Name of ruby base package's name.
                    111: #
                    112: # RUBY_SRCDIR
                    113: #      Directory of base ruby package.
                    114: #
                    115: # RUBY_SHLIBVER
                    116: #      Suffix of libruby shared library's version.
                    117: #
                    118: # RUBY_SHLIB
                    119: #      String after libruby shared library.
                    120: #
                    121: # RUBY_SHLIBALIAS
                    122: #      Symblic link with libruby shared library with major version only.
                    123: #
                    124: # RUBY_STATICLIB
                    125: #      Name of libruby static library.
                    126: #
                    127: # RUBY_VER_DIR
                    128: #      Name of version directory under each library (and more) directories.
                    129: #
                    130: # RUBY_ARCH
                    131: #      Name of architecture-dependent directory name.
                    132: #
                    133: # RUBY_INC
                    134: #      machine independent include directory of ruby.
                    135: #
                    136: # RUBY_ARCHINC
                    137: #      machine dependent include directory of ruby.
                    138: #
                    139: # RUBY_LIB_BASE
                    140: #      common relative path of ruby's library.
                    141: #
                    142: # RUBY_LIB
                    143: #      version specific relative path of ruby's library.
                    144: #
                    145: # RUBY_ARCHLIB
                    146: #      version specific and machine dependent relative path of ruby's library.
                    147: #
                    148: # RUBY_SITELIB_BASE
                    149: #      common site local directory.
                    150: #
                    151: # RUBY_SITELIB
                    152: #      version specific site local directory.
                    153: #
                    154: # RUBY_SITEARCHLIB
                    155: #      version specific and machine dependent site local directory.
                    156: #
                    157: # RUBY_VENDORLIB_BASE
                    158: #      common vendor (pkgsrc) directory.
                    159: #
                    160: # RUBY_VENDORLIB
                    161: #      version specific vendor local directory.
                    162: #
                    163: # RUBY_VENDORARCHLIB
                    164: #      version specific and machine dependent vendor local directory.
                    165: #
                    166: # RUBY_DOC
                    167: #      version specific document direcotry.
                    168: #
                    169: # RUBY_EG
                    170: #      version specific examples direcotry.
                    171: #
                    172: # RUBY_GEM_BASE
                    173: #      common GEM directory.
                    174: #      
                    175: # GEM_HOME
                    176: #      version specific GEM directory.
                    177: #
                    178: # RUBY_RIDIR
                    179: #      common ri directory.
                    180: #
                    181: # RUBY_BASERIDIR
                    182: #      version specific ri directory.
                    183: #
                    184: # RUBY_SYSRIDIR
                    185: #      version specific system ri directory.
                    186: #
                    187: # RUBY_SITERIDIR
                    188: #      version specific site ri directory.
                    189: #
                    190: # Keywords: ruby
1.1       taca      191: #
                    192: 
1.18      rillig    193: .if !defined(_RUBYVERSION_MK)
1.1       taca      194: _RUBYVERSION_MK=       # defined
                    195: 
                    196: .include "../../mk/bsd.prefs.mk"
                    197: 
                    198: # current supported Ruby's version
1.40      taca      199: RUBY18_VERSION=                1.8.7
1.64      taca      200: RUBY193_VERSION=       1.9.3
1.23      taca      201: 
1.32      taca      202: # patch
1.82      taca      203: RUBY18_PATCHLEVEL=     pl370
1.78      taca      204: RUBY193_PATCHLEVEL=    p194
1.49      taca      205: 
1.59      taca      206: # current API compatible version; used for version of shared library
1.49      taca      207: RUBY18_API_VERSION=    1.8.7
1.64      taca      208: RUBY193_API_VERSION=   1.9.1
1.1       taca      209: 
                    210: #
1.77      taca      211: RUBY_VERSION_DEFAULT?= 193
1.64      taca      212: 
1.86      taca      213: RUBY_VERSION_SUPPORTED?= 193 18
1.64      taca      214: RUBY_VER?=             ${RUBY_VERSION_DEFAULT}
                    215: 
                    216: # If package support only one version, use it.
                    217: .if ${RUBY_VERSION_SUPPORTED:[\#]} == 1
1.80      taca      218: RUBY_VER=              ${RUBY_VERSION_SUPPORTED}
                    219: RUBY_VERSION_DEFAULT=  ${RUBY_VERSION_SUPPORTED}
1.64      taca      220: .endif
1.1       taca      221: 
1.52      joerg     222: .if defined(RUBY_VERSION_REQD)
1.64      taca      223: . for rv in ${RUBY_VERSION_SUPPORTED}
                    224: .  if ${rv} == ${RUBY_VERSION_REQD}
                    225: RUBY_VER=      ${rv}
1.52      joerg     226: .  endif
1.64      taca      227: . endfor
1.1       taca      228: .endif
1.29      taca      229: 
1.81      obache    230: RUBY_VER:=     ${RUBY_VER_MAP.${RUBY_VER}:U${RUBY_VER}}
1.67      joerg     231: 
1.64      taca      232: .if ${RUBY_VER} == "18"
                    233: RUBY_VERSION=          ${RUBY18_VERSION}
                    234: RUBY_VERSION_FULL=     ${RUBY_VERSION}${RUBY_PATCHLEVEL:S/pl/./}
                    235: RUBY_ABI_VERSION=      ${RUBY18_API_VERSION}
                    236: .elif ${RUBY_VER} == "193"
                    237: RUBY_VERSION=          ${RUBY193_VERSION}
                    238: RUBY_VERSION_FULL=     ${RUBY_VERSION}${RUBY_PATCHLEVEL}
                    239: RUBY_ABI_VERSION=      ${RUBY_VERSION}
                    240: .else
                    241: PKG_FAIL_REASON+= "Unknown Ruby version specified: ${RUBY_VER}."
1.32      taca      242: .endif
1.1       taca      243: 
1.64      taca      244: RUBY_PATCHLEVEL=       ${RUBY${RUBY_VER}_PATCHLEVEL}
                    245: RUBY_API_VERSION=      ${RUBY${RUBY_VER}_API_VERSION}
                    246: 
1.60      wiz       247: # Variable assignment for multi-ruby packages
1.64      taca      248: MULTI+=        RUBY_VER=${RUBY_VERS:U${RUBY_VERSION_DEFAULT}}
1.4       taca      249: 
1.1       taca      250: # RUBY_NOVERSION should be set to "Yes" if the package dosen't depend on
                    251: #      any specific version of ruby command.  In this case, package's
                    252: #      name begin with "ruby-".
                    253: #      If RUBY_NOVERSION is "No" (default), the package's name is begin
1.87    ! taca      254: #      with ${RUBY_NAME}; "ruby18", "ruby193",  and so on.
1.1       taca      255: #
1.53      taca      256: #      It also affects to RUBY_DOC, RUBY_EG...
1.1       taca      257: #
                    258: RUBY_NOVERSION?=       No
                    259: 
1.29      taca      260: # _RUBY_VER_MAJOR, _RUBY_VER_MINOR, _RUBY_VER_TEENY and _RUBY_PATCHLEVEL
                    261: # is defined from version of Ruby.  It should not be used in packages'
                    262: # Makefile.
                    263: #
1.64      taca      264: _RUBY_VER_MAJOR=       ${RUBY_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\1/}
                    265: _RUBY_VER_MINOR=       ${RUBY_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\2/}
                    266: _RUBY_VER_TEENY=       ${RUBY_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\3/}
1.1       taca      267: 
1.64      taca      268: _RUBY_API_MAJOR=       ${RUBY_API_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\1\2/}
                    269: _RUBY_API_MINOR=       ${RUBY_API_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\3/}
1.1       taca      270: 
1.64      taca      271: RUBY_SUFFIX=           ${RUBY_VER}
1.49      taca      272: 
1.64      taca      273: RUBY_NAME=             ruby${RUBY_SUFFIX}
                    274: RUBYGEM_NAME=          gem${RUBY_SUFFIX}
                    275: RAKE_NAME=             rake${RUBY_SUFFIX}
1.1       taca      276: 
1.49      taca      277: RUBY_ENCODING_ARG?=
                    278: 
1.10      taca      279: RUBY_BASE=             ruby${RUBY_VER}-base
                    280: 
1.1       taca      281: RUBY_PKGPREFIX?=       ${RUBY_NAME}
                    282: 
1.87    ! taca      283: .if ${RUBY_VER} == "18"
1.64      taca      284: RUBY_VER_DIR=          ${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}
                    285: .else
                    286: RUBY_VER_DIR=          ${RUBY_VERSION}
1.1       taca      287: .endif
                    288: 
                    289: .if empty(RUBY_NOVERSION:M[nN][oO])
                    290: RUBY_SUFFIX=
                    291: RUBY_NAME=             ruby
                    292: .endif
                    293: 
1.64      taca      294: RUBY_BUILD_RDOC?=      Yes
                    295: RUBY_BUILD_RI?=                Yes
1.49      taca      296: 
1.15      taca      297: RUBY?=                 ${PREFIX}/bin/${RUBY_NAME}
                    298: RDOC?=                 ${PREFIX}/bin/rdoc${RUBY_VER}
1.1       taca      299: 
                    300: RUBY_ARCH?= ${LOWER_ARCH}-${LOWER_OPSYS}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX}
                    301: 
                    302: #
1.53      taca      303: # Ruby shared and static library version handling.
1.10      taca      304: #
1.49      taca      305: RUBY_SHLIBVER?=                ${RUBY_API_VERSION}
1.53      taca      306: RUBY_SHLIB?=           ${RUBY_VER}.${RUBY_SLEXT}.${RUBY_SHLIBVER}
                    307: RUBY_SHLIBALIAS?=      @comment
                    308: RUBY_STATICLIB?=       ${RUBY_VER}-static.a
1.10      taca      309: 
                    310: .if ${OPSYS} == "NetBSD" || ${OPSYS} == "Interix"
1.64      taca      311: RUBY_SHLIBVER=         ${_RUBY_API_MAJOR}.${_RUBY_API_MINOR}
                    312: _RUBY_SHLIBALIAS=      ${RUBY_VER}.${RUBY_SLEXT}.${_RUBY_API_MAJOR}
1.12      jlam      313: .elif ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly"
1.87    ! taca      314: .if ${RUBY_VER} == "18"
1.12      jlam      315: RUBY_SHLIBVER=         ${RUBY_VER}
1.75      marino    316: .else
                    317: RUBY_SHLIBVER=         ${_RUBY_VER_MAJOR}${_RUBY_VER_MINOR}${_RUBY_API_MINOR}
                    318: .endif
1.83      bsiegert  319: .elif ${OPSYS} == "OpenBSD" || ${OPSYS} == "MirBSD"
1.64      taca      320: RUBY_SHLIBVER=         ${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}${_RUBY_API_MINOR}
1.53      taca      321: .elif ${OPSYS} == "Darwin"
                    322: RUBY_SHLIB=            ${RUBY_VER}.${RUBY_SHLIBVER}.${RUBY_SLEXT}
                    323: .if ${RUBY_VER} == "18"
                    324: _RUBY_SHLIBALIAS=      ${RUBY_VER}.${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}.${RUBY_SLEXT}
                    325: .else
                    326: _RUBY_SHLIBALIAS=      .${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}.${RUBY_SLEXT}
                    327: RUBY_STATICLIB=                ${RUBY_VER}.${RUBY_API_VERSION}-static.a
                    328: .endif
1.10      taca      329: .elif ${OPSYS} == "Linux"
1.54      taca      330: _RUBY_SHLIBALIAS=      ${RUBY_VER}.${RUBY_SLEXT}.${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}
1.56      taca      331: .elif ${OPSYS} == "SunOS"
                    332: RUBY_SHLIBVER=         ${_RUBY_VER_MAJOR}
1.64      taca      333:  _RUBY_SHLIBALIAS=     ${RUBY_VER}.${RUBY_SLEXT}.${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}.${_RUBY_API_MINOR}
1.10      taca      334: .endif
                    335: 
1.53      taca      336: .if !empty(_RUBY_SHLIBALIAS)
                    337: RUBY_SHLIBALIAS=       lib/libruby${_RUBY_SHLIBALIAS}
1.10      taca      338: .endif
                    339: 
1.64      taca      340: .if ${_OPSYS_SHLIB_TYPE} == "dylib"
1.5       taca      341: RUBY_DLEXT=    bundle
1.53      taca      342: RUBY_SLEXT=    dylib
1.5       taca      343: .else
                    344: RUBY_DLEXT=    so
1.53      taca      345: RUBY_SLEXT=    so
1.5       taca      346: .endif
                    347: 
                    348: #
1.71      taca      349: # Ruby distribution file, few package need it.
                    350: #
                    351: _RUBY_PATCHLEVEL=      ${RUBY_PATCHLEVEL:S/pl/p/:S/pre/preview/}
                    352: 
                    353: .if !empty(_RUBY_PATCHLEVEL)
                    354: RUBY_DISTNAME?=                ruby-${RUBY_VERSION}-${_RUBY_PATCHLEVEL}
                    355: .else
                    356: RUBY_DISTNAME?=                ruby-${RUBY_VERSION}
                    357: .endif
                    358: 
                    359: #
1.26      taca      360: # Use pthread library with Ruby
                    361: #
1.64      taca      362: .if !empty(MACHINE_PLATFORM:MDarwin-9.*-powerpc)
1.42      minskim   363: # Workaround for Ruby Bug #193
                    364: # http://redmine.ruby-lang.org/issues/show/193
                    365: RUBY_USE_PTHREAD?=     no
1.26      taca      366: .else
                    367: RUBY_USE_PTHREAD?=     yes
                    368: .endif
                    369: 
1.23      taca      370: RUBY_DYNAMIC_DIRS?=    # empty
                    371: 
1.10      taca      372: RUBY_SRCDIR?=  ${_PKGSRC_TOPDIR}/lang/${RUBY_BASE}
                    373: 
                    374: #
1.23      taca      375: # common paths
1.1       taca      376: #
1.49      taca      377: RUBY_INC=              include/ruby-${RUBY_VER_DIR}
                    378: RUBY_ARCHINC=          ${RUBY_INC}/${RUBY_ARCH}
                    379: RUBY_LIB_BASE=         lib/ruby
                    380: RUBY_LIB?=             ${RUBY_LIB_BASE}/${RUBY_VER_DIR}
1.40      taca      381: RUBY_ARCHLIB?=         ${RUBY_LIB}/${RUBY_ARCH}
1.49      taca      382: RUBY_SITELIB_BASE?=    ${RUBY_LIB_BASE}/site_ruby
1.40      taca      383: RUBY_SITELIB?=         ${RUBY_SITELIB_BASE}/${RUBY_VER_DIR}
                    384: RUBY_SITEARCHLIB?=     ${RUBY_SITELIB}/${RUBY_ARCH}
1.49      taca      385: RUBY_VENDORLIB_BASE?=  ${RUBY_LIB_BASE}/vendor_ruby
1.40      taca      386: RUBY_VENDORLIB?=       ${RUBY_VENDORLIB_BASE}/${RUBY_VER_DIR}
                    387: RUBY_VENDORARCHLIB?=   ${RUBY_VENDORLIB}/${RUBY_ARCH}
1.49      taca      388: 
1.40      taca      389: RUBY_DOC?=             share/doc/${RUBY_NAME}
                    390: RUBY_EG?=              share/examples/${RUBY_NAME}
                    391: 
1.64      taca      392: 
1.49      taca      393: RUBY_GEM_BASE?=                ${RUBY_LIB_BASE}/gems
                    394: GEM_HOME?=             ${RUBY_GEM_BASE}/${RUBY_VER_DIR}
1.31      taca      395: 
                    396: #
                    397: # ri database relative path
                    398: #
                    399: RUBY_RIDIR?=           share/ri
1.15      taca      400: RUBY_BASERIDIR?=       ${RUBY_RIDIR}/${RUBY_VER_DIR}
                    401: RUBY_SYSRIDIR?=                ${RUBY_BASERIDIR}/system
                    402: RUBY_SITERIDIR?=       ${RUBY_BASERIDIR}/site
1.1       taca      403: 
                    404: #
                    405: # MAKE_ENV
                    406: #
1.18      rillig    407: MAKE_ENV+=             RUBY=${RUBY:Q} RUBY_VER=${RUBY_VER:Q} \
                    408:                        RUBY_VERSION_DEFAULT=${RUBY_VERSION_DEFAULT:Q}
1.15      taca      409: 
1.64      taca      410: MAKEFLAGS+=            RUBY_VERSION_DEFAULT=${RUBY_VERSION_DEFAULT:Q}
1.15      taca      411: 
1.49      taca      412: #
1.1       taca      413: # PLIST
                    414: #
1.86      taca      415: PLIST_VARS+=           ruby18 ruby19 ruby193
1.49      taca      416: .if ${RUBY_VER} == "18"
                    417: PLIST.ruby18=          yes
1.64      taca      418: .elif ${RUBY_VER} == "193"
                    419: PLIST.ruby19=          yes
                    420: PLIST.ruby193=         yes
1.49      taca      421: .endif
                    422: 
                    423: PLIST_RUBY_DIRS=       RUBY_INC=${RUBY_INC:Q} RUBY_ARCHINC=${RUBY_ARCHINC:Q} \
                    424:                        RUBY_LIB_BASE=${RUBY_LIB_BASE:Q} \
                    425:                        RUBY_LIB=${RUBY_LIB:Q} \
                    426:                        RUBY_ARCHLIB=${RUBY_ARCHLIB:Q} \
1.40      taca      427:                        RUBY_SITELIB_BASE=${RUBY_SITELIB_BASE:Q} \
1.49      taca      428:                        RUBY_SITELIB=${RUBY_SITELIB:Q} \
                    429:                        RUBY_SITEARCHLIB=${RUBY_SITEARCHLIB:Q} \
1.40      taca      430:                        RUBY_VENDORLIB_BASE=${RUBY_VENDORLIB_BASE:Q} \
                    431:                        RUBY_VENDORLIB=${RUBY_VENDORLIB:Q} \
                    432:                        RUBY_VENDORARCHLIB=${RUBY_VENDORARCHLIB:Q} \
1.49      taca      433:                        RUBY_DOC=${RUBY_DOC:Q} \
                    434:                        RUBY_EG=${RUBY_EG:Q} \
                    435:                        RUBY_GEM_BASE=${RUBY_GEM_BASE:Q} \
                    436:                        GEM_HOME=${GEM_HOME:Q} \
                    437:                        RUBY_RIDIR=${RUBY_RIDIR:Q} \
                    438:                        RUBY_BASERIDIR=${RUBY_BASERIDIR:Q} \
                    439:                        RUBY_SYSRIDIR=${RUBY_SYSRIDIR:Q} \
                    440:                        RUBY_SITERIDIR=${RUBY_SITERIDIR:Q}
1.1       taca      441: 
1.14      taca      442: #
                    443: # substitutions
                    444: #
1.18      rillig    445: FILES_SUBST+=          RUBY=${RUBY:Q} RUBY_NAME=${RUBY_NAME:Q} \
                    446:                        RUBY_PKGPREFIX=${RUBY_PKGPREFIX:Q} \
                    447:                        RUBY_VER=${RUBY_VER:Q} \
1.15      taca      448:                        ${PLIST_RUBY_DIRS}
1.14      taca      449: 
1.15      taca      450: MESSAGE_SUBST+=                RUBY="${RUBY}" RUBY_VER="${RUBY_VER}" \
1.14      taca      451:                        RUBY_VERSION="${RUBY_VERSION}" \
1.15      taca      452:                        RUBY_PKGPREFIX="${RUBY_PKGPREFIX}" \
                    453:                        ${PLIST_RUBY_DIRS:S,DIR="${PREFIX}/,DIR=",}
1.14      taca      454: 
1.18      rillig    455: PLIST_SUBST+=          RUBY=${RUBY:Q} RUBY_VER=${RUBY_VER:Q} \
1.49      taca      456:                        RUBY_PKGPREFIX=${RUBY_PKGPREFIX} \
1.18      rillig    457:                        RUBY_VERSION=${RUBY_VERSION:Q} \
                    458:                        RUBY_VER_DIR=${RUBY_VER_DIR:Q} \
1.53      taca      459:                        RUBY_DLEXT=${RUBY_DLEXT:Q} RUBY_SLEXT=${RUBY_SLEXT:Q} \
                    460:                        RUBY_SHLIB=${RUBY_SHLIB:Q} \
                    461:                        RUBY_SHLIBALIAS=${RUBY_SHLIBALIAS:Q} \
                    462:                        RUBY_STATICLIB=${RUBY_STATICLIB:Q} \
1.39      jlam      463:                        RUBY_ARCH=${RUBY_ARCH:Q} \
1.58      taca      464:                        ${PLIST_RUBY_DIRS:S,DIR="${PREFIX}/,DIR=",}
1.1       taca      465: 
1.22      taca      466: #
1.23      taca      467: # make dynamic PLIST
1.22      taca      468: #
1.23      taca      469: .if !empty(RUBY_DYNAMIC_DIRS)
                    470: 
                    471: RUBY_PLIST_DYNAMIC=    ${WRKDIR}/PLIST.work
                    472: 
                    473: .if !defined(PLIST_SRC)
                    474: .  if exists(${PKGDIR}/PLIST.common)
                    475: PLIST_SRC+=            ${PKGDIR}/PLIST.common
                    476: .  elif exists(${PKGDIR}/PLIST)
                    477: PLIST_SRC+=            ${PKGDIR}/PLIST
                    478: .  endif
                    479: 
                    480: PLIST_SRC+=            ${RUBY_PLIST_DYNAMIC}
                    481: 
                    482: .  if exists(${PKGDIR}/PLIST.common_end)
                    483: PLIST_SRC+=            ${PKGDIR}/PLIST.common_end
                    484: .  endif
                    485: 
                    486: .endif
                    487: 
                    488: RUBY_PLIST_COMMENT_CMD= \
                    489:        ${ECHO} "@comment The following lines are automatically generated"
1.37      obache    490: RUBY_PLIST_FILES_CMD= ( cd ${DESTDIR}${PREFIX}; \
1.23      taca      491:        ${FIND} ${RUBY_DYNAMIC_DIRS} \( -type f -o -type l \) -print ) | \
                    492:        ${SORT} -u
                    493: RUBY_GENERATE_PLIST =  ( \
                    494:        ${RUBY_PLIST_COMMENT_CMD}; \
1.47      joerg     495:        ${RUBY_PLIST_FILES_CMD} ) > ${RUBY_PLIST_DYNAMIC}
1.22      taca      496: .endif
1.23      taca      497: 
1.53      taca      498: PRINT_PLIST_AWK+=      /lib\/libruby${RUBY_STATICLIB}$$/ \
                    499:                        { sub(/${RUBY_STATICLIB}/, "$${RUBY_STATICLIB}"); }
                    500: PRINT_PLIST_AWK+=      /lib\/libruby${RUBY_VER}\.${RUBY_SLEXT}/ \
                    501:                        { sub(/${RUBY_VER}\.${RUBY_SLEXT}$$/, \
                    502:                        "$${RUBY_VER}.$${RUBY_SLEXT}"); }
                    503: PRINT_PLIST_AWK+=      /${RUBY_SHLIB}$$/ \
                    504:                        { sub(/${RUBY_SHLIB}$$/, "$${RUBY_SHLIB}"); }
                    505: PRINT_PLIST_AWK+=      /${RUBY_SLEXT}\.${RUBY_SHLIBVER}$$/ \
                    506:                        { sub(/${RUBY_SLEXT}\.${RUBY_SHLIBVER}$$/, \
                    507:                        "$${RUBY_SLEXT}.$${RUBY_SHLIBVER}"); }
                    508: .if ${RUBY_SHLIBALIAS} != "@comment"
                    509: PRINT_PLIST_AWK+=      /${RUBY_SHLIBALIAS:S/\//\\\//}$$/ \
                    510:                        { sub(/${RUBY_SHLIBALIAS:S/\//\\\//}$$/, \
                    511:                        "$${RUBY_SHLIBALIAS}"); }
1.49      taca      512: .endif
                    513: PRINT_PLIST_AWK+=      /^${RUBY_ARCHINC:S|/|\\/|g}/ \
                    514:                        { gsub(/${RUBY_ARCHINC:S|/|\\/|g}/, "$${RUBY_ARCHINC}"); \
                    515:                        print; next; }
                    516: PRINT_PLIST_AWK+=      /^${RUBY_INC:S|/|\\/|g}/ \
                    517:                        { gsub(/${RUBY_INC:S|/|\\/|g}/, "$${RUBY_INC}"); \
                    518:                        print; next; }
1.40      taca      519: PRINT_PLIST_AWK+=      /\.${RUBY_DLEXT}$$/ \
                    520:                        { gsub(/${RUBY_DLEXT}$$/, "$${RUBY_DLEXT}") }
1.47      joerg     521: PRINT_PLIST_AWK+=      /^${RUBY_ARCHLIB:S|/|\\/|g}/ \
1.40      taca      522:                        { gsub(/${RUBY_ARCHLIB:S|/|\\/|g}/, "$${RUBY_ARCHLIB}"); \
                    523:                        print; next; }
1.47      joerg     524: PRINT_PLIST_AWK+=      /^${RUBY_VENDORARCHLIB:S|/|\\/|g}/ \
1.40      taca      525:                        { gsub(/${RUBY_VENDORARCHLIB:S|/|\\/|g}/, "$${RUBY_VENDORARCHLIB}"); \
                    526:                        print; next; }
1.47      joerg     527: PRINT_PLIST_AWK+=      /^${RUBY_VENDORLIB:S|/|\\/|g}/ \
1.40      taca      528:                        { gsub(/${RUBY_VENDORLIB:S|/|\\/|g}/, "$${RUBY_VENDORLIB}"); \
                    529:                        print; next; }
1.47      joerg     530: PRINT_PLIST_AWK+=      /^${RUBY_SITEARCHLIB:S|/|\\/|g}/ \
1.40      taca      531:                        { gsub(/${RUBY_SITEARCHLIB:S|/|\\/|g}/, "$${RUBY_SITEARCHLIB}"); \
                    532:                        print; next; }
1.47      joerg     533: PRINT_PLIST_AWK+=      /^${RUBY_SITELIB:S|/|\\/|g}/ \
1.40      taca      534:                        { gsub(/${RUBY_SITELIB:S|/|\\/|g}/, "$${RUBY_SITELIB}"); \
                    535:                        print; next; }
1.49      taca      536: PRINT_PLIST_AWK+=      /^${RUBY_SITELIB_BASE:S|/|\\/|g}/ \
1.40      taca      537:                        { gsub(/${RUBY_SITELIB_BASE:S|/|\\/|g}/, "$${RUBY_SITELIB_BASE}"); \
                    538:                        print; next; }
1.49      taca      539: PRINT_PLIST_AWK+=      /^${RUBY_VENDORLIB_BASE:S|/|\\/|g}/ \
1.40      taca      540:                        { gsub(/${RUBY_VENDORLIB_BASE:S|/|\\/|g}/, "$${RUBY_VENDORLIB_BASE}"); \
                    541:                        print; next; }
1.47      joerg     542: PRINT_PLIST_AWK+=      /^${RUBY_LIB:S|/|\\/|g}/ \
1.40      taca      543:                        { gsub(/${RUBY_LIB:S|/|\\/|g}/, "$${RUBY_LIB}"); \
                    544:                        print; next; }
1.47      joerg     545: PRINT_PLIST_AWK+=      /^${RUBY_DOC:S|/|\\/|g}/ \
1.40      taca      546:                        { gsub(/${RUBY_DOC:S|/|\\/|g}/, "$${RUBY_DOC}"); \
                    547:                        print; next; }
1.47      joerg     548: PRINT_PLIST_AWK+=      /^${RUBY_EG:S|/|\\/|g}/ \
1.40      taca      549:                        { gsub(/${RUBY_EG:S|/|\\/|g}/, "$${RUBY_EG}"); \
                    550:                        print; next; }
1.47      joerg     551: PRINT_PLIST_AWK+=      /^${RUBY_SITERIDIR:S|/|\\/|g}/ \
1.40      taca      552:                        { gsub(/${RUBY_SITERIDIR:S|/|\\/|g}/, "$${RUBY_SITERIDIR}"); \
                    553:                        print; next; }
1.49      taca      554: PRINT_PLIST_AWK+=      /^${RUBY_SYSRIDIR:S|/|\\/|g}\// \
                    555:                        { next; }
                    556: PRINT_PLIST_AWK+=      /\/${RUBY_NAME}/ \
                    557:                        { sub(/${RUBY_NAME}/, "$${RUBY_NAME}"); }
1.65      taca      558: PRINT_PLIST_AWK+=      /^${GEM_HOME:S|/|\\/|g:S|.|\\.|g}/ \
                    559:                        { gsub(/${GEM_HOME:S|/|\\/|g}/, "$${GEM_HOME}"); }
1.40      taca      560: 
1.1       taca      561: .endif # _RUBY_MK

CVSweb <webmaster@jp.NetBSD.org>