summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2017-11-15 17:39:23 +0100
committerFabian Groffen <grobian@gentoo.org>2017-11-15 17:39:23 +0100
commita07bcbae9eb5d4d360741bb879a394c736a337ee (patch)
tree87754d072accfe7a60ca7f1ddb1ac1b4f58239cd
parentnet-misc/wget: migrated to gx86 (again) (diff)
downloadprefix-a07bcbae.tar.gz
prefix-a07bcbae.tar.bz2
prefix-a07bcbae.zip
dev-lang/ruby: sync, bug #637572
Bug: https://bugs.gentoo.org/637572 Package-Manager: Portage-2.3.13-prefix, Repoman-2.3.4
-rw-r--r--dev-lang/ruby/Manifest6
-rw-r--r--dev-lang/ruby/ruby-2.2.8.ebuild (renamed from dev-lang/ruby/ruby-2.1.5.ebuild)84
-rw-r--r--dev-lang/ruby/ruby-2.4.2.ebuild251
3 files changed, 304 insertions, 37 deletions
diff --git a/dev-lang/ruby/Manifest b/dev-lang/ruby/Manifest
index 98f3bf0a8f..8e65e9d59e 100644
--- a/dev-lang/ruby/Manifest
+++ b/dev-lang/ruby/Manifest
@@ -1,6 +1,8 @@
-DIST ruby-2.1.5.tar.xz 9371780 SHA256 22ba1eb8d475c9ed7e0541418d86044c1ea4c093ab79c300c38fc0f721afe9a3 SHA512 8a257da64158d49bc2810695baf4b5849ef83e3dde452bf1e4823e52e8261225427d729fce2fb4e9b53d6d17ca9c96d491f242535c2f963738b74f90944e2a0b WHIRLPOOL 7dab5db91e56ba95a221c456fbcebfb86aff038a084b7638f504e91e4c9b45a0ad7ee0296d6531281c33d75a31ee4f5ad05af6567a93034316f3992ebc5d6bf3
DIST ruby-2.2.1.tar.xz 10320352 SHA256 3b2852c07fdc12d0ba2b5698c7587ae2b46141539a526d143da5860b55a626c0 SHA512 853517426cd4735bab42298a13cef6f4864b6f8787c3985eaa39a4d1efb40e121bdb51e874b567f0ec339fe001920bcd165067633992b2be30e7804191559151 WHIRLPOOL fdf6c064470172f366902c6d0896f25dfeea2690c0b184cc42ef65f8389a531ec8209551757cc3654fd4da54cb2055c687d3aca0a9716955586f50446ad0f26d
+DIST ruby-2.2.8.tar.xz 10520648 SHA256 37eafc15037396c26870f6a6c5bcd0658d14b46cd5e191a3b56d89dd22d561b0 SHA512 e21004bee537f0c706f4ac9526507b414ddb6a8d721e8fad8d7fe88992a4f048eb5eb79f8d8b8af2a8b331dcfa74b560490218a1acb3532c2cdb4fb4909da3c9 WHIRLPOOL a5b2f7a6c5131376980cf4d2a5f2d7a8a440effed588214c295fb4b83483d84310ba6bfbb96ee904384831eda47f0b1c0263d5190ca41db95df272428144cad1
DIST ruby-2.4.1.tar.xz 9939188 SHA256 4fc8a9992de3e90191de369270ea4b6c1b171b7941743614cc50822ddc1fe654 SHA512 e6fd290b6edd166348b70f0f1c56f7ed9d956c4c1eb91d97d0548041ca4196b9b75ec1ad35c745bdbfd4de195899093e7205d7f02b014ecf1c48e6f31cf25903 WHIRLPOOL b45a6e3bd70e6ef802d084ad87ad0eddd85932e07939bd6ed6a2e6944aa289f231971fedd7d1eece792becb08312f37b80073a2a9df070f61f32747c0708523e
-DIST ruby-patches-2.1.5.tar.bz2 2310 SHA256 1743dc0cec0adc1a0b5d90b0ed7908f888b8251b7a414049a57e6e32e01e4ad6 SHA512 b695621d210a7afc6704dd480bf3e7fc559174ebf240d2287338d60537ba45e5bf0f5defac6b254064d4b28077e2b97ef23b7eadc1bfa1a6bf2c616e828f937c WHIRLPOOL e9fde062fc04e4e22aec2dc55250f9007c64b07c7d03875b4073c19af9cfb0ae735d6dcb2b65bd1465a457cf0ff0602866600b5af1d520df3efc8a418763ab5b
+DIST ruby-2.4.2.tar.xz 10046412 SHA256 748a8980d30141bd1a4124e11745bb105b436fb1890826e0d2b9ea31af27f735 SHA512 c1d42272fb0d94b693452e703b0ea4942bf59cbd4b08ba83bf039f54be97ebc88511632413da0164970b4cf97bc302bccb88aab48edfa8fa147498e7ee741595 WHIRLPOOL 4117f18e7901700d2cf603ed60cbe9b59ca65359ec359a7616b2cf90c76c25117afe864a8a7b55e7dc52c93377c541a8b497f1b281cdccade97aafa5ca363a5b
DIST ruby-patches-2.2.1.tar.bz2 2267 SHA256 0ad98acf3d3f9128c2471e360d4cef0c8967ef2feb59c18f8a781a94c13f349f SHA512 af533ae77b0149bceb04d544b2a6f6c0bd4bcbef53912b233452a7eeda1ecb9cd53aed1631ba9414e76eb0f960e9248fb82525ce5caf843aaad2ebf654cf74ce WHIRLPOOL c495f4e95c1709da1c91b5f7b42b9bc03dfed3849fb7b51ac120fbaae1dabdc99e631e60455f86f91f64eb113c9b24cbeb857efc84c128406350938e01bdb291
+DIST ruby-patches-2.2.8.tar.bz2 5764 SHA256 5c44fc38cb25d7dbdd8bef0fae49b5fc2f4f42da4e5b4b871655fd5e68faddbe SHA512 296387ec7f2ff82ad55f147d8f9568de544403d286ad24bb60aca916215d7ff6e1d6aca5a31c00a1999504989cda2bbd3260cae96c18ba73f9ffdcfd6b2695bd WHIRLPOOL 28889531d98b1bb96ceaa059f7fc641cc3db16eda0e3ad4cea031127c71897613d73cc3c8926dfd9ec978be79ca1201e7c90056ddcbec58d3e842c8af9a52389
DIST ruby-patches-2.4.1-r2.tar.bz2 4030 SHA256 f1beac832d3bd94b8a0be137da845ce96edd574be61f25945150e9a351e4ee73 SHA512 e3f141710a23e4716696fdd5fd898386b32ce6e9d729738591bde8a74f9af8353e0a3f5f9c48403443c6c1ee074b5c2f3b5e9503d96b57de5c6c484ccb337b40 WHIRLPOOL 327404741b8448f7d49ad3ca3cfe915b60881348fc98e18027276f26d4381237f67b7f8d849df765e76184c2f4a92861b585ddf9b25dcb485e4ac5e2b4ad43cd
+DIST ruby-patches-2.4.2.tar.bz2 3443 SHA256 621e92c4c14cec458100adf74e122df76663be4f75fc4ea86423a9ac6755ea3e SHA512 fb8349c67c72caf10ec12c4b5410194b4df24345446c2e3b6c6176d00727bfe803f4a905ef094a2d52315b6f4c3ce74fb8fbaa2fdf5efe46e6ccb24bf8418b17 WHIRLPOOL 306a16b49037a669398fb9c1b7c2b5484860d8749bf4c12d0e5eec02e3a7f7760b48b4a3cd709e0fa2b54f3d8dddff36d7eeb8d53d2d647d59e099b0299b8ed1
diff --git a/dev-lang/ruby/ruby-2.1.5.ebuild b/dev-lang/ruby/ruby-2.2.8.ebuild
index 16535d3be4..deecdf4920 100644
--- a/dev-lang/ruby/ruby-2.1.5.ebuild
+++ b/dev-lang/ruby/ruby-2.2.8.ebuild
@@ -1,6 +1,5 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/ruby/ruby-2.1.5.ebuild,v 1.4 2015/03/31 18:33:50 ulm Exp $
EAPI=5
@@ -8,15 +7,12 @@ EAPI=5
inherit autotools eutils flag-o-matic multilib versionator
-RUBYPL=$(get_version_component_range 4)
-
MY_P="${PN}-$(get_version_component_range 1-3)"
-#MY_P="${PN}-$(get_version_component_range 1-3)-${RUBYPL:-0}"
S=${WORKDIR}/${MY_P}
SLOT=$(get_version_component_range 1-2)
MY_SUFFIX=$(delete_version_separator 1 ${SLOT})
-RUBYVERSION=2.1.0
+RUBYVERSION=2.2.0
if [[ -n ${PATCHSET} ]]; then
if [[ ${PVR} == ${PV} ]]; then
@@ -30,43 +26,55 @@ fi
DESCRIPTION="An object-oriented scripting language"
HOMEPAGE="http://www.ruby-lang.org/"
-SRC_URI="mirror://ruby/2.1/${MY_P}.tar.xz
- http://dev.gentoo.org/~flameeyes/ruby-team/${PN}-patches-${PATCHSET}.tar.bz2"
+SRC_URI="mirror://ruby/2.2/${MY_P}.tar.xz
+ https://dev.gentoo.org/~flameeyes/ruby-team/${PN}-patches-${PATCHSET}.tar.bz2"
LICENSE="|| ( Ruby-BSD BSD-2 )"
KEYWORDS="~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="berkdb debug doc examples gdbm ipv6 +rdoc rubytests socks5 ssl xemacs ncurses +readline cpu_flags_x86_sse2"
+IUSE="berkdb debug doc examples gdbm ipv6 jemalloc libressl +rdoc rubytests socks5 ssl tk xemacs ncurses +readline"
RDEPEND="
- berkdb? ( sys-libs/db )
+ berkdb? ( sys-libs/db:= )
gdbm? ( sys-libs/gdbm )
- ssl? ( dev-libs/openssl )
+ jemalloc? ( dev-libs/jemalloc )
+ ssl? (
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl )
+ )
socks5? ( >=net-proxy/dante-1.1.13 )
- ncurses? ( sys-libs/ncurses )
- readline? ( sys-libs/readline )
+ tk? (
+ dev-lang/tcl:0=[threads]
+ dev-lang/tk:0=[threads]
+ )
+ ncurses? ( sys-libs/ncurses:0= )
+ readline? ( sys-libs/readline:0= )
dev-libs/libyaml
virtual/libffi
sys-libs/zlib
- >=app-eselect/eselect-ruby-20131227
+ >=app-eselect/eselect-ruby-20141227
!<dev-ruby/rdoc-3.9.4
!<dev-ruby/rubygems-1.8.10-r1"
DEPEND="${RDEPEND}"
+
+BUNDLED_GEMS="
+ >=dev-ruby/minitest-5.4.3[ruby_targets_ruby22]
+ >=dev-ruby/power_assert-0.2.2[ruby_targets_ruby22]
+ >=dev-ruby/test-unit-3.0.8[ruby_targets_ruby22]
+"
+
PDEPEND="
- virtual/rubygems[ruby_targets_ruby21]
- >=dev-ruby/json-1.8.1[ruby_targets_ruby21]
- >=dev-ruby/rake-0.9.6[ruby_targets_ruby21]
- rdoc? ( >=dev-ruby/rdoc-4.0.1[ruby_targets_ruby21] )
+ ${BUNDLED_GEMS}
+ virtual/rubygems[ruby_targets_ruby22]
+ >=dev-ruby/json-1.8.1[ruby_targets_ruby22]
+ >=dev-ruby/rake-0.9.6[ruby_targets_ruby22]
+ rdoc? ( >=dev-ruby/rdoc-4.0.1[ruby_targets_ruby22] )
xemacs? ( app-xemacs/ruby-modes )"
src_prepare() {
epatch "${FILESDIR}/${PN}-1.9.1-prefix.patch"
- if use cpu_flags_x86_sse2 ; then
- excluded_patches="012_no_forced_sse2.patch"
- fi
-
- EPATCH_EXCLUDE="${excluded_patches}" EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" \
epatch "${WORKDIR}/patches"
# We can no longer unbundle all of rake because rubygems now depends
@@ -74,9 +82,13 @@ src_prepare() {
# rubygems, but remove the bits that would cause a file collision.
einfo "Unbundling gems..."
cd "$S"
- rm -r \
+ rm -rf \
{bin,lib}/rake lib/rake.rb man/rake.1 \
bin/gem || die "removal failed"
+ # Remove bundled gems that we will install via PDEPEND, bug
+ # 539700. Use explicit version numbers to ensure rm fails when they
+ # change so we can update dependencies accordingly.
+ rm gems/{minitest-5.4.3,power_assert-0.2.2,test-unit-3.0.8}.gem || die
# Fix a hardcoded lib path in configure script
sed -i -e "s:\(RUBY_LIB_PREFIX=\"\${prefix}/\)lib:\1$(get_libdir):" \
@@ -89,12 +101,7 @@ src_prepare() {
}
src_configure() {
- local myconf=
-
- # The Tk module can no longer be built because the module code is no
- # longer compatible with newer stable versions.
- # https://bugs.gentoo.org/show_bug.cgi?id=500894
- local modules="tk"
+ local modules= myconf=
# -fomit-frame-pointer makes ruby segfault, see bug #150413.
filter-flags -fomit-frame-pointer
@@ -136,8 +143,14 @@ src_configure() {
if ! use ncurses ; then
modules="${modules},curses"
fi
+ if ! use tk ; then
+ modules="${modules},tk"
+ fi
- INSTALL="${EPREFIX}/usr/bin/install -c" econf \
+ # Provide an empty LIBPATHENV because we disable rpath but we do not
+ # need LD_LIBRARY_PATH by default since that breaks USE=multitarget
+ # #564272
+ INSTALL="${EPREFIX}/usr/bin/install -c" LIBPATHENV="" econf \
--program-suffix=${MY_SUFFIX} \
--with-soname=ruby${MY_SUFFIX} \
--docdir=${EPREFIX}/usr/share/doc/${P} \
@@ -145,6 +158,7 @@ src_configure() {
--enable-pthread \
--disable-rpath \
--with-out-ext="${modules}" \
+ $(use_with jemalloc jemalloc) \
$(use_enable socks5 socks) \
$(use_enable doc install-doc) \
--enable-ipv6 \
@@ -188,7 +202,7 @@ src_install() {
local MINIRUBY=$(echo -e 'include Makefile\ngetminiruby:\n\t@echo $(MINIRUBY)'|make -f - getminiruby)
- LD_LIBRARY_PATH="${ED}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
+ LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
RUBYLIB="${S}:${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}"
for d in $(find "${S}/ext" -type d) ; do
RUBYLIB="${RUBYLIB}:$d"
@@ -198,9 +212,9 @@ src_install() {
emake V=1 DESTDIR="${D}" install || die "make install failed"
# Remove installed rubygems copy
- rm -r "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}/rubygems" || die "rm rubygems failed"
- rm -r "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}"/rdoc* || die "rm rdoc failed"
- rm -r "${ED}/usr/bin/"{ri,rdoc}"${MY_SUFFIX}" || die "rm rdoc bins failed"
+ rm -rf "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}/rubygems" || die "rm rubygems failed"
+ rm -rf "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}"/rdoc* || die "rm rdoc failed"
+ rm -rf "${ED}/usr/bin/"{ri,rdoc}"${MY_SUFFIX}" || die "rm rdoc bins failed"
if use doc; then
make DESTDIR="${D}" install-doc || die "make install-doc failed"
@@ -228,7 +242,7 @@ pkg_postinst() {
elog
elog "To switch between available Ruby profiles, execute as root:"
- elog "\teselect ruby set ruby(19|20|...)"
+ elog "\teselect ruby set ruby(21|22|...)"
elog
}
diff --git a/dev-lang/ruby/ruby-2.4.2.ebuild b/dev-lang/ruby/ruby-2.4.2.ebuild
new file mode 100644
index 0000000000..65f42b0dc7
--- /dev/null
+++ b/dev-lang/ruby/ruby-2.4.2.ebuild
@@ -0,0 +1,251 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+#PATCHSET=1
+
+inherit autotools eutils flag-o-matic multilib versionator
+
+MY_P="${PN}-$(get_version_component_range 1-3)"
+S=${WORKDIR}/${MY_P}
+
+SLOT=$(get_version_component_range 1-2)
+MY_SUFFIX=$(delete_version_separator 1 ${SLOT})
+RUBYVERSION=${SLOT}.0
+
+if [[ -n ${PATCHSET} ]]; then
+ if [[ ${PVR} == ${PV} ]]; then
+ PATCHSET="${PV}-r0.${PATCHSET}"
+ else
+ PATCHSET="${PVR}.${PATCHSET}"
+ fi
+else
+ PATCHSET="${PVR}"
+fi
+
+DESCRIPTION="An object-oriented scripting language"
+HOMEPAGE="http://www.ruby-lang.org/"
+SRC_URI="mirror://ruby/${SLOT}/${MY_P}.tar.xz
+ https://dev.gentoo.org/~graaff/ruby-team/${PN}-patches-${PATCHSET}.tar.bz2"
+
+LICENSE="|| ( Ruby-BSD BSD-2 )"
+KEYWORDS="~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="berkdb debug doc examples gdbm ipv6 jemalloc libressl +rdoc rubytests socks5 ssl static-libs tk xemacs"
+
+RDEPEND="
+ berkdb? ( sys-libs/db:= )
+ gdbm? ( sys-libs/gdbm )
+ jemalloc? ( dev-libs/jemalloc )
+ ssl? (
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl )
+ )
+ socks5? ( >=net-proxy/dante-1.1.13 )
+ tk? (
+ dev-lang/tcl:0=[threads]
+ dev-lang/tk:0=[threads]
+ )
+ dev-libs/libyaml
+ virtual/libffi
+ sys-libs/zlib
+ >=app-eselect/eselect-ruby-20161226
+ !<dev-ruby/rdoc-3.9.4
+ !<dev-ruby/rubygems-1.8.10-r1"
+
+DEPEND="${RDEPEND}"
+
+BUNDLED_GEMS="
+ >=dev-ruby/did_you_mean-1.1.0:2.4[ruby_targets_ruby24]
+ >=dev-ruby/minitest-5.10.1[ruby_targets_ruby24]
+ >=dev-ruby/net-telnet-0.1.1[ruby_targets_ruby24]
+ >=dev-ruby/power_assert-0.4.1[ruby_targets_ruby24]
+ >=dev-ruby/rake-12.0.0[ruby_targets_ruby24]
+ >=dev-ruby/test-unit-3.2.3[ruby_targets_ruby24]
+ >=dev-ruby/xmlrpc-0.2.1[ruby_targets_ruby24]
+"
+
+PDEPEND="
+ ${BUNDLED_GEMS}
+ virtual/rubygems[ruby_targets_ruby24]
+ >=dev-ruby/json-2.0.2[ruby_targets_ruby24]
+ rdoc? ( >=dev-ruby/rdoc-5.1.0[ruby_targets_ruby24] )
+ xemacs? ( app-xemacs/ruby-modes )"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-1.9.1-prefix.patch"
+ EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" \
+ epatch "${WORKDIR}/patches"
+
+ einfo "Unbundling gems..."
+ cd "$S"
+ # Remove bundled gems that we will install via PDEPEND, bug
+ # 539700. Use explicit version numbers to ensure rm fails when they
+ # change so we can update dependencies accordingly.
+ 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
+
+ einfo "Removing bundled libraries..."
+ rm -fr ext/fiddle/libffi-3.2.1 || die
+
+ # Fix a hardcoded lib path in configure script
+ sed -i -e "s:\(RUBY_LIB_PREFIX=\"\${prefix}/\)lib:\1$(get_libdir):" \
+ configure.in || die "sed failed"
+ # Fix hardcoded SHELL var in mkmf library
+ sed -i -e "s#\(SHELL = \).*#\1${EPREFIX}/bin/sh#" lib/mkmf.rb
+ # avoid symlink loop on Darwin (?!)
+ sed -i -e '/LIBRUBY_ALIASES=/s/lib$(RUBY_INSTALL_NAME).dylib//' \
+ configure.in || die "sed failed"
+
+ eapply_user
+
+ eautoreconf
+}
+
+src_configure() {
+ local modules= myconf=
+
+ # -fomit-frame-pointer makes ruby segfault, see bug #150413.
+ filter-flags -fomit-frame-pointer
+ # In many places aliasing rules are broken; play it safe
+ # as it's risky with newer compilers to leave it as it is.
+ append-flags -fno-strict-aliasing
+ # SuperH needs this
+ use sh && append-flags -mieee
+
+ # Socks support via dante
+ if use socks5 ; then
+ # Socks support can't be disabled as long as SOCKS_SERVER is
+ # set and socks library is present, so need to unset
+ # SOCKS_SERVER in that case.
+ unset SOCKS_SERVER
+ fi
+
+ # Increase GC_MALLOC_LIMIT if set (default is 8000000)
+ if [ -n "${RUBY_GC_MALLOC_LIMIT}" ] ; then
+ append-flags "-DGC_MALLOC_LIMIT=${RUBY_GC_MALLOC_LIMIT}"
+ fi
+
+ # ipv6 hack, bug 168939. Needs --enable-ipv6.
+ use ipv6 || myconf="${myconf} --with-lookup-order-hack=INET"
+
+ # Determine which modules *not* to build depending in the USE flags.
+ if ! use berkdb ; then
+ modules="${modules},dbm"
+ fi
+ if ! use gdbm ; then
+ modules="${modules},gdbm"
+ fi
+ if ! use ssl ; then
+ modules="${modules},openssl"
+ fi
+ if ! use tk ; then
+ modules="${modules},tk"
+ fi
+
+ # Provide an empty LIBPATHENV because we disable rpath but we do not
+ # need LD_LIBRARY_PATH by default since that breaks USE=multitarget
+ # #564272
+ INSTALL="${EPREFIX}/usr/bin/install -c" LIBPATHENV="" econf \
+ --program-suffix=${MY_SUFFIX} \
+ --with-soname=ruby${MY_SUFFIX} \
+ --docdir=${EPREFIX}/usr/share/doc/${P} \
+ --enable-shared \
+ --enable-pthread \
+ --disable-rpath \
+ --with-out-ext="${modules}" \
+ $(use_with jemalloc jemalloc) \
+ $(use_enable socks5 socks) \
+ $(use_enable doc install-doc) \
+ --enable-ipv6 \
+ $(use_enable static-libs static) \
+ $(use_enable static-libs install-static-library) \
+ $(use_with static-libs static-linked-ext) \
+ $(use_enable debug) \
+ ${myconf} \
+ --with-readline-dir="${EPREFIX}"/usr \
+ --enable-option-checking=no \
+ || die "econf failed"
+}
+
+src_compile() {
+ emake V=1 EXTLDFLAGS="${LDFLAGS}" || die "emake failed"
+}
+
+src_test() {
+ emake -j1 V=1 test || die "make test failed"
+
+ elog "Ruby's make test has been run. Ruby also ships with a make check"
+ elog "that cannot be run until after ruby has been installed."
+ elog
+ if use rubytests; then
+ elog "You have enabled rubytests, so they will be installed to"
+ elog "/usr/share/${PN}-${SLOT}/test. To run them you must be a user other"
+ elog "than root, and you must place them into a writeable directory."
+ elog "Then call: "
+ elog
+ elog "ruby${MY_SUFFIX} -C /location/of/tests runner.rb"
+ else
+ elog "Enable the rubytests USE flag to install the make check tests"
+ fi
+}
+
+src_install() {
+ # Remove the remaining bundled gems. We do this late in the process
+ # since they are used during the build to e.g. create the
+ # documentation.
+ rm -rf ext/json || die
+
+ # Ruby is involved in the install process, we don't want interference here.
+ unset RUBYOPT
+
+ local MINIRUBY=$(echo -e 'include Makefile\ngetminiruby:\n\t@echo $(MINIRUBY)'|make -f - getminiruby)
+
+ LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
+ DYLD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${DYLD_LIBRARY_PATH+:}${DYLD_LIBRARY_PATH}"
+ RUBYLIB="${S}:${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}"
+ for d in $(find "${S}/ext" -type d) ; do
+ RUBYLIB="${RUBYLIB}:$d"
+ done
+ export LD_LIBRARY_PATH DYLD_LIBRARY_PATH RUBYLIB
+
+ emake V=1 DESTDIR="${D}" install || die "make install failed"
+
+ # Remove installed rubygems and rdoc copy
+ rm -rf "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}/rubygems" || die "rm rubygems failed"
+ rm -rf "${ED}/usr/bin/"gem"${MY_SUFFIX}" || die "rm rdoc bins failed"
+ rm -rf "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}"/rdoc* || die "rm rdoc failed"
+ rm -rf "${ED}/usr/bin/"{ri,rdoc}"${MY_SUFFIX}" || die "rm rdoc bins failed"
+
+ if use doc; then
+ make DESTDIR="${D}" install-doc || die "make install-doc failed"
+ fi
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}
+ doins -r sample
+ fi
+
+ dodoc ChangeLog NEWS doc/NEWS* README* || die
+
+ if use rubytests; then
+ pushd test
+ insinto /usr/share/${PN}-${SLOT}/test
+ doins -r .
+ popd
+ fi
+}
+
+pkg_postinst() {
+ if [[ ! -n $(readlink "${EROOT}"usr/bin/ruby) ]] ; then
+ eselect ruby set ruby${MY_SUFFIX}
+ fi
+
+ elog
+ elog "To switch between available Ruby profiles, execute as root:"
+ elog "\teselect ruby set ruby(23|24|...)"
+ elog
+}
+
+pkg_postrm() {
+ eselect ruby cleanup
+}