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

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

CVSweb <webmaster@jp.NetBSD.org>