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

1.15    ! taca        1: # $NetBSD: rubyversion.mk,v 1.14 2005/10/16 15:09:01 taca Exp $
1.1       taca        2: #
                      3: 
                      4: .ifndef _RUBYVERSION_MK
                      5: _RUBYVERSION_MK=       # defined
                      6: 
                      7: .include "../../mk/bsd.prefs.mk"
                      8: 
                      9: # current supported Ruby's version
                     10: RUBY16_VERSION?=       1.6.8
1.15    ! taca       11: RUBY18_VERSION?=       1.8.3
1.1       taca       12: 
                     13: # RUBY_VERSION_DEFAULT defines default version for Ruby related
                     14: #      packages and user can define in mk.conf.  (1.6 or 1.8)
                     15: #
                     16: RUBY_VERSION_DEFAULT?= 1.8
                     17: 
                     18: # RUBY_VERSION defines the specific Ruby's version which is supported
                     19: #      by the package.  It should be defined by packages whose distfiles
                     20: #      are contained by Ruby's release distribution.
                     21: #
                     22: #      Default value is set to ${RUBY_VERSION_DEFAULT}
                     23: #
                     24: .if !defined(RUBY_VERSION)
                     25: .if ${RUBY_VERSION_DEFAULT} == "1.6"
                     26: RUBY_VERSION?=         ${RUBY16_VERSION}
                     27: .elif ${RUBY_VERSION_DEFAULT} == "1.8"
                     28: RUBY_VERSION?=         ${RUBY18_VERSION}
                     29: .endif
                     30: .endif
                     31: 
                     32: # RUBY_VERSION_SUPPORTED defines the list of ${RUBY_VER} which is
                     33: #      supported by the package.  It should be defined by The pacakges
                     34: #      for specific version Ruby.
                     35: #
                     36: RUBY_VERSION_SUPPORTED?= 16 18
                     37: 
1.4       taca       38: # RUBY_VERSION_LIST defines the list of ${RUBY_VER} which is known to
                     39: #      this framework.
                     40: #
1.5       taca       41: RUBY_VERSION_LIST= 16,18
1.4       taca       42: 
1.1       taca       43: # RUBY_NOVERSION should be set to "Yes" if the package dosen't depend on
                     44: #      any specific version of ruby command.  In this case, package's
                     45: #      name begin with "ruby-".
                     46: #      If RUBY_NOVERSION is "No" (default), the package's name is begin
                     47: #      with ${RUBY_NAME}; "ruby16-", "ruby18" and so on.
                     48: #
                     49: #      It also affects to RUBY_DOCDIR, RUBY_EXAMPLESDIR...
                     50: #
                     51: RUBY_NOVERSION?=       No
                     52: 
                     53: # _RUBY_VER_MAJOR, _RUBY_VER_MINOR, _RUBY_VERS_TEENY is defined from
                     54: #      version of Ruby.  It could be used in packages' Makefile but
                     55: #      it isn't recommended.
                     56: #
                     57: _RUBY_VER_MAJOR=       ${RUBY_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\1/}
                     58: _RUBY_VER_MINOR=       ${RUBY_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\2/}
                     59: _RUBY_VERS_TEENY=      ${RUBY_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\3/}
                     60: 
                     61: # RUBY_VER defines Ruby base release.
                     62: #
                     63: RUBY_VER=              ${_RUBY_VER_MAJOR}${_RUBY_VER_MINOR}
                     64: 
1.3       taca       65: #
1.6       taca       66: # RUBY_HAS_ARCHLIB     This package contains machine dependent binaries.
                     67: # RUBY_REQD            Minimum required Ruby's version
1.3       taca       68: #
1.6       taca       69: .if defined(RUBY_HAS_ARCHLIB) && empty(RUBY_HAS_ARCHLIB:M[nN][oO])
                     70: .if ${RUBY_VER} == "16"
                     71: RUBY_REQD?=            ${RUBY16_VERSION}
                     72: .elif ${RUBY_VER} == "18"
                     73: RUBY_REQD?=            ${RUBY18_VERSION}
                     74: .endif
                     75: .else
1.3       taca       76: .if ${RUBY_VER} == "16"
                     77: RUBY_REQD?=            1.6.8
                     78: .elif ${RUBY_VER} == "18"
                     79: RUBY_REQD?=            1.8.1
                     80: .endif
1.6       taca       81: .endif
1.3       taca       82: 
1.1       taca       83: # RUBY_SUFFIX is appended to Ruby's commands; ruby, irb and so on.
                     84: #
                     85: RUBY_SUFFIX?=          ${RUBY_VER}
                     86: 
                     87: # RUBY_NAME defines executable's name of Ruby itself.
                     88: #
                     89: RUBY_NAME?=            ruby${RUBY_SUFFIX}
                     90: 
1.10      taca       91: # RUBY_BASE is base of ruby package's name
                     92: #
                     93: RUBY_BASE=             ruby${RUBY_VER}-base
                     94: 
1.1       taca       95: # RUBY_PKGPREFIX is prefix part for ruby based packages.
                     96: #
                     97: RUBY_PKGPREFIX?=       ${RUBY_NAME}
                     98: 
                     99: # RUBY_VER_DIR is used as part of  Ruby's library directories.
                    100: #
                    101: RUBY_VER_DIR?=         ${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}
                    102: 
                    103: # Simple check for package availability with Ruby's version.
                    104: #
                    105: .if empty(RUBY_VERSION_SUPPORTED:M${RUBY_VER})
                    106: PKG_FAIL_REASON+= "This package isn't supported by ${RUBY_NAME}."
                    107: .endif
                    108: 
                    109: # RUBY_NOVERSION specifies that package dosen't depends on any
                    110: # version of Ruby.
                    111: #
                    112: .if empty(RUBY_NOVERSION:M[nN][oO])
                    113: RUBY_SUFFIX=
                    114: RUBY_NAME=             ruby
                    115: .endif
                    116: 
                    117: # RUBY related command's full pathname.
                    118: #
1.15    ! taca      119: RUBY?=                 ${PREFIX}/bin/${RUBY_NAME}
        !           120: RDOC?=                 ${PREFIX}/bin/rdoc${RUBY_VER}
1.1       taca      121: 
                    122: #
                    123: # RUBY_ARCH is used architecture depended direcotry name.
                    124: #
1.9       taca      125: .if ${OPSYS} == "Linux" && ${RUBY_VER} == "16"
                    126: RUBY_ARCH?= ${LOWER_ARCH}-${LOWER_OPSYS}-gnu
                    127: .else
1.1       taca      128: RUBY_ARCH?= ${LOWER_ARCH}-${LOWER_OPSYS}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX}
1.9       taca      129: .endif
1.1       taca      130: 
                    131: #
1.10      taca      132: # Ruby shared library version handling.
                    133: #
                    134: RUBY_SHLIBMAJOR?=      ${_RUBY_VER_MAJOR}
                    135: RUBY_SHLIBVER?=                ${RUBY_VERSION}
                    136: 
                    137: .if ${OPSYS} == "NetBSD" || ${OPSYS} == "Interix"
                    138: RUBY_SHLIBMAJOR=       ${RUBY_VER}
                    139: RUBY_SHLIBVER=         ${RUBY_VER}.${_RUBY_VERS_TEENY}
1.12      jlam      140: .elif ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly"
1.10      taca      141: RUBY_SHLIBMAJOR=       # unused
1.12      jlam      142: RUBY_SHLIBVER=         ${RUBY_VER}
1.10      taca      143: .elif ${OPSYS} == "OpenBSD"
                    144: RUBY_SHLIBMAJOR=       # unused
                    145: RUBY_SHLIBVER=         ${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}${_RUBY_VERS_TEENY}
                    146: .elif ${OPSYS} == "IRIX"
                    147: RUBY_SHLIBMAJOR=       # unused
                    148: .elif ${OPSYS} == "Linux"
                    149: RUBY_SHLIBMAJOR=       ${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}
                    150: .endif
                    151: 
                    152: .if empty(RUBY_SHLIBMAJOR)
                    153: RUBY_NOSHLIBMAJOR=     "@comment "
                    154: .else
                    155: RUBY_NOSHLIBMAJOR=
                    156: .endif
                    157: 
                    158: #
1.5       taca      159: # RUBY_DLEXT is suffix of extention library.
                    160: #
                    161: .if ${OPSYS} == "Darwin"
                    162: RUBY_DLEXT=    bundle
                    163: .else
                    164: RUBY_DLEXT=    so
                    165: .endif
                    166: 
                    167: #
1.10      taca      168: # source directory
                    169: #
                    170: RUBY_SRCDIR?=  ${_PKGSRC_TOPDIR}/lang/${RUBY_BASE}
                    171: 
                    172: #
1.1       taca      173: # common PATH
                    174: #
1.15    ! taca      175: RUBY_LIBDIR?=          ${PREFIX}/lib/ruby/${RUBY_VER_DIR}
1.1       taca      176: RUBY_ARCHLIBDIR?=      ${RUBY_LIBDIR}/${RUBY_ARCH}
1.15    ! taca      177: RUBY_SITELIBDIR?=      ${PREFIX}/lib/ruby/site_ruby/${RUBY_VER_DIR}
1.1       taca      178: RUBY_SITEARCHLIBDIR?=  ${RUBY_SITELIBDIR}/${RUBY_ARCH}
1.15    ! taca      179: RUBY_DOCDIR?=          ${PREFIX}/share/doc/${RUBY_NAME}
        !           180: RUBY_EXAMPLESDIR?=     ${PREFIX}/share/examples/${RUBY_NAME}
        !           181: RUBY_RIDIR?=           ${PREFIX}/share/ri
        !           182: RUBY_BASERIDIR?=       ${RUBY_RIDIR}/${RUBY_VER_DIR}
        !           183: RUBY_SYSRIDIR?=                ${RUBY_BASERIDIR}/system
        !           184: RUBY_SITERIDIR?=       ${RUBY_BASERIDIR}/site
1.1       taca      185: 
                    186: #
1.14      taca      187: # set ruby reletaed package to common DIST_SUBDIR
1.1       taca      188: #
1.14      taca      189: _RUBY_DIST_SUBDIR?=    ruby
                    190: .if defined(USE_RUBY_DIST_SUBDIR) && !empty(USE_RUBY_DIST_SUBDIR:M[yY][eE][sS])
                    191: DIST_SUBDIR?=          ${_RUBY_DIST_SUBDIR}
1.13      taca      192: .endif
                    193: 
                    194: #
1.1       taca      195: # MAKE_ENV
                    196: #
1.15    ! taca      197: MAKE_ENV+=             RUBY="${RUBY}" RUBY_VER="${RUBY_VER}" \
1.10      taca      198:                        RUBY_VERSION="${RUBY_VERSION}" \
1.15    ! taca      199:                        RUBY_VERSION_DEFAULT="${RUBY_VERSION_DEFAULT}"
        !           200: 
        !           201: MAKEFLAGS+=            RUBY_VERSION="${RUBY_VERSION}" \
        !           202:                        RUBY_VERSION_DEFAULT="${RUBY_VERSION_DEFAULT}"
        !           203: 
1.1       taca      204: # PLIST
                    205: #
                    206: PLIST_RUBY_DIRS=       RUBY_LIBDIR="${RUBY_LIBDIR}" \
                    207:                        RUBY_ARCHLIBDIR="${RUBY_ARCHLIBDIR}" \
                    208:                        RUBY_SITELIBDIR="${RUBY_SITELIBDIR}" \
                    209:                        RUBY_SITEARCHLIBDIR="${RUBY_SITEARCHLIBDIR}" \
                    210:                        RUBY_DOCDIR="${RUBY_DOCDIR}" \
1.5       taca      211:                        RUBY_EXAMPLESDIR="${RUBY_EXAMPLESDIR}" \
1.15    ! taca      212:                        RUBY_RIDIR="${RUBY_RIDIR}" \
        !           213:                        RUBY_BASERIDIR="${RUBY_BASERIDIR}" \
        !           214:                        RUBY_SYSRIDIR="${RUBY_SYSRIDIR}" \
        !           215:                        RUBY_SITERIDIR="${RUBY_SITERIDIR}"
1.1       taca      216: 
1.14      taca      217: #
                    218: # substitutions
                    219: #
1.15    ! taca      220: FILES_SUBST+=          RUBY="${RUBY}" RUBY_NAME="${RUBY_NAME}" \
        !           221:                        RUBY_PKGPREFIX="${RUBY_PKGPREFIX}" \
        !           222:                        RUBY_VER="${RUBY_VER}" \
        !           223:                        ${PLIST_RUBY_DIRS}
1.14      taca      224: 
1.15    ! taca      225: MESSAGE_SUBST+=                RUBY="${RUBY}" RUBY_VER="${RUBY_VER}" \
1.14      taca      226:                        RUBY_VERSION="${RUBY_VERSION}" \
1.15    ! taca      227:                        RUBY_PKGPREFIX="${RUBY_PKGPREFIX}" \
        !           228:                        ${PLIST_RUBY_DIRS:S,DIR="${PREFIX}/,DIR=",}
1.14      taca      229: 
1.15    ! taca      230: PLIST_SUBST+=          RUBY="${RUBY}" RUBY_VER="${RUBY_VER}" \
1.10      taca      231:                        RUBY_VERSION="${RUBY_VERSION}" \
1.11      taca      232:                        RUBY_VER_DIR="${RUBY_VER_DIR}" \
1.15    ! taca      233:                        RUBY_DLEXT="${RUBY_DLEXT}" \
        !           234:                        ${PLIST_RUBY_DIRS:S,DIR="${PREFIX}/,DIR=",}
1.1       taca      235: 
                    236: .endif # _RUBY_MK

CVSweb <webmaster@jp.NetBSD.org>