1 |
flameeyes 10/07/30 16:56:22 |
2 |
|
3 |
Modified: ruby-ng.eclass |
4 |
Log: |
5 |
Apply changes to the eclass for Prefix support. Thanks to Jeremy Olexa. |
6 |
Closes bug #330543. |
7 |
|
8 |
Revision Changes Path |
9 |
1.24 eclass/ruby-ng.eclass |
10 |
|
11 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-ng.eclass?rev=1.24&view=markup |
12 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-ng.eclass?rev=1.24&content-type=text/plain |
13 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-ng.eclass?r1=1.23&r2=1.24 |
14 |
|
15 |
Index: ruby-ng.eclass |
16 |
=================================================================== |
17 |
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v |
18 |
retrieving revision 1.23 |
19 |
retrieving revision 1.24 |
20 |
diff -u -r1.23 -r1.24 |
21 |
--- ruby-ng.eclass 30 Jul 2010 15:05:08 -0000 1.23 |
22 |
+++ ruby-ng.eclass 30 Jul 2010 16:56:21 -0000 1.24 |
23 |
@@ -1,6 +1,6 @@ |
24 |
# Copyright 1999-2009 Gentoo Foundation |
25 |
# Distributed under the terms of the GNU General Public License v2 |
26 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.23 2010/07/30 15:05:08 flameeyes Exp $ |
27 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.24 2010/07/30 16:56:21 flameeyes Exp $ |
28 |
# |
29 |
# @ECLASS: ruby-ng.eclass |
30 |
# @MAINTAINER: |
31 |
@@ -53,7 +53,7 @@ |
32 |
case ${EAPI} in |
33 |
0|1) |
34 |
die "Unsupported EAPI=${EAPI} (too old) for ruby-ng.eclass" ;; |
35 |
- 2) ;; |
36 |
+ 2|3) ;; |
37 |
*) |
38 |
die "Unknown EAPI=${EAPI} for ruby-ng.eclass" |
39 |
esac |
40 |
@@ -391,8 +391,14 @@ |
41 |
} |
42 |
|
43 |
_each_ruby_check_install() { |
44 |
+ local scancmd=scanelf |
45 |
+ # we have a Mach-O object here |
46 |
+ [[ ${CHOST} == *-darwin ]] && scancmd=scanmacho |
47 |
+ |
48 |
+ has "${EAPI}" 2 && ! use prefix && EPREFIX= |
49 |
+ |
50 |
local libruby_basename=$(${RUBY} -rrbconfig -e 'puts Config::CONFIG["LIBRUBY_SO"]') |
51 |
- local libruby_soname=$(scanelf -F "%S#F" -qS "/usr/$(get_libdir)/${libruby_basename}") |
52 |
+ local libruby_soname=$(basename $(${scancmd} -F "%S#F" -qS "${EPREFIX}/usr/$(get_libdir)/${libruby_basename}")) |
53 |
local sitedir=$(${RUBY} -rrbconfig -e 'puts Config::CONFIG["sitedir"]') |
54 |
local sitelibdir=$(${RUBY} -rrbconfig -e 'puts Config::CONFIG["sitelibdir"]') |
55 |
|
56 |
@@ -413,7 +419,7 @@ |
57 |
# extensions via ruby-fakegem; make sure to check only in sitelibdir, since |
58 |
# that's what changes between two implementations (otherwise you'd get false |
59 |
# positives now that Ruby 1.9.2 installs with the same sitedir as 1.8) |
60 |
- scanelf -qnR "${D}${sitelibdir}" "${D}${sitelibdir/site_ruby/gems}" \ |
61 |
+ ${scancmd} -qnR "${D}${sitelibdir}" "${D}${sitelibdir/site_ruby/gems}" \ |
62 |
| fgrep -v "${libruby_soname}" \ |
63 |
> "${T}"/ruby-ng-${_ruby_implementation}-mislink.log |
64 |
|
65 |
@@ -452,8 +458,10 @@ |
66 |
# Installs the specified file(s) into the sitelibdir of the Ruby interpreter in ${RUBY}. |
67 |
doruby() { |
68 |
[[ -z ${RUBY} ]] && die "\$RUBY is not set" |
69 |
+ has "${EAPI}" 2 && ! use prefix && EPREFIX= |
70 |
( # don't want to pollute calling env |
71 |
- insinto $(ruby_rbconfig_value 'sitelibdir') |
72 |
+ sitelibdir=$(ruby_rbconfig_value 'sitelibdir') |
73 |
+ insinto ${sitelibdir#${EPREFIX}} |
74 |
insopts -m 0644 |
75 |
doins "$@" |
76 |
) || die "failed to install $@" |