summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Graaff <graaff@gentoo.org>2016-03-11 08:06:13 +0100
committerHans de Graaff <graaff@gentoo.org>2016-03-11 08:06:42 +0100
commit79aa89ff22755b5b4c9f43bdd3d0bcd3210e45b4 (patch)
tree5aaff0adef04d47406a76d548917c0df76aeb002 /dev-ruby/rack
parentdev-ruby/rack: drop ruby19 (diff)
downloadgentoo-79aa89ff22755b5b4c9f43bdd3d0bcd3210e45b4.tar.gz
gentoo-79aa89ff22755b5b4c9f43bdd3d0bcd3210e45b4.tar.bz2
gentoo-79aa89ff22755b5b4c9f43bdd3d0bcd3210e45b4.zip
dev-ruby/rack: add ruby23
Backport patch from upstream 2.0.0.alpha for compatibility with ruby23. Package-Manager: portage-2.2.26
Diffstat (limited to 'dev-ruby/rack')
-rw-r--r--dev-ruby/rack/files/rack-1.6-rewindable-ruby23.patch38
-rw-r--r--dev-ruby/rack/rack-1.6.4-r1.ebuild46
2 files changed, 84 insertions, 0 deletions
diff --git a/dev-ruby/rack/files/rack-1.6-rewindable-ruby23.patch b/dev-ruby/rack/files/rack-1.6-rewindable-ruby23.patch
new file mode 100644
index 000000000000..9d36a7328e2c
--- /dev/null
+++ b/dev-ruby/rack/files/rack-1.6-rewindable-ruby23.patch
@@ -0,0 +1,38 @@
+From 11b5a15dd1c8a41d87eb73df7bb99a3affecd787 Mon Sep 17 00:00:00 2001
+From: deepj <deepjungle.maca@gmail.com>
+Date: Mon, 25 May 2015 22:41:31 +0200
+Subject: [PATCH] Clean up Rack::Rewindable
+
+---
+ lib/rack/rewindable_input.rb | 11 -----------
+ 1 file changed, 11 deletions(-)
+
+diff --git a/lib/rack/rewindable_input.rb b/lib/rack/rewindable_input.rb
+index 64efdda..dd6b784 100644
+--- a/lib/rack/rewindable_input.rb
++++ b/lib/rack/rewindable_input.rb
+@@ -57,15 +57,6 @@ def close
+
+ private
+
+- # Ruby's Tempfile class has a bug. Subclass it and fix it.
+- class Tempfile < ::Tempfile
+- def _close
+- @tmpfile.close if @tmpfile
+- @data[1] = nil if @data
+- @tmpfile = nil
+- end
+- end
+-
+ def make_rewindable
+ # Buffer all data into a tempfile. Since this tempfile is private to this
+ # RewindableInput object, we chmod it so that nobody else can read or write
+@@ -77,8 +68,6 @@ def make_rewindable
+ @rewindable_io.set_encoding(Encoding::BINARY) if @rewindable_io.respond_to?(:set_encoding)
+ @rewindable_io.binmode
+ if filesystem_has_posix_semantics?
+- # Use ::File.unlink as 1.9.1 Tempfile has a bug where unlink closes the file!
+- ::File.unlink @rewindable_io.path
+ raise 'Unlink failed. IO closed.' if @rewindable_io.closed?
+ @unlinked = true
+ end
diff --git a/dev-ruby/rack/rack-1.6.4-r1.ebuild b/dev-ruby/rack/rack-1.6.4-r1.ebuild
new file mode 100644
index 000000000000..ebfd70949207
--- /dev/null
+++ b/dev-ruby/rack/rack-1.6.4-r1.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+USE_RUBY="ruby20 ruby21 ruby22 ruby23"
+
+RUBY_FAKEGEM_DOCDIR="doc"
+RUBY_FAKEGEM_EXTRADOC="HISTORY.md KNOWN-ISSUES README.rdoc SPEC"
+
+inherit ruby-fakegem eutils versionator
+
+DESCRIPTION="A modular Ruby webserver interface"
+HOMEPAGE="https://rack.github.com/"
+
+LICENSE="MIT"
+SLOT="$(get_version_component_range 1-2)"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
+
+RUBY_PATCHES=( ${PN}-1.2.1-gentoo.patch ${PN}-1.6-rewindable-ruby23.patch )
+
+ruby_add_rdepend "virtual/ruby-ssl"
+
+# The gem has automagic dependencies over mongrel, ruby-openid,
+# memcache-client, thin, mongrel and camping; not sure if we should
+# make them dependencies at all.
+ruby_add_bdepend "test? ( dev-ruby/bacon )"
+
+# Block against versions in older slots that also try to install a binary.
+RDEPEND="${RDEPEND} !<dev-ruby/rack-1.4.5-r1:1.4 !<dev-ruby/rack-1.5.2-r4:1.5"
+
+all_ruby_prepare() {
+ # The build system tries to generate the ChangeLog from git. Create
+ # an empty file to avoid a needless dependency on git.
+ touch ChangeLog || die
+}
+
+each_ruby_test() {
+ # Since the Rakefile calls specrb directly rather than loading it, we
+ # cannot use it to launch the tests or only the currently-selected
+ # RUBY interpreter will be tested.
+ ${RUBY} -S bacon -Ilib -w -a \
+ -q -t '^(?!Rack::Handler|Rack::Adapter|Rack::Session::Memcache|Rack::Server)' \
+ || die "test failed for ${RUBY}"
+}