| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/dev-ruby/nokogiri/nokogiri-1.5.0-r2.ebuild,v 1.4 2012/03/02 09:51:03 naota Exp $
|
| 4 |
|
| 5 |
EAPI=4
|
| 6 |
|
| 7 |
USE_RUBY="ruby18 ruby19 ree18 jruby"
|
| 8 |
|
| 9 |
RUBY_FAKEGEM_TASK_DOC="docs"
|
| 10 |
RUBY_FAKEGEM_DOCDIR="doc"
|
| 11 |
RUBY_FAKEGEM_EXTRADOC="CHANGELOG.rdoc CHANGELOG.ja.rdoc README.rdoc README.ja.rdoc"
|
| 12 |
|
| 13 |
inherit ruby-fakegem eutils multilib
|
| 14 |
|
| 15 |
DESCRIPTION="Nokogiri is an HTML, XML, SAX, and Reader parser."
|
| 16 |
HOMEPAGE="http://nokogiri.rubyforge.org/"
|
| 17 |
LICENSE="MIT"
|
| 18 |
SRC_URI="https://github.com/tenderlove/nokogiri/tarball/v${PV} -> ${P}.tgz"
|
| 19 |
RUBY_S="tenderlove-nokogiri-*"
|
| 20 |
|
| 21 |
KEYWORDS="~amd64 ~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"
|
| 22 |
SLOT="0"
|
| 23 |
IUSE=""
|
| 24 |
|
| 25 |
RDEPEND="${RDEPEND}
|
| 26 |
dev-libs/libxml2
|
| 27 |
dev-libs/libxslt"
|
| 28 |
DEPEND="${DEPEND}
|
| 29 |
dev-libs/libxml2
|
| 30 |
dev-libs/libxslt"
|
| 31 |
|
| 32 |
# The tests require _minitest_, not the virtual; what is shipped with
|
| 33 |
# Ruby 1.9 is *not* enough, unfortunately
|
| 34 |
ruby_add_bdepend "
|
| 35 |
dev-ruby/rake-compiler
|
| 36 |
dev-ruby/rexical
|
| 37 |
dev-ruby/hoe
|
| 38 |
dev-ruby/rdoc
|
| 39 |
dev-ruby/racc
|
| 40 |
test? ( dev-ruby/minitest )"
|
| 41 |
|
| 42 |
all_ruby_prepare() {
|
| 43 |
sed -i \
|
| 44 |
-e '/tasks\/cross_compile/s:^:#:' \
|
| 45 |
-e '/:test.*prerequisites/s:^:#:' \
|
| 46 |
Rakefile || die
|
| 47 |
# Remove the cross compilation options since they interfere with
|
| 48 |
# native building.
|
| 49 |
sed -i -e 's/cross_compile = true/cross_compile = false/' Rakefile || die
|
| 50 |
sed -i -e '/cross_config_options/d' Rakefile || die
|
| 51 |
}
|
| 52 |
|
| 53 |
each_ruby_prepare() {
|
| 54 |
# These test exclusions should be limited to the specific tests, but
|
| 55 |
# we are overdue with re-adding jruby so we use the big hammer for now.
|
| 56 |
case ${RUBY} in
|
| 57 |
*ruby19)
|
| 58 |
# Remove test file with failing tests related to encodings.
|
| 59 |
rm test/xml/test_node_encoding.rb || die
|
| 60 |
;;
|
| 61 |
*jruby)
|
| 62 |
# Remove test files with broken tests,
|
| 63 |
# https://github.com/tenderlove/nokogiri/issues/496
|
| 64 |
rm test/html/sax/test_parser.rb test/html/test_document_encoding.rb test/xml/sax/test_push_parser.rb test/xslt/test_exception_handling.rb || die
|
| 65 |
;;
|
| 66 |
*)
|
| 67 |
;;
|
| 68 |
esac
|
| 69 |
}
|
| 70 |
|
| 71 |
each_ruby_configure() {
|
| 72 |
case ${RUBY} in
|
| 73 |
*jruby)
|
| 74 |
;;
|
| 75 |
*)
|
| 76 |
${RUBY} -Cext/${PN} extconf.rb \
|
| 77 |
--with-zlib-include="${EPREFIX}"/usr/include \
|
| 78 |
--with-zlib-lib="${EPREFIX}"/$(get_libdir) \
|
| 79 |
--with-iconv-include="${EPREFIX}"/usr/include \
|
| 80 |
--with-iconv-lib="${EPREFIX}"/$(get_libdir) \
|
| 81 |
--with-xml2-include="${EPREFIX}"/usr/include/libxml2 \
|
| 82 |
--with-xml2-lib="${EPREFIX}"/usr/$(get_libdir) \
|
| 83 |
--with-xslt-dir="${EPREFIX}"/usr \
|
| 84 |
--with-iconvlib=iconv \
|
| 85 |
|| die "extconf.rb failed"
|
| 86 |
;;
|
| 87 |
esac
|
| 88 |
}
|
| 89 |
|
| 90 |
each_ruby_compile() {
|
| 91 |
case ${RUBY} in
|
| 92 |
*jruby)
|
| 93 |
${RUBY} -S rake compile || die
|
| 94 |
;;
|
| 95 |
*)
|
| 96 |
if ! [[ -f lib/nokogiri/css/tokenizer.rb ]]; then
|
| 97 |
${RUBY} -S rake lib/nokogiri/css/tokenizer.rb || die "rexical failed"
|
| 98 |
fi
|
| 99 |
|
| 100 |
if ! [[ -f lib/nokogiri/css/parser.rb ]]; then
|
| 101 |
${RUBY} -S rake lib/nokogiri/css/parser.rb || die "racc failed"
|
| 102 |
fi
|
| 103 |
|
| 104 |
emake -Cext/${PN} \
|
| 105 |
CFLAGS="${CFLAGS} -fPIC" \
|
| 106 |
archflag="${LDFLAGS}" || die "make extension failed"
|
| 107 |
cp -l ext/${PN}/${PN}$(get_modname) lib/${PN}/ || die
|
| 108 |
;;
|
| 109 |
esac
|
| 110 |
}
|