Backport upstream patch to compile with hardened gcc, bug 542610. Drop unneeded sse2...
authorHans de Graaff <graaff@gentoo.org>
Fri, 24 Apr 2015 08:15:31 +0000 (08:15 +0000)
committerHans de Graaff <graaff@gentoo.org>
Fri, 24 Apr 2015 08:15:31 +0000 (08:15 +0000)
Package-Manager: portage-2.2.18/cvs/Linux x86_64
Manifest-Sign-Key: 0x8883FA56A308A8D7!

dev-lang/ruby/ChangeLog
dev-lang/ruby/Manifest
dev-lang/ruby/ruby-2.1.6-r1.ebuild [new file with mode: 0644]
dev-lang/ruby/ruby-2.2.2-r1.ebuild [new file with mode: 0644]

index 17c9daa7bec788b53c25128909a1524050846bd2..e18994dfe0e2841c95a7591cbf03a44a18ef5613 100644 (file)
@@ -1,6 +1,14 @@
 # ChangeLog for dev-lang/ruby
 # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/ruby/ChangeLog,v 1.709 2015/04/22 17:20:37 jer Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/ruby/ChangeLog,v 1.710 2015/04/24 08:15:22 graaff Exp $
+
+*ruby-2.2.2-r1 (24 Apr 2015)
+*ruby-2.1.6-r1 (24 Apr 2015)
+
+  24 Apr 2015; Hans de Graaff <graaff@gentoo.org> +ruby-2.1.6-r1.ebuild,
+  +ruby-2.2.2-r1.ebuild:
+  Backport upstream patch to compile with hardened gcc, bug 542610. Drop
+  unneeded sse2 patch for ruby 2.1.6, bug 546974.
 
   22 Apr 2015; Jeroen Roovers <jer@gentoo.org> ruby-1.9.3_p551-r1.ebuild,
   ruby-2.0.0_p645.ebuild:
index a9a4f7335c7c15475061c57aa812c23a2232de4c..ff94186634fee78debc5e201917bdcd9a8d10abf 100644 (file)
@@ -16,9 +16,11 @@ DIST ruby-patches-2.0.0_p598.tar.bz2 2947 SHA256 dc173fe94af215fd2c1823f46140e4f
 DIST ruby-patches-2.0.0_p643.tar.bz2 2947 SHA256 dc173fe94af215fd2c1823f46140e4f11892dec59ce55b10ffad26b622bb6e4e SHA512 423a4fddfc8d7fd4f5b041989da343bc96ce0c3f22a448cab8cec47d4c458f4deeb83b167a0a3ae71d3be57df9b41151d1cafadd191bd3d3e9b08b32732e36cd WHIRLPOOL 9c728e95cf01abdb48afc2ff008dc73d341096b253c664297b6780b32821c1ec406c388ce5860b5dd2ce2de862fb80b2ae45d03750045aaf13c371743f97c92e
 DIST ruby-patches-2.0.0_p645.tar.bz2 2947 SHA256 dc173fe94af215fd2c1823f46140e4f11892dec59ce55b10ffad26b622bb6e4e SHA512 423a4fddfc8d7fd4f5b041989da343bc96ce0c3f22a448cab8cec47d4c458f4deeb83b167a0a3ae71d3be57df9b41151d1cafadd191bd3d3e9b08b32732e36cd WHIRLPOOL 9c728e95cf01abdb48afc2ff008dc73d341096b253c664297b6780b32821c1ec406c388ce5860b5dd2ce2de862fb80b2ae45d03750045aaf13c371743f97c92e
 DIST ruby-patches-2.1.5.tar.bz2 2310 SHA256 1743dc0cec0adc1a0b5d90b0ed7908f888b8251b7a414049a57e6e32e01e4ad6 SHA512 b695621d210a7afc6704dd480bf3e7fc559174ebf240d2287338d60537ba45e5bf0f5defac6b254064d4b28077e2b97ef23b7eadc1bfa1a6bf2c616e828f937c WHIRLPOOL e9fde062fc04e4e22aec2dc55250f9007c64b07c7d03875b4073c19af9cfb0ae735d6dcb2b65bd1465a457cf0ff0602866600b5af1d520df3efc8a418763ab5b
+DIST ruby-patches-2.1.6-r1.tar.bz2 2348 SHA256 2c158373217a719f2961c1f2cf2f3494eb43c413dc41ba7f9c1d88c60baca7f7 SHA512 01367d463a3aa72261742ae468d96ca1fb06a2d6b2a7a0cc416e449a7ae602d4478fb2394390636725424f252fa95c5db7d2c8116dc0b1e4477d8d641961980f WHIRLPOOL b39e8b9bdd8d05958b3b4c5884bfdd65c99b9aee2470a48ca748cbf336948bf0bb9f834ce3fec5e9365abaf385de760012f67dec6db257d7cbeff04ce0c5c7fb
 DIST ruby-patches-2.1.6.tar.bz2 2310 SHA256 1743dc0cec0adc1a0b5d90b0ed7908f888b8251b7a414049a57e6e32e01e4ad6 SHA512 b695621d210a7afc6704dd480bf3e7fc559174ebf240d2287338d60537ba45e5bf0f5defac6b254064d4b28077e2b97ef23b7eadc1bfa1a6bf2c616e828f937c WHIRLPOOL e9fde062fc04e4e22aec2dc55250f9007c64b07c7d03875b4073c19af9cfb0ae735d6dcb2b65bd1465a457cf0ff0602866600b5af1d520df3efc8a418763ab5b
 DIST ruby-patches-2.2.0-r1.tar.bz2 2195 SHA256 c7acb19428dd1d5b59bff37e7705549e6e369504a99c171acc4d78b156ef1632 SHA512 ee438dd791a44778bb3da4afe96bac11cacb408cd859dcf057d12e3cc6d5e989b3b5f9c8662ede5229cc8d477126bfe46e1a02048a10e62b67abe22c0ecf4ab4 WHIRLPOOL 8e40576f1087ecc7a41ee9414857eac58e163895ffad3f4c4bb629bda38c8063b3eec608117251812fd8353b44dc58766e12f893cb37a6da7b277979b4da12db
 DIST ruby-patches-2.2.1.tar.bz2 2267 SHA256 0ad98acf3d3f9128c2471e360d4cef0c8967ef2feb59c18f8a781a94c13f349f SHA512 af533ae77b0149bceb04d544b2a6f6c0bd4bcbef53912b233452a7eeda1ecb9cd53aed1631ba9414e76eb0f960e9248fb82525ce5caf843aaad2ebf654cf74ce WHIRLPOOL c495f4e95c1709da1c91b5f7b42b9bc03dfed3849fb7b51ac120fbaae1dabdc99e631e60455f86f91f64eb113c9b24cbeb857efc84c128406350938e01bdb291
+DIST ruby-patches-2.2.2-r1.tar.bz2 3066 SHA256 65342c7cd5146f0d5025932d31e2ed40e1247355d68356e17a06b0ff728fbef1 SHA512 1c578b868db179bca6dd7800528ac23076b1f44519d93b92fafd724d8e5a158512b05cb3d5f7a4f5ada156692978f98cab7dd5b4282701e57c33d50bcda977de WHIRLPOOL 241622b25acdc8b2a7cb912bac2f6e29a4331798ba67507821b3fb295791d7bea8b7933540f2cd47cc7e8477df14be478286d018b7afe9ae121cd8c49c58dc83
 DIST ruby-patches-2.2.2.tar.bz2 2261 SHA256 c44939c8be6ae9ec8f6219fad4ca0aa7d8345f3d58aa4e8b3f129ef8c5ed326c SHA512 aada036fb1aabddcfcf2db862e3d8f5de5a8b61f28c8846b4e76d55743b4e51b542c20312fd094ac3972b3bb78917dadb6b36c384174ca85f823ab4b6a1c3433 WHIRLPOOL aec4e7c05135d76128c9a81df316a6b439dd9471bb227450a1a9b319d0f262279145c86fa5c2b4319c4f7e13691ed3525edf8b43f182baba83d3274f4a045720
 EBUILD ruby-1.9.3_p551-r1.ebuild 6180 SHA256 974aec0ea28363732d80ddf7b5692b6510a4b3231d54a46bc732229421b14210 SHA512 c302ff638ddc64ee10df2fce36c6323cd0655a9b57cd76db7ea0bad5716203e570589ad788914f9f295457ca6e48c162313cd7473e39b159b7b8e801c19b155b WHIRLPOOL 844212ed3a148e988b798e8b01e6d09309e9a124a6d063df7a3e75089401b78e4649521a7beab90984ee417a17d47d1506715652b9208d8bfe6eb85cc1c3ced4
 EBUILD ruby-1.9.3_p551.ebuild 6173 SHA256 7d2a30eee01118bec87a2a5b0b645fcc68517aaf8636dbe4b142022d981343ae SHA512 a85379763eb01935759ff3bb8d4a39c3d4af0ac8a00ec7c88b2f616d93edc6870d9a50fb13ad3cf302e2abd0d058cfa41def32fcc2dfd3927bb15d241d29cc08 WHIRLPOOL 2ad1bfe90ecd54c6f300717ac02a5cbe290cf613f5e3b81de52b962a5edd0af386b07b372446b141290b44a0a634c1dd879ccceb1411c251a6077d237bb06aa8
@@ -26,17 +28,19 @@ EBUILD ruby-2.0.0_p598.ebuild 6514 SHA256 e2391a6b8ef4cc60f72490b8586431dc81918a
 EBUILD ruby-2.0.0_p643.ebuild 6522 SHA256 0c0adf141bd869cb257cd02e630edc052712e551404f78df609d69625aa00a1d SHA512 e3b712fa2a2b2396f313b2e5f924ed22ae5cd1e26423862f35e9763bd1ed0aa83ca47b5bf2d6660a1bded3318a75fd472ecf754f6ac2666324847164dd3c0cf7 WHIRLPOOL 70ae7252ec04e39d7d15cb421f46d93a0f97ceaa81b1b30f1b71c437e472a385e30383455c2c7416da0f414e1a4ac86aee8262195cf77ae2b3f461cf1d3fddad
 EBUILD ruby-2.0.0_p645.ebuild 6518 SHA256 3ff00d0737cbe8630a64ba268c860880ffc00dfecd95b694bd487c4bc1802d0d SHA512 40194a8bf84a9c72b3ae98656d15472c471d062cd831af81f0f64fa9ffe8e215111e71203b1900c6f0fd5fde95c8f7f2b35d0741d13b5cf2fe735e1ee6499f6f WHIRLPOOL bc58dc9508d5305814e2c32c7e2335c711de2dfaff0f4fe2712484667d40c883ca8bcd0c3b21a9d777d9c92d59cedfbb27c9b887186a51c8f9a1147d391739b4
 EBUILD ruby-2.1.5.ebuild 6566 SHA256 026b089c4d9dae94cb045e4a75ee052717f049b014099acb1efda050f71133fd SHA512 122e7dc71afe6c1713d987db1d37b49c4b214a6e9cd1c65f380fc9324228f958aea923a8e389996c40d3e978e9c4493ca7fb229ab8e7645c334947d5c00389d3 WHIRLPOOL 8d1cce18a212097cb5cbce664e8fd2c29202dae911579715890716ebdd3dbd6d67a8620b1dcfbec3f9b4f8a80773b167c4c2a7cf8917e7c09725347996926358
+EBUILD ruby-2.1.6-r1.ebuild 6431 SHA256 3074d6c71587b22be27503d1a39e60a80619167d23010c205fd71e35613e87f8 SHA512 0519068eef7b3cfe9c8bfc3582332376d4f5402ad47c27f2172fc4164029a04b638d0035b1b65063614d0b399962cab5f98f72ad6bcac9922bfa0f282e2809cf WHIRLPOOL e83578993eb14332190230f46c710bff67592145262e5905997b1e176098ef534b78a84cccc94a73623ee1df545f2a89a8e910a866ca38ce06bf547536a875f3
 EBUILD ruby-2.1.6.ebuild 6569 SHA256 fe7691afd4f235ebe7b067aeba4c43963c692ef943726a4ec2c04bf348c3b91b SHA512 0bc905043e55aa711f3cca8f703593bea7f1925d5958a6b1a50e00916d252325483c21c4b481a79524d1cbc00f2a0e927d39406bab8f3e67262221898215b2a3 WHIRLPOOL 26d1b0b3878b81ce13d021bb0b4e18c35636e07839b3a139ccb9b4189a0a74ac525b5f08a510ef1230731438e89677aa9fa0fd88579fc46d39b7e7604856b467
 EBUILD ruby-2.2.0-r1.ebuild 6843 SHA256 f1f4e6b35839ed49bb4a6767f63c553e72d13c4553e826a2fc21ac7953f43161 SHA512 7caa560ced8f0c70d461c473fea88605ecb4a483eab1bc0cc744c7b7be76a8eebd9fdbf6da759568b64923183f92aebcfbc033b3f1e7bf23574b693c84c8961f WHIRLPOOL 23c1f8d3bb622e57ab6613ed654e7e6206c7528c26bad2dd43d94968420d6dabfc82684a054b444ff45d6f235993dd25776e932a7d052f6f11ece63cf8038211
 EBUILD ruby-2.2.1.ebuild 6840 SHA256 6a865b473d094c836bf23a62986fc409903aadb268969b94e7e8e1268ed98ab4 SHA512 4463e375c3798813dd170b0ee72086ffd4cc99a3df83ea12fac92a0693881225caadee7f40841b1e40295bccb0253bd77e6e4dfd7af13c53bdfc048ec5b8dd9c WHIRLPOOL 12762ef01f80dbad97e331c3c9b9e14c3c4144342bcf487cd573990d0cb34659f6f86f0279abd812e1d0acf79cb9b5c3c22e08059f40919d8279ad8f679c3004
+EBUILD ruby-2.2.2-r1.ebuild 6846 SHA256 d29b0f148a612b7d9a898ff4d6875ecf3333184132c743eaee371655beda268b SHA512 fb23ffaa312d8dd54e6a41132e456ffe82d88799eb060e06689877ce3d5e0a5f8b7e640eb7f46e3cb8b89c62e24e8551f411ae50ade02adba1b13d5a0b8797ee WHIRLPOOL 11f004d5754b7f57794b23218283febefa8947f3a9f2d9247c6cf857b686412b04a5152c105d7cf52491cd7ca254a4e86cfad152daab5e189700439af672355f
 EBUILD ruby-2.2.2.ebuild 6843 SHA256 62821c4627e03a2e38e15cd0b59a1cba6fd3915183d19b55068de44db1dc878c SHA512 02c863825f49d5e20493ec94df40aed2c6f164c13c777be3b8a38a96786784a692173d10e49eaefb2431445f663acbd2142216c8fe7e7e14fce364d0d88aa95b WHIRLPOOL f1fa591f90766993743b9419101b202c5f4b919000c23669f9fccf7732bd3357f122375cf88fba9e656afe8f489dac6aed49a3a87ebce7798f00a67dafedd1d1
-MISC ChangeLog 2669 SHA256 f3f61346d314791819e570d060523208ef33523f44ee6115d9e1fb49dc83d661 SHA512 0453f12db57a81f8ff09c57e9e3aa6149db031d53e62f72e8b99ffd83d59be0252120d68add911b9b56331ba85b0e2ca87bec5392b103eaf3f04d5f94e6b4273 WHIRLPOOL 50aad51fe933be858c1aca813fee7bfb47a302adab98e705fcc45ff94140b795d592753487bb1cb4950ab67145b8643deed22a0f1bfa54c1d7f10f85d8c9d266
+MISC ChangeLog 2953 SHA256 44698ca83b8aaf4bbd894b921d0a3dde02852c9db39f5c5fa5568271e7f08271 SHA512 61cf60ce185facfa52bdcc7e28a908fe4f19198236257417ccc1efd17ab5c243bfea1edb11696e2dcec98e037b5cb4bdd79a132bbcb674f10a478de169db67d6 WHIRLPOOL 58ae80f24926fbed3c94bb69949432808900e3e6b6c6e6a49b97f73a9d9556a60e997539523a2b41bc972c8a8e5003d707a69a13b2a01f41c970ae7babd74360
 MISC ChangeLog-2014 104250 SHA256 6587f8f101dc832a9f0c01b77a9d448b6a7b1c3c7befd1368e297bbe3dc41f1c SHA512 89ffec2164a619bbb418ecf43ecb0893a3f6a4846ff1ac403980e68d85efa7d502fa2f7338c80f8fcf12b56a1ed791c7d6d1bfc607f80fa88c1a88c3c6f93a85 WHIRLPOOL 47ced91b8df722e42d33773a243f89e57ca49f8942418d19321a1ed041fd9dabad747ff640fbb1f0de73220c23cd37778eedc44a14b8883b8220ee512089a823
 MISC metadata.xml 1084 SHA256 77b5afe4fc85576b9f4758b1cc1e9ad7021e40bdc341ca8a7932f54dba63a77b SHA512 3341c4c2bac3f5088827470ffaa842196c190d8732425fc0876cace29878602f62b4e0857e1eb52e8a2370df283735ed54da8d72802f8d09c9a513fe97e3e6ba WHIRLPOOL 481ca1b6f1bed13b2cdafe644f5478af62d29aa66374b5f2be55f5474a044d15894708dc1226f612c748d165cd1a26be5b0d307f290b74bca6a3c564a12e162a
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
-iEYEAREIAAYFAlU32GcACgkQVWmRsqeSphOxswCggGt4n3lv1sW0IJYrGR36LxiC
-6osAn3QKxn1L55Lf9GEAHiRL/cr5dgsd
-=EgzF
+iF0EAREIAAYFAlU5+6MACgkQiIP6VqMIqNcXjQD2Mr1eIMDctGeNBFUeXk8TLTC3
+IyJkg2CL243eqpB74gD9FZTzxH9nJX00Jutso6jZ5J3+AXZ5Uyr6AmWIiwQJ3dY=
+=85dK
 -----END PGP SIGNATURE-----
diff --git a/dev-lang/ruby/ruby-2.1.6-r1.ebuild b/dev-lang/ruby/ruby-2.1.6-r1.ebuild
new file mode 100644 (file)
index 0000000..e0f898b
--- /dev/null
@@ -0,0 +1,227 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/ruby/ruby-2.1.6-r1.ebuild,v 1.1 2015/04/24 08:15:22 graaff Exp $
+
+EAPI=5
+
+#PATCHSET=1
+
+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
+
+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/2.1/${MY_P}.tar.xz
+                http://dev.gentoo.org/~flameeyes/ruby-team/${PN}-patches-${PATCHSET}.tar.bz2"
+
+LICENSE="|| ( Ruby-BSD BSD-2 )"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
+IUSE="berkdb debug doc examples gdbm ipv6 +rdoc rubytests socks5 ssl xemacs ncurses +readline"
+
+RDEPEND="
+       berkdb? ( sys-libs/db )
+       gdbm? ( sys-libs/gdbm )
+       ssl? ( dev-libs/openssl )
+       socks5? ( >=net-proxy/dante-1.1.13 )
+       ncurses? ( sys-libs/ncurses )
+       readline?  ( sys-libs/readline )
+       dev-libs/libyaml
+       virtual/libffi
+       sys-libs/zlib
+       >=app-eselect/eselect-ruby-20131227
+       !<dev-ruby/rdoc-3.9.4
+       !<dev-ruby/rubygems-1.8.10-r1"
+
+DEPEND="${RDEPEND}"
+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] )
+       xemacs? ( app-xemacs/ruby-modes )"
+
+src_prepare() {
+       EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" \
+               epatch "${WORKDIR}/patches"
+
+       # We can no longer unbundle all of rake because rubygems now depends
+       # on this. We leave the actual rake code around to bootstrap
+       # rubygems, but remove the bits that would cause a file collision.
+       einfo "Unbundling gems..."
+       cd "$S"
+       rm -r \
+               {bin,lib}/rake lib/rake.rb man/rake.1 \
+               bin/gem || die "removal failed"
+
+       # 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
+}
+
+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"
+
+       # -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 readline ; then
+               modules="${modules},readline"
+       fi
+       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 ncurses ; then
+               modules="${modules},curses"
+       fi
+
+       INSTALL="${EPREFIX}/usr/bin/install -c" 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_enable socks5 socks) \
+               $(use_enable doc install-doc) \
+               --enable-ipv6 \
+               $(use_enable debug) \
+               ${myconf} \
+               --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="${D}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
+       RUBYLIB="${S}:${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}"
+       for d in $(find "${S}/ext" -type d) ; do
+               RUBYLIB="${RUBYLIB}:$d"
+       done
+       export LD_LIBRARY_PATH RUBYLIB
+
+       emake V=1 DESTDIR="${D}" install || die "make install failed"
+
+       # Remove installed rubygems copy
+       rm -r "${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}/rubygems" || die "rm rubygems failed"
+       rm -r "${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}"/rdoc* || die "rm rdoc failed"
+       rm -r "${D}/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 "${ROOT}"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(19|20|...)"
+       elog
+}
+
+pkg_postrm() {
+       eselect ruby cleanup
+}
diff --git a/dev-lang/ruby/ruby-2.2.2-r1.ebuild b/dev-lang/ruby/ruby-2.2.2-r1.ebuild
new file mode 100644 (file)
index 0000000..f3caabf
--- /dev/null
@@ -0,0 +1,238 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/ruby/ruby-2.2.2-r1.ebuild,v 1.1 2015/04/24 08:15:22 graaff Exp $
+
+EAPI=5
+
+#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=2.2.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/2.2/${MY_P}.tar.xz
+                http://dev.gentoo.org/~flameeyes/ruby-team/${PN}-patches-${PATCHSET}.tar.bz2"
+
+LICENSE="|| ( Ruby-BSD BSD-2 )"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
+IUSE="berkdb debug doc examples gdbm ipv6 jemalloc +rdoc rubytests socks5 ssl xemacs ncurses +readline"
+
+RDEPEND="
+       berkdb? ( sys-libs/db )
+       gdbm? ( sys-libs/gdbm )
+       jemalloc? ( dev-libs/jemalloc )
+       ssl? ( dev-libs/openssl )
+       socks5? ( >=net-proxy/dante-1.1.13 )
+       ncurses? ( sys-libs/ncurses )
+       readline?  ( sys-libs/readline )
+       dev-libs/libyaml
+       virtual/libffi
+       sys-libs/zlib
+       >=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="
+       ${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_FORCE="yes" EPATCH_SUFFIX="patch" \
+               epatch "${WORKDIR}/patches"
+
+       # We can no longer unbundle all of rake because rubygems now depends
+       # on this. We leave the actual rake code around to bootstrap
+       # rubygems, but remove the bits that would cause a file collision.
+       einfo "Unbundling gems..."
+       cd "$S"
+       rm -r \
+               {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):" \
+               configure.in || die "sed failed"
+
+       eautoreconf
+}
+
+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"
+
+       # -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 readline ; then
+               modules="${modules},readline"
+       fi
+       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 ncurses ; then
+               modules="${modules},curses"
+       fi
+
+       INSTALL="${EPREFIX}/usr/bin/install -c" 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_enable jemalloc jemalloc) \
+               $(use_enable socks5 socks) \
+               $(use_enable doc install-doc) \
+               --enable-ipv6 \
+               $(use_enable debug) \
+               ${myconf} \
+               --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="${D}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
+       RUBYLIB="${S}:${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}"
+       for d in $(find "${S}/ext" -type d) ; do
+               RUBYLIB="${RUBYLIB}:$d"
+       done
+       export LD_LIBRARY_PATH RUBYLIB
+
+       emake V=1 DESTDIR="${D}" install || die "make install failed"
+
+       # Remove installed rubygems copy
+       rm -r "${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}/rubygems" || die "rm rubygems failed"
+       rm -r "${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}"/rdoc* || die "rm rdoc failed"
+       rm -r "${D}/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 "${ROOT}"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(19|20|...)"
+       elog
+}
+
+pkg_postrm() {
+       eselect ruby cleanup
+}