Add MODRUBY_RUBY_ADJ and MODRUBY_ADJ_FILES. MODRUBY_RUBY_ADJ is a

perl command that accepts filename arguments and modifies the common
/usr/bin/env ruby shebang to ${RUBY}.  MODRUBY_ADJ_FILES is a short
cut that allows you to set filename patterns and have
MODRUBY_RUBY_ADJ called on all files in ${WRKSRC} that match that
pattern.  It adds a pre-configure action to do so, if a pre-configure
action is not already defined.  If a pre-configure action is already
defined, you can call the replacement command with
${MODRUBY_ADJ_REPLACE}.

ok sthen, landry
This commit is contained in:
jeremy 2010-10-07 17:48:53 +00:00
parent 0204a47dca
commit ea588ec908

View File

@ -1,4 +1,4 @@
# $OpenBSD: ruby.port.mk,v 1.27 2010/09/28 20:12:16 jeremy Exp $
# $OpenBSD: ruby.port.mk,v 1.28 2010/10/07 17:48:53 jeremy Exp $
# ruby module
@ -42,6 +42,19 @@ REGRESS_DEPENDS+= ::devel/ruby-rspec
SUBST_VARS+= MODRUBY_BIN_REV MODRUBY_REV MODRUBY_ARCH
MODRUBY_RUBY_ADJ= perl -pi -e 's,/usr/bin/env ruby,${RUBY},'
MODRUBY_ADJ_FILES?=
.if !empty(MODRUBY_ADJ_FILES)
MODRUBY_ADJ_REPLACE= for pat in ${MODRUBY_ADJ_FILES:QL}; do \
find ${WRKSRC} -name $$pat -print0 | \
xargs -0r ${MODRUBY_RUBY_ADJ} ; \
done
. if !target(pre-configure)
pre-configure:
${MODRUBY_ADJ_REPLACE}
. endif
.endif
.if ${CONFIGURE_STYLE:L:Mextconf}
CONFIGURE_STYLE= simple
CONFIGURE_SCRIPT= ${RUBY} extconf.rb