Gentoo Archives: gentoo-commits

From: Hans de Graaff <graaff@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-ruby/rdoc/
Date: Thu, 29 Dec 2016 06:51:01
Message-Id: 1482994212.f71a28c52eb2c051bc0f694515888807e47139a3.graaff@gentoo
1 commit: f71a28c52eb2c051bc0f694515888807e47139a3
2 Author: Hans de Graaff <graaff <AT> gentoo <DOT> org>
3 AuthorDate: Thu Dec 29 06:50:12 2016 +0000
4 Commit: Hans de Graaff <graaff <AT> gentoo <DOT> org>
5 CommitDate: Thu Dec 29 06:50:12 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f71a28c5
7
8 dev-ruby/rdoc: fix binwrappers, bug 603922
9
10 Properly install the binwrappers by correctly setting
11 RUBY_FAKEGEM_BINDIR.
12
13 Also add a missing dependency on eselect-ruby to make
14 sure the version can handle all the ruby targets.
15
16 Package-Manager: portage-2.3.0
17
18 dev-ruby/rdoc/rdoc-5.0.0-r2.ebuild | 91 ++++++++++++++++++++++++++++++++++++++
19 1 file changed, 91 insertions(+)
20
21 diff --git a/dev-ruby/rdoc/rdoc-5.0.0-r2.ebuild b/dev-ruby/rdoc/rdoc-5.0.0-r2.ebuild
22 new file mode 100644
23 index 00000000..951905c
24 --- /dev/null
25 +++ b/dev-ruby/rdoc/rdoc-5.0.0-r2.ebuild
26 @@ -0,0 +1,91 @@
27 +# Copyright 1999-2016 Gentoo Foundation
28 +# Distributed under the terms of the GNU General Public License v2
29 +# $Id$
30 +
31 +EAPI=5
32 +USE_RUBY="ruby20 ruby21 ruby22 ruby23 ruby24"
33 +
34 +RUBY_FAKEGEM_TASK_DOC=""
35 +RUBY_FAKEGEM_DOCDIR="doc"
36 +RUBY_FAKEGEM_EXTRADOC="History.rdoc README.rdoc RI.rdoc TODO.rdoc"
37 +
38 +RUBY_FAKEGEM_BINDIR="exe"
39 +
40 +inherit ruby-fakegem eutils
41 +
42 +DESCRIPTION="An extended version of the RDoc library from Ruby 1.8"
43 +HOMEPAGE="https://github.com/rdoc/rdoc/"
44 +SRC_URI="https://github.com/rdoc/rdoc/archive/v${PV}.tar.gz -> ${P}.tar.gz"
45 +
46 +LICENSE="Ruby MIT"
47 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
48 +SLOT="0"
49 +IUSE=""
50 +
51 +RDEPEND+=">=app-eselect/eselect-ruby-20161226"
52 +
53 +ruby_add_bdepend "
54 + dev-ruby/kpeg
55 + dev-ruby/racc
56 + test? (
57 + >=dev-ruby/minitest-5.8:5
58 + )"
59 +
60 +ruby_add_rdepend "dev-ruby/json:2"
61 +
62 +all_ruby_prepare() {
63 + # Other packages also have use for a nonexistent directory, bug 321059
64 + sed -i -e 's#/nonexistent#/nonexistent_rdoc_tests#g' test/test_rdoc*.rb || die
65 +
66 + # Avoid unneeded dependency on bundler, bug 603696
67 + sed -i -e '/bundler/ s:^:#:' \
68 + -e 's/Bundler::GemHelper.gemspec.full_name/"rdoc"/' Rakefile || die
69 +
70 + # Remove test that is depending on the locale, which we can't garantuee.
71 + sed -i -e '/def test_encode_with/,/^ end/ s:^:#:' test/test_rdoc_options.rb || die
72 +
73 + # Remove test depending on FEATURES=userpriv, bug 361959
74 + sed -i -e '/def test_check_files/,/^ end/ s:^:#:' test/test_rdoc_options.rb || die
75 +
76 + # Remove tests for code that is not included and not listed in Manifest.txt
77 + rm -f test/test_rdoc_i18n_{locale,text}.rb \
78 + test/test_rdoc_generator_pot* || die
79 +}
80 +
81 +all_ruby_compile() {
82 + all_fakegem_compile
83 +
84 + if use doc ; then
85 + ruby -Ilib -S exe/rdoc || die
86 + fi
87 +}
88 +
89 +each_ruby_compile() {
90 + ${RUBY} -S rake generate || die
91 +}
92 +
93 +each_ruby_test() {
94 + ${RUBY} -Ilib:. -e 'gem "json", "~>2.0"; Dir["test/test_*.rb"].each{|f| require f}' || die
95 +}
96 +
97 +all_ruby_install() {
98 + all_fakegem_install
99 +
100 + for bin in rdoc ri; do
101 + ruby_fakegem_binwrapper $bin /usr/bin/$bin-2
102 +
103 + for version in 20 21 22 23; do
104 + if use ruby_targets_ruby${version}; then
105 + ruby_fakegem_binwrapper $bin /usr/bin/${bin}${version}
106 + sed -i -e "1s/env ruby/ruby${version}/" \
107 + "${ED}/usr/bin/${bin}${version}" || die
108 + fi
109 + done
110 + done
111 +}
112 +
113 +pkg_postinst() {
114 + if [[ ! -n $(readlink "${ROOT}"usr/bin/rdoc) ]] ; then
115 + eselect ruby set $(eselect --brief --colour=no ruby show | head -n1)
116 + fi
117 +}