Annotation of pkgsrc/lang/ruby/rubyversion.mk, revision 1.23
1.23 ! taca 1: # $NetBSD: rubyversion.mk,v 1.22 2006/09/03 02:53:13 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:
150: #
1.5 taca 151: # RUBY_DLEXT is suffix of extention library.
152: #
153: .if ${OPSYS} == "Darwin"
154: RUBY_DLEXT= bundle
155: .else
156: RUBY_DLEXT= so
157: .endif
158:
159: #
1.23 ! taca 160: # Dynamic PLIST directories
! 161: #
! 162: RUBY_DYNAMIC_DIRS?= # empty
! 163:
! 164: #
1.10 taca 165: # source directory
166: #
167: RUBY_SRCDIR?= ${_PKGSRC_TOPDIR}/lang/${RUBY_BASE}
168:
169: #
1.23 ! taca 170: # common paths
1.1 taca 171: #
1.15 taca 172: RUBY_LIBDIR?= ${PREFIX}/lib/ruby/${RUBY_VER_DIR}
1.1 taca 173: RUBY_ARCHLIBDIR?= ${RUBY_LIBDIR}/${RUBY_ARCH}
1.15 taca 174: RUBY_SITELIBDIR?= ${PREFIX}/lib/ruby/site_ruby/${RUBY_VER_DIR}
1.1 taca 175: RUBY_SITEARCHLIBDIR?= ${RUBY_SITELIBDIR}/${RUBY_ARCH}
1.15 taca 176: RUBY_DOCDIR?= ${PREFIX}/share/doc/${RUBY_NAME}
177: RUBY_EXAMPLESDIR?= ${PREFIX}/share/examples/${RUBY_NAME}
178: RUBY_RIDIR?= ${PREFIX}/share/ri
179: RUBY_BASERIDIR?= ${RUBY_RIDIR}/${RUBY_VER_DIR}
180: RUBY_SYSRIDIR?= ${RUBY_BASERIDIR}/system
181: RUBY_SITERIDIR?= ${RUBY_BASERIDIR}/site
1.1 taca 182:
183: #
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:
1.22 taca 225: #
1.23 ! taca 226: # make dynamic PLIST
1.22 taca 227: #
1.23 ! taca 228: .if !empty(RUBY_DYNAMIC_DIRS)
! 229:
! 230: RUBY_PLIST_DYNAMIC= ${WRKDIR}/PLIST.work
! 231:
! 232: .if !defined(PLIST_SRC)
! 233: . if exists(${PKGDIR}/PLIST.common)
! 234: PLIST_SRC+= ${PKGDIR}/PLIST.common
! 235: . elif exists(${PKGDIR}/PLIST)
! 236: PLIST_SRC+= ${PKGDIR}/PLIST
! 237: . endif
! 238:
! 239: PLIST_SRC+= ${RUBY_PLIST_DYNAMIC}
! 240:
! 241: . if exists(${PKGDIR}/PLIST.common_end)
! 242: PLIST_SRC+= ${PKGDIR}/PLIST.common_end
! 243: . endif
! 244:
! 245: .endif
! 246:
! 247: RUBY_PLIST_COMMENT_CMD= \
! 248: ${ECHO} "@comment The following lines are automatically generated"
! 249: RUBY_PLIST_FILES_CMD= ( cd ${PREFIX}; \
! 250: ${FIND} ${RUBY_DYNAMIC_DIRS} \( -type f -o -type l \) -print ) | \
! 251: ${SORT} -u
! 252: RUBY_PLIST_DIRS_CMD= ( cd ${PREFIX}; \
! 253: ${FIND} ${RUBY_DYNAMIC_DIRS} -type d -print ) | ${SORT} -ru | \
! 254: ${SED} -e 's|^|@dirrm |'
! 255: RUBY_GENERATE_PLIST = ( \
! 256: ${RUBY_PLIST_COMMENT_CMD}; \
! 257: ${RUBY_PLIST_FILES_CMD}; \
! 258: ${RUBY_PLIST_DIRS_CMD} ) > ${RUBY_PLIST_DYNAMIC}
1.22 taca 259: .endif
1.23 ! taca 260:
! 261: .if !empty(RUBY_NOVERSION:M[nN][oO])
! 262: # Common macros.
! 263: .if ${OPSYS} == "NetBSD"
! 264: .if empty(OS_VERSION:M1.[0-9].*)
! 265: PTHREAD_OPTS+= native
1.22 taca 266: .include "../../mk/pthread.buildlink3.mk"
1.23 ! taca 267: .if defined(PTHREAD_TYPE) && ${PTHREAD_TYPE} == "none"
! 268: CONFIGURE_ARGS+= --disable-pthread
! 269: .else
! 270: CONFIGURE_ARGS+= --enable-pthread
! 271: .endif
! 272: .endif
! 273: .endif
! 274: .include "../../mk/bdb.buildlink3.mk"
1.22 taca 275: .include "../../devel/zlib/buildlink3.mk"
276: .include "../../security/openssl/buildlink3.mk"
1.23 ! taca 277: .include "../../mk/dlopen.buildlink3.mk"
1.22 taca 278: .endif
279:
1.1 taca 280: .endif # _RUBY_MK
CVSweb <webmaster@jp.NetBSD.org>