| 1 |
# Copyright 1999-2013 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/dev-ruby/rdoc/rdoc-3.12.ebuild,v 1.14 2013/01/28 15:16:45 aballier Exp $
|
| 4 |
|
| 5 |
EAPI=3
|
| 6 |
USE_RUBY="ruby18 ree18 ruby19 jruby"
|
| 7 |
|
| 8 |
RUBY_FAKEGEM_TASK_DOC="docs"
|
| 9 |
|
| 10 |
RUBY_FAKEGEM_DOCDIR="doc"
|
| 11 |
RUBY_FAKEGEM_EXTRADOC="History.rdoc README.rdoc RI.rdoc TODO.rdoc"
|
| 12 |
|
| 13 |
RUBY_FAKEGEM_BINWRAP=""
|
| 14 |
|
| 15 |
inherit ruby-fakegem eutils
|
| 16 |
|
| 17 |
DESCRIPTION="An extended version of the RDoc library from Ruby 1.8"
|
| 18 |
HOMEPAGE="https://github.com/rdoc/rdoc/"
|
| 19 |
|
| 20 |
LICENSE="Ruby MIT"
|
| 21 |
SLOT="0"
|
| 22 |
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
|
| 23 |
IUSE=""
|
| 24 |
|
| 25 |
ruby_add_bdepend "
|
| 26 |
dev-ruby/racc
|
| 27 |
doc? ( >=dev-ruby/hoe-2.7.0 )
|
| 28 |
test? (
|
| 29 |
>=dev-ruby/hoe-2.7.0
|
| 30 |
dev-ruby/minitest
|
| 31 |
)"
|
| 32 |
|
| 33 |
ruby_add_rdepend "=dev-ruby/json-1* >=dev-ruby/json-1.4"
|
| 34 |
|
| 35 |
# This ebuild replaces rdoc in ruby-1.9.2 and later.
|
| 36 |
# ruby 1.8.6 is no longer supported.
|
| 37 |
RDEPEND="${RDEPEND}
|
| 38 |
ruby_targets_ruby19? (
|
| 39 |
>=dev-lang/ruby-1.9.2:1.9
|
| 40 |
)
|
| 41 |
ruby_targets_ruby18? (
|
| 42 |
>=dev-lang/ruby-1.8.7:1.8
|
| 43 |
)"
|
| 44 |
|
| 45 |
all_ruby_prepare() {
|
| 46 |
# Other packages also have use for a nonexistent directory, bug 321059
|
| 47 |
sed -i -e 's#/nonexistent#/nonexistent_rdoc_tests#g' test/test_rdoc*.rb || die
|
| 48 |
|
| 49 |
# Remove unavailable and unneeded isolate plugin for Hoe
|
| 50 |
sed -i -e '/isolate/d' Rakefile || die
|
| 51 |
|
| 52 |
epatch "${FILESDIR}/${PN}-3.0.1-bin-require.patch"
|
| 53 |
epatch "${FILESDIR}/${PN}-fix-hash-ordering-tests.patch"
|
| 54 |
|
| 55 |
# Remove test that is depending on the locale, which we can't garantuee.
|
| 56 |
sed -i -e '/def test_encode_with/,/^ end/ s:^:#:' test/test_rdoc_options.rb || die
|
| 57 |
|
| 58 |
# Remove test depending on FEATURES=userpriv, bug 361959
|
| 59 |
sed -i -e '/def test_check_files/,/^ end/ s:^:#:' test/test_rdoc_options.rb || die
|
| 60 |
|
| 61 |
# Avoid the generate rule since it doesn't work on jruby, see below.
|
| 62 |
sed -i -e '/:generate/d' Rakefile || die
|
| 63 |
}
|
| 64 |
|
| 65 |
each_ruby_compile() {
|
| 66 |
# Generate the file inline here since the Rakefile confuses jruby
|
| 67 |
# into a circular dependency.
|
| 68 |
for file in lib/rdoc/rd/block_parser lib/rdoc/rd/inline_parser ; do
|
| 69 |
${RUBY} -S racc -l -o ${file}.rb ${file}.ry || die
|
| 70 |
done
|
| 71 |
}
|
| 72 |
|
| 73 |
all_ruby_install() {
|
| 74 |
all_fakegem_install
|
| 75 |
|
| 76 |
for bin in rdoc ri; do
|
| 77 |
ruby_fakegem_binwrapper $bin /usr/bin/$bin-2
|
| 78 |
|
| 79 |
if use ruby_targets_ruby19; then
|
| 80 |
ruby_fakegem_binwrapper $bin /usr/bin/${bin}19
|
| 81 |
sed -i -e "1s/env ruby/ruby19/" \
|
| 82 |
"${ED}/usr/bin/${bin}19" || die
|
| 83 |
fi
|
| 84 |
done
|
| 85 |
}
|