Annotation of pkgsrc/lang/ruby/rubyversion.mk, revision 1.28
1.28 ! taca 1: # $NetBSD: rubyversion.mk,v 1.27 2006/09/14 01:43:26 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:
1.10 taca 151: #
1.5 taca 152: # RUBY_DLEXT is suffix of extention library.
153: #
154: .if ${OPSYS} == "Darwin"
155: RUBY_DLEXT= bundle
156: .else
157: RUBY_DLEXT= so
158: .endif
159:
160: #
1.26 taca 161: # Use pthread library with Ruby
162: #
163: .if ${OPSYS} == "NetBSD" && !empty(OS_VERSION:M1.[0-9].*)
164: RUBY_USE_PTHREAD?= no
165: .else
166: RUBY_USE_PTHREAD?= yes
167: PTHREAD_OPTS+= native
1.27 taca 168: PTHREAD_AUTO_VARS= yes
1.26 taca 169: .endif
170:
171: #
1.23 taca 172: # Dynamic PLIST directories
173: #
174: RUBY_DYNAMIC_DIRS?= # empty
175:
176: #
1.10 taca 177: # source directory
178: #
179: RUBY_SRCDIR?= ${_PKGSRC_TOPDIR}/lang/${RUBY_BASE}
180:
181: #
1.23 taca 182: # common paths
1.1 taca 183: #
1.15 taca 184: RUBY_LIBDIR?= ${PREFIX}/lib/ruby/${RUBY_VER_DIR}
1.1 taca 185: RUBY_ARCHLIBDIR?= ${RUBY_LIBDIR}/${RUBY_ARCH}
1.15 taca 186: RUBY_SITELIBDIR?= ${PREFIX}/lib/ruby/site_ruby/${RUBY_VER_DIR}
1.1 taca 187: RUBY_SITEARCHLIBDIR?= ${RUBY_SITELIBDIR}/${RUBY_ARCH}
1.15 taca 188: RUBY_DOCDIR?= ${PREFIX}/share/doc/${RUBY_NAME}
189: RUBY_EXAMPLESDIR?= ${PREFIX}/share/examples/${RUBY_NAME}
190: RUBY_RIDIR?= ${PREFIX}/share/ri
191: RUBY_BASERIDIR?= ${RUBY_RIDIR}/${RUBY_VER_DIR}
192: RUBY_SYSRIDIR?= ${RUBY_BASERIDIR}/system
193: RUBY_SITERIDIR?= ${RUBY_BASERIDIR}/site
1.1 taca 194:
195: #
196: # MAKE_ENV
197: #
1.18 rillig 198: MAKE_ENV+= RUBY=${RUBY:Q} RUBY_VER=${RUBY_VER:Q} \
199: RUBY_VERSION=${RUBY_VERSION:Q} \
200: RUBY_VERSION_DEFAULT=${RUBY_VERSION_DEFAULT:Q}
1.15 taca 201:
1.18 rillig 202: MAKEFLAGS+= RUBY_VERSION=${RUBY_VERSION:Q} \
203: RUBY_VERSION_DEFAULT=${RUBY_VERSION_DEFAULT:Q}
1.15 taca 204:
1.1 taca 205: # PLIST
206: #
207: PLIST_RUBY_DIRS= RUBY_LIBDIR="${RUBY_LIBDIR}" \
208: RUBY_ARCHLIBDIR="${RUBY_ARCHLIBDIR}" \
209: RUBY_SITELIBDIR="${RUBY_SITELIBDIR}" \
210: RUBY_SITEARCHLIBDIR="${RUBY_SITEARCHLIBDIR}" \
211: RUBY_DOCDIR="${RUBY_DOCDIR}" \
1.5 taca 212: RUBY_EXAMPLESDIR="${RUBY_EXAMPLESDIR}" \
1.15 taca 213: RUBY_RIDIR="${RUBY_RIDIR}" \
214: RUBY_BASERIDIR="${RUBY_BASERIDIR}" \
215: RUBY_SYSRIDIR="${RUBY_SYSRIDIR}" \
216: RUBY_SITERIDIR="${RUBY_SITERIDIR}"
1.1 taca 217:
1.14 taca 218: #
219: # substitutions
220: #
1.18 rillig 221: FILES_SUBST+= RUBY=${RUBY:Q} RUBY_NAME=${RUBY_NAME:Q} \
222: RUBY_PKGPREFIX=${RUBY_PKGPREFIX:Q} \
223: RUBY_VER=${RUBY_VER:Q} \
1.15 taca 224: ${PLIST_RUBY_DIRS}
1.14 taca 225:
1.15 taca 226: MESSAGE_SUBST+= RUBY="${RUBY}" RUBY_VER="${RUBY_VER}" \
1.14 taca 227: RUBY_VERSION="${RUBY_VERSION}" \
1.15 taca 228: RUBY_PKGPREFIX="${RUBY_PKGPREFIX}" \
229: ${PLIST_RUBY_DIRS:S,DIR="${PREFIX}/,DIR=",}
1.14 taca 230:
1.18 rillig 231: PLIST_SUBST+= RUBY=${RUBY:Q} RUBY_VER=${RUBY_VER:Q} \
232: RUBY_VERSION=${RUBY_VERSION:Q} \
233: RUBY_VER_DIR=${RUBY_VER_DIR:Q} \
234: RUBY_DLEXT=${RUBY_DLEXT:Q} \
1.15 taca 235: ${PLIST_RUBY_DIRS:S,DIR="${PREFIX}/,DIR=",}
1.1 taca 236:
1.22 taca 237: #
1.23 taca 238: # make dynamic PLIST
1.22 taca 239: #
1.23 taca 240: .if !empty(RUBY_DYNAMIC_DIRS)
241:
242: RUBY_PLIST_DYNAMIC= ${WRKDIR}/PLIST.work
243:
244: .if !defined(PLIST_SRC)
245: . if exists(${PKGDIR}/PLIST.common)
246: PLIST_SRC+= ${PKGDIR}/PLIST.common
247: . elif exists(${PKGDIR}/PLIST)
248: PLIST_SRC+= ${PKGDIR}/PLIST
249: . endif
250:
251: PLIST_SRC+= ${RUBY_PLIST_DYNAMIC}
252:
253: . if exists(${PKGDIR}/PLIST.common_end)
254: PLIST_SRC+= ${PKGDIR}/PLIST.common_end
255: . endif
256:
257: .endif
258:
259: RUBY_PLIST_COMMENT_CMD= \
260: ${ECHO} "@comment The following lines are automatically generated"
261: RUBY_PLIST_FILES_CMD= ( cd ${PREFIX}; \
262: ${FIND} ${RUBY_DYNAMIC_DIRS} \( -type f -o -type l \) -print ) | \
263: ${SORT} -u
264: RUBY_PLIST_DIRS_CMD= ( cd ${PREFIX}; \
265: ${FIND} ${RUBY_DYNAMIC_DIRS} -type d -print ) | ${SORT} -ru | \
266: ${SED} -e 's|^|@dirrm |'
267: RUBY_GENERATE_PLIST = ( \
268: ${RUBY_PLIST_COMMENT_CMD}; \
269: ${RUBY_PLIST_FILES_CMD}; \
270: ${RUBY_PLIST_DIRS_CMD} ) > ${RUBY_PLIST_DYNAMIC}
1.22 taca 271: .endif
1.23 taca 272:
273: .if !empty(RUBY_NOVERSION:M[nN][oO])
1.26 taca 274: .if empty(RUBY_USE_PTHREAD:M[nN][oO])
1.22 taca 275: .include "../../mk/pthread.buildlink3.mk"
1.23 taca 276: .endif
277: .include "../../mk/bdb.buildlink3.mk"
1.28 ! taca 278: .include "../../converters/libiconv/buildlink3.mk"
1.22 taca 279: .include "../../devel/zlib/buildlink3.mk"
280: .include "../../security/openssl/buildlink3.mk"
1.23 taca 281: .include "../../mk/dlopen.buildlink3.mk"
1.22 taca 282: .endif
283:
1.1 taca 284: .endif # _RUBY_MK
CVSweb <webmaster@jp.NetBSD.org>