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

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

CVSweb <webmaster@jp.NetBSD.org>