Gentoo Archives: gentoo-commits

From: Hans de Graaff <graaff@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-ruby/nokogiri/
Date: Sun, 07 Feb 2021 16:18:13
Message-Id: 1612714662.052039aee141a897715526370e3b4751622000f1.graaff@gentoo
1 commit: 052039aee141a897715526370e3b4751622000f1
2 Author: Hans de Graaff <graaff <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 7 16:17:02 2021 +0000
4 Commit: Hans de Graaff <graaff <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 7 16:17:42 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=052039ae
7
8 dev-ruby/nokogiri: fix extension install
9
10 Package-Manager: Portage-3.0.13, Repoman-3.0.2
11 Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org>
12
13 dev-ruby/nokogiri/nokogiri-1.11.1-r2.ebuild | 102 ++++++++++++++++++++++++++++
14 1 file changed, 102 insertions(+)
15
16 diff --git a/dev-ruby/nokogiri/nokogiri-1.11.1-r2.ebuild b/dev-ruby/nokogiri/nokogiri-1.11.1-r2.ebuild
17 new file mode 100644
18 index 00000000000..9b2e31dba78
19 --- /dev/null
20 +++ b/dev-ruby/nokogiri/nokogiri-1.11.1-r2.ebuild
21 @@ -0,0 +1,102 @@
22 +# Copyright 1999-2021 Gentoo Authors
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI=7
26 +
27 +USE_RUBY="ruby25 ruby26 ruby27"
28 +
29 +RUBY_FAKEGEM_EXTRADOC="CHANGELOG.md README.md ROADMAP.md STANDARD_RESPONSES.md"
30 +
31 +RUBY_FAKEGEM_EXTRAINSTALL="ext"
32 +
33 +RUBY_FAKEGEM_GEMSPEC="nokogiri.gemspec"
34 +
35 +RUBY_FAKEGEM_EXTENSIONS=(ext/nokogiri/extconf.rb)
36 +
37 +inherit ruby-fakegem multilib
38 +
39 +DESCRIPTION="Nokogiri is an HTML, XML, SAX, and Reader parser"
40 +HOMEPAGE="https://www.nokogiri.org/"
41 +LICENSE="MIT"
42 +SRC_URI="https://github.com/sparklemotion/nokogiri/archive/v${PV}.tar.gz -> ${P}-git.tgz"
43 +
44 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
45 +SLOT="0"
46 +IUSE=""
47 +
48 +RDEPEND="${RDEPEND}
49 + >=dev-libs/libxml2-2.9.10:=
50 + >=dev-libs/libxslt-1.1.34
51 + virtual/libiconv"
52 +DEPEND="${DEPEND}
53 + >=dev-libs/libxml2-2.9.10
54 + >=dev-libs/libxslt-1.1.34
55 + virtual/libiconv"
56 +
57 +ruby_add_rdepend ">=dev-ruby/racc-1.4:0"
58 +
59 +ruby_add_bdepend "
60 + >=dev-ruby/pkg-config-1.1.7
61 + >=dev-ruby/rexical-1.0.7
62 + dev-ruby/rdoc
63 + test? ( dev-ruby/minitest )"
64 +
65 +all_ruby_prepare() {
66 + sed -i \
67 + -e '/tasks\/cross_compile/s:^:#:' \
68 + -e '/:test.*prerequisites/s:^:#:' \
69 + -e '/license/ s:^:#:' \
70 + Rakefile || die
71 + # Remove the cross compilation options since they interfere with
72 + # native building.
73 + sed -i -e 's/cross_compile = true/cross_compile = false/' Rakefile || die
74 + sed -i -e '/cross_config_options/d' Rakefile || die
75 +
76 + sed -e '/simplecov/,/^end/ s:^:#:' \
77 + -e '/reporters/I s:^:#:' \
78 + -i test/helper.rb || die
79 +
80 + sed -i -e '/mini_portile2/ s:^:#:' ${RUBY_FAKEGEM_GEMSPEC} || die
81 +}
82 +
83 +each_ruby_configure() {
84 + NOKOGIRI_USE_SYSTEM_LIBRARIES=true \
85 + ${RUBY} -Cext/${PN} extconf.rb \
86 + --with-zlib-include="${EPREFIX}"/usr/include \
87 + --with-zlib-lib="${EPREFIX}"/$(get_libdir) \
88 + --with-iconv-include="${EPREFIX}"/usr/include \
89 + --with-iconv-lib="${EPREFIX}"/$(get_libdir) \
90 + --with-xml2-include="${EPREFIX}"/usr/include/libxml2 \
91 + --with-xml2-lib="${EPREFIX}"/usr/$(get_libdir) \
92 + --with-xslt-dir="${EPREFIX}"/usr \
93 + --with-iconvlib=iconv \
94 + || die "extconf.rb failed"
95 +}
96 +
97 +each_ruby_compile() {
98 + if ! [[ -f lib/nokogiri/css/tokenizer.rb ]]; then
99 + ${RUBY} -S rake lib/nokogiri/css/tokenizer.rb || die "rexical failed"
100 + fi
101 +
102 + if ! [[ -f lib/nokogiri/css/parser.rb ]]; then
103 + ${RUBY} -S rake lib/nokogiri/css/parser.rb || die "racc failed"
104 + fi
105 +
106 + emake -Cext/${PN} \
107 + V=1 \
108 + CFLAGS="${CFLAGS} -fPIC" \
109 + archflag="${LDFLAGS}" || die "make extension failed"
110 + cp -l ext/${PN}/${PN}$(get_modname) lib/${PN}/ || die
111 +}
112 +
113 +each_ruby_test() {
114 + ${RUBY} -Ilib:.:test -e 'Dir["test/**/test_*.rb"].each {|f| require f}' || die
115 +}
116 +
117 +each_ruby_install() {
118 + each_fakegem_install
119 +
120 + # Clean up "ext" directory before installing it. nokogumbo expects
121 + # the header files and shared object to be in ext.
122 + rm -rf ext/java ext/nokogiri/*.o ext/nokogiri/{mkmf.log,Makefile} || die
123 +}