/[gentoo-x86]/eclass/gems.eclass
Gentoo

Contents of /eclass/gems.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.16 - (hide annotations) (download)
Wed Jan 31 13:46:07 2007 UTC (7 years, 9 months ago) by pclouds
Branch: MAIN
Changes since 1.15: +2 -2 lines
Don't call ruby_patch_mkmf, it causes #164525

1 pythonhead 1.1 # Copyright 1999-2005 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 pclouds 1.16 # $Header: /var/cvsroot/gentoo-x86/eclass/gems.eclass,v 1.15 2007/01/29 12:15:50 pclouds Exp $
4 pythonhead 1.1 #
5     # Author: Rob Cakebread <pythonhead@gentoo.org>
6 caleb 1.9 # Current Maintainer: Ruby Herd <ruby@gentoo.org>
7 pythonhead 1.1 #
8     # The gems eclass is designed to allow easier installation of
9 swegener 1.6 # gems-based ruby packagess and their incorporation into
10 pythonhead 1.1 # the Gentoo Linux system.
11     #
12     # - Features:
13 flameeyes 1.14 # gems_location() - Set ${GEMSDIR} with gem install dir and ${GEM_SRC} with path to gem to install
14 pythonhead 1.1 # gems_src_install() - installs a gem into ${D}
15 flameeyes 1.14 # gems_src_unpack() - Does nothing.
16 pythonhead 1.2 # gems_src_compile() - Does nothing.
17     #
18     # NOTE:
19     # See http://dev.gentoo.org/~pythonhead/ruby/gems.html for notes on using gems with portage
20 pythonhead 1.1
21    
22     inherit ruby eutils
23    
24    
25 caleb 1.7 DEPEND=">=dev-ruby/rubygems-0.8.4-r1
26     !dev-ruby/rdoc"
27 pythonhead 1.1
28     S=${WORKDIR}
29    
30 caleb 1.8 IUSE="doc"
31 pythonhead 1.1
32     gems_location() {
33     local sitelibdir
34     sitelibdir=`ruby -r rbconfig -e 'print Config::CONFIG["sitelibdir"]'`
35     export GEMSDIR=${sitelibdir/site_ruby/gems}
36 pythonhead 1.2
37 pythonhead 1.1 }
38    
39     gems_src_unpack() {
40 pclouds 1.16 #ruby_patch_mkmf
41 pythonhead 1.1 true
42     }
43    
44     gems_src_install() {
45     gems_location
46 pythonhead 1.2
47     if [ -z "${MY_P}" ]; then
48     GEM_SRC=${DISTDIR}/${P}
49 pclouds 1.10 spec_path=${D}/${GEMSDIR}/specifications/${P}.gemspec
50 pythonhead 1.2 else
51     GEM_SRC=${DISTDIR}/${MY_P}
52 pclouds 1.10 spec_path=${D}/${GEMSDIR}/specifications/${MY_P}.gemspec
53 pythonhead 1.2 fi
54    
55 caleb 1.8 if use doc; then
56 pclouds 1.12 myconf="--rdoc"
57 caleb 1.8 else
58 pclouds 1.12 myconf="--no-rdoc"
59 caleb 1.8 fi
60    
61 pclouds 1.12 # RI documentation installation: bug #145222
62     if gem --version|grep -q ^0.9; then
63     if use doc; then
64     myconf="--ri ${myconf}"
65     else
66     myconf="--no-ri ${myconf}"
67     fi
68     fi
69    
70    
71 pythonhead 1.1 dodir ${GEMSDIR}
72 pclouds 1.13 gem install ${GEM_SRC} -v ${PV} ${myconf} -l -i ${D}/${GEMSDIR} || die "gem install failed: gem-$(gem --version) install ${GEM_SRC} -v ${PV} ${myconf} -l -i ${D}/${GEMSDIR}"
73 swegener 1.6
74 pclouds 1.10 # This is a workaround for <=rubygems-0.9.0.8 because it's exitstatus equals 0
75     # even if the dependencies are not found. So we are testing if rubygems at
76     # least installed the gemspec (which should always occur otherwise).
77     # See bug #104733
78 flameeyes 1.14 test -f ${spec_path} || die "gem install failed (spec file ${spec_path} missing)"
79 pclouds 1.10
80 swegener 1.6 if [ -d ${D}/${GEMSDIR}/bin ] ; then
81 pythonhead 1.1 exeinto /usr/bin
82     for exe in ${D}/${GEMSDIR}/bin/* ; do
83     doexe ${exe}
84     done
85     fi
86     }
87    
88     gems_src_compile() {
89     true
90     }
91    
92 pythonhead 1.2 EXPORT_FUNCTIONS src_unpack src_compile src_install

  ViewVC Help
Powered by ViewVC 1.1.20