/[gentoo-x86]/dev-ruby/hpricot/hpricot-0.8.6.ebuild
Gentoo

Contents of /dev-ruby/hpricot/hpricot-0.8.6.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sun Oct 28 18:14:58 2012 UTC (2 years ago) by armin76
Branch: MAIN
Changes since 1.1: +2 -2 lines
Add ~alpha/~ia64/~sparc wrt #405757

(Portage version: 2.1.11.9/cvs/Linux x86_64)

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/hpricot/hpricot-0.8.6.ebuild,v 1.1 2012/01/25 01:21:18 flameeyes Exp $
4
5 EAPI=2
6
7 USE_RUBY="ruby18 ree18 ruby19 jruby"
8
9 RUBY_FAKEGEM_DOCDIR="doc"
10 RUBY_FAKEGEM_EXTRADOC="CHANGELOG README.md"
11
12 inherit ruby-fakegem eutils
13
14 DESCRIPTION="A fast and liberal HTML parser for Ruby."
15 HOMEPAGE="http://wiki.github.com/hpricot/hpricot"
16
17 LICENSE="MIT"
18 SLOT="0"
19 KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x86-solaris"
20 IUSE=""
21
22 # Probably needs the same jdk as JRuby but I'm not sure how to express
23 # that just yet.
24 DEPEND="${DEPEND}
25 dev-util/ragel
26 ruby_targets_jruby? ( >=virtual/jdk-1.5 )"
27 RDEPEND="${RDEPEND}"
28
29 ruby_add_bdepend "dev-ruby/rake
30 dev-ruby/rake-compiler
31 test? ( virtual/ruby-test-unit )"
32
33 # dev-ruby/fast_xs does not cover JRuby so still bundle it here for now
34 RUBY_TARGETS="${RUBY_TARGETS/jruby/}" \
35 ruby_add_rdepend="dev-ruby/fast_xs"
36
37 all_ruby_prepare() {
38 sed -i -e '/[Bb]undler/ s:^:#:' Rakefile || die
39
40 # Fix encoding assumption of environment for Ruby 1.9.
41 # https://github.com/hpricot/hpricot/issues/52
42 # sed -i -e '1 iEncoding.default_external=Encoding::UTF_8 if RUBY_VERSION =~ /1.9/' test/load_files.rb || die
43 }
44
45 each_ruby_prepare() {
46 # dev-ruby/fast_xs does not cover JRuby so still bundle it here for now
47 [[ ${RUBY} == */jruby ]] && continue
48
49 pushd .. &>/dev/null
50 epatch "${FILESDIR}"/${P}-fast_xs.patch
51 popd .. &>/dev/null
52 }
53
54 each_ruby_configure() {
55 # dev-ruby/fast_xs does not cover JRuby so still bundle it here for now
56 if [[ ${RUBY} == */jruby ]]; then
57 ${RUBY} -Cext/fast_xs extconf.rb || die "fast_xs/extconf.rb failed"
58 fi
59
60 ${RUBY} -Cext/hpricot_scan extconf.rb || die "hpricot_scan/extconf.rb failed"
61 }
62
63 each_ruby_compile() {
64 local modname=$(get_modname)
65
66 # dev-ruby/fast_xs does not cover JRuby so still bundle it here for now
67 if [[ ${RUBY} == */jruby ]]; then
68 modname=".jar"
69 emake -Cext/fast_xs || die "make fast_xs failed"
70 cp ext/fast_xs/fast_xs.jar lib/ || die
71 fi
72
73 emake -Cext/hpricot_scan CFLAGS="${CFLAGS} -fPIC" archflag="${LDFLAGS}" || die "make hpricot_scan failed"
74 cp ext/hpricot_scan/hpricot_scan${modname} lib/ || die
75 }

  ViewVC Help
Powered by ViewVC 1.1.20