god is distributed as a ruby gem, but unlike other ruby gems, doesn't
have a package prefix.  However, it still inherits the FLAVORs, even
though they all result in the same package name. Modify ruby.port.mk
so that the FLAVOR handling can be disabled for gem ports by setting
MODRUBY_HANDLE_FLAVORS = No, and use this in god's Makefile.

While here, enable the regress tests.  The regress tests require testrb,
which differs between ruby versions (and are used in other regress tests
that I'll be sending diffs for), so add MODRUBY_BIN_TESTRB to
ruby.port.mk with the appropriate testrb command.

Looking for OKs.

Jeremy

Index: Makefile
===================================================================
RCS file: /cvs/ports/sysutils/god/Makefile,v
retrieving revision 1.10
diff -u -p -r1.10 Makefile
--- Makefile    6 Jan 2011 04:24:24 -0000       1.10
+++ Makefile    24 Mar 2011 20:41:53 -0000
@@ -15,6 +15,7 @@ PERMIT_DISTFILES_FTP= Yes
 
 MODULES=       lang/ruby
 
+MODRUBY_HANDLE_FLAVORS = No
 BUILD_DEPENDS= ${RUN_DEPENDS}
 RUN_DEPENDS=   devel/ruby-hoe>=1.4.0
 
@@ -23,5 +24,10 @@ CONFIGURE_STYLE=ruby gem ext
 post-install:
        @mkdir -p ${PREFIX}/share/examples/god
        @cp -r ${WRKSRC}/examples/* ${PREFIX}/share/examples/god/
+
+REGRESS_DEPENDS =      devel/ruby-mocha,${MODRUBY_FLAVOR}
+
+do-regress:
+       cd ${WRKSRC} && RUBYOPT=-rubygems ${MODRUBY_BIN_TESTRB} test/test_*.rb
 
 .include <bsd.port.mk>
Index: lang/ruby/ruby.port.mk
===================================================================
RCS file: /cvs/ports/lang/ruby/ruby.port.mk,v
retrieving revision 1.43
diff -u -p -r1.43 ruby.port.mk
--- lang/ruby/ruby.port.mk      18 Mar 2011 23:04:22 -0000      1.43
+++ lang/ruby/ruby.port.mk      24 Mar 2011 20:39:18 -0000
@@ -4,6 +4,14 @@
 
 CATEGORIES+=           lang/ruby
 
+# Whether the ruby module should automatically add FLAVORs.
+# If left blank, does so only for gem and extconf ports.
+.if ${CONFIGURE_STYLE:L:Mgem} || ${CONFIGURE_STYLE:L:Mextconf}
+MODRUBY_HANDLE_FLAVORS ?= Yes
+.else
+MODRUBY_HANDLE_FLAVORS ?= No
+.endif
+
 # This allows you to build ruby 1.8, ruby 1.9, and jruby packages using
 # the same port directory for gem and extconf based ports.  It does this
 # by adding FLAVORS automatically, unless FLAVORS are already defined
@@ -11,7 +19,7 @@ CATEGORIES+=          lang/ruby
 # version.  For example, JDBC gem ports want to set MODRUBY_REV=jruby,
 # since they don't work on ruby 1.8 or ruby 1.9.
 .if !defined(MODRUBY_REV)
-.  if ${CONFIGURE_STYLE:L:Mgem} || ${CONFIGURE_STYLE:L:Mextconf}
+.  if ${MODRUBY_HANDLE_FLAVORS:L:Myes}
 .    if !defined(FLAVORS)
 FLAVORS?=              ruby19 rbx jruby
 .    endif
@@ -118,6 +126,7 @@ MODRUBY_RSPEC_DEPENDS =     devel/ruby-rspec
 RUBY=                  ${LOCALBASE}/jruby/bin/jruby
 RAKE=                  ${RUBY} -S rake
 RSPEC=                 ${RUBY} -S spec
+MODRUBY_BIN_TESTRB =   ${RUBY} -S testrb
 
 # Without this, JRuby often fails with a memory error.
 MAKE_ENV+=             JAVA_MEM='-Xms256m -Xmx256m'
@@ -125,9 +134,11 @@ MAKE_ENV+=         JAVA_MEM='-Xms256m -Xmx256m'
 RUBY=                  ${LOCALBASE}/bin/rbx
 RAKE=                  ${RUBY} -S rake
 RSPEC=                 ${RUBY} -S spec
+MODRUBY_BIN_TESTRB =   ${RUBY} -S testrb
 .else
 RUBY=                  ${LOCALBASE}/bin/ruby${MODRUBY_BINREV}
 RAKE=                  ${LOCALBASE}/bin/rake${MODRUBY_BINREV}
+MODRUBY_BIN_TESTRB =   ${LOCALBASE}/bin/testrb${MODRUBY_BINREV}
 .  if ${MODRUBY_REV} == 1.8
 MODRUBY_RAKE_DEPENDS = devel/ruby-rake
 RSPEC=                 ${LOCALBASE}/bin/spec

Reply via email to