2008-09-28 11:47:27 -04:00
|
|
|
# $OpenBSD: ruby.port.mk,v 1.21 2008/09/28 15:47:27 bernd Exp $
|
2002-03-17 17:29:02 -05:00
|
|
|
|
|
|
|
# ruby module
|
|
|
|
|
2006-07-14 11:41:21 -04:00
|
|
|
MODRUBY_REV= 1.8
|
|
|
|
|
2006-06-11 14:57:11 -04:00
|
|
|
RUBY= ${LOCALBASE}/bin/ruby
|
|
|
|
|
2006-12-01 09:04:06 -05:00
|
|
|
MODRUBY_RUN_DEPENDS+= ::lang/ruby
|
2008-09-02 17:08:29 -04:00
|
|
|
MODRUBY_LIB_DEPENDS+= ruby.>=2::lang/ruby
|
2006-12-01 09:04:06 -05:00
|
|
|
|
2006-06-11 14:57:11 -04:00
|
|
|
BUILD_DEPENDS+= ::lang/ruby
|
2006-12-01 09:04:06 -05:00
|
|
|
RUN_DEPENDS+= ${MODRUBY_RUN_DEPENDS}
|
2002-03-17 17:29:02 -05:00
|
|
|
|
2008-06-14 19:40:35 -04:00
|
|
|
CATEGORIES+= lang/ruby
|
|
|
|
|
2002-12-09 16:04:08 -05:00
|
|
|
# location of ruby libraries
|
2002-12-09 15:26:36 -05:00
|
|
|
MODRUBY_LIBDIR= ${LOCALBASE}/lib/ruby
|
2002-12-09 16:04:08 -05:00
|
|
|
|
|
|
|
# common directories for ruby extensions
|
|
|
|
# used to create docs and examples install path
|
2002-12-09 15:26:36 -05:00
|
|
|
MODRUBY_DOCDIR= ${PREFIX}/share/doc/ruby
|
|
|
|
MODRUBY_EXAMPLEDIR= ${PREFIX}/share/examples/ruby
|
2006-07-14 11:41:21 -04:00
|
|
|
MODRUBY_ARCH= ${MACHINE_ARCH:S/amd64/x86_64/}-openbsd${OSREV}
|
2002-03-17 17:29:02 -05:00
|
|
|
|
2006-11-25 05:03:32 -05:00
|
|
|
SUBST_VARS+= MODRUBY_REV MODRUBY_ARCH
|
2004-02-20 17:52:57 -05:00
|
|
|
|
2006-11-27 04:36:14 -05:00
|
|
|
.if ${CONFIGURE_STYLE:L:Mextconf}
|
|
|
|
CONFIGURE_STYLE= simple
|
|
|
|
CONFIGURE_SCRIPT= ${LOCALBASE}/bin/ruby extconf.rb
|
|
|
|
.elif ${CONFIGURE_STYLE:L:Mgem}
|
2006-06-11 15:56:31 -04:00
|
|
|
EXTRACT_SUFX= .gem
|
|
|
|
|
2008-09-28 11:47:27 -04:00
|
|
|
BUILD_DEPENDS+= :ruby-gems->=1.3.0:devel/ruby-gems
|
2006-12-01 09:04:06 -05:00
|
|
|
MODRUBY_RUN_DEPENDS+= ::devel/ruby-gems
|
2006-06-11 15:56:31 -04:00
|
|
|
NO_BUILD= Yes
|
|
|
|
|
|
|
|
SUBST_VARS+= DISTNAME
|
|
|
|
|
|
|
|
GEM= ${LOCALBASE}/bin/gem
|
2006-07-14 11:41:21 -04:00
|
|
|
GEM_BASE= ${PREFIX}/lib/ruby/gems/${MODRUBY_REV}
|
2008-09-28 11:47:27 -04:00
|
|
|
GEM_FLAGS= --local --rdoc --no-force --verbose --default-source-index
|
2007-11-13 12:32:59 -05:00
|
|
|
_GEM_CONTENT= ${WRKDIR}/gem-content
|
2006-10-18 09:41:36 -04:00
|
|
|
_GEM_DATAFILE= ${_GEM_CONTENT}/data.tar.gz
|
|
|
|
_GEM_PATCHED= ${DISTNAME}${EXTRACT_SUFX}
|
2006-06-11 15:56:31 -04:00
|
|
|
|
2007-11-13 11:10:37 -05:00
|
|
|
# Ignore specified gem dependencies.
|
|
|
|
GEM_SKIPDEPENDS?=
|
2008-01-14 13:39:07 -05:00
|
|
|
. if !empty(GEM_SKIPDEPENDS)
|
2007-11-13 11:10:37 -05:00
|
|
|
GEM_FLAGS+= --skip-dependencies "${GEM_SKIPDEPENDS}"
|
2008-01-14 13:39:07 -05:00
|
|
|
. endif
|
2007-11-13 11:10:37 -05:00
|
|
|
|
2006-10-18 09:41:36 -04:00
|
|
|
. if !target(do-extract)
|
|
|
|
do-extract:
|
|
|
|
@mkdir -p ${_GEM_CONTENT} ${WRKDIST}
|
|
|
|
@cd ${_GEM_CONTENT} && tar -xf ${FULLDISTDIR}/${DISTNAME}${EXTRACT_SUFX}
|
|
|
|
@cd ${WRKDIST} && tar -xzf ${_GEM_DATAFILE} && rm ${_GEM_DATAFILE}
|
|
|
|
. endif
|
|
|
|
. if !target(pre-fake)
|
|
|
|
pre-fake:
|
|
|
|
@${ECHO_MSG} "===> Writing patched gem for ${FULLPKGNAME}${_MASTER}"
|
|
|
|
# "special" handling for ruby tar, included in ruby-gems
|
|
|
|
@cd ${WRKDIST} && find . -type f \! -name '*.orig' -print | \
|
|
|
|
pax -wz -s '/^\.\///' -f ${_GEM_DATAFILE}
|
2007-11-13 12:32:59 -05:00
|
|
|
@cd ${_GEM_CONTENT} && tar -cf ${WRKDIR}/${_GEM_PATCHED} *.gz
|
2006-10-18 09:41:36 -04:00
|
|
|
. endif
|
2008-01-14 13:39:07 -05:00
|
|
|
# Most gems need a custom do-regress target.
|
2006-06-11 15:56:31 -04:00
|
|
|
. if !target(do-regress)
|
|
|
|
NO_REGRESS= Yes
|
|
|
|
. endif
|
|
|
|
. if !target(do-install)
|
|
|
|
do-install:
|
|
|
|
@${INSTALL_DATA_DIR} ${GEM_BASE}
|
|
|
|
@${SUDO} ${GEM} install ${GEM_FLAGS} --install-dir ${GEM_BASE} \
|
2006-10-18 09:41:36 -04:00
|
|
|
${WRKDIR}/${_GEM_PATCHED}
|
2006-06-11 15:56:31 -04:00
|
|
|
@if [ -d ${GEM_BASE}/bin ]; then \
|
|
|
|
for f in ${GEM_BASE}/bin/*; do \
|
|
|
|
mv $$f ${PREFIX}/bin; \
|
|
|
|
done; \
|
|
|
|
rm -r ${GEM_BASE}/bin; \
|
|
|
|
fi
|
|
|
|
. endif
|
|
|
|
.elif ${CONFIGURE_STYLE:L:Msetup}
|
2006-06-11 14:57:11 -04:00
|
|
|
MODRUBY_configure= \
|
|
|
|
cd ${WRKSRC}; ${SETENV} ${CONFIGURE_ENV} ${RUBY} setup.rb config \
|
|
|
|
--prefix=${PREFIX} ${CONFIGURE_ARGS};
|
|
|
|
. if !target(do-build)
|
|
|
|
do-build:
|
|
|
|
@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${RUBY} setup.rb setup
|
|
|
|
. endif
|
|
|
|
. if !target(do-regress)
|
|
|
|
NO_REGRESS=Yes
|
|
|
|
. endif
|
|
|
|
. if !target(do-install)
|
|
|
|
do-install:
|
|
|
|
@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${RUBY} setup.rb install \
|
|
|
|
--prefix=${DESTDIR}
|
|
|
|
. endif
|
|
|
|
.endif
|