1 |
commit: 75430c8e80559509f1e08aacb36aa2dc3ba5746e |
2 |
Author: Hans de Graaff <graaff <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Apr 29 16:57:01 2019 +0000 |
4 |
Commit: Hans de Graaff <graaff <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Apr 29 16:57:41 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75430c8e |
7 |
|
8 |
dev-ruby/childprocess: fix ruby26 compatibility |
9 |
|
10 |
https://github.com/enkessler/childprocess/pull/149 |
11 |
|
12 |
Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org> |
13 |
Package-Manager: Portage-2.3.62, Repoman-2.3.11 |
14 |
|
15 |
dev-ruby/childprocess/childprocess-1.0.1-r1.ebuild | 43 ++++++++++++++++++++++ |
16 |
.../files/childprocess-1.0.1-ruby26-reopen.patch | 23 ++++++++++++ |
17 |
2 files changed, 66 insertions(+) |
18 |
|
19 |
diff --git a/dev-ruby/childprocess/childprocess-1.0.1-r1.ebuild b/dev-ruby/childprocess/childprocess-1.0.1-r1.ebuild |
20 |
new file mode 100644 |
21 |
index 00000000000..31146115840 |
22 |
--- /dev/null |
23 |
+++ b/dev-ruby/childprocess/childprocess-1.0.1-r1.ebuild |
24 |
@@ -0,0 +1,43 @@ |
25 |
+# Copyright 1999-2019 Gentoo Authors |
26 |
+# Distributed under the terms of the GNU General Public License v2 |
27 |
+ |
28 |
+EAPI=6 |
29 |
+ |
30 |
+USE_RUBY="ruby24 ruby25 ruby26" |
31 |
+ |
32 |
+RUBY_FAKEGEM_RECIPE_TEST="rspec3" |
33 |
+ |
34 |
+RUBY_FAKEGEM_RECIPE_DOC="rdoc" |
35 |
+RUBY_FAKEGEM_EXTRADOC="README.md" |
36 |
+ |
37 |
+RUBY_FAKEGEM_GEMSPEC="${PN}.gemspec" |
38 |
+ |
39 |
+inherit ruby-fakegem |
40 |
+ |
41 |
+DESCRIPTION="Solution for controlling external programs running in the background" |
42 |
+HOMEPAGE="https://github.com/jarib/childprocess" |
43 |
+ |
44 |
+LICENSE="MIT" |
45 |
+SLOT="2" |
46 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86" |
47 |
+IUSE="" |
48 |
+ |
49 |
+ruby_add_rdepend ">=dev-ruby/ffi-1.0.11" |
50 |
+ |
51 |
+all_ruby_prepare() { |
52 |
+ eapply "${FILESDIR}/${P}-ruby26-reopen.patch" |
53 |
+ |
54 |
+ # Remove bundler support |
55 |
+ rm Gemfile || die |
56 |
+ sed -i -e "/[Bb]undler/d" Rakefile || die |
57 |
+ sed -i -e "/[Cc]overalls/d" spec/spec_helper.rb || die |
58 |
+ sed -i -e 's/git ls-files/find/' ${RUBY_FAKEGEM_GEMSPEC} || die |
59 |
+} |
60 |
+ |
61 |
+each_ruby_prepare() { |
62 |
+ sed -i -e "s:'ruby':'"${RUBY}"':" spec/childprocess_spec.rb || die |
63 |
+} |
64 |
+ |
65 |
+each_ruby_test() { |
66 |
+ RUBYLIB=lib RSPEC_VERSION=3 ruby-ng_rspec |
67 |
+} |
68 |
|
69 |
diff --git a/dev-ruby/childprocess/files/childprocess-1.0.1-ruby26-reopen.patch b/dev-ruby/childprocess/files/childprocess-1.0.1-ruby26-reopen.patch |
70 |
new file mode 100644 |
71 |
index 00000000000..11f94421829 |
72 |
--- /dev/null |
73 |
+++ b/dev-ruby/childprocess/files/childprocess-1.0.1-ruby26-reopen.patch |
74 |
@@ -0,0 +1,23 @@ |
75 |
+diff --git a/lib/childprocess/unix/fork_exec_process.rb b/lib/childprocess/unix/fork_exec_process.rb |
76 |
+index 5ed2a79..cc7a850 100644 |
77 |
+--- a/lib/childprocess/unix/fork_exec_process.rb |
78 |
++++ b/lib/childprocess/unix/fork_exec_process.rb |
79 |
+@@ -29,8 +29,16 @@ module ChildProcess |
80 |
+ exec_r.close |
81 |
+ set_env |
82 |
+ |
83 |
+- STDOUT.reopen(stdout || "/dev/null") |
84 |
+- STDERR.reopen(stderr || "/dev/null") |
85 |
++ if stdout |
86 |
++ STDOUT.reopen(stdout) |
87 |
++ else |
88 |
++ STDOUT.reopen("/dev/null", "a+") |
89 |
++ end |
90 |
++ if stderr |
91 |
++ STDERR.reopen(stderr) |
92 |
++ else |
93 |
++ STDERR.reopen("/dev/null", "a+") |
94 |
++ end |
95 |
+ |
96 |
+ if duplex? |
97 |
+ STDIN.reopen(reader) |