Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 159580 Details for
Bug 203706
dev-lang/ruby:1.9 unmask
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to implement multiple gem installations for different ruby versions
gems_for_multiple_ruby_versions.patch (text/plain), 3.37 KB, created by
Mark Somerville
on 2008-07-04 22:35:12 UTC
(
hide
)
Description:
Patch to implement multiple gem installations for different ruby versions
Filename:
MIME Type:
Creator:
Mark Somerville
Created:
2008-07-04 22:35:12 UTC
Size:
3.37 KB
patch
obsolete
>--- /usr/portage/eclass/gems.eclass 2008-02-17 09:05:59.000000000 +0000 >+++ gems.eclass 2008-07-04 23:03:09.000000000 +0100 >@@ -10,10 +10,13 @@ > # the Gentoo Linux system. > # > # - Features: >-# gems_location() - Set ${GEMSDIR} with gem install dir and ${GEM_SRC} with path to gem to install >+# gems_location() - Set ${GEMSDIR} with gem install dir and ${GEM_SRC} with >+# path to gem to install. Optionally takes a ruby version string, like >+# "ruby18" as a parameter. > # gems_src_unpack() - Does nothing. > # gems_src_compile() - Does nothing. >-# gems_src_install() - installs a gem into ${D} >+# gems_src_install() - installs a gem into ${D} using each ruby version that is both >+# installed and specified in USE_RUBY. > # > # NOTE: > # See http://dev.gentoo.org/~pythonhead/ruby/gems.html for notes on using gems with portage >@@ -33,9 +36,14 @@ > > gems_location() { > local sitelibdir >- sitelibdir=$(ruby -r rbconfig -e 'print Config::CONFIG["sitelibdir"]') >+ local ruby_version >+ if [[ -z "$1" ]]; then >+ ruby_version="ruby" >+ else >+ ruby_version=$1 >+ fi >+ sitelibdir=$(/usr/bin/${ruby_version} -r rbconfig -e 'print Config::CONFIG["sitelibdir"]') > export GEMSDIR=${sitelibdir/site_ruby/gems} >- > } > > gems_src_unpack() { >@@ -47,16 +55,6 @@ > } > > gems_src_install() { >- gems_location >- >- if [[ -z "${MY_P}" ]]; then >- [[ -z "${GEM_SRC}" ]] && GEM_SRC="${DISTDIR}/${P}" >- spec_path="${D}/${GEMSDIR}/specifications/${P}.gemspec" >- else >- [[ -z "${GEM_SRC}" ]] && GEM_SRC="${DISTDIR}/${MY_P}" >- spec_path="${D}/${GEMSDIR}/specifications/${MY_P}.gemspec" >- fi >- > local myconf > if use doc; then > myconf="--rdoc --ri" >@@ -64,16 +62,46 @@ > myconf="--no-rdoc --no-ri" > fi > >- dodir ${GEMSDIR} >- gem install ${GEM_SRC} --version ${PV} ${myconf} \ >- --local --install-dir "${D}/${GEMSDIR}" || die "gem install failed" >- >- if [[ -d "${D}/${GEMSDIR}/bin" ]] ; then >- exeinto /usr/bin >- for exe in ${D}/${GEMSDIR}/bin/* ; do >- doexe ${exe} >- done >+ # I'm not sure how many ebuilds have correctly set USE_RUBY - let's assume >+ # ruby18 if they haven't, since even pure Ruby gems that have been written >+ # against 1.8 can explode under 1.9. >+ if [[ -z "${USE_RUBY}" ]]; then >+ USE_RUBY="ruby18" >+ elif [[ "${USE_RUBY}" == "any" ]]; then >+ # Get the installed versions. >+ USE_RUBY=`ls /usr/bin/ruby* | grep -E 'ruby1(8|9)' | sed -e 's@/usr/bin/@@g'` > fi >+ >+ local num_ruby_slots=$(echo "${USE_RUBY}" | wc -w) >+ >+ for ruby_version in ${USE_RUBY} ; do >+ einfo "Installing for ${ruby_version}..." >+ gems_location ${ruby_version} >+ dodir ${GEMSDIR} >+ >+ if [[ -z "${MY_P}" ]]; then >+ [[ -z "${GEM_SRC}" ]] && GEM_SRC="${DISTDIR}/${P}" >+ spec_path="${D}/${GEMSDIR}/specifications/${P}.gemspec" >+ else >+ [[ -z "${GEM_SRC}" ]] && GEM_SRC="${DISTDIR}/${MY_P}" >+ spec_path="${D}/${GEMSDIR}/specifications/${MY_P}.gemspec" >+ fi >+ >+ /usr/bin/${ruby_version} /usr/bin/gem install ${GEM_SRC} --version ${PV} ${myconf} \ >+ --local --install-dir "${D}/${GEMSDIR}" || die "gem install failed" >+ >+ if [[ -d "${D}/${GEMSDIR}/bin" ]] ; then >+ exeinto /usr/bin >+ for exe in ${D}/${GEMSDIR}/bin/* ; do >+ if [ "$num_ruby_slots" -ge 2 ] ; then >+ # Ensures that the exe file gets run using the currently >+ # selected version of ruby. >+ sed -i -e 's@^#!/usr/bin/ruby.*$@#!/usr/bin/ruby@' "${exe}" >+ fi >+ doexe ${exe} >+ done >+ fi >+ done > } > > EXPORT_FUNCTIONS src_unpack src_compile src_install
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 203706
:
140658
|
144341
|
159395
| 159580 |
162250
|
163751
|
163770