2012-03-20 07:14:30 +01:00
|
|
|
# $NetBSD: modules.mk,v 1.33 2012/03/20 06:14:30 taca Exp $
|
2004-11-27 14:57:20 +01:00
|
|
|
|
|
|
|
.if !defined(_RUBY_MODULE_MK)
|
|
|
|
_RUBY_MODULE_MK= # defined
|
|
|
|
|
2012-03-20 07:14:30 +01:00
|
|
|
.if defined(RUBY_RAILS_SUPPORTED)
|
|
|
|
USE_TOOLS+= expr
|
|
|
|
.endif
|
|
|
|
|
2004-11-27 14:57:20 +01:00
|
|
|
.include "../../lang/ruby/rubyversion.mk"
|
2005-04-02 07:10:10 +02:00
|
|
|
|
2010-09-10 05:21:57 +02:00
|
|
|
#
|
|
|
|
# Default package name would prefixed by RUBY_PKGPREFIX.
|
|
|
|
#
|
|
|
|
PKGNAME?= ${RUBY_PKGPREFIX}-${DISTNAME}
|
|
|
|
|
2005-04-02 07:10:10 +02:00
|
|
|
.if defined(NO_BUILD) && empty(NO_BUILD:M[Nn][Oo])
|
2011-11-08 16:15:59 +01:00
|
|
|
DEPENDS+= ruby${RUBY_VER}-base>=${RUBY_VERSION}:../../lang/${RUBY_BASE}
|
2005-04-02 07:10:10 +02:00
|
|
|
.else
|
2004-11-27 14:57:20 +01:00
|
|
|
.include "../../lang/ruby/buildlink3.mk"
|
2005-04-02 07:10:10 +02:00
|
|
|
.endif
|
2004-11-27 14:57:20 +01:00
|
|
|
|
2012-03-20 07:14:30 +01:00
|
|
|
.if defined(RUBY_RAILS_SUPPORTED)
|
|
|
|
.include "../../lang/ruby/rails.mk"
|
|
|
|
.if ${RUBY_RAILS} > 3
|
|
|
|
RUBY_RDOC_REQD?= 2.5.0
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
2011-06-16 17:14:31 +02:00
|
|
|
#
|
|
|
|
# rdoc version
|
|
|
|
#
|
|
|
|
.include "../../lang/ruby/rdoc.mk"
|
|
|
|
|
2005-12-05 21:49:47 +01:00
|
|
|
CONFIGURE_ENV+= RUBY=${RUBY:Q} RDOC=${RDOC:Q}
|
2004-11-27 14:57:20 +01:00
|
|
|
|
2005-03-06 17:46:05 +01:00
|
|
|
#
|
2004-11-27 14:57:20 +01:00
|
|
|
# extconf.rb support
|
|
|
|
#
|
2009-02-15 04:16:37 +01:00
|
|
|
# USE_RUBY_EXTCONF Use extconf script.
|
|
|
|
#
|
2004-11-27 14:57:20 +01:00
|
|
|
# RUBY_EXTCONF specify extconf script name (default: extconf.rb).
|
|
|
|
# RUBY_EXTCONF_CHECK make sure to check existence of Makefile after
|
|
|
|
# executing extconf script (default: yes).
|
|
|
|
# RUBY_EXTCONF_MAKEFILE name of Makefile checked by RUBY_EXTCONF_CHECK
|
|
|
|
# (default: Makefile)
|
|
|
|
#
|
|
|
|
.if defined(USE_RUBY_EXTCONF) && empty(USE_RUBY_EXTCONF:M[nN][oO])
|
|
|
|
|
|
|
|
RUBY_EXTCONF?= extconf.rb
|
|
|
|
INSTALL_TARGET?= site-install
|
2008-06-19 16:30:45 +02:00
|
|
|
CONFIGURE_ARGS+= ${RUBY_EXTCONF_ARGS}
|
|
|
|
RUBY_EXTCONF_ARGS?= --with-opt-dir=${PREFIX:Q} --vendor
|
2004-11-27 14:57:20 +01:00
|
|
|
RUBY_EXTCONF_CHECK?= yes
|
|
|
|
RUBY_EXTCONF_MAKEFILE?= Makefile
|
|
|
|
|
|
|
|
do-configure: ruby-extconf-configure
|
|
|
|
|
|
|
|
.if defined(RUBY_EXTCONF_SUBDIRS)
|
|
|
|
ruby-extconf-configure:
|
|
|
|
.for d in ${RUBY_EXTCONF_SUBDIRS}
|
2010-09-10 05:21:57 +02:00
|
|
|
@${ECHO_MSG} "===> Running ${RUBY_EXTCONF} in ${d} to configure"; \
|
|
|
|
${ECHO_MSG} "${RUBY} ${RUBY_EXTCONF} ${CONFIGURE_ARGS}"
|
2009-05-16 09:22:01 +02:00
|
|
|
${RUN}cd ${WRKSRC}/${d}; \
|
2004-11-27 14:57:20 +01:00
|
|
|
${SETENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_EXTCONF} ${CONFIGURE_ARGS}
|
|
|
|
.if empty(RUBY_EXTCONF_CHECK:M[nN][oO])
|
2009-05-16 09:22:01 +02:00
|
|
|
${RUN}cd ${WRKSRC}/${d}; \
|
2004-11-27 14:57:20 +01:00
|
|
|
${TEST} -f ${RUBY_EXTCONF_MAKEFILE}
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
.if !target(do-build)
|
|
|
|
do-build: ruby-extconf-build
|
|
|
|
|
|
|
|
ruby-extconf-build:
|
|
|
|
.for d in ${RUBY_EXTCONF_SUBDIRS}
|
|
|
|
@${ECHO_MSG} "===> Building ${d}"
|
2009-05-16 09:22:01 +02:00
|
|
|
${RUN}cd ${WRKSRC}/${d}; ${SETENV} ${MAKE_ENV} ${MAKE} ${BUILD_TARGET}
|
2004-11-27 14:57:20 +01:00
|
|
|
.endfor
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(do-install)
|
|
|
|
do-install: ruby-extconf-install
|
|
|
|
|
|
|
|
ruby-extconf-install:
|
|
|
|
.for d in ${RUBY_EXTCONF_SUBDIRS}
|
|
|
|
@${ECHO_MSG} "===> Installing ${d}"
|
2010-11-07 00:44:01 +01:00
|
|
|
${RUN}cd ${WRKSRC}/${d}; ${SETENV} ${INSTALL_ENV} ${MAKE_ENV} ${MAKE} ${INSTALL_TARGET} ${INSTALL_MAKE_FLAGS}
|
2004-11-27 14:57:20 +01:00
|
|
|
.endfor
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.else
|
|
|
|
ruby-extconf-configure:
|
2010-09-10 05:21:57 +02:00
|
|
|
@${ECHO_MSG} "===> Running ${RUBY_EXTCONF} to configure"; \
|
|
|
|
${ECHO_MSG} "${RUBY} ${RUBY_EXTCONF} ${CONFIGURE_ARGS}"
|
2009-05-16 09:22:01 +02:00
|
|
|
${RUN}cd ${WRKSRC}; \
|
2004-11-27 14:57:20 +01:00
|
|
|
${SETENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_EXTCONF} ${CONFIGURE_ARGS}
|
|
|
|
.if empty(RUBY_EXTCONF_CHECK:M[nN][oO])
|
2009-05-16 09:22:01 +02:00
|
|
|
${RUN}cd ${WRKSRC}/${d}; \
|
2004-11-27 14:57:20 +01:00
|
|
|
${TEST} -f ${RUBY_EXTCONF_MAKEFILE}
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# setup.rb support
|
|
|
|
#
|
2009-02-15 04:16:37 +01:00
|
|
|
# USE_RUBY_SETUP Uset setup script.
|
|
|
|
# USE_RUBY_SETUP_PKG Use pkgsrc's ruby-setup package.
|
|
|
|
#
|
2004-11-27 14:57:20 +01:00
|
|
|
# RUBY_SETUP specify setup script name (default: setup.rb).
|
|
|
|
#
|
|
|
|
.elif defined(USE_RUBY_SETUP) && empty(USE_RUBY_SETUP:M[nN][oO])
|
|
|
|
|
|
|
|
RUBY_SETUP?= setup.rb
|
|
|
|
|
2009-02-15 04:16:37 +01:00
|
|
|
.if defined(USE_RUBY_SETUP_PKG) && empty(USE_RUBY_SETUP_PKG:M[nN][oO])
|
|
|
|
BUILD_DEPENDS+= ${RUBY_PKGPREFIX}-setup>=3.4.0:../../devel/ruby-setup
|
|
|
|
.endif
|
|
|
|
|
2004-11-27 14:57:20 +01:00
|
|
|
.if !target(do-configure)
|
|
|
|
do-configure: ruby-setup-configure
|
|
|
|
|
|
|
|
ruby-setup-configure:
|
2009-02-15 04:16:37 +01:00
|
|
|
.if defined(USE_RUBY_SETUP_PKG) && empty(USE_RUBY_SETUP_PKG:M[nN][oO])
|
2009-02-15 04:20:03 +01:00
|
|
|
@${ECHO_MSG} "===> Use pkgsrc's ruby-setup"
|
2009-05-16 09:22:01 +02:00
|
|
|
${RUN}cd ${WRKSRC}; \
|
2009-02-15 04:16:37 +01:00
|
|
|
${CP} ${PREFIX}/${RUBY_VENDORLIB}/setup.rb ${RUBY_SETUP}
|
|
|
|
.endif
|
2004-11-27 14:57:20 +01:00
|
|
|
@${ECHO_MSG} "===> Running ${RUBY_SETUP} to configure"
|
2009-05-16 09:22:01 +02:00
|
|
|
${RUN}cd ${WRKSRC}; \
|
2004-11-27 14:57:20 +01:00
|
|
|
${SETENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_SETUP} config ${CONFIGURE_ARGS}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(do-build)
|
|
|
|
do-build: ruby-setup-build
|
|
|
|
|
|
|
|
ruby-setup-build:
|
|
|
|
@${ECHO_MSG} "===> Running ${RUBY_SETUP} to build"
|
2009-05-16 09:22:01 +02:00
|
|
|
${RUN}cd ${WRKSRC}; \
|
2004-11-27 14:57:20 +01:00
|
|
|
${SETENV} ${MAKE_ENV} ${RUBY} ${RUBY_SETUP} setup
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(do-install)
|
|
|
|
do-install: ruby-setup-install
|
|
|
|
|
2008-02-08 16:10:41 +01:00
|
|
|
_RUBY_SETUP_INSTALLARGS= ${INSTALL_TARGET}
|
|
|
|
.if ${_USE_DESTDIR} != "no"
|
2008-03-08 01:47:31 +01:00
|
|
|
_RUBY_SETUP_INSTALLARGS+= --prefix=${DESTDIR:Q}
|
2008-02-08 16:10:41 +01:00
|
|
|
.endif
|
|
|
|
|
2004-11-27 14:57:20 +01:00
|
|
|
ruby-setup-install:
|
|
|
|
@${ECHO_MSG} "===> Running ${RUBY_SETUP} to ${INSTALL_TARGET}"
|
2009-05-16 09:22:01 +02:00
|
|
|
${RUN}cd ${WRKSRC}; \
|
2008-03-12 04:18:47 +01:00
|
|
|
${SETENV} ${INSTALL_ENV} ${MAKE_ENV} ${RUBY} ${RUBY_SETUP} ${_RUBY_SETUP_INSTALLARGS}
|
2004-11-27 14:57:20 +01:00
|
|
|
.endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# install.rb support
|
|
|
|
#
|
|
|
|
# USE_RUBY_INSTALL use simple install.rb script to install
|
|
|
|
# (default: undefined)
|
|
|
|
# RUBY_SIMPLE_INSTALL name of simple install.rb script (default: install.rb)
|
|
|
|
#
|
|
|
|
.elif defined(USE_RUBY_INSTALL) && empty(USE_RUBY_INSTALL:M[nN][oO])
|
|
|
|
|
|
|
|
RUBY_SIMPLE_INSTALL?= install.rb
|
|
|
|
INSTALL_TARGET?= # empty
|
|
|
|
|
2008-06-19 16:30:45 +02:00
|
|
|
SUBST_CLASSES+= rinstall
|
|
|
|
SUBST_STAGE.rinstall= pre-install
|
|
|
|
SUBST_FILES.rinstall= ${RUBY_SIMPLE_INSTALL}
|
|
|
|
SUBST_SED.rinstall= -e "s|'sitedir'|'vendordir'|g"
|
|
|
|
SUBST_SED.rinstall+= -e "s|'sitelibdir'|'vendorlibdir'|g"
|
|
|
|
SUBST_SED.rinstall+= -e 's|"sitelibdir"|"vendorlibdir"|g'
|
|
|
|
SUBST_SED.rinstall+= -e 's|/site_ruby/|/vendor_ruby/|g'
|
|
|
|
SUBST_MESSAGE.rinstall= Fixing ${RUBY_SIMPLE_INSTALL} files.
|
|
|
|
|
2004-11-27 14:57:20 +01:00
|
|
|
.if !target(do-install)
|
|
|
|
do-install: ruby-simple-install
|
|
|
|
|
|
|
|
ruby-simple-install:
|
|
|
|
@${ECHO_MSG} "===> Running ${RUBY_SIMPLE_INSTALL} to ${INSTALL_TARGET}"
|
2009-05-16 09:22:01 +02:00
|
|
|
${RUN}cd ${WRKSRC}; \
|
2008-03-12 04:18:47 +01:00
|
|
|
${SETENV} ${INSTALL_ENV} ${MAKE_ENV} ${RUBY} ${RUBY_SIMPLE_INSTALL} ${INSTALL_TARGET}
|
2004-11-27 14:57:20 +01:00
|
|
|
.endif
|
|
|
|
.endif # USE_RUBY_INSTALL
|
|
|
|
|
2010-09-10 05:21:57 +02:00
|
|
|
.if defined(USE_RAKE) && empty(USE_RAKE:M[nN][oO])
|
|
|
|
|
|
|
|
.if ${RUBY_VER} == "18"
|
|
|
|
.if !empty(USE_RAKE:M[Rr][Uu][Nn])
|
2012-03-17 14:53:01 +01:00
|
|
|
DEPENDS+= ${RUBY_PKGPREFIX}-rake>=0.8.7:../../devel/ruby-rake
|
2010-09-10 05:21:57 +02:00
|
|
|
.else
|
2012-03-17 14:53:01 +01:00
|
|
|
BUILD_DEPENDS+= ${RUBY_PKGPREFIX}-rake>=0.8.7:../../devel/ruby-rake
|
2010-09-10 05:21:57 +02:00
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# RAKE
|
|
|
|
# The path to the ``rake'' binary.
|
|
|
|
#
|
|
|
|
EVAL_PREFIX+= RAKE_PREFIX=${RAKE_NAME}
|
|
|
|
RAKE= ${RAKE_PREFIX}/bin/${RAKE_NAME}
|
|
|
|
MAKE_ENV+= RAKE=${RAKE:Q}
|
|
|
|
.endif
|
|
|
|
|
2004-11-27 14:57:20 +01:00
|
|
|
.include "replace.mk"
|
|
|
|
.endif
|