Annotation of pkgsrc/lang/ruby/rubyversion.mk, revision 1.41
1.41 ! taca 1: # $NetBSD: rubyversion.mk,v 1.40 2008/06/19 14:30:45 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.40 taca 10: RUBY18_VERSION= 1.8.7
1.23 taca 11:
1.32 taca 12: # patch
1.41 ! taca 13: RUBY18_PATCHLEVEL= 22
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/}
1.40 taca 66: .if !empty(RUBY_PATCH_LEVEL)
1.29 taca 67: _RUBY_PATCHLEVEL= ${RUBY_VERSION:C/(.*-)//}
1.40 taca 68: .endif
1.1 taca 69:
70: # RUBY_VER defines Ruby base release.
71: #
72: RUBY_VER= ${_RUBY_VER_MAJOR}${_RUBY_VER_MINOR}
73:
1.3 taca 74: #
1.6 taca 75: # RUBY_HAS_ARCHLIB This package contains machine dependent binaries.
76: # RUBY_REQD Minimum required Ruby's version
1.3 taca 77: #
1.6 taca 78: .if defined(RUBY_HAS_ARCHLIB) && empty(RUBY_HAS_ARCHLIB:M[nN][oO])
1.16 taca 79: .if ${RUBY_VER} == "18"
1.6 taca 80: RUBY_REQD?= ${RUBY18_VERSION}
81: .endif
82: .else
1.16 taca 83: .if ${RUBY_VER} == "18"
1.3 taca 84: RUBY_REQD?= 1.8.1
85: .endif
1.6 taca 86: .endif
1.3 taca 87:
1.1 taca 88: # RUBY_SUFFIX is appended to Ruby's commands; ruby, irb and so on.
89: #
90: RUBY_SUFFIX?= ${RUBY_VER}
91:
92: # RUBY_NAME defines executable's name of Ruby itself.
93: #
94: RUBY_NAME?= ruby${RUBY_SUFFIX}
95:
1.10 taca 96: # RUBY_BASE is base of ruby package's name
97: #
98: RUBY_BASE= ruby${RUBY_VER}-base
99:
1.1 taca 100: # RUBY_PKGPREFIX is prefix part for ruby based packages.
101: #
102: RUBY_PKGPREFIX?= ${RUBY_NAME}
103:
104: # RUBY_VER_DIR is used as part of Ruby's library directories.
105: #
106: RUBY_VER_DIR?= ${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}
107:
108: # Simple check for package availability with Ruby's version.
109: #
110: .if empty(RUBY_VERSION_SUPPORTED:M${RUBY_VER})
111: PKG_FAIL_REASON+= "This package isn't supported by ${RUBY_NAME}."
112: .endif
113:
114: # RUBY_NOVERSION specifies that package dosen't depends on any
115: # version of Ruby.
116: #
117: .if empty(RUBY_NOVERSION:M[nN][oO])
118: RUBY_SUFFIX=
119: RUBY_NAME= ruby
120: .endif
121:
122: # RUBY related command's full pathname.
123: #
1.15 taca 124: RUBY?= ${PREFIX}/bin/${RUBY_NAME}
125: RDOC?= ${PREFIX}/bin/rdoc${RUBY_VER}
1.1 taca 126:
127: #
1.17 minskim 128: # RUBY_ARCH is used as architecture-dependent directory name.
1.1 taca 129: #
130: RUBY_ARCH?= ${LOWER_ARCH}-${LOWER_OPSYS}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX}
131:
132: #
1.10 taca 133: # Ruby shared library version handling.
134: #
135: RUBY_SHLIBMAJOR?= ${_RUBY_VER_MAJOR}
136: RUBY_SHLIBVER?= ${RUBY_VERSION}
137:
138: .if ${OPSYS} == "NetBSD" || ${OPSYS} == "Interix"
139: RUBY_SHLIBMAJOR= ${RUBY_VER}
1.29 taca 140: RUBY_SHLIBVER= ${RUBY_VER}.${_RUBY_VER_TEENY}
1.12 jlam 141: .elif ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly"
1.10 taca 142: RUBY_SHLIBMAJOR= # unused
1.12 jlam 143: RUBY_SHLIBVER= ${RUBY_VER}
1.10 taca 144: .elif ${OPSYS} == "OpenBSD"
145: RUBY_SHLIBMAJOR= # unused
1.29 taca 146: RUBY_SHLIBVER= ${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}${_RUBY_VER_TEENY}
1.10 taca 147: .elif ${OPSYS} == "IRIX"
148: RUBY_SHLIBMAJOR= # unused
149: .elif ${OPSYS} == "Linux"
150: RUBY_SHLIBMAJOR= ${_RUBY_VER_MAJOR}.${_RUBY_VER_MINOR}
151: .endif
152:
153: .if empty(RUBY_SHLIBMAJOR)
154: RUBY_NOSHLIBMAJOR= "@comment "
155: .else
156: RUBY_NOSHLIBMAJOR=
157: .endif
158:
1.25 taca 159:
1.10 taca 160: #
1.5 taca 161: # RUBY_DLEXT is suffix of extention library.
162: #
163: .if ${OPSYS} == "Darwin"
164: RUBY_DLEXT= bundle
165: .else
166: RUBY_DLEXT= so
167: .endif
168:
169: #
1.26 taca 170: # Use pthread library with Ruby
171: #
172: .if ${OPSYS} == "NetBSD" && !empty(OS_VERSION:M1.[0-9].*)
173: RUBY_USE_PTHREAD?= no
174: .else
175: RUBY_USE_PTHREAD?= yes
176: PTHREAD_OPTS+= native
1.27 taca 177: PTHREAD_AUTO_VARS= yes
1.26 taca 178: .endif
179:
180: #
1.23 taca 181: # Dynamic PLIST directories
182: #
183: RUBY_DYNAMIC_DIRS?= # empty
184:
185: #
1.10 taca 186: # source directory
187: #
188: RUBY_SRCDIR?= ${_PKGSRC_TOPDIR}/lang/${RUBY_BASE}
189:
190: #
1.23 taca 191: # common paths
1.1 taca 192: #
1.40 taca 193: RUBY_LIB?= lib/ruby/${RUBY_VER_DIR}
194: RUBY_ARCHLIB?= ${RUBY_LIB}/${RUBY_ARCH}
195: RUBY_SITELIB_BASE?= lib/ruby/site_ruby
196: RUBY_SITELIB?= ${RUBY_SITELIB_BASE}/${RUBY_VER_DIR}
197: RUBY_SITEARCHLIB?= ${RUBY_SITELIB}/${RUBY_ARCH}
198: RUBY_VENDORLIB_BASE?= lib/ruby/vendor_ruby
199: RUBY_VENDORLIB?= ${RUBY_VENDORLIB_BASE}/${RUBY_VER_DIR}
200: RUBY_VENDORARCHLIB?= ${RUBY_VENDORLIB}/${RUBY_ARCH}
201: RUBY_DOC?= share/doc/${RUBY_NAME}
202: RUBY_EG?= share/examples/${RUBY_NAME}
203:
204: #
205: # These will be discontinued in near future.
206: #
207: RUBY_LIBDIR= ${PREFIX}/${RUBY_LIB}
208: RUBY_ARCHLIBDIR= ${PREFIX}/${RUBY_ARCHLIB}
209: RUBY_SITELIBDIR= ${PREFIX}/${RUBY_SITELIB}
210: RUBY_SITEARCHLIBDIR= ${PREFIX}/${RUBY_SITEARCHLIB}
211: RUBY_VENDORLIBDIR= ${PREFIX}/${RUBY_VENDORLIB}
212: RUBY_VENDORARCHLIBDIR= ${PREFIX}/${RUBY_VENDORARCHLIB}
213: RUBY_DOCDIR= ${PREFIX}/${RUBY_DOC}
214: RUBY_EXAMPLESDIR= ${PREFIX}/${RUBY_EG}
1.31 taca 215:
216: #
217: # ri database relative path
218: #
219: RUBY_RIDIR?= share/ri
1.15 taca 220: RUBY_BASERIDIR?= ${RUBY_RIDIR}/${RUBY_VER_DIR}
221: RUBY_SYSRIDIR?= ${RUBY_BASERIDIR}/system
222: RUBY_SITERIDIR?= ${RUBY_BASERIDIR}/site
1.1 taca 223:
224: #
225: # MAKE_ENV
226: #
1.18 rillig 227: MAKE_ENV+= RUBY=${RUBY:Q} RUBY_VER=${RUBY_VER:Q} \
228: RUBY_VERSION=${RUBY_VERSION:Q} \
229: RUBY_VERSION_DEFAULT=${RUBY_VERSION_DEFAULT:Q}
1.15 taca 230:
1.18 rillig 231: MAKEFLAGS+= RUBY_VERSION=${RUBY_VERSION:Q} \
232: RUBY_VERSION_DEFAULT=${RUBY_VERSION_DEFAULT:Q}
1.15 taca 233:
1.1 taca 234: # PLIST
235: #
1.40 taca 236: PLIST_RUBY_DIRS= RUBY_LIB="${RUBY_LIB}" \
237: RUBY_ARCHLIB="${RUBY_ARCHLIB}" \
238: RUBY_SITELIB_BASE=${RUBY_SITELIB_BASE:Q} \
239: RUBY_SITELIB="${RUBY_SITELIB}" \
240: RUBY_SITEARCHLIB="${RUBY_SITEARCHLIB}" \
241: RUBY_VENDORLIB_BASE=${RUBY_VENDORLIB_BASE:Q} \
242: RUBY_VENDORLIB=${RUBY_VENDORLIB:Q} \
243: RUBY_VENDORARCHLIB=${RUBY_VENDORARCHLIB:Q} \
244: RUBY_DOC="${RUBY_DOC}" \
245: RUBY_EG="${RUBY_EG}" \
246: RUBY_LIBDIR="${RUBY_LIBDIR}" \
1.1 taca 247: RUBY_ARCHLIBDIR="${RUBY_ARCHLIBDIR}" \
248: RUBY_SITELIBDIR="${RUBY_SITELIBDIR}" \
249: RUBY_SITEARCHLIBDIR="${RUBY_SITEARCHLIBDIR}" \
250: RUBY_DOCDIR="${RUBY_DOCDIR}" \
1.5 taca 251: RUBY_EXAMPLESDIR="${RUBY_EXAMPLESDIR}" \
1.15 taca 252: RUBY_RIDIR="${RUBY_RIDIR}" \
253: RUBY_BASERIDIR="${RUBY_BASERIDIR}" \
254: RUBY_SYSRIDIR="${RUBY_SYSRIDIR}" \
255: RUBY_SITERIDIR="${RUBY_SITERIDIR}"
1.1 taca 256:
1.14 taca 257: #
258: # substitutions
259: #
1.18 rillig 260: FILES_SUBST+= RUBY=${RUBY:Q} RUBY_NAME=${RUBY_NAME:Q} \
261: RUBY_PKGPREFIX=${RUBY_PKGPREFIX:Q} \
262: RUBY_VER=${RUBY_VER:Q} \
1.15 taca 263: ${PLIST_RUBY_DIRS}
1.14 taca 264:
1.15 taca 265: MESSAGE_SUBST+= RUBY="${RUBY}" RUBY_VER="${RUBY_VER}" \
1.14 taca 266: RUBY_VERSION="${RUBY_VERSION}" \
1.15 taca 267: RUBY_PKGPREFIX="${RUBY_PKGPREFIX}" \
268: ${PLIST_RUBY_DIRS:S,DIR="${PREFIX}/,DIR=",}
1.14 taca 269:
1.18 rillig 270: PLIST_SUBST+= RUBY=${RUBY:Q} RUBY_VER=${RUBY_VER:Q} \
271: RUBY_VERSION=${RUBY_VERSION:Q} \
272: RUBY_VER_DIR=${RUBY_VER_DIR:Q} \
273: RUBY_DLEXT=${RUBY_DLEXT:Q} \
1.39 jlam 274: RUBY_ARCH=${RUBY_ARCH:Q} \
1.15 taca 275: ${PLIST_RUBY_DIRS:S,DIR="${PREFIX}/,DIR=",}
1.1 taca 276:
1.22 taca 277: #
1.23 taca 278: # make dynamic PLIST
1.22 taca 279: #
1.23 taca 280: .if !empty(RUBY_DYNAMIC_DIRS)
281:
282: RUBY_PLIST_DYNAMIC= ${WRKDIR}/PLIST.work
283:
284: .if !defined(PLIST_SRC)
285: . if exists(${PKGDIR}/PLIST.common)
286: PLIST_SRC+= ${PKGDIR}/PLIST.common
287: . elif exists(${PKGDIR}/PLIST)
288: PLIST_SRC+= ${PKGDIR}/PLIST
289: . endif
290:
291: PLIST_SRC+= ${RUBY_PLIST_DYNAMIC}
292:
293: . if exists(${PKGDIR}/PLIST.common_end)
294: PLIST_SRC+= ${PKGDIR}/PLIST.common_end
295: . endif
296:
297: .endif
298:
299: RUBY_PLIST_COMMENT_CMD= \
300: ${ECHO} "@comment The following lines are automatically generated"
1.37 obache 301: RUBY_PLIST_FILES_CMD= ( cd ${DESTDIR}${PREFIX}; \
1.23 taca 302: ${FIND} ${RUBY_DYNAMIC_DIRS} \( -type f -o -type l \) -print ) | \
303: ${SORT} -u
1.37 obache 304: RUBY_PLIST_DIRS_CMD= ( cd ${DESTDIR}${PREFIX}; \
1.23 taca 305: ${FIND} ${RUBY_DYNAMIC_DIRS} -type d -print ) | ${SORT} -ru | \
306: ${SED} -e 's|^|@dirrm |'
307: RUBY_GENERATE_PLIST = ( \
308: ${RUBY_PLIST_COMMENT_CMD}; \
309: ${RUBY_PLIST_FILES_CMD}; \
310: ${RUBY_PLIST_DIRS_CMD} ) > ${RUBY_PLIST_DYNAMIC}
1.22 taca 311: .endif
1.23 taca 312:
313: .if !empty(RUBY_NOVERSION:M[nN][oO])
1.26 taca 314: .if empty(RUBY_USE_PTHREAD:M[nN][oO])
1.22 taca 315: .include "../../mk/pthread.buildlink3.mk"
1.23 taca 316: .endif
317: .include "../../mk/bdb.buildlink3.mk"
1.28 taca 318: .include "../../converters/libiconv/buildlink3.mk"
1.22 taca 319: .include "../../devel/zlib/buildlink3.mk"
320: .include "../../security/openssl/buildlink3.mk"
1.23 taca 321: .include "../../mk/dlopen.buildlink3.mk"
1.22 taca 322: .endif
323:
1.40 taca 324: PRINT_PLIST_AWK+= /\.${RUBY_DLEXT}$$/ \
325: { gsub(/${RUBY_DLEXT}$$/, "$${RUBY_DLEXT}") }
326: PRINT_PLIST_AWK+= /^(@dirrm )?${RUBY_ARCHLIB:S|/|\\/|g}/ \
327: { gsub(/${RUBY_ARCHLIB:S|/|\\/|g}/, "$${RUBY_ARCHLIB}"); \
328: print; next; }
329: PRINT_PLIST_AWK+= /^(@dirrm )?${RUBY_VENDORARCHLIB:S|/|\\/|g}/ \
330: { gsub(/${RUBY_VENDORARCHLIB:S|/|\\/|g}/, "$${RUBY_VENDORARCHLIB}"); \
331: print; next; }
332: PRINT_PLIST_AWK+= /^(@dirrm )?${RUBY_VENDORLIB:S|/|\\/|g}/ \
333: { gsub(/${RUBY_VENDORLIB:S|/|\\/|g}/, "$${RUBY_VENDORLIB}"); \
334: print; next; }
335: PRINT_PLIST_AWK+= /^@dirrm ${RUBY_SITEARCHLIB:S|/|\\/|g}$$/ \
336: { next; }
337: PRINT_PLIST_AWK+= /^@dirrm ${RUBY_SITELIB:S|/|\\/|g}$$/ \
338: { next; }
339: PRINT_PLIST_AWK+= /^(@dirrm )?${RUBY_SITEARCHLIB:S|/|\\/|g}/ \
340: { gsub(/${RUBY_SITEARCHLIB:S|/|\\/|g}/, "$${RUBY_SITEARCHLIB}"); \
341: print; next; }
342: PRINT_PLIST_AWK+= /^(@dirrm )?${RUBY_SITELIB:S|/|\\/|g}/ \
343: { gsub(/${RUBY_SITELIB:S|/|\\/|g}/, "$${RUBY_SITELIB}"); \
344: print; next; }
345: PRINT_PLIST_AWK+= /^(@dirrm )?${RUBY_SITELIB_BASE:S|/|\\/|g}$$/ \
346: { gsub(/${RUBY_SITELIB_BASE:S|/|\\/|g}/, "$${RUBY_SITELIB_BASE}"); \
347: print; next; }
348: PRINT_PLIST_AWK+= /^(@dirrm )?${RUBY_VENDORLIB_BASE:S|/|\\/|g}$$/ \
349: { gsub(/${RUBY_VENDORLIB_BASE:S|/|\\/|g}/, "$${RUBY_VENDORLIB_BASE}"); \
350: print; next; }
351: PRINT_PLIST_AWK+= /^(@dirrm )?${RUBY_LIB:S|/|\\/|g}/ \
352: { gsub(/${RUBY_LIB:S|/|\\/|g}/, "$${RUBY_LIB}"); \
353: print; next; }
354: PRINT_PLIST_AWK+= /^@dirrm ${RUBY_DOC:S|/|\\/|g}$$/ \
355: { next; }
356: PRINT_PLIST_AWK+= /^(@dirrm )?${RUBY_DOC:S|/|\\/|g}/ \
357: { gsub(/${RUBY_DOC:S|/|\\/|g}/, "$${RUBY_DOC}"); \
358: print; next; }
359: PRINT_PLIST_AWK+= /^@dirrm ${RUBY_EG:S|/|\\/|g}$$/ \
360: { next; }
361: PRINT_PLIST_AWK+= /^(@dirrm )?${RUBY_EG:S|/|\\/|g}/ \
362: { gsub(/${RUBY_EG:S|/|\\/|g}/, "$${RUBY_EG}"); \
363: print; next; }
364: PRINT_PLIST_AWK+= /^@dirrm ${RUBY_SITERIDIR:S|/|\\/|g}$$/ \
365: { next; }
366: PRINT_PLIST_AWK+= /^(@dirrm )?${RUBY_SITERIDIR:S|/|\\/|g}/ \
367: { gsub(/${RUBY_SITERIDIR:S|/|\\/|g}/, "$${RUBY_SITERIDIR}"); \
368: print; next; }
369: PRINT_PLIST_AWK+= /^@dirrm ${RUBY_SYSRIDIR:S|/|\\/|g}$$/ \
370: { next; }
371: PRINT_PLIST_AWK+= /^(@dirrm )?${RUBY_SYSRIDIR:S|/|\\/|g}/ \
372: { gsub(/${RUBY_SYSRIDIR:S|/|\\/|g}/, "$${RUBY_SYSRIDIR}"); \
373: print; next; }
374:
1.1 taca 375: .endif # _RUBY_MK
CVSweb <webmaster@jp.NetBSD.org>