Gentoo Archives: gentoo-commits

From: Aric Belsito <lluixhi@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/musl:master commit in: dev-lang/ruby/
Date: Thu, 29 Mar 2018 19:50:27
Message-Id: 1522353000.052686427c7e8d8aa65445a062e4f4bbc501099a.lluixhi@gentoo
1 commit: 052686427c7e8d8aa65445a062e4f4bbc501099a
2 Author: Aric Belsito <lluixhi <AT> gmail <DOT> com>
3 AuthorDate: Thu Mar 29 19:49:24 2018 +0000
4 Commit: Aric Belsito <lluixhi <AT> gmail <DOT> com>
5 CommitDate: Thu Mar 29 19:50:00 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=05268642
7
8 dev-lang/ruby: version bump to 2.4.4/2.5.1
9
10 dev-lang/ruby/Manifest | 4 +
11 dev-lang/ruby/ruby-2.4.4.ebuild | 248 ++++++++++++++++++++++++++++++++++++++++
12 dev-lang/ruby/ruby-2.5.1.ebuild | 243 +++++++++++++++++++++++++++++++++++++++
13 3 files changed, 495 insertions(+)
14
15 diff --git a/dev-lang/ruby/Manifest b/dev-lang/ruby/Manifest
16 index a814d02..5ef37ea 100644
17 --- a/dev-lang/ruby/Manifest
18 +++ b/dev-lang/ruby/Manifest
19 @@ -1,5 +1,9 @@
20 DIST ruby-2.4.3.tar.xz 10040072 BLAKE2B 87ad9700312a104a60b079f4ef95804d2a9e01109e9fef6e83e593464f1d2c5077af54cbbaff6e0d25a925d05f513cade6c76f05960d9bcc1817bdee51ad4a0f SHA512 8bcf60c994a96787da5d743c66f5609a5a6d834d6d61243cdea7fd059197c3b10da43c99e5649be85e2f2329eedcbb1dd76e89ce3ac586be9056348f7449ed09
21 +DIST ruby-2.4.4.tar.xz 10049304 BLAKE2B 76bb2c3f63cda8e6f3814c74dded23568b2f7f12036d745bf55fc4a68e281ef3ae0fe29bf8e194db71f72e724ffe750a31bec9246ad1c01eb05ed93512a6422e SHA512 4dc112a149273d4221484ccbf1260c6c5fcad7e0a6e4bc91e4ef69cbc093d3191f7abd71420f80d680f8ea5d111e6803ba2af32166aa501913639e6d5696fde0
22 DIST ruby-2.5.0.tar.xz 11292472 BLAKE2B 852ce003a79d9d77e72928353382962440e99ed1d03558c89a928e8f4a582b27357ef63e3ef45f3b30009f7a95f356100941bd84151571ade3a88b2d0595f8ad SHA512 55714a33d7661fe8b432f73c34fd67b49699f8b79df1cbd680a74899124d31111ab0f444677672aac1ba725820182940d485efb2db0bf2bc96737c5d40c54578
23 +DIST ruby-2.5.1.tar.xz 11348108 BLAKE2B ea1019a81f96169ab8d435215362b36b098df373ac4f53ecda328686ec2c13204a38c66bb1bf9504d18e1762e7e6ae277bab3b16bb53b8e628962df715769f3b SHA512 31bacf58469953282cd5d8b51862dcf4b84dedb927c1871bc3fca32fc157fe49187631575a70838705fe246f4555647577a7ecc26894445a7d64de5503dc11b4
24 DIST ruby-patches-2.4.3.tar.bz2 2898 BLAKE2B e46502dbb0aa25c3d71693a6c04b433bd4de60f194cdd283517c4b08da190356885d9bca4a6765402088185fa8ec681156e8e8eecf0703a2c1ea7bb81adc0bf9 SHA512 d767d43c7df737469247e42e1c4205b8c6850c8f335a2869c884f145c037e9bab10492cc7cd2903f5c33e232cdc5bbdabb3e8da837c7bf420b9d58d1d33149ed
25 +DIST ruby-patches-2.4.4.tar.bz2 2898 BLAKE2B e46502dbb0aa25c3d71693a6c04b433bd4de60f194cdd283517c4b08da190356885d9bca4a6765402088185fa8ec681156e8e8eecf0703a2c1ea7bb81adc0bf9 SHA512 d767d43c7df737469247e42e1c4205b8c6850c8f335a2869c884f145c037e9bab10492cc7cd2903f5c33e232cdc5bbdabb3e8da837c7bf420b9d58d1d33149ed
26 DIST ruby-patches-2.5.0-r1.tar.bz2 1888 BLAKE2B 38358c4d10a5c825ad1d50aa9e538fbfb0875deffaecf2064be3c52d593539f37b83bf726437922b1f13bd3d5c63e30ae071cd75c891e7083d3a363c4b49c905 SHA512 39068008cd7050a6787cfe35ef0a21ebeb5128226153b80f8d34e89bc77d6159f32e6980dfd8f3e38fc748cf3d648d102b3dcfcb79a484a517a5008bfd8161b9
27 DIST ruby-patches-2.5.0-r2.tar.bz2 2986 BLAKE2B 64d64eda19bff94f205a6314c2af59896064fb64c118e0f3859d82aeb7e58478170b9160804ab8faf569054b65228abeecc5900e568e17133c21e9aed9bdf589 SHA512 c2bca3f98c7bb1de267b9f07eb1b0903c499c79e9c9d0166a6924e88e837434f27ddedd7aead7ebbe32f0530f751601ac5486a0db46ee28b94d7cea13e0e7924
28 +DIST ruby-patches-2.5.1.tar.bz2 2986 BLAKE2B 64d64eda19bff94f205a6314c2af59896064fb64c118e0f3859d82aeb7e58478170b9160804ab8faf569054b65228abeecc5900e568e17133c21e9aed9bdf589 SHA512 c2bca3f98c7bb1de267b9f07eb1b0903c499c79e9c9d0166a6924e88e837434f27ddedd7aead7ebbe32f0530f751601ac5486a0db46ee28b94d7cea13e0e7924
29
30 diff --git a/dev-lang/ruby/ruby-2.4.4.ebuild b/dev-lang/ruby/ruby-2.4.4.ebuild
31 new file mode 100644
32 index 0000000..479eec9
33 --- /dev/null
34 +++ b/dev-lang/ruby/ruby-2.4.4.ebuild
35 @@ -0,0 +1,248 @@
36 +# Copyright 1999-2018 Gentoo Foundation
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=6
40 +
41 +#PATCHSET=1
42 +
43 +inherit autotools eutils flag-o-matic multilib versionator
44 +
45 +MY_P="${PN}-$(get_version_component_range 1-3)"
46 +S=${WORKDIR}/${MY_P}
47 +
48 +SLOT=$(get_version_component_range 1-2)
49 +MY_SUFFIX=$(delete_version_separator 1 ${SLOT})
50 +RUBYVERSION=${SLOT}.0
51 +
52 +if [[ -n ${PATCHSET} ]]; then
53 + if [[ ${PVR} == ${PV} ]]; then
54 + PATCHSET="${PV}-r0.${PATCHSET}"
55 + else
56 + PATCHSET="${PVR}.${PATCHSET}"
57 + fi
58 +else
59 + PATCHSET="${PVR}"
60 +fi
61 +
62 +DESCRIPTION="An object-oriented scripting language"
63 +HOMEPAGE="http://www.ruby-lang.org/"
64 +SRC_URI="mirror://ruby/${SLOT}/${MY_P}.tar.xz
65 + https://dev.gentoo.org/~graaff/ruby-team/${PN}-patches-${PATCHSET}.tar.bz2"
66 +
67 +LICENSE="|| ( Ruby-BSD BSD-2 )"
68 +KEYWORDS="~amd64 ~arm ~ia64 ~mips ~ppc ~sh ~sparc ~x86"
69 +IUSE="berkdb debug doc examples gdbm ipv6 jemalloc libressl +rdoc rubytests socks5 ssl static-libs tk xemacs"
70 +
71 +RDEPEND="
72 + berkdb? ( sys-libs/db:= )
73 + gdbm? ( sys-libs/gdbm:= )
74 + jemalloc? ( dev-libs/jemalloc )
75 + ssl? (
76 + !libressl? ( dev-libs/openssl:0= )
77 + libressl? ( dev-libs/libressl )
78 + )
79 + socks5? ( >=net-proxy/dante-1.1.13 )
80 + tk? (
81 + dev-lang/tcl:0=[threads]
82 + dev-lang/tk:0=[threads]
83 + )
84 + dev-libs/libyaml
85 + virtual/libffi
86 + sys-libs/zlib
87 + >=app-eselect/eselect-ruby-20161226
88 + !<dev-ruby/rdoc-3.9.4
89 + !<dev-ruby/rubygems-1.8.10-r1"
90 +
91 +DEPEND="${RDEPEND}"
92 +
93 +BUNDLED_GEMS="
94 + >=dev-ruby/did_you_mean-1.1.0:2.4[ruby_targets_ruby24]
95 + >=dev-ruby/minitest-5.10.1[ruby_targets_ruby24]
96 + >=dev-ruby/net-telnet-0.1.1[ruby_targets_ruby24]
97 + >=dev-ruby/power_assert-0.4.1[ruby_targets_ruby24]
98 + >=dev-ruby/rake-12.0.0[ruby_targets_ruby24]
99 + >=dev-ruby/test-unit-3.2.3[ruby_targets_ruby24]
100 + >=dev-ruby/xmlrpc-0.2.1[ruby_targets_ruby24]
101 +"
102 +
103 +PDEPEND="
104 + ${BUNDLED_GEMS}
105 + virtual/rubygems[ruby_targets_ruby24]
106 + >=dev-ruby/json-2.0.2[ruby_targets_ruby24]
107 + rdoc? ( >=dev-ruby/rdoc-5.1.0[ruby_targets_ruby24] )
108 + xemacs? ( app-xemacs/ruby-modes )"
109 +
110 +src_prepare() {
111 + EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" \
112 + epatch "${WORKDIR}/patches"
113 +
114 + einfo "Unbundling gems..."
115 + cd "$S"
116 + # Remove bundled gems that we will install via PDEPEND, bug
117 + # 539700. Use explicit version numbers to ensure rm fails when they
118 + # change so we can update dependencies accordingly.
119 + rm -f gems/{did_you_mean-1.1.0,minitest-5.10.1,net-telnet-0.1.1,power_assert-0.4.1,rake-12.0.0,test-unit-3.2.3,xmlrpc-0.2.1}.gem || die
120 +
121 + einfo "Removing bundled libraries..."
122 + rm -fr ext/fiddle/libffi-3.2.1 || die
123 +
124 + # Fix a hardcoded lib path in configure script
125 + sed -i -e "s:\(RUBY_LIB_PREFIX=\"\${prefix}/\)lib:\1$(get_libdir):" \
126 + configure.in || die "sed failed"
127 +
128 + eapply_user
129 +
130 + eautoreconf
131 +}
132 +
133 +src_configure() {
134 + local modules= myconf=
135 +
136 + # -fomit-frame-pointer makes ruby segfault, see bug #150413.
137 + filter-flags -fomit-frame-pointer
138 + # In many places aliasing rules are broken; play it safe
139 + # as it's risky with newer compilers to leave it as it is.
140 + append-flags -fno-strict-aliasing
141 + # SuperH needs this
142 + use sh && append-flags -mieee
143 +
144 + # Socks support via dante
145 + if use socks5 ; then
146 + # Socks support can't be disabled as long as SOCKS_SERVER is
147 + # set and socks library is present, so need to unset
148 + # SOCKS_SERVER in that case.
149 + unset SOCKS_SERVER
150 + fi
151 +
152 + # Increase GC_MALLOC_LIMIT if set (default is 8000000)
153 + if [ -n "${RUBY_GC_MALLOC_LIMIT}" ] ; then
154 + append-flags "-DGC_MALLOC_LIMIT=${RUBY_GC_MALLOC_LIMIT}"
155 + fi
156 +
157 + # ipv6 hack, bug 168939. Needs --enable-ipv6.
158 + use ipv6 || myconf="${myconf} --with-lookup-order-hack=INET"
159 +
160 + # Determine which modules *not* to build depending in the USE flags.
161 + if ! use berkdb ; then
162 + modules="${modules},dbm"
163 + fi
164 + if ! use gdbm ; then
165 + modules="${modules},gdbm"
166 + fi
167 + if ! use ssl ; then
168 + modules="${modules},openssl"
169 + fi
170 + if ! use tk ; then
171 + modules="${modules},tk"
172 + fi
173 +
174 + # Configure script does not detect isinf/isnan as macros, which breaks
175 + # some native extensions.
176 + export ac_cv_func_isnan=yes
177 + export ac_cv_func_isinf=yes
178 +
179 + # Provide an empty LIBPATHENV because we disable rpath but we do not
180 + # need LD_LIBRARY_PATH by default since that breaks USE=multitarget
181 + # #564272
182 + INSTALL="${EPREFIX}/usr/bin/install -c" LIBPATHENV="" econf \
183 + --program-suffix=${MY_SUFFIX} \
184 + --with-soname=ruby${MY_SUFFIX} \
185 + --docdir=${EPREFIX}/usr/share/doc/${P} \
186 + --enable-shared \
187 + --enable-pthread \
188 + --disable-rpath \
189 + --with-out-ext="${modules}" \
190 + $(use_with jemalloc jemalloc) \
191 + $(use_enable socks5 socks) \
192 + $(use_enable doc install-doc) \
193 + --enable-ipv6 \
194 + $(use_enable static-libs static) \
195 + $(use_enable static-libs install-static-library) \
196 + $(use_with static-libs static-linked-ext) \
197 + $(use_enable debug) \
198 + ${myconf} \
199 + --enable-option-checking=no \
200 + || die "econf failed"
201 +}
202 +
203 +src_compile() {
204 + emake V=1 EXTLDFLAGS="${LDFLAGS}" || die "emake failed"
205 +}
206 +
207 +src_test() {
208 + emake -j1 V=1 test || die "make test failed"
209 +
210 + elog "Ruby's make test has been run. Ruby also ships with a make check"
211 + elog "that cannot be run until after ruby has been installed."
212 + elog
213 + if use rubytests; then
214 + elog "You have enabled rubytests, so they will be installed to"
215 + elog "/usr/share/${PN}-${SLOT}/test. To run them you must be a user other"
216 + elog "than root, and you must place them into a writeable directory."
217 + elog "Then call: "
218 + elog
219 + elog "ruby${MY_SUFFIX} -C /location/of/tests runner.rb"
220 + else
221 + elog "Enable the rubytests USE flag to install the make check tests"
222 + fi
223 +}
224 +
225 +src_install() {
226 + # Remove the remaining bundled gems. We do this late in the process
227 + # since they are used during the build to e.g. create the
228 + # documentation.
229 + rm -rf ext/json || die
230 +
231 + # Ruby is involved in the install process, we don't want interference here.
232 + unset RUBYOPT
233 +
234 + local MINIRUBY=$(echo -e 'include Makefile\ngetminiruby:\n\t@echo $(MINIRUBY)'|make -f - getminiruby)
235 +
236 + LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
237 + RUBYLIB="${S}:${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}"
238 + for d in $(find "${S}/ext" -type d) ; do
239 + RUBYLIB="${RUBYLIB}:$d"
240 + done
241 + export LD_LIBRARY_PATH RUBYLIB
242 +
243 + emake V=1 DESTDIR="${D}" install || die "make install failed"
244 +
245 + # Remove installed rubygems and rdoc copy
246 + rm -rf "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}/rubygems" || die "rm rubygems failed"
247 + rm -rf "${ED}/usr/bin/"gem"${MY_SUFFIX}" || die "rm rdoc bins failed"
248 + rm -rf "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}"/rdoc* || die "rm rdoc failed"
249 + rm -rf "${ED}/usr/bin/"{ri,rdoc}"${MY_SUFFIX}" || die "rm rdoc bins failed"
250 +
251 + if use doc; then
252 + make DESTDIR="${D}" install-doc || die "make install-doc failed"
253 + fi
254 +
255 + if use examples; then
256 + insinto /usr/share/doc/${PF}
257 + doins -r sample
258 + fi
259 +
260 + dodoc ChangeLog NEWS doc/NEWS* README* || die
261 +
262 + if use rubytests; then
263 + pushd test
264 + insinto /usr/share/${PN}-${SLOT}/test
265 + doins -r .
266 + popd
267 + fi
268 +}
269 +
270 +pkg_postinst() {
271 + if [[ ! -n $(readlink "${EROOT}"usr/bin/ruby) ]] ; then
272 + eselect ruby set ruby${MY_SUFFIX}
273 + fi
274 +
275 + elog
276 + elog "To switch between available Ruby profiles, execute as root:"
277 + elog "\teselect ruby set ruby(23|24|...)"
278 + elog
279 +}
280 +
281 +pkg_postrm() {
282 + eselect ruby cleanup
283 +}
284
285 diff --git a/dev-lang/ruby/ruby-2.5.1.ebuild b/dev-lang/ruby/ruby-2.5.1.ebuild
286 new file mode 100644
287 index 0000000..c6826ce
288 --- /dev/null
289 +++ b/dev-lang/ruby/ruby-2.5.1.ebuild
290 @@ -0,0 +1,243 @@
291 +# Copyright 1999-2018 Gentoo Foundation
292 +# Distributed under the terms of the GNU General Public License v2
293 +
294 +EAPI=6
295 +
296 +#PATCHSET=1
297 +
298 +inherit autotools eutils flag-o-matic multilib versionator
299 +
300 +MY_P="${PN}-$(get_version_component_range 1-3)"
301 +S=${WORKDIR}/${MY_P}
302 +
303 +SLOT=$(get_version_component_range 1-2)
304 +MY_SUFFIX=$(delete_version_separator 1 ${SLOT})
305 +RUBYVERSION=${SLOT}.0
306 +
307 +if [[ -n ${PATCHSET} ]]; then
308 + if [[ ${PVR} == ${PV} ]]; then
309 + PATCHSET="${PV}-r0.${PATCHSET}"
310 + else
311 + PATCHSET="${PVR}.${PATCHSET}"
312 + fi
313 +else
314 + PATCHSET="${PVR}"
315 +fi
316 +
317 +DESCRIPTION="An object-oriented scripting language"
318 +HOMEPAGE="http://www.ruby-lang.org/"
319 +SRC_URI="mirror://ruby/${SLOT}/${MY_P}.tar.xz
320 + https://dev.gentoo.org/~graaff/ruby-team/${PN}-patches-${PATCHSET}.tar.bz2"
321 +
322 +LICENSE="|| ( Ruby-BSD BSD-2 )"
323 +KEYWORDS="~amd64 ~arm ~ia64 ~mips ~ppc ~sh ~sparc ~x86"
324 +IUSE="berkdb debug doc examples gdbm ipv6 jemalloc libressl +rdoc rubytests socks5 ssl static-libs tk xemacs"
325 +
326 +RDEPEND="
327 + berkdb? ( sys-libs/db:= )
328 + gdbm? ( sys-libs/gdbm:= )
329 + jemalloc? ( dev-libs/jemalloc )
330 + ssl? (
331 + !libressl? ( dev-libs/openssl:0= )
332 + libressl? ( dev-libs/libressl )
333 + )
334 + socks5? ( >=net-proxy/dante-1.1.13 )
335 + tk? (
336 + dev-lang/tcl:0=[threads]
337 + dev-lang/tk:0=[threads]
338 + )
339 + dev-libs/libyaml
340 + virtual/libffi
341 + sys-libs/zlib
342 + >=app-eselect/eselect-ruby-20171225
343 +"
344 +
345 +DEPEND="${RDEPEND}"
346 +
347 +BUNDLED_GEMS="
348 + >=dev-ruby/did_you_mean-1.2.0:2.5[ruby_targets_ruby25]
349 + >=dev-ruby/minitest-5.10.3[ruby_targets_ruby25]
350 + >=dev-ruby/net-telnet-0.1.1[ruby_targets_ruby25]
351 + >=dev-ruby/power_assert-1.1.1[ruby_targets_ruby25]
352 + >=dev-ruby/rake-12.3.0[ruby_targets_ruby25]
353 + >=dev-ruby/test-unit-3.2.7[ruby_targets_ruby25]
354 + >=dev-ruby/xmlrpc-0.3.0[ruby_targets_ruby25]
355 +"
356 +
357 +PDEPEND="
358 + ${BUNDLED_GEMS}
359 + virtual/rubygems[ruby_targets_ruby25]
360 + >=dev-ruby/json-2.0.2[ruby_targets_ruby25]
361 + rdoc? ( >=dev-ruby/rdoc-5.1.0[ruby_targets_ruby25] )
362 + xemacs? ( app-xemacs/ruby-modes )"
363 +
364 +src_prepare() {
365 + EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" \
366 + epatch "${WORKDIR}/patches"
367 +
368 + einfo "Unbundling gems..."
369 + cd "$S"
370 + # Remove bundled gems that we will install via PDEPEND, bug
371 + # 539700. Use explicit version numbers to ensure rm fails when they
372 + # change so we can update dependencies accordingly.
373 + rm -f gems/{did_you_mean-1.2.0,minitest-5.10.3,net-telnet-0.1.1,power_assert-1.1.1,rake-12.3.0,test-unit-3.2.7,xmlrpc-0.3.0}.gem || die
374 +
375 + einfo "Removing bundled libraries..."
376 + rm -fr ext/fiddle/libffi-3.2.1 || die
377 +
378 + eapply_user
379 +
380 + eautoreconf
381 +}
382 +
383 +src_configure() {
384 + local modules= myconf=
385 +
386 + # -fomit-frame-pointer makes ruby segfault, see bug #150413.
387 + filter-flags -fomit-frame-pointer
388 + # In many places aliasing rules are broken; play it safe
389 + # as it's risky with newer compilers to leave it as it is.
390 + append-flags -fno-strict-aliasing
391 + # SuperH needs this
392 + use sh && append-flags -mieee
393 +
394 + # Socks support via dante
395 + if use socks5 ; then
396 + # Socks support can't be disabled as long as SOCKS_SERVER is
397 + # set and socks library is present, so need to unset
398 + # SOCKS_SERVER in that case.
399 + unset SOCKS_SERVER
400 + fi
401 +
402 + # Increase GC_MALLOC_LIMIT if set (default is 8000000)
403 + if [ -n "${RUBY_GC_MALLOC_LIMIT}" ] ; then
404 + append-flags "-DGC_MALLOC_LIMIT=${RUBY_GC_MALLOC_LIMIT}"
405 + fi
406 +
407 + # ipv6 hack, bug 168939. Needs --enable-ipv6.
408 + use ipv6 || myconf="${myconf} --with-lookup-order-hack=INET"
409 +
410 + # Determine which modules *not* to build depending in the USE flags.
411 + if ! use berkdb ; then
412 + modules="${modules},dbm"
413 + fi
414 + if ! use gdbm ; then
415 + modules="${modules},gdbm"
416 + fi
417 + if ! use ssl ; then
418 + modules="${modules},openssl"
419 + fi
420 + if ! use tk ; then
421 + modules="${modules},tk"
422 + fi
423 +
424 + # Configure script does not detect isinf/isnan as macros, which breaks
425 + # some native extensions.
426 + export ac_cv_func_isnan=yes
427 + export ac_cv_func_isinf=yes
428 +
429 + # Provide an empty LIBPATHENV because we disable rpath but we do not
430 + # need LD_LIBRARY_PATH by default since that breaks USE=multitarget
431 + # #564272
432 + INSTALL="${EPREFIX}/usr/bin/install -c" LIBPATHENV="" econf \
433 + --program-suffix=${MY_SUFFIX} \
434 + --with-soname=ruby${MY_SUFFIX} \
435 + --docdir=${EPREFIX}/usr/share/doc/${P} \
436 + --enable-shared \
437 + --enable-pthread \
438 + --disable-rpath \
439 + --with-out-ext="${modules}" \
440 + $(use_with jemalloc jemalloc) \
441 + $(use_enable socks5 socks) \
442 + $(use_enable doc install-doc) \
443 + --enable-ipv6 \
444 + $(use_enable static-libs static) \
445 + $(use_enable static-libs install-static-library) \
446 + $(use_with static-libs static-linked-ext) \
447 + $(use_enable debug) \
448 + ${myconf} \
449 + --enable-option-checking=no \
450 + || die "econf failed"
451 +}
452 +
453 +src_compile() {
454 + emake V=1 EXTLDFLAGS="${LDFLAGS}" || die "emake failed"
455 +}
456 +
457 +src_test() {
458 + emake -j1 V=1 test || die "make test failed"
459 +
460 + elog "Ruby's make test has been run. Ruby also ships with a make check"
461 + elog "that cannot be run until after ruby has been installed."
462 + elog
463 + if use rubytests; then
464 + elog "You have enabled rubytests, so they will be installed to"
465 + elog "/usr/share/${PN}-${SLOT}/test. To run them you must be a user other"
466 + elog "than root, and you must place them into a writeable directory."
467 + elog "Then call: "
468 + elog
469 + elog "ruby${MY_SUFFIX} -C /location/of/tests runner.rb"
470 + else
471 + elog "Enable the rubytests USE flag to install the make check tests"
472 + fi
473 +}
474 +
475 +src_install() {
476 + # Remove the remaining bundled gems. We do this late in the process
477 + # since they are used during the build to e.g. create the
478 + # documentation.
479 + rm -rf ext/json || die
480 +
481 + # Ruby is involved in the install process, we don't want interference here.
482 + unset RUBYOPT
483 +
484 + local MINIRUBY=$(echo -e 'include Makefile\ngetminiruby:\n\t@echo $(MINIRUBY)'|make -f - getminiruby)
485 +
486 + LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
487 + RUBYLIB="${S}:${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}"
488 + for d in $(find "${S}/ext" -type d) ; do
489 + RUBYLIB="${RUBYLIB}:$d"
490 + done
491 + export LD_LIBRARY_PATH RUBYLIB
492 +
493 + emake V=1 DESTDIR="${D}" install || die "make install failed"
494 +
495 + # Remove installed rubygems and rdoc copy
496 + rm -rf "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}/rubygems" || die "rm rubygems failed"
497 + rm -rf "${ED}/usr/bin/"gem"${MY_SUFFIX}" || die "rm rdoc bins failed"
498 + rm -rf "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}"/rdoc* || die "rm rdoc failed"
499 + rm -rf "${ED}/usr/bin/"{ri,rdoc}"${MY_SUFFIX}" || die "rm rdoc bins failed"
500 +
501 + if use doc; then
502 + make DESTDIR="${D}" install-doc || die "make install-doc failed"
503 + fi
504 +
505 + if use examples; then
506 + insinto /usr/share/doc/${PF}
507 + doins -r sample
508 + fi
509 +
510 + dodoc ChangeLog NEWS doc/NEWS* README* || die
511 +
512 + if use rubytests; then
513 + pushd test
514 + insinto /usr/share/${PN}-${SLOT}/test
515 + doins -r .
516 + popd
517 + fi
518 +}
519 +
520 +pkg_postinst() {
521 + if [[ ! -n $(readlink "${EROOT}"usr/bin/ruby) ]] ; then
522 + eselect ruby set ruby${MY_SUFFIX}
523 + fi
524 +
525 + elog
526 + elog "To switch between available Ruby profiles, execute as root:"
527 + elog "\teselect ruby set ruby(23|24|...)"
528 + elog
529 +}
530 +
531 +pkg_postrm() {
532 + eselect ruby cleanup
533 +}