| 1 | # Copyright 1999-2009 Gentoo Foundation |
1 | # Copyright 1999-2009 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.22 2010/07/14 13:11:51 flameeyes Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.23 2010/07/30 15:05:08 flameeyes Exp $ |
| 4 | # |
4 | # |
| 5 | # @ECLASS: ruby-ng.eclass |
5 | # @ECLASS: ruby-ng.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # Ruby herd <ruby@gentoo.org> |
7 | # Ruby herd <ruby@gentoo.org> |
| 8 | # |
8 | # |
| … | |
… | |
| 390 | _ruby_invoke_environment all all_ruby_test |
390 | _ruby_invoke_environment all all_ruby_test |
| 391 | } |
391 | } |
| 392 | |
392 | |
| 393 | _each_ruby_check_install() { |
393 | _each_ruby_check_install() { |
| 394 | local libruby_basename=$(${RUBY} -rrbconfig -e 'puts Config::CONFIG["LIBRUBY_SO"]') |
394 | local libruby_basename=$(${RUBY} -rrbconfig -e 'puts Config::CONFIG["LIBRUBY_SO"]') |
| 395 | local libruby_soname=$(scanelf -qS "/usr/$(get_libdir)/${libruby_basename}" | awk '{ print $1 }') |
395 | local libruby_soname=$(scanelf -F "%S#F" -qS "/usr/$(get_libdir)/${libruby_basename}") |
| 396 | local sitedir=$(${RUBY} -rrbconfig -e 'puts Config::CONFIG["sitedir"]') |
396 | local sitedir=$(${RUBY} -rrbconfig -e 'puts Config::CONFIG["sitedir"]') |
| 397 | local sitelibdir=$(${RUBY} -rrbconfig -e 'puts Config::CONFIG["sitelibdir"]') |
397 | local sitelibdir=$(${RUBY} -rrbconfig -e 'puts Config::CONFIG["sitelibdir"]') |
| 398 | |
398 | |
| 399 | # Look for wrong files in sitedir |
399 | # Look for wrong files in sitedir |
| 400 | # if [[ -d "${D}${sitedir}" ]]; then |
400 | # if [[ -d "${D}${sitedir}" ]]; then |
| … | |
… | |
| 407 | # fi |
407 | # fi |
| 408 | |
408 | |
| 409 | # The current implementation lacks libruby (i.e.: jruby) |
409 | # The current implementation lacks libruby (i.e.: jruby) |
| 410 | [[ -z ${libruby_soname} ]] && return 0 |
410 | [[ -z ${libruby_soname} ]] && return 0 |
| 411 | |
411 | |
| 412 | scanelf -qnR "${D}${sitedir}" \ |
412 | # Check also the gems directory, since we could be installing compiled |
|
|
413 | # extensions via ruby-fakegem; make sure to check only in sitelibdir, since |
|
|
414 | # that's what changes between two implementations (otherwise you'd get false |
|
|
415 | # positives now that Ruby 1.9.2 installs with the same sitedir as 1.8) |
|
|
416 | scanelf -qnR "${D}${sitelibdir}" "${D}${sitelibdir/site_ruby/gems}" \ |
| 413 | | fgrep -v "${libruby_soname}" \ |
417 | | fgrep -v "${libruby_soname}" \ |
| 414 | > "${T}"/ruby-ng-${_ruby_implementation}-mislink.log |
418 | > "${T}"/ruby-ng-${_ruby_implementation}-mislink.log |
| 415 | |
419 | |
| 416 | if [[ -s "${T}"/ruby-ng-${_ruby_implementation}-mislink.log ]]; then |
420 | if [[ -s "${T}"/ruby-ng-${_ruby_implementation}-mislink.log ]]; then |
| 417 | ewarn "Extensions installed for ${_ruby_implementation} with missing links to ${libruby_soname}" |
421 | ewarn "Extensions installed for ${_ruby_implementation} with missing links to ${libruby_soname}" |