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

1.34    ! taca        1: # $NetBSD: rubyversion.mk,v 1.33 2007/05/17 14:42:32 taca 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.32      taca       10: RUBY18_VERSION=                1.8.6
1.23      taca       11: 
1.32      taca       12: # patch
1.34    ! taca       13: RUBY18_PATCHLEVEL=     36
1.1       taca       14: 
                     15: # RUBY_VERSION_DEFAULT defines default version for Ruby related
                     16: #      packages and user can define in mk.conf.  (1.6 or 1.8)
                     17: #
                     18: RUBY_VERSION_DEFAULT?= 1.8
                     19: 
                     20: # RUBY_VERSION defines the specific Ruby's version which is supported
                     21: #      by the package.  It should be defined by packages whose distfiles
                     22: #      are contained by Ruby's release distribution.
                     23: #
                     24: #      Default value is set to ${RUBY_VERSION_DEFAULT}
                     25: #
1.16      taca       26: .if ${RUBY_VERSION_DEFAULT} == "1.8"
1.1       taca       27: RUBY_VERSION?=         ${RUBY18_VERSION}
1.33      taca       28: RUBY_PATCH_LEVEL?=     ${RUBY18_PATCHLEVEL}
1.1       taca       29: .endif
1.29      taca       30: 
1.32      taca       31: .if !empty(RUBY_PATCH_LEVEL)
                     32: RUBY_VERSION_SUFFIX=   ${RUBY_VERSION}.${RUBY_PATCH_LEVEL}
                     33: .else
                     34: RUBY_VERSION_SUFFIX=   ${RUBY_VERSION}
                     35: .endif
1.1       taca       36: 
                     37: # RUBY_VERSION_SUPPORTED defines the list of ${RUBY_VER} which is
1.19      abs        38: #      supported by the package.  It should be defined by the packages
                     39: #      for specific Ruby versions.
1.1       taca       40: #
1.16      taca       41: RUBY_VERSION_SUPPORTED?= 18
1.1       taca       42: 
1.4       taca       43: # RUBY_VERSION_LIST defines the list of ${RUBY_VER} which is known to
                     44: #      this framework.
                     45: #
1.16      taca       46: RUBY_VERSION_LIST= 18
1.4       taca       47: 
1.1       taca       48: # RUBY_NOVERSION should be set to "Yes" if the package dosen't depend on
                     49: #      any specific version of ruby command.  In this case, package's
                     50: #      name begin with "ruby-".
                     51: #      If RUBY_NOVERSION is "No" (default), the package's name is begin
1.16      taca       52: #      with ${RUBY_NAME}; "ruby18", "ruby19",  and so on.
1.1       taca       53: #
                     54: #      It also affects to RUBY_DOCDIR, RUBY_EXAMPLESDIR...
                     55: #
                     56: RUBY_NOVERSION?=       No
                     57: 
1.29      taca       58: # _RUBY_VER_MAJOR, _RUBY_VER_MINOR, _RUBY_VER_TEENY and _RUBY_PATCHLEVEL
                     59: # is defined from version of Ruby.  It should not be used in packages'
                     60: # Makefile.
                     61: #
                     62: _RUBY_VER=             ${RUBY_VERSION:C/(-.*)//}
                     63: _RUBY_VER_MAJOR=       ${_RUBY_VER:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\1/}
                     64: _RUBY_VER_MINOR=       ${_RUBY_VER:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\2/}
                     65: _RUBY_VER_TEENY=       ${_RUBY_VER:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\3/}
                     66: _RUBY_PATCHLEVEL=      ${RUBY_VERSION:C/(.*-)//}
1.1       taca       67: 
                     68: # RUBY_VER defines Ruby base release.
                     69: #
                     70: RUBY_VER=              ${_RUBY_VER_MAJOR}${_RUBY_VER_MINOR}
                     71: 
1.3       taca       72: #
1.6       taca       73: # RUBY_HAS_ARCHLIB     This package contains machine dependent binaries.
                     74: # RUBY_REQD            Minimum required Ruby's version
1.3       taca       75: #
1.6       taca       76: .if defined(RUBY_HAS_ARCHLIB) && empty(RUBY_HAS_ARCHLIB:M[nN][oO])
1.16      taca       77: .if ${RUBY_VER} == "18"
1.6       taca       78: RUBY_REQD?=            ${RUBY18_VERSION}
                     79: .endif
                     80: .else
1.16      taca       81: .if ${RUBY_VER} == "18"
1.3       taca       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: #
1.15      taca      122: RUBY?=                 ${PREFIX}/bin/${RUBY_NAME}
                    123: RDOC?=                 ${PREFIX}/bin/rdoc${RUBY_VER}
1.1       taca      124: 
                    125: #
1.17      minskim   126: # RUBY_ARCH is used as architecture-dependent directory name.
1.1       taca      127: #
                    128: RUBY_ARCH?= ${LOWER_ARCH}-${LOWER_OPSYS}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX}
                    129: 
                    130: #
1.10      taca      131: # Ruby shared library version handling.
                    132: #
                    133: RUBY_SHLIBMAJOR?=      ${_RUBY_VER_MAJOR}
                    134: RUBY_SHLIBVER?=                ${RUBY_VERSION}
                    135: 
                    136: .if ${OPSYS} == "NetBSD" || ${OPSYS} == "Interix"
                    137: RUBY_SHLIBMAJOR=       ${RUBY_VER}
1.29      taca      138: RUBY_SHLIBVER=         ${RUBY_VER}.${_RUBY_VER_TEENY}
1.12      jlam      139: .elif ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly"
1.10      taca      140: RUBY_SHLIBMAJOR=       # unused
1.12      jlam      141: RUBY_SHLIBVER=         ${RUBY_VER}
1.10      taca      142: .elif ${OPSYS} == "OpenBSD"
                    143: RUBY_SHLIBMAJOR=       # unused
1.29      taca      144: RUBY_SHLIBVER=         ${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}${_RUBY_VER_TEENY}
1.10      taca      145: .elif ${OPSYS} == "IRIX"
                    146: RUBY_SHLIBMAJOR=       # unused
                    147: .elif ${OPSYS} == "Linux"
                    148: RUBY_SHLIBMAJOR=       ${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}
                    149: .endif
                    150: 
                    151: .if empty(RUBY_SHLIBMAJOR)
                    152: RUBY_NOSHLIBMAJOR=     "@comment "
                    153: .else
                    154: RUBY_NOSHLIBMAJOR=
                    155: .endif
                    156: 
1.25      taca      157: 
1.10      taca      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.26      taca      168: # Use pthread library with Ruby
                    169: #
                    170: .if ${OPSYS} == "NetBSD" && !empty(OS_VERSION:M1.[0-9].*)
                    171: RUBY_USE_PTHREAD?=     no
                    172: .else
                    173: RUBY_USE_PTHREAD?=     yes
                    174: PTHREAD_OPTS+=         native
1.27      taca      175: PTHREAD_AUTO_VARS=     yes
1.26      taca      176: .endif
                    177: 
                    178: #
1.23      taca      179: # Dynamic PLIST directories
                    180: #
                    181: RUBY_DYNAMIC_DIRS?=    # empty
                    182: 
                    183: #
1.10      taca      184: # source directory
                    185: #
                    186: RUBY_SRCDIR?=  ${_PKGSRC_TOPDIR}/lang/${RUBY_BASE}
                    187: 
                    188: #
1.23      taca      189: # common paths
1.1       taca      190: #
1.15      taca      191: RUBY_LIBDIR?=          ${PREFIX}/lib/ruby/${RUBY_VER_DIR}
1.1       taca      192: RUBY_ARCHLIBDIR?=      ${RUBY_LIBDIR}/${RUBY_ARCH}
1.15      taca      193: RUBY_SITELIBDIR?=      ${PREFIX}/lib/ruby/site_ruby/${RUBY_VER_DIR}
1.1       taca      194: RUBY_SITEARCHLIBDIR?=  ${RUBY_SITELIBDIR}/${RUBY_ARCH}
1.15      taca      195: RUBY_DOCDIR?=          ${PREFIX}/share/doc/${RUBY_NAME}
                    196: RUBY_EXAMPLESDIR?=     ${PREFIX}/share/examples/${RUBY_NAME}
1.31      taca      197: 
                    198: #
                    199: # ri database relative path
                    200: #
                    201: RUBY_RIDIR?=           share/ri
1.15      taca      202: RUBY_BASERIDIR?=       ${RUBY_RIDIR}/${RUBY_VER_DIR}
                    203: RUBY_SYSRIDIR?=                ${RUBY_BASERIDIR}/system
                    204: RUBY_SITERIDIR?=       ${RUBY_BASERIDIR}/site
1.1       taca      205: 
                    206: #
                    207: # MAKE_ENV
                    208: #
1.18      rillig    209: MAKE_ENV+=             RUBY=${RUBY:Q} RUBY_VER=${RUBY_VER:Q} \
                    210:                        RUBY_VERSION=${RUBY_VERSION:Q} \
                    211:                        RUBY_VERSION_DEFAULT=${RUBY_VERSION_DEFAULT:Q}
1.15      taca      212: 
1.18      rillig    213: MAKEFLAGS+=            RUBY_VERSION=${RUBY_VERSION:Q} \
                    214:                        RUBY_VERSION_DEFAULT=${RUBY_VERSION_DEFAULT:Q}
1.15      taca      215: 
1.1       taca      216: # PLIST
                    217: #
                    218: PLIST_RUBY_DIRS=       RUBY_LIBDIR="${RUBY_LIBDIR}" \
                    219:                        RUBY_ARCHLIBDIR="${RUBY_ARCHLIBDIR}" \
                    220:                        RUBY_SITELIBDIR="${RUBY_SITELIBDIR}" \
                    221:                        RUBY_SITEARCHLIBDIR="${RUBY_SITEARCHLIBDIR}" \
                    222:                        RUBY_DOCDIR="${RUBY_DOCDIR}" \
1.5       taca      223:                        RUBY_EXAMPLESDIR="${RUBY_EXAMPLESDIR}" \
1.15      taca      224:                        RUBY_RIDIR="${RUBY_RIDIR}" \
                    225:                        RUBY_BASERIDIR="${RUBY_BASERIDIR}" \
                    226:                        RUBY_SYSRIDIR="${RUBY_SYSRIDIR}" \
                    227:                        RUBY_SITERIDIR="${RUBY_SITERIDIR}"
1.1       taca      228: 
1.14      taca      229: #
                    230: # substitutions
                    231: #
1.18      rillig    232: FILES_SUBST+=          RUBY=${RUBY:Q} RUBY_NAME=${RUBY_NAME:Q} \
                    233:                        RUBY_PKGPREFIX=${RUBY_PKGPREFIX:Q} \
                    234:                        RUBY_VER=${RUBY_VER:Q} \
1.15      taca      235:                        ${PLIST_RUBY_DIRS}
1.14      taca      236: 
1.15      taca      237: MESSAGE_SUBST+=                RUBY="${RUBY}" RUBY_VER="${RUBY_VER}" \
1.14      taca      238:                        RUBY_VERSION="${RUBY_VERSION}" \
1.15      taca      239:                        RUBY_PKGPREFIX="${RUBY_PKGPREFIX}" \
                    240:                        ${PLIST_RUBY_DIRS:S,DIR="${PREFIX}/,DIR=",}
1.14      taca      241: 
1.18      rillig    242: PLIST_SUBST+=          RUBY=${RUBY:Q} RUBY_VER=${RUBY_VER:Q} \
                    243:                        RUBY_VERSION=${RUBY_VERSION:Q} \
                    244:                        RUBY_VER_DIR=${RUBY_VER_DIR:Q} \
                    245:                        RUBY_DLEXT=${RUBY_DLEXT:Q} \
1.15      taca      246:                        ${PLIST_RUBY_DIRS:S,DIR="${PREFIX}/,DIR=",}
1.1       taca      247: 
1.22      taca      248: #
1.23      taca      249: # make dynamic PLIST
1.22      taca      250: #
1.23      taca      251: .if !empty(RUBY_DYNAMIC_DIRS)
                    252: 
                    253: RUBY_PLIST_DYNAMIC=    ${WRKDIR}/PLIST.work
                    254: 
                    255: .if !defined(PLIST_SRC)
                    256: .  if exists(${PKGDIR}/PLIST.common)
                    257: PLIST_SRC+=            ${PKGDIR}/PLIST.common
                    258: .  elif exists(${PKGDIR}/PLIST)
                    259: PLIST_SRC+=            ${PKGDIR}/PLIST
                    260: .  endif
                    261: 
                    262: PLIST_SRC+=            ${RUBY_PLIST_DYNAMIC}
                    263: 
                    264: .  if exists(${PKGDIR}/PLIST.common_end)
                    265: PLIST_SRC+=            ${PKGDIR}/PLIST.common_end
                    266: .  endif
                    267: 
                    268: .endif
                    269: 
                    270: RUBY_PLIST_COMMENT_CMD= \
                    271:        ${ECHO} "@comment The following lines are automatically generated"
                    272: RUBY_PLIST_FILES_CMD= ( cd ${PREFIX}; \
                    273:        ${FIND} ${RUBY_DYNAMIC_DIRS} \( -type f -o -type l \) -print ) | \
                    274:        ${SORT} -u
                    275: RUBY_PLIST_DIRS_CMD= ( cd ${PREFIX}; \
                    276:        ${FIND} ${RUBY_DYNAMIC_DIRS} -type d -print ) | ${SORT} -ru | \
                    277:        ${SED} -e 's|^|@dirrm |'
                    278: RUBY_GENERATE_PLIST =  ( \
                    279:        ${RUBY_PLIST_COMMENT_CMD}; \
                    280:        ${RUBY_PLIST_FILES_CMD}; \
                    281:        ${RUBY_PLIST_DIRS_CMD} ) > ${RUBY_PLIST_DYNAMIC}
1.22      taca      282: .endif
1.23      taca      283: 
                    284: .if !empty(RUBY_NOVERSION:M[nN][oO])
1.26      taca      285: .if empty(RUBY_USE_PTHREAD:M[nN][oO])
1.22      taca      286: .include "../../mk/pthread.buildlink3.mk"
1.23      taca      287: .endif
                    288: .include "../../mk/bdb.buildlink3.mk"
1.28      taca      289: .include "../../converters/libiconv/buildlink3.mk"
1.22      taca      290: .include "../../devel/zlib/buildlink3.mk"
                    291: .include "../../security/openssl/buildlink3.mk"
1.23      taca      292: .include "../../mk/dlopen.buildlink3.mk"
1.22      taca      293: .endif
                    294: 
1.1       taca      295: .endif # _RUBY_MK

CVSweb <webmaster@jp.NetBSD.org>