summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2012-02-25 13:12:59 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2012-02-25 13:12:59 +0000
commitc54d96dd795ececf5cd587a7e1c0aa74a67e26dd (patch)
tree22be9d2d46659a0ae924cbded1024a3d96548cad /dev-ruby/hpricot
parentVersion bump, drop old. (diff)
downloadgentoo-2-c54d96dd795ececf5cd587a7e1c0aa74a67e26dd.tar.gz
gentoo-2-c54d96dd795ececf5cd587a7e1c0aa74a67e26dd.tar.bz2
gentoo-2-c54d96dd795ececf5cd587a7e1c0aa74a67e26dd.zip
Fix install with JRuby; add missing dependency.
(Portage version: 2.2.0_alpha89/cvs/Linux x86_64)
Diffstat (limited to 'dev-ruby/hpricot')
-rw-r--r--dev-ruby/hpricot/ChangeLog7
-rw-r--r--dev-ruby/hpricot/hpricot-0.8.6-r1.ebuild71
2 files changed, 77 insertions, 1 deletions
diff --git a/dev-ruby/hpricot/ChangeLog b/dev-ruby/hpricot/ChangeLog
index ffe69ddaf9ec..ed590180af1d 100644
--- a/dev-ruby/hpricot/ChangeLog
+++ b/dev-ruby/hpricot/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for dev-ruby/hpricot
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-ruby/hpricot/ChangeLog,v 1.35 2012/01/25 01:21:18 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-ruby/hpricot/ChangeLog,v 1.36 2012/02/25 13:12:59 flameeyes Exp $
+
+*hpricot-0.8.6-r1 (25 Feb 2012)
+
+ 25 Feb 2012; Diego E. Pettenò <flameeyes@gentoo.org> +hpricot-0.8.6-r1.ebuild:
+ Fix install with JRuby; add missing dependency.
*hpricot-0.8.6 (25 Jan 2012)
diff --git a/dev-ruby/hpricot/hpricot-0.8.6-r1.ebuild b/dev-ruby/hpricot/hpricot-0.8.6-r1.ebuild
new file mode 100644
index 000000000000..ac5c0842d297
--- /dev/null
+++ b/dev-ruby/hpricot/hpricot-0.8.6-r1.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-ruby/hpricot/hpricot-0.8.6-r1.ebuild,v 1.1 2012/02/25 13:12:59 flameeyes Exp $
+
+EAPI=4
+
+USE_RUBY="ruby18 ree18 ruby19 jruby"
+
+RUBY_FAKEGEM_DOCDIR="doc"
+RUBY_FAKEGEM_EXTRADOC="CHANGELOG README.md"
+
+inherit ruby-fakegem eutils
+
+DESCRIPTION="A fast and liberal HTML parser for Ruby."
+HOMEPAGE="http://wiki.github.com/hpricot/hpricot"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x86-solaris"
+IUSE=""
+
+ruby_add_bdepend "dev-ruby/rake
+ dev-ruby/rake-compiler
+ test? ( virtual/ruby-test-unit )"
+
+# dev-ruby/fast_xs does not cover JRuby so still bundle it here for now
+USE_RUBY="${USE_RUBY/jruby/}" \
+ ruby_add_rdepend "dev-ruby/fast_xs"
+
+# Probably needs the same jdk as JRuby but I'm not sure how to express
+# that just yet.
+DEPEND+="
+ dev-util/ragel
+ ruby_targets_jruby? ( >=virtual/jdk-1.5 )"
+
+all_ruby_prepare() {
+ sed -i -e '/[Bb]undler/ s:^:#:' Rakefile || die
+
+ # Fix encoding assumption of environment for Ruby 1.9.
+ # https://github.com/hpricot/hpricot/issues/52
+ # sed -i -e '1 iEncoding.default_external=Encoding::UTF_8 if RUBY_VERSION =~ /1.9/' test/load_files.rb || die
+}
+
+each_ruby_prepare() {
+ # dev-ruby/fast_xs does not cover JRuby so still bundle it here for now
+ [[ ${RUBY} == */jruby ]] && return
+
+ pushd .. &>/dev/null
+ epatch "${FILESDIR}"/${P}-fast_xs.patch
+ popd .. &>/dev/null
+}
+
+each_ruby_configure() {
+ # dev-ruby/fast_xs does not cover JRuby so still bundle it here for now
+ [[ ${RUBY} == */jruby ]] && return
+
+ ${RUBY} -Cext/hpricot_scan extconf.rb || die "hpricot_scan/extconf.rb failed"
+}
+
+each_ruby_compile() {
+ local modname=$(get_modname)
+
+ # dev-ruby/fast_xs does not cover JRuby so still bundle it here for now
+ if [[ ${RUBY} == */jruby ]]; then
+ ${RUBY} -S rake compile_java || die "rake compile_java failed"
+ return
+ fi
+
+ emake -Cext/hpricot_scan CFLAGS="${CFLAGS} -fPIC" archflag="${LDFLAGS}" || die "make hpricot_scan failed"
+ cp ext/hpricot_scan/hpricot_scan${modname} lib/ || die
+}