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

Diff of /eclass/ruby.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.11 Revision 1.12
1# Copyright 1999-2003 Gentoo Technologies, Inc. 1# Copyright 1999-2003 Gentoo Technologies, Inc.
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/Attic/ruby.eclass,v 1.11 2003/11/03 15:55:37 usata Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/ruby.eclass,v 1.12 2003/11/15 18:02:29 usata Exp $
4# 4#
5# Author: Mamoru KOMACHI <usata@gentoo.org> 5# Author: Mamoru KOMACHI <usata@gentoo.org>
6# 6#
7# The ruby eclass is designed to allow easier installation of ruby 7# The ruby eclass is designed to allow easier installation of ruby
8# softwares, and their incorporation into the Gentoo Linux system. 8# softwares, and their incorporation into the Gentoo Linux system.
9 9
10# src_unpack, src_compile and src_install call a set of functions to emerge
11# ruby with SLOT support; econf, emake and einstall is a wrapper for ruby
12# to automate configuration, make and install process (they override default
13# econf, emake and einstall defined by ebuild.sh respectively).
14
15# Variables:
16# USE_RUBY Defines which version of ruby is supported.
17# Set it to "0" if it installs only version independent files,
18# and set it to something like "1.6 1.8" if the ebuild supports
19# both ruby 1.6 and 1.8 but has version depenedent files such
20# as libraries.
21# EXTRA_ECONF You can pass extra arguments to econf by defining this
22# variable. Note that you cannot specify them by command line
23# if you are using <sys-apps/portage-2.0.49-r17.
24
10ECLASS=ruby 25ECLASS=ruby
11INHERITED="${INHERITED} ${ECLASS}" 26INHERITED="${INHERITED} ${ECLASS}"
12EXPORT_FUNCTIONS erubyconf erubymake erubyinstall erubydoc \ 27EXPORT_FUNCTIONS erubyconf erubymake erubyinstall erubydoc \
13 src_unpack econf emake src_compile einstall src_install 28 src_unpack econf emake src_compile einstall src_install
14 29
17 32
18SLOT="0" 33SLOT="0"
19LICENSE="Ruby" 34LICENSE="Ruby"
20 35
21newdepend ">=dev-lang/ruby-1.6.8" 36newdepend ">=dev-lang/ruby-1.6.8"
22if has_version '=dev-lang/ruby-1.6*' ; then 37if has_version '=dev-lang/ruby-1.6*' && [[ "${USE_RUBY/1.6/}" != "${USE_RUBY}" ]] ; then
23 USE_RUBY_1_6=1 38 WITH_RUBY="${WITH_RUBY} 1.6"
24fi 39fi
25if has_version '=dev-lang/ruby-1.8*' ; then 40if has_version '=dev-lang/ruby-1.8*' && [[ "${USE_RUBY/1.8/}" != "${USE_RUBY}" ]] ; then
26 USE_RUBY_1_8=1 41 WITH_RUBY="${WITH_RUBY} 1.8"
27fi 42fi
28 43
29ruby_src_unpack() { 44ruby_src_unpack() {
30 if [ "${USE_RUBY_1_6}" -a "${USE_RUBY_1_8}" ] && \ 45 if [[ "${WITH_RUBY/1.6/}" != "${WITH_RUBY}" && "${WITH_RUBY/1.8/}" != "${WITH_RUBY}" ]] ; then
31 [ ! "${WANT_RUBY_1_6}" -a ! "${WANT_RUBY_1_8}" ] && \
32 [ -n "${RUBY_SLOT}" ] ; then
33 mkdir -p ${S}/{1.6,1.8} 46 mkdir -p ${S}/{1.6,1.8}
34 if [ "${RUBY_SLOT}" = "1.6" -o "${RUBY_SLOT}" = "0" ] ; then
35 cd ${S}/1.6; unpack ${A}; cd - 47 cd ${S}/1.6; unpack ${A}; cd -
36 fi
37 if [ "${RUBY_SLOT}" = "1.8" -o "${RUBY_SLOT}" = "0" ] ; then
38 cd ${S}/1.8; unpack ${A}; cd - 48 cd ${S}/1.8; unpack ${A}; cd -
39 fi
40 else 49 else
41 unpack ${A} 50 unpack ${A}
42 fi 51 fi
43} 52}
44 53
76 ${RUBY} extconf.rb $@ || die "extconf.rb failed" 85 ${RUBY} extconf.rb $@ || die "extconf.rb failed"
77 fi 86 fi
78} 87}
79 88
80ruby_econf() { 89ruby_econf() {
81 if [ "${USE_RUBY_1_6}" -a "${USE_RUBY_1_8}" ] && \ 90 if [[ "${WITH_RUBY/1.6/}" != "${WITH_RUBY}" && "${WITH_RUBY/1.8/}" != "${WITH_RUBY}" ]] ; then
82 [ ! "${WANT_RUBY_1_6}" -a ! "${WANT_RUBY_1_8}" ] && \
83 [ -n "${RUBY_SLOT}" ] ; then
84 if [ "${RUBY_SLOT}" = "1.6" -o "${RUBY_SLOT}" = "0" ] ; then
85 einfo "running econf for ruby 1.6 ;)" 91 einfo "running econf for ruby 1.6 ;)"
86 cd 1.6/${S#${WORKDIR}} 92 cd 1.6/${S#${WORKDIR}}
87 erubyconf ruby16 $@ || die 93 erubyconf ruby16 $@ || die
88 cd - 94 cd -
89 fi
90 if [ "${RUBY_SLOT}" = "1.8" -o "${RUBY_SLOT}" = "0" ] ; then
91 einfo "running econf for ruby 1.8 ;)" 95 einfo "running econf for ruby 1.8 ;)"
92 cd 1.8/${S#${WORKDIR}} 96 cd 1.8/${S#${WORKDIR}}
93 erubyconf ruby18 $@ || die 97 erubyconf ruby18 $@ || die
94 cd - 98 cd -
95 fi
96 else 99 else
97 einfo "running econf for ruby ;)" 100 einfo "running econf for ruby ;)"
98 erubyconf ruby $@ || die 101 erubyconf ruby $@ || die
99 fi 102 fi
100} 103}
104 make $@ || die "emake for ruby failed" 107 make $@ || die "emake for ruby failed"
105 fi 108 fi
106} 109}
107 110
108ruby_emake() { 111ruby_emake() {
109 if [ "${USE_RUBY_1_6}" -a "${USE_RUBY_1_8}" ] && \ 112 if [[ "${WITH_RUBY/1.6/}" != "${WITH_RUBY}" && "${WITH_RUBY/1.8/}" != "${WITH_RUBY}" ]] ; then
110 [ ! "${WANT_RUBY_1_6}" -a ! "${WANT_RUBY_1_8}" ] && \
111 [ -n "${RUBY_SLOT}" ] ; then
112 if [ "${RUBY_SLOT}" = "1.6" -o "${RUBY_SLOT}" = "0" ] ; then
113 einfo "running emake for ruby 1.6 ;)" 113 einfo "running emake for ruby 1.6 ;)"
114 cd 1.6/${S#${WORKDIR}} 114 cd 1.6/${S#${WORKDIR}}
115 erubymake $@ || die 115 erubymake $@ || die
116 cd - 116 cd -
117 fi
118 if [ "${RUBY_SLOT}" = "1.8" -o "${RUBY_SLOT}" = "0" ] ; then
119 einfo "running emake for ruby 1.8 ;)" 117 einfo "running emake for ruby 1.8 ;)"
120 cd 1.8/${S#${WORKDIR}} 118 cd 1.8/${S#${WORKDIR}}
121 erubymake $@ || die 119 erubymake $@ || die
122 cd - 120 cd -
123 fi
124 else 121 else
125 einfo "running emake for ruby ;)" 122 einfo "running emake for ruby ;)"
126 erubymake $@ || die 123 erubymake $@ || die
127 fi 124 fi
128} 125}
150 ${RUBY} install.rb install $@ \ 147 ${RUBY} install.rb install $@ \
151 || die "install.rb install failed" 148 || die "install.rb install failed"
152 elif [ -f extconf.rb -o -f Makefile ] ; then 149 elif [ -f extconf.rb -o -f Makefile ] ; then
153 make DESTDIR=${D} $@ install || die "make install failed" 150 make DESTDIR=${D} $@ install || die "make install failed"
154 else 151 else
155 if [ "${WANT_RUBY_1_6}" -o "${WANT_RUBY_1_8}" \ 152 if [[ "${WITH_RUBY/1.6/}" != "${WITH_RUBY}" && "${WITH_RUBY/1.8/}" != "${WITH_RUBY}" ]] ; then
156 -o "${RUBY_SLOT}" = "1.6" -o "${RUBY_SLOT}" = "1.8" ] ; then
157 siteruby=$(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitelibdir"]') 153 siteruby=$(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitelibdir"]')
158 else 154 else
159 siteruby=$(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitedir"]') 155 siteruby=$(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitedir"]')
160 fi 156 fi
161 insinto ${siteruby} 157 insinto ${siteruby}
163 fi 159 fi
164} 160}
165 161
166ruby_einstall() { 162ruby_einstall() {
167 163
168 if [ "${USE_RUBY_1_6}" -a "${USE_RUBY_1_8}" ] && \ 164 if [[ "${WITH_RUBY/1.6/}" != "${WITH_RUBY}" && "${WITH_RUBY/1.8/}" != "${WITH_RUBY}" ]] ; then
169 [ ! "${WANT_RUBY_1_6}" -a ! "${WANT_RUBY_1_8}" ] && \
170 [ -n "${RUBY_SLOT}" ] ; then
171 if [ "${RUBY_SLOT}" = "1.6" -o "${RUBY_SLOT}" = "0" ] ; then
172 einfo "running einstall for ruby 1.6 ;)" 165 einfo "running einstall for ruby 1.6 ;)"
173 MY_S=${S}/1.6/${S#${WORKDIR}} 166 MY_S=${S}/1.6/${S#${WORKDIR}}
174 cd ${MY_S} 167 cd ${MY_S}
175 erubyinstall ruby16 $@ 168 erubyinstall ruby16 $@
176 fi
177 if [ "${RUBY_SLOT}" = "1.8" -o "${RUBY_SLOT}" = "0" ] ; then
178 einfo "running einstall for ruby 1.8 ;)" 169 einfo "running einstall for ruby 1.8 ;)"
179 MY_S=${S}/1.8/${S#${WORKDIR}} 170 MY_S=${S}/1.8/${S#${WORKDIR}}
180 cd ${MY_S} 171 cd ${MY_S}
181 erubyinstall ruby18 $@ 172 erubyinstall ruby18 $@
182 fi
183 S=${MY_S} 173 S=${MY_S}
184 #cd - 174 #cd -
185 else 175 else
186 einfo "running einstall for ruby ;)" 176 einfo "running einstall for ruby ;)"
187 erubyinstall ruby $@ 177 erubyinstall ruby $@

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.20