/[gentoo-x86]/dev-lang/ruby/ruby-1.9.3_p125.ebuild
Gentoo

Contents of /dev-lang/ruby/ruby-1.9.3_p125.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Sun Sep 16 16:45:22 2012 UTC (2 years, 3 months ago) by ulm
Branch: MAIN
Changes since 1.6: +2 -2 lines
Update LICENSE, bug 434332.

(Portage version: 2.1.11.16/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-lang/ruby/ruby-1.9.3_p125.ebuild,v 1.6 2012/07/22 14:07:45 nixnut Exp $
4
5 EAPI=2
6
7 #PATCHSET=
8
9 inherit autotools eutils flag-o-matic multilib versionator
10
11 RUBYPL=$(get_version_component_range 4)
12
13 MY_P="${PN}-$(get_version_component_range 1-3)-${RUBYPL:-0}"
14 S=${WORKDIR}/${MY_P}
15
16 SLOT=$(get_version_component_range 1-2)
17 MY_SUFFIX=$(delete_version_separator 1 ${SLOT})
18 # 1.9.3 still uses 1.9.1
19 RUBYVERSION=1.9.1
20
21 if [[ -n ${PATCHSET} ]]; then
22 if [[ ${PVR} == ${PV} ]]; then
23 PATCHSET="${PV}-r0.${PATCHSET}"
24 else
25 PATCHSET="${PVR}.${PATCHSET}"
26 fi
27 else
28 PATCHSET="${PVR}"
29 fi
30
31 DESCRIPTION="An object-oriented scripting language"
32 HOMEPAGE="http://www.ruby-lang.org/"
33 SRC_URI="mirror://ruby/1.9/${MY_P}.tar.bz2
34 http://dev.gentoo.org/~flameeyes/ruby-team/${PN}-patches-${PATCHSET}.tar.bz2"
35
36 LICENSE="|| ( Ruby-BSD BSD-2 )"
37 KEYWORDS="~alpha amd64 arm ~hppa ~ia64 ~mips ppc ~ppc64 ~s390 ~sh ~sparc x86 ~x86-fbsd"
38 IUSE="berkdb debug doc examples gdbm ipv6 +rdoc rubytests socks5 ssl tk xemacs ncurses +readline +yaml" #libedit
39
40 # libedit support is removed everywhere because of this upstream bug:
41 # http://redmine.ruby-lang.org/issues/show/3698
42
43 RDEPEND="
44 berkdb? ( sys-libs/db )
45 gdbm? ( sys-libs/gdbm )
46 ssl? ( dev-libs/openssl )
47 socks5? ( >=net-proxy/dante-1.1.13 )
48 tk? ( dev-lang/tk[threads] )
49 ncurses? ( sys-libs/ncurses )
50 readline? ( sys-libs/readline )
51 yaml? ( dev-libs/libyaml )
52 virtual/libffi
53 sys-libs/zlib
54 >=app-admin/eselect-ruby-20100402
55 !<dev-ruby/rdoc-3.9.4
56 !<dev-ruby/rubygems-1.8.10-r1"
57 # libedit? ( dev-libs/libedit )
58 # !libedit? ( readline? ( sys-libs/readline ) )
59
60 DEPEND="${RDEPEND}"
61 PDEPEND="
62 rdoc? ( >=dev-ruby/rdoc-3.9.4[ruby_targets_ruby19] )
63 xemacs? ( app-xemacs/ruby-modes )"
64
65 src_prepare() {
66 EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" \
67 epatch "${WORKDIR}/patches"
68
69 einfo "Unbundling gems..."
70 cd "$S"
71 rm -r \
72 {bin,lib}/rake lib/rake.rb man/rake.1 \
73 ext/json \
74 bin/gem || die "removal failed"
75
76 # Fix a hardcoded lib path in configure script
77 sed -i -e "s:\(RUBY_LIB_PREFIX=\"\${prefix}/\)lib:\1$(get_libdir):" \
78 configure.in || die "sed failed"
79
80 eautoreconf
81 }
82
83 src_configure() {
84 local myconf=
85
86 # -fomit-frame-pointer makes ruby segfault, see bug #150413.
87 filter-flags -fomit-frame-pointer
88 # In many places aliasing rules are broken; play it safe
89 # as it's risky with newer compilers to leave it as it is.
90 append-flags -fno-strict-aliasing
91 # SuperH needs this
92 use sh && append-flags -mieee
93
94 # Socks support via dante
95 if use socks5 ; then
96 # Socks support can't be disabled as long as SOCKS_SERVER is
97 # set and socks library is present, so need to unset
98 # SOCKS_SERVER in that case.
99 unset SOCKS_SERVER
100 fi
101
102 # Increase GC_MALLOC_LIMIT if set (default is 8000000)
103 if [ -n "${RUBY_GC_MALLOC_LIMIT}" ] ; then
104 append-flags "-DGC_MALLOC_LIMIT=${RUBY_GC_MALLOC_LIMIT}"
105 fi
106
107 # ipv6 hack, bug 168939. Needs --enable-ipv6.
108 use ipv6 || myconf="${myconf} --with-lookup-order-hack=INET"
109
110 # if use libedit; then
111 # einfo "Using libedit to provide readline extension"
112 # myconf="${myconf} --enable-libedit --with-readline"
113 # elif use readline; then
114 # einfo "Using readline to provide readline extension"
115 # myconf="${myconf} --with-readline"
116 # else
117 # myconf="${myconf} --without-readline"
118 # fi
119 myconf="${myconf} $(use_with readline)"
120
121 # Set a faux target (bug #342819)
122 use hppa && myconf="${myconf} --target=parisc"
123
124 econf \
125 --program-suffix=${MY_SUFFIX} \
126 --with-soname=ruby${MY_SUFFIX} \
127 --enable-shared \
128 --enable-pthread \
129 $(use_enable socks5 socks) \
130 $(use_enable doc install-doc) \
131 --enable-ipv6 \
132 $(use_enable debug) \
133 $(use_with berkdb dbm) \
134 $(use_with gdbm) \
135 $(use_with ssl openssl) \
136 $(use_with tk) \
137 $(use_with ncurses curses) \
138 $(use_with yaml psych) \
139 ${myconf} \
140 --enable-option-checking=no \
141 || die "econf failed"
142 }
143
144 src_compile() {
145 emake EXTLDFLAGS="${LDFLAGS}" || die "emake failed"
146 }
147
148 src_test() {
149 emake -j1 test || die "make test failed"
150
151 elog "Ruby's make test has been run. Ruby also ships with a make check"
152 elog "that cannot be run until after ruby has been installed."
153 elog
154 if use rubytests; then
155 elog "You have enabled rubytests, so they will be installed to"
156 elog "/usr/share/${PN}-${SLOT}/test. To run them you must be a user other"
157 elog "than root, and you must place them into a writeable directory."
158 elog "Then call: "
159 elog
160 elog "ruby${MY_SUFFIX} -C /location/of/tests runner.rb"
161 else
162 elog "Enable the rubytests USE flag to install the make check tests"
163 fi
164 }
165
166 src_install() {
167 # Ruby is involved in the install process, we don't want interference here.
168 unset RUBYOPT
169
170 local MINIRUBY=$(echo -e 'include Makefile\ngetminiruby:\n\t@echo $(MINIRUBY)'|make -f - getminiruby)
171
172 LD_LIBRARY_PATH="${D}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
173 RUBYLIB="${S}:${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}"
174 for d in $(find "${S}/ext" -type d) ; do
175 RUBYLIB="${RUBYLIB}:$d"
176 done
177 export LD_LIBRARY_PATH RUBYLIB
178
179 emake DESTDIR="${D}" install || die "make install failed"
180
181 # Remove installed rubygems copy
182 rm -r "${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}/rubygems" || die "rm rubygems failed"
183 rm -r "${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}"/rdoc* || die "rm rdoc failed"
184 rm -r "${D}/usr/bin/"{ri,rdoc}"${MY_SUFFIX}" || die "rm rdoc bins failed"
185
186 if use doc; then
187 make DESTDIR="${D}" install-doc || die "make install-doc failed"
188 fi
189
190 if use examples; then
191 insinto /usr/share/doc/${PF}
192 doins -r sample
193 fi
194
195 dosym "libruby${MY_SUFFIX}$(get_libname ${PV%_*})" \
196 "/usr/$(get_libdir)/libruby$(get_libname ${PV%.*})"
197 dosym "libruby${MY_SUFFIX}$(get_libname ${PV%_*})" \
198 "/usr/$(get_libdir)/libruby$(get_libname ${PV%_*})"
199
200 dodoc ChangeLog NEWS doc/NEWS* README* ToDo || die
201
202 if use rubytests; then
203 pushd test
204 insinto /usr/share/${PN}-${SLOT}/test
205 doins -r .
206 popd
207 fi
208 }
209
210 pkg_postinst() {
211 if [[ ! -n $(readlink "${ROOT}"usr/bin/ruby) ]] ; then
212 eselect ruby set ruby${MY_SUFFIX}
213 fi
214
215 elog
216 elog "To switch between available Ruby profiles, execute as root:"
217 elog "\teselect ruby set ruby(18|19|...)"
218 elog
219 }
220
221 pkg_postrm() {
222 eselect ruby cleanup
223 }

  ViewVC Help
Powered by ViewVC 1.1.20