Some ruby-gnome2 ebuild does not build C bindings, so there is no need to
call each_ruby_{configure,compile} and emake install of this eclass. Check
if "extconf.rb" and "Makefile" to decide what to do.

Signed-off-by: Naohiro Aota <na...@gentoo.org>
---
 eclass/ruby-ng-gnome2.eclass | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/eclass/ruby-ng-gnome2.eclass b/eclass/ruby-ng-gnome2.eclass
index 1cc3cdce4ce6..619a02d0d1d7 100644
--- a/eclass/ruby-ng-gnome2.eclass
+++ b/eclass/ruby-ng-gnome2.eclass
@@ -51,6 +51,8 @@ SLOT="0"
 # @DESCRIPTION:
 # Run the configure script in the subbinding for each specific ruby target.
 each_ruby_configure() {
+       test -e extconf.rb || return
+
        ${RUBY} extconf.rb || die "extconf.rb failed"
 }
 
@@ -58,6 +60,8 @@ each_ruby_configure() {
 # @DESCRIPTION:
 # Compile the C bindings in the subbinding for each specific ruby target.
 each_ruby_compile() {
+       test -e Makefile || return
+
        # We have injected --no-undefined in Ruby as a safety precaution
        # against broken ebuilds, but the Ruby-Gnome bindings
        # unfortunately rely on the lazy load of other extensions; see bug
@@ -74,11 +78,13 @@ each_ruby_compile() {
 # @DESCRIPTION:
 # Install the files in the subbinding for each specific ruby target.
 each_ruby_install() {
-       # Create the directories, or the package will create them as files.
-       local archdir=$(ruby_rbconfig_value "sitearchdir")
-       dodir ${archdir#${EPREFIX}} /usr/$(get_libdir)/pkgconfig
+       if [ -e Makefile ]; then
+               # Create the directories, or the package will create them as 
files.
+               local archdir=$(ruby_rbconfig_value "sitearchdir")
+               dodir ${archdir#${EPREFIX}} /usr/$(get_libdir)/pkgconfig
 
-       emake DESTDIR="${D}" install || die "make install failed"
+               emake DESTDIR="${D}" install || die "make install failed"
+       fi
 
        each_fakegem_install
 }
-- 
2.25.0


Reply via email to