1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
7 RUBY_FAKEGEM_TASK_DOC=""
8 RUBY_FAKEGEM_DOCDIR="doc"
9 RUBY_FAKEGEM_EXTRADOC="History.rdoc README.rdoc RI.rdoc TODO.rdoc"
11 RUBY_FAKEGEM_BINWRAP=""
12 RUBY_FAKEGEM_BINDIR="exe"
14 inherit ruby-fakegem eutils
16 DESCRIPTION="An extended version of the RDoc library from Ruby 1.8"
17 HOMEPAGE="https://github.com/rdoc/rdoc/"
18 SRC_URI="https://github.com/rdoc/rdoc/archive/v${PV}.tar.gz -> ${P}.tar.gz"
21 KEYWORDS="~alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 sparc x86 ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
25 RDEPEND+=">=app-eselect/eselect-ruby-20161226"
27 RUBY_PATCHES=( "${FILESDIR}/${P}-jquery.patch" )
34 >=dev-ruby/minitest-5.8:5
37 ruby_add_rdepend "dev-ruby/json:2"
40 # Other packages also have use for a nonexistent directory, bug 321059
41 sed -i -e 's#/nonexistent#/nonexistent_rdoc_tests#g' test/test_rdoc*.rb || die
43 # Avoid unneeded dependency on bundler, bug 603696
44 sed -i -e '/bundler/ s:^:#:' \
45 -e 's/Bundler::GemHelper.gemspec.full_name/"rdoc"/' Rakefile || die
47 # Remove test that is depending on the locale, which we can't garantuee.
48 sed -i -e '/def test_encode_with/,/^ end/ s:^:#:' test/test_rdoc_options.rb || die
50 # Remove test depending on FEATURES=userpriv, bug 361959
51 sed -i -e '/def test_check_files/,/^ end/ s:^:#:' test/test_rdoc_options.rb || die
53 # Remove tests for code that is not included and not listed in Manifest.txt
54 rm -f test/test_rdoc_i18n_{locale,text}.rb \
55 test/test_rdoc_generator_pot* || die
57 # Removal is not included in the upstream patch
58 rm -f lib/rdoc/generator/template/darkfish/js/jquery.js || die
65 ruby -Ilib -S exe/rdoc || die
70 ${RUBY} -S rake generate || die
74 ${RUBY} -Ilib:. -e 'gem "json", "~>2.0"; Dir["test/test_*.rb"].each{|f| require f}' || die
80 for bin in rdoc ri; do
81 ruby_fakegem_binwrapper $bin /usr/bin/$bin-2
83 for version in $(ruby_get_use_implementations); do
84 version=`echo ${version} | cut -c 5-`
85 if use ruby_targets_ruby${version}; then
86 ruby_fakegem_binwrapper $bin /usr/bin/${bin}${version}
87 sed -i -e "1s/env ruby/ruby${version}/" \
88 "${ED}/usr/bin/${bin}${version}" || die
95 if [[ ! -n $(readlink "${ROOT}"usr/bin/rdoc) ]] ; then
96 eselect ruby set $(eselect --brief --colour=no ruby show | head -n1)