Solve bug #320545 in the least hacky way: disable --no-undefined for
authorDiego Elio Pettenò <flameeyes@gentoo.org>
Fri, 21 May 2010 16:54:25 +0000 (16:54 +0000)
committerDiego Elio Pettenò <flameeyes@gentoo.org>
Fri, 21 May 2010 16:54:25 +0000 (16:54 +0000)
the Ruby-Gnome2 bindings. Unfortunately they rely on a
partially-undefined behaviour, let's just hope they'll never come
giving us trouble for this.

Also avoid using cp -a (non-portable) for installing samples, use
insinto/doins instead.

eclass/ruby-ng-gnome2.eclass

index ca0165e1a12559382b28c5478f1fe5dcadecf997..51eb6b16537baca3f439dff6e87e93b16fbe9cbc 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2010 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng-gnome2.eclass,v 1.1 2010/01/13 18:33:32 graaff Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng-gnome2.eclass,v 1.2 2010/05/21 16:54:25 flameeyes Exp $
 #
 # @ECLASS: ruby-ng-gnome2.eclass
 # @MAINTAINER:
@@ -34,6 +34,13 @@ each_ruby_configure() {
 # @DESCRIPTION:
 # Compile the C bindings in the subbinding for each specific ruby target.
 each_ruby_compile() {
+       # 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
+       # #320545.
+       find . -name Makefile -print0 | xargs -0 \
+               sed -i -e 's:-Wl,--no-undefined ::' || die "--no-undefined removal failed"
+
        emake || die "emake failed"
 }
 
@@ -55,7 +62,7 @@ all_ruby_install() {
                [ -s "$doc" ] && dodoc $doc
        done
        if [[ -d sample ]]; then
-               dodir /usr/share/doc/${PF}
-               cp -a sample "${D}"/usr/share/doc/${PF} || die "cp failed"
+               insinto /usr/share/doc/${PF}
+               doins -r sample || die "sample install failed"
        fi
 }