1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 USE_RUBY="ruby19 ruby20 ruby21 ruby22"
9 RUBY_FAKEGEM_TASK_DOC="yard"
10 RUBY_FAKEGEM_DOCDIR="rdoc"
11 RUBY_FAKEGEM_EXTRADOC="docs/*.md README.md"
15 DESCRIPTION="EventMachine is a fast, simple event-processing library for Ruby programs"
16 HOMEPAGE="http://rubyeventmachine.com"
18 LICENSE="|| ( GPL-2 Ruby )"
20 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
28 ruby_add_bdepend "doc? ( dev-ruby/yard )
29 test? ( dev-ruby/test-unit:2 )"
32 # Remove package tasks to avoid dependency on rake-compiler.
33 rm rakelib/package.rake || die
35 # fix test issue - upstream b96b736b39261f7d74f013633cc7cd619afa20c4
36 sed -i -e 's/DEBUG/BROADCAST/g' tests/test_set_sock_opt.rb || die
37 sed -i -e "/omit_/d" tests/test_*.rb || die
38 # Remove the resolver tests since they require network access and
39 # the localhost test fails with an IPv6 localhost.
40 rm tests/test_resolver.rb || die
42 rm tests/test_kb.rb || die
43 # Avoid tests that require network access
44 sed -i -e '/test_bind_connect/,/^ end/ s:^:#:' \
45 tests/test_basic.rb || die
46 sed -i -e '/test_\(cookie\|http_client\|version_1_0\)/,/^ end/ s:^:#:' \
47 tests/test_httpclient.rb || die
48 sed -i -e '/test_\(get\|https_get\)/,/^ end/ s:^:#:' \
49 tests/test_httpclient2.rb || die
50 sed -i -e '/test_connect_timeout/,/^ end/ s:^:#:' \
51 tests/test_unbind_reason.rb || die
52 sed -i -e '/test_for_real/,/^ end/ s:^:#:' \
53 tests/test_pending_connect_timeout.rb || die
54 rm -f tests/test_{get_sock_opt,set_sock_opt,idle_connection}.rb || die
57 each_ruby_configure() {
58 for extdir in ext ext/fastfilereader; do
60 ${RUBY} extconf.rb || die "extconf.rb failed for ${extdir}"
66 for extdir in ext ext/fastfilereader; do
68 # both extensions use C++, so use the CXXFLAGS not the CFLAGS
69 emake V=1 CFLAGS="${CXXFLAGS} -fPIC" archflag="${LDFLAGS}" || die "emake failed for ${extdir}"
71 cp $extdir/*.so lib/ || die "Unable to copy extensions for ${extdir}"
76 ${RUBY} -Ilib -S testrb tests/test_*.rb || die
82 insinto /usr/share/doc/${PF}/
83 doins -r examples || die "Failed to install examples"