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

1.25    ! taca        1: # $NetBSD: rubyversion.mk,v 1.24 2006/09/08 02:36:51 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.23      taca       10: RUBY18_VERSION?=       1.8.5
                     11: 
                     12: #
                     13: RUBY18_PATCH_DATE=     20060906
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: #
                     26: .if !defined(RUBY_VERSION)
1.16      taca       27: .if ${RUBY_VERSION_DEFAULT} == "1.8"
1.1       taca       28: RUBY_VERSION?=         ${RUBY18_VERSION}
                     29: .endif
                     30: .endif
                     31: 
                     32: # RUBY_VERSION_SUPPORTED defines the list of ${RUBY_VER} which is
1.19      abs        33: #      supported by the package.  It should be defined by the packages
                     34: #      for specific Ruby versions.
1.1       taca       35: #
1.16      taca       36: RUBY_VERSION_SUPPORTED?= 18
1.1       taca       37: 
1.4       taca       38: # RUBY_VERSION_LIST defines the list of ${RUBY_VER} which is known to
                     39: #      this framework.
                     40: #
1.16      taca       41: RUBY_VERSION_LIST= 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
1.16      taca       47: #      with ${RUBY_NAME}; "ruby18", "ruby19",  and so on.
1.1       taca       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])
1.16      taca       70: .if ${RUBY_VER} == "18"
1.6       taca       71: RUBY_REQD?=            ${RUBY18_VERSION}
                     72: .endif
                     73: .else
1.16      taca       74: .if ${RUBY_VER} == "18"
1.3       taca       75: RUBY_REQD?=            1.8.1
                     76: .endif
1.6       taca       77: .endif
1.3       taca       78: 
1.1       taca       79: # RUBY_SUFFIX is appended to Ruby's commands; ruby, irb and so on.
                     80: #
                     81: RUBY_SUFFIX?=          ${RUBY_VER}
                     82: 
                     83: # RUBY_NAME defines executable's name of Ruby itself.
                     84: #
                     85: RUBY_NAME?=            ruby${RUBY_SUFFIX}
                     86: 
1.10      taca       87: # RUBY_BASE is base of ruby package's name
                     88: #
                     89: RUBY_BASE=             ruby${RUBY_VER}-base
                     90: 
1.1       taca       91: # RUBY_PKGPREFIX is prefix part for ruby based packages.
                     92: #
                     93: RUBY_PKGPREFIX?=       ${RUBY_NAME}
                     94: 
                     95: # RUBY_VER_DIR is used as part of  Ruby's library directories.
                     96: #
                     97: RUBY_VER_DIR?=         ${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}
                     98: 
                     99: # Simple check for package availability with Ruby's version.
                    100: #
                    101: .if empty(RUBY_VERSION_SUPPORTED:M${RUBY_VER})
                    102: PKG_FAIL_REASON+= "This package isn't supported by ${RUBY_NAME}."
                    103: .endif
                    104: 
                    105: # RUBY_NOVERSION specifies that package dosen't depends on any
                    106: # version of Ruby.
                    107: #
                    108: .if empty(RUBY_NOVERSION:M[nN][oO])
                    109: RUBY_SUFFIX=
                    110: RUBY_NAME=             ruby
                    111: .endif
                    112: 
                    113: # RUBY related command's full pathname.
                    114: #
1.15      taca      115: RUBY?=                 ${PREFIX}/bin/${RUBY_NAME}
                    116: RDOC?=                 ${PREFIX}/bin/rdoc${RUBY_VER}
1.1       taca      117: 
                    118: #
1.17      minskim   119: # RUBY_ARCH is used as architecture-dependent directory name.
1.1       taca      120: #
                    121: RUBY_ARCH?= ${LOWER_ARCH}-${LOWER_OPSYS}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX}
                    122: 
                    123: #
1.10      taca      124: # Ruby shared library version handling.
                    125: #
                    126: RUBY_SHLIBMAJOR?=      ${_RUBY_VER_MAJOR}
                    127: RUBY_SHLIBVER?=                ${RUBY_VERSION}
                    128: 
                    129: .if ${OPSYS} == "NetBSD" || ${OPSYS} == "Interix"
                    130: RUBY_SHLIBMAJOR=       ${RUBY_VER}
                    131: RUBY_SHLIBVER=         ${RUBY_VER}.${_RUBY_VERS_TEENY}
1.12      jlam      132: .elif ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly"
1.10      taca      133: RUBY_SHLIBMAJOR=       # unused
1.12      jlam      134: RUBY_SHLIBVER=         ${RUBY_VER}
1.10      taca      135: .elif ${OPSYS} == "OpenBSD"
                    136: RUBY_SHLIBMAJOR=       # unused
                    137: RUBY_SHLIBVER=         ${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}${_RUBY_VERS_TEENY}
                    138: .elif ${OPSYS} == "IRIX"
                    139: RUBY_SHLIBMAJOR=       # unused
                    140: .elif ${OPSYS} == "Linux"
                    141: RUBY_SHLIBMAJOR=       ${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}
                    142: .endif
                    143: 
                    144: .if empty(RUBY_SHLIBMAJOR)
                    145: RUBY_NOSHLIBMAJOR=     "@comment "
                    146: .else
                    147: RUBY_NOSHLIBMAJOR=
                    148: .endif
                    149: 
1.25    ! taca      150: .if ${OPSYS} == "NetBSD" && !empty(OS_VERSION:M1.[0-9].*)
        !           151: RUBY_NOPTHREAD=        yes
        !           152: .else
        !           153: RUBY_NOPTHREAD=        no
        !           154: .endif
        !           155: 
1.10      taca      156: #
1.5       taca      157: # RUBY_DLEXT is suffix of extention library.
                    158: #
                    159: .if ${OPSYS} == "Darwin"
                    160: RUBY_DLEXT=    bundle
                    161: .else
                    162: RUBY_DLEXT=    so
                    163: .endif
                    164: 
                    165: #
1.23      taca      166: # Dynamic PLIST directories
                    167: #
                    168: RUBY_DYNAMIC_DIRS?=    # empty
                    169: 
                    170: #
1.10      taca      171: # source directory
                    172: #
                    173: RUBY_SRCDIR?=  ${_PKGSRC_TOPDIR}/lang/${RUBY_BASE}
                    174: 
                    175: #
1.23      taca      176: # common paths
1.1       taca      177: #
1.15      taca      178: RUBY_LIBDIR?=          ${PREFIX}/lib/ruby/${RUBY_VER_DIR}
1.1       taca      179: RUBY_ARCHLIBDIR?=      ${RUBY_LIBDIR}/${RUBY_ARCH}
1.15      taca      180: RUBY_SITELIBDIR?=      ${PREFIX}/lib/ruby/site_ruby/${RUBY_VER_DIR}
1.1       taca      181: RUBY_SITEARCHLIBDIR?=  ${RUBY_SITELIBDIR}/${RUBY_ARCH}
1.15      taca      182: RUBY_DOCDIR?=          ${PREFIX}/share/doc/${RUBY_NAME}
                    183: RUBY_EXAMPLESDIR?=     ${PREFIX}/share/examples/${RUBY_NAME}
                    184: RUBY_RIDIR?=           ${PREFIX}/share/ri
                    185: RUBY_BASERIDIR?=       ${RUBY_RIDIR}/${RUBY_VER_DIR}
                    186: RUBY_SYSRIDIR?=                ${RUBY_BASERIDIR}/system
                    187: RUBY_SITERIDIR?=       ${RUBY_BASERIDIR}/site
1.1       taca      188: 
                    189: #
                    190: # MAKE_ENV
                    191: #
1.18      rillig    192: MAKE_ENV+=             RUBY=${RUBY:Q} RUBY_VER=${RUBY_VER:Q} \
                    193:                        RUBY_VERSION=${RUBY_VERSION:Q} \
                    194:                        RUBY_VERSION_DEFAULT=${RUBY_VERSION_DEFAULT:Q}
1.15      taca      195: 
1.18      rillig    196: MAKEFLAGS+=            RUBY_VERSION=${RUBY_VERSION:Q} \
                    197:                        RUBY_VERSION_DEFAULT=${RUBY_VERSION_DEFAULT:Q}
1.15      taca      198: 
1.1       taca      199: # PLIST
                    200: #
                    201: PLIST_RUBY_DIRS=       RUBY_LIBDIR="${RUBY_LIBDIR}" \
                    202:                        RUBY_ARCHLIBDIR="${RUBY_ARCHLIBDIR}" \
                    203:                        RUBY_SITELIBDIR="${RUBY_SITELIBDIR}" \
                    204:                        RUBY_SITEARCHLIBDIR="${RUBY_SITEARCHLIBDIR}" \
                    205:                        RUBY_DOCDIR="${RUBY_DOCDIR}" \
1.5       taca      206:                        RUBY_EXAMPLESDIR="${RUBY_EXAMPLESDIR}" \
1.15      taca      207:                        RUBY_RIDIR="${RUBY_RIDIR}" \
                    208:                        RUBY_BASERIDIR="${RUBY_BASERIDIR}" \
                    209:                        RUBY_SYSRIDIR="${RUBY_SYSRIDIR}" \
                    210:                        RUBY_SITERIDIR="${RUBY_SITERIDIR}"
1.1       taca      211: 
1.14      taca      212: #
                    213: # substitutions
                    214: #
1.18      rillig    215: FILES_SUBST+=          RUBY=${RUBY:Q} RUBY_NAME=${RUBY_NAME:Q} \
                    216:                        RUBY_PKGPREFIX=${RUBY_PKGPREFIX:Q} \
                    217:                        RUBY_VER=${RUBY_VER:Q} \
1.15      taca      218:                        ${PLIST_RUBY_DIRS}
1.14      taca      219: 
1.15      taca      220: MESSAGE_SUBST+=                RUBY="${RUBY}" RUBY_VER="${RUBY_VER}" \
1.14      taca      221:                        RUBY_VERSION="${RUBY_VERSION}" \
1.15      taca      222:                        RUBY_PKGPREFIX="${RUBY_PKGPREFIX}" \
                    223:                        ${PLIST_RUBY_DIRS:S,DIR="${PREFIX}/,DIR=",}
1.14      taca      224: 
1.18      rillig    225: PLIST_SUBST+=          RUBY=${RUBY:Q} RUBY_VER=${RUBY_VER:Q} \
                    226:                        RUBY_VERSION=${RUBY_VERSION:Q} \
                    227:                        RUBY_VER_DIR=${RUBY_VER_DIR:Q} \
                    228:                        RUBY_DLEXT=${RUBY_DLEXT:Q} \
1.15      taca      229:                        ${PLIST_RUBY_DIRS:S,DIR="${PREFIX}/,DIR=",}
1.1       taca      230: 
1.22      taca      231: #
1.23      taca      232: # make dynamic PLIST
1.22      taca      233: #
1.23      taca      234: .if !empty(RUBY_DYNAMIC_DIRS)
                    235: 
                    236: RUBY_PLIST_DYNAMIC=    ${WRKDIR}/PLIST.work
                    237: 
                    238: .if !defined(PLIST_SRC)
                    239: .  if exists(${PKGDIR}/PLIST.common)
                    240: PLIST_SRC+=            ${PKGDIR}/PLIST.common
                    241: .  elif exists(${PKGDIR}/PLIST)
                    242: PLIST_SRC+=            ${PKGDIR}/PLIST
                    243: .  endif
                    244: 
                    245: PLIST_SRC+=            ${RUBY_PLIST_DYNAMIC}
                    246: 
                    247: .  if exists(${PKGDIR}/PLIST.common_end)
                    248: PLIST_SRC+=            ${PKGDIR}/PLIST.common_end
                    249: .  endif
                    250: 
                    251: .endif
                    252: 
                    253: RUBY_PLIST_COMMENT_CMD= \
                    254:        ${ECHO} "@comment The following lines are automatically generated"
                    255: RUBY_PLIST_FILES_CMD= ( cd ${PREFIX}; \
                    256:        ${FIND} ${RUBY_DYNAMIC_DIRS} \( -type f -o -type l \) -print ) | \
                    257:        ${SORT} -u
                    258: RUBY_PLIST_DIRS_CMD= ( cd ${PREFIX}; \
                    259:        ${FIND} ${RUBY_DYNAMIC_DIRS} -type d -print ) | ${SORT} -ru | \
                    260:        ${SED} -e 's|^|@dirrm |'
                    261: RUBY_GENERATE_PLIST =  ( \
                    262:        ${RUBY_PLIST_COMMENT_CMD}; \
                    263:        ${RUBY_PLIST_FILES_CMD}; \
                    264:        ${RUBY_PLIST_DIRS_CMD} ) > ${RUBY_PLIST_DYNAMIC}
1.22      taca      265: .endif
1.23      taca      266: 
                    267: .if !empty(RUBY_NOVERSION:M[nN][oO])
1.25    ! taca      268: .if !empty(RUBY_NOPTHREAD:M[nN][oO])
1.22      taca      269: .include "../../mk/pthread.buildlink3.mk"
1.23      taca      270: .endif
                    271: .include "../../mk/bdb.buildlink3.mk"
1.22      taca      272: .include "../../devel/zlib/buildlink3.mk"
                    273: .include "../../security/openssl/buildlink3.mk"
1.23      taca      274: .include "../../mk/dlopen.buildlink3.mk"
1.22      taca      275: .endif
                    276: 
1.1       taca      277: .endif # _RUBY_MK

CVSweb <webmaster@jp.NetBSD.org>