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