Add new src_test, and add return code patch from [ruby-core:10609] and [ruby-core...
authorRichard Brown <rbrown@gentoo.org>
Tue, 1 May 2007 21:17:42 +0000 (21:17 +0000)
committerRichard Brown <rbrown@gentoo.org>
Tue, 1 May 2007 21:17:42 +0000 (21:17 +0000)
Package-Manager: portage-2.1.2.2

dev-lang/ruby/ChangeLog
dev-lang/ruby/Manifest
dev-lang/ruby/files/digest-ruby-1.8.6-r1 [new file with mode: 0644]
dev-lang/ruby/files/ruby-1.8.6-exit-status.patch [new file with mode: 0644]
dev-lang/ruby/ruby-1.8.6-r1.ebuild [new file with mode: 0644]

index dd7e4f9d965e076b8d29ac889d87e45289a34b52..11acef2d7b56fd01e187fdf09a801714a1eb11c3 100644 (file)
@@ -1,6 +1,13 @@
 # ChangeLog for dev-lang/ruby
 # Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/ruby/ChangeLog,v 1.263 2007/04/24 11:22:57 rbrown Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/ruby/ChangeLog,v 1.264 2007/05/01 21:17:42 rbrown Exp $
+
+*ruby-1.8.6-r1 (01 May 2007)
+
+  01 May 2007; Richard Brown <rbrown@gentoo.org>
+  +files/ruby-1.8.6-exit-status.patch, +ruby-1.8.6-r1.ebuild:
+  Add new src_test, and add return code patch from [ruby-core:10609] and
+  [ruby-core:10760]
 
   24 Apr 2007; Richard Brown <rbrown@gentoo.org> ruby-1.8.4-r3.ebuild,
   ruby-1.8.5_p2.ebuild, ruby-1.8.5_p12.ebuild, ruby-1.8.5_p35.ebuild,
index 2dccc39c42b542a5e06ed2beb516573df6b52580..4c35afcb66ef48298f49e1b56896bfabe5a9079a 100644 (file)
@@ -6,6 +6,10 @@ AUX ruby-1.8.4-yaml.diff 457 RMD160 6bb5d1700c877d5dc4192da6eaae9bc6712f78b0 SHA
 MD5 2fade36ba9727ddc61257d1588b5db16 files/ruby-1.8.4-yaml.diff 457
 RMD160 6bb5d1700c877d5dc4192da6eaae9bc6712f78b0 files/ruby-1.8.4-yaml.diff 457
 SHA256 425847a21b2c794c4cf910bcd7d6603951bc20c55f39e768dd6befd99ea1a0bb files/ruby-1.8.4-yaml.diff 457
+AUX ruby-1.8.6-exit-status.patch 2284 RMD160 09d777250a298848cff9d11fee5f00551cbab2a4 SHA1 7f3b4b4eba17ef8bf934e6c0d75c823bd0587a62 SHA256 41e7cd46b654e60b29333da68a70c110fac6a0794e35ec10cc13bbd35b150176
+MD5 677eaed33af3a3768f9e372ffe97695c files/ruby-1.8.6-exit-status.patch 2284
+RMD160 09d777250a298848cff9d11fee5f00551cbab2a4 files/ruby-1.8.6-exit-status.patch 2284
+SHA256 41e7cd46b654e60b29333da68a70c110fac6a0794e35ec10cc13bbd35b150176 files/ruby-1.8.6-exit-status.patch 2284
 DIST onigd2_5_4.tar.gz 212280 RMD160 6f694c6cf12f803d0bc608f493789c92c3cbcf68 SHA1 68438f08aed58bb4655e9268268a0311ea524df7 SHA256 cd4b4177633e8e42e34c26e3f41b0b9bccf747dc51d72a38943fef9cbc0eaa7b
 DIST onigd2_5_7.tar.gz 215529 RMD160 43cf52af1243acf21932690307ed7b0c81ff2771 SHA1 041cac9ce58f3002228a98db3c4c6934f5682593 SHA256 205b2857d77efc4caa3b98eaf91fd1cc8b8722b497df933d1fbd23f7a5186549
 DIST ruby-1.8.4.tar.gz 4312965 RMD160 1c0572a4ee369af57a3db68027b2566052eac944 SHA1 93999577c7fc4decc6b2fe8fefa96e743f278fbf SHA256 71432841b3965b7ab2d83f0dc7c3049195ea4e9267a8dc2d825a8a0466982930
@@ -31,6 +35,10 @@ EBUILD ruby-1.8.5_p35.ebuild 4173 RMD160 3fb78e6895b9c3166ca1f7bfbaf555d520a2a03
 MD5 bf844d93ff5405d0cf8db29de410b84b ruby-1.8.5_p35.ebuild 4173
 RMD160 3fb78e6895b9c3166ca1f7bfbaf555d520a2a034 ruby-1.8.5_p35.ebuild 4173
 SHA256 1bb9fb04c31797fec1b00ee186245b12a0ed8ee5392884a0c3e8b0c58a0f7b5c ruby-1.8.5_p35.ebuild 4173
+EBUILD ruby-1.8.6-r1.ebuild 4985 RMD160 e72d73fc17887901e07802a1c300163b0d8f29de SHA1 cbf51518b99981087c278586c840ff64b60fc319 SHA256 87a93449e3f0b91e07ad8895d722575ebeed5d33ac64d75635568b302e54ef05
+MD5 e2ba61ee1bc7d75d5dc3a68f6ed6b3e6 ruby-1.8.6-r1.ebuild 4985
+RMD160 e72d73fc17887901e07802a1c300163b0d8f29de ruby-1.8.6-r1.ebuild 4985
+SHA256 87a93449e3f0b91e07ad8895d722575ebeed5d33ac64d75635568b302e54ef05 ruby-1.8.6-r1.ebuild 4985
 EBUILD ruby-1.8.6.ebuild 4226 RMD160 7ad40e6cbda096669f80010c08f92b87e8494c7b SHA1 c67d945097fde0e2d2662d4f69fd75ca6ac7e28d SHA256 41df41f72539fa94631b35b0515e5e503a6491bc03f78749864a1ce101bb838c
 MD5 aa061336a3b4d6f798f424b5d68c6794 ruby-1.8.6.ebuild 4226
 RMD160 7ad40e6cbda096669f80010c08f92b87e8494c7b ruby-1.8.6.ebuild 4226
@@ -43,10 +51,10 @@ EBUILD ruby-1.8.6_pre3.ebuild 4302 RMD160 cf241241efc414d4e626f38bcc09ca72065f2f
 MD5 2da62fce4df6f025688db4d7c8df99a2 ruby-1.8.6_pre3.ebuild 4302
 RMD160 cf241241efc414d4e626f38bcc09ca72065f2ff7 ruby-1.8.6_pre3.ebuild 4302
 SHA256 58c7aa3b0c8cbb3f80455647db0d67a6476850217a1fcdc0548cfa46a1581127 ruby-1.8.6_pre3.ebuild 4302
-MISC ChangeLog 38212 RMD160 dab591e8b189eb48f4ed09865873beec06fa8440 SHA1 25020118d307850bb70cedd0318df04924779f18 SHA256 a131413aeca717d2b8e344b648d7aee81660dd8382bb9ad01b637869a14dbad4
-MD5 9f3a66999db9cc4648909b57c93d73e7 ChangeLog 38212
-RMD160 dab591e8b189eb48f4ed09865873beec06fa8440 ChangeLog 38212
-SHA256 a131413aeca717d2b8e344b648d7aee81660dd8382bb9ad01b637869a14dbad4 ChangeLog 38212
+MISC ChangeLog 38447 RMD160 3d9a8e52353bd06a9c1e7700066bbb92352bb4a2 SHA1 8a866b79bc793bec98699322c0550b52c6628531 SHA256 702fa16a6f12725258a43887be01a14ca0fffb6023b3dc716444758afa657467
+MD5 a513d920440c5bfcbc2da2987e9d4a1c ChangeLog 38447
+RMD160 3d9a8e52353bd06a9c1e7700066bbb92352bb4a2 ChangeLog 38447
+SHA256 702fa16a6f12725258a43887be01a14ca0fffb6023b3dc716444758afa657467 ChangeLog 38447
 MISC metadata.xml 157 RMD160 5d9e2c7ecba96ffebd936d38acedf859cdea84e1 SHA1 8ce15dcc608eeb5616aeec610dc695cbe6f93e02 SHA256 11fba03a217e2d996f5cd8895493a5692ece8ddac2c1a2dfc71d0e830555121c
 MD5 3eec9f3fe48b51f49dbc1f171a3b026f metadata.xml 157
 RMD160 5d9e2c7ecba96ffebd936d38acedf859cdea84e1 metadata.xml 157
@@ -66,6 +74,9 @@ SHA256 bbb5d32f084537e89f7ac201de06942620d794d744c8ae0c07797efb1bd00942 files/di
 MD5 e7fc9a14d094a485d0db9eac1e17ca88 files/digest-ruby-1.8.6 235
 RMD160 d8b37132ebe5eba9d4485f1ce320ab3fc824cc4d files/digest-ruby-1.8.6 235
 SHA256 06257e9ae516624582d8e9067e50d992537ffddab879573208164353cc3d8075 files/digest-ruby-1.8.6 235
+MD5 e7fc9a14d094a485d0db9eac1e17ca88 files/digest-ruby-1.8.6-r1 235
+RMD160 d8b37132ebe5eba9d4485f1ce320ab3fc824cc4d files/digest-ruby-1.8.6-r1 235
+SHA256 06257e9ae516624582d8e9067e50d992537ffddab879573208164353cc3d8075 files/digest-ruby-1.8.6-r1 235
 MD5 e1b51b71b8dc46892665721197d57976 files/digest-ruby-1.8.6_pre1 262
 RMD160 1d8f6d5b0272b4be75b83833e2c73a657a271721 files/digest-ruby-1.8.6_pre1 262
 SHA256 7e7c281c1d784e8c72c7cdf674bb75e29871a39ed9fb241d0b7d30e4fefe7977 files/digest-ruby-1.8.6_pre1 262
diff --git a/dev-lang/ruby/files/digest-ruby-1.8.6-r1 b/dev-lang/ruby/files/digest-ruby-1.8.6-r1
new file mode 100644 (file)
index 0000000..a77335f
--- /dev/null
@@ -0,0 +1,3 @@
+MD5 23d2494aa94e7ae1ecbbb8c5e1507683 ruby-1.8.6.tar.gz 4589394
+RMD160 a1ad902bb1311233cd3cf9db52ab2ec076a709f5 ruby-1.8.6.tar.gz 4589394
+SHA256 3ef37fb961d04471a1aef2c8079d6fab09932e3281d79859d5cd5d426bde0868 ruby-1.8.6.tar.gz 4589394
diff --git a/dev-lang/ruby/files/ruby-1.8.6-exit-status.patch b/dev-lang/ruby/files/ruby-1.8.6-exit-status.patch
new file mode 100644 (file)
index 0000000..a86587f
--- /dev/null
@@ -0,0 +1,80 @@
+Index: test/ruby/test_beginendblock.rb
+===================================================================
+--- test/ruby/test_beginendblock.rb    (revision 12125)
++++ test/ruby/test_beginendblock.rb    (revision 12126)
+@@ -54,4 +54,34 @@
+     assert_equal(expected, File.read(erroutpath))
+     # expecting Tempfile to unlink launcher and errout file.
+   end
++
++  def test_raise_in_at_exit
++    # [ruby-core:09675]
++    ruby = EnvUtil.rubybin
++    out = IO.popen("#{q(ruby)} -e 'STDERR.reopen(STDOUT);" \
++                 "at_exit{raise %[SomethingBad]};" \
++                 "raise %[SomethingElse]'") {|f|
++      f.read
++    }
++    assert_match /SomethingBad/, out
++    assert_match /SomethingElse/, out
++  end
++
++  def test_should_propagate_exit_code
++    ruby = EnvUtil.rubybin
++    assert_equal false, system("#{q(ruby)} -e 'at_exit{exit 2}'")
++    assert_equal 2, $?.exitstatus
++    assert_nil $?.termsig
++  end
++
++  def test_should_propagate_signaled
++    ruby = EnvUtil.rubybin
++    out = IO.popen("#{q(ruby)} -e 'STDERR.reopen(STDOUT);" \
++                 "at_exit{Process.kill(:INT, $$)}'"){|f|
++      f.read
++    }
++    assert_match /Interrupt$/, out
++    assert_nil $?.exitstatus
++    assert_equal Signal.list["INT"], $?.termsig
++  end
+ end
+Index: eval.c
+===================================================================
+--- eval.c     (revision 12125)
++++ eval.c     (revision 12126)
+@@ -1562,11 +1562,15 @@
+     int ex;
+ {
+     int state;
+-    volatile VALUE err = ruby_errinfo;
++    VALUE err;
++    volatile VALUE errs[2];
++    int nerr;
++    errs[0] = ruby_errinfo;
+     ruby_safe_level = 0;
+     Init_stack((void*)&state);
+     ruby_finalize_0();
++    errs[1] = ruby_errinfo;
+     PUSH_TAG(PROT_NONE);
+     PUSH_ITER(ITER_NOT);
+     if ((state = EXEC_TAG()) == 0) {
+@@ -1577,15 +1581,15 @@
+       ex = state;
+     }
+     POP_ITER();
+-    ruby_errinfo = err;
++    ruby_errinfo = errs[0];
+     ex = error_handle(ex);
+     ruby_finalize_1();
+     POP_TAG();
+-    if (err) {
++    for (nerr = sizeof(errs) / sizeof(errs[0]); nerr;) {
++      if (!(err = errs[--nerr])) continue;
+       if (rb_obj_is_kind_of(err, rb_eSystemExit)) {
+-          VALUE st = rb_iv_get(err, "status");
+-          return NUM2INT(st);
++          return sysexit_status(err);
+       }
+       else if (rb_obj_is_kind_of(err, rb_eSignal)) {
+           VALUE sig = rb_iv_get(err, "signo");
diff --git a/dev-lang/ruby/ruby-1.8.6-r1.ebuild b/dev-lang/ruby/ruby-1.8.6-r1.ebuild
new file mode 100644 (file)
index 0000000..feba0a5
--- /dev/null
@@ -0,0 +1,167 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/ruby/ruby-1.8.6-r1.ebuild,v 1.1 2007/05/01 21:17:42 rbrown Exp $
+
+WANT_AUTOCONF="latest"
+WANT_AUTOMAKE="latest"
+
+# A new version is needed for 1.8.6, currently disabled.
+ONIGURUMA="onigd2_5_8"
+
+inherit flag-o-matic alternatives eutils multilib autotools versionator
+
+DESCRIPTION="An object-oriented scripting language"
+HOMEPAGE="http://www.ruby-lang.org/"
+SRC_URI="ftp://ftp.ruby-lang.org/pub/ruby/$(get_version_component_range 1-2)/${P}.tar.gz"
+#      cjk? ( http://www.geocities.jp/kosako3/oniguruma/archive/${ONIGURUMA}.tar.gz )"
+
+LICENSE="Ruby"
+SLOT="1.8"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
+IUSE="debug doc examples ipv6 rubytests socks5 threads tk" # cjk
+RESTRICT="confcache"
+
+RDEPEND=">=sys-libs/gdbm-1.8.0
+       >=sys-libs/readline-4.1
+       >=sys-libs/ncurses-5.2
+       socks5? ( >=net-proxy/dante-1.1.13 )
+       tk? ( dev-lang/tk )
+       >=dev-ruby/ruby-config-0.3.1
+       !=dev-lang/ruby-cvs-1.8*
+       !dev-ruby/rdoc
+       !dev-ruby/rexml"
+DEPEND="${RDEPEND}"
+PROVIDE="virtual/ruby"
+
+src_unpack() {
+       unpack ${A}
+
+#      if use cjk ; then
+#              einfo "Applying ${ONIGURUMA}"
+#              pushd ${WORKDIR}/oniguruma
+##             epatch ${FILESDIR}/oniguruma-2.3.1-gentoo.patch
+#              econf --with-rubydir=${S} || die "econf failed"
+#              MY_PV=$(get_version_component_range 1-2)
+#              make ${MY_PV/./}
+#              popd
+#      fi
+
+       cd "${S}"
+
+       # 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"
+
+       eautoreconf
+
+       epatch ${FILESDIR}/${P}-exit-status.patch
+}
+
+src_compile() {
+       # -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
+
+       # 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
+
+       econf --program-suffix=${SLOT/./} --enable-shared \
+               $(use_enable socks5 socks) \
+               $(use_enable doc install-doc) \
+               $(use_enable threads pthread) \
+               $(use_enable ipv6 ipv6) \
+               $(use_enable debug debug) \
+               --with-sitedir=/usr/$(get_libdir)/ruby/site_ruby \
+               || die "econf failed"
+
+       emake || die "emake failed"
+}
+
+src_test() {
+       emake -j1 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 -C /location/of/tests runner.rb"
+       else
+               elog "Enable the rubytests USE flag to install the make check tests"
+       fi
+}
+
+src_install() {
+       LD_LIBRARY_PATH=${D}/usr/$(get_libdir)
+       RUBYLIB="${S}:${D}/usr/$(get_libdir)/ruby/${SLOT}"
+       for d in $(find ${S}/ext -type d) ; do
+               RUBYLIB="${RUBYLIB}:$d"
+       done
+       export LD_LIBRARY_PATH RUBYLIB
+
+       make DESTDIR="${D}" install || die "make install failed"
+
+       MINIRUBY=$(echo -e 'include Makefile\ngetminiruby:\n\t@echo $(MINIRUBY)'|make -f - getminiruby)
+       keepdir $(${MINIRUBY} -rrbconfig -e "print Config::CONFIG['sitelibdir']")
+       keepdir $(${MINIRUBY} -rrbconfig -e "print Config::CONFIG['sitearchdir']")
+
+       if use doc; then
+               make DESTDIR="${D}" install-doc || die "make install-doc failed"
+       fi
+
+       if use examples; then
+               dodir /usr/share/doc/${PF}
+               cp -pPR sample ${D}/usr/share/doc/${PF}
+       fi
+
+       dosym libruby${SLOT/./}$(get_libname ${PV%_*}) /usr/$(get_libdir)/libruby$(get_libname ${PV%.*})
+       dosym libruby${SLOT/./}$(get_libname ${PV%_*}) /usr/$(get_libdir)/libruby$(get_libname ${PV%_*})
+
+       dodoc ChangeLog NEWS README* ToDo
+
+       if use rubytests; then
+               dodir /usr/share/${PN}-${SLOT}
+               cp -pPR test ${D}/usr/share/${PN}-${SLOT}
+       fi
+}
+
+pkg_postinst() {
+       ewarn
+       ewarn "Warning: Vim won't work if you've just updated ruby from"
+       ewarn "1.6.x to 1.8.x due to the library version change."
+       ewarn "In that case, you will need to remerge vim."
+       ewarn
+
+       ewarn "If you upgrade to >=sys-apps/coreutils-6.7-r1,"
+       ewarn "you should re-emerge ruby again."
+       ewarn "See bug #159922 for details"
+       ewarn
+       if [ ! -n "$(readlink ${ROOT}usr/bin/ruby)" ] ; then
+               ${ROOT}usr/sbin/ruby-config ruby${SLOT/./}
+       fi
+       elog
+       elog "You can change the default ruby interpreter by ${ROOT}usr/sbin/ruby-config"
+       elog
+}
+
+pkg_postrm() {
+       if [ ! -n "$(readlink ${ROOT}usr/bin/ruby)" ] ; then
+               ${ROOT}usr/sbin/ruby-config ruby${SLOT/./}
+       fi
+}