diff options
Diffstat (limited to 'dev-ruby/nokogiri')
-rw-r--r-- | dev-ruby/nokogiri/Manifest | 1 | ||||
-rw-r--r-- | dev-ruby/nokogiri/nokogiri-1.11.7.ebuild | 107 |
2 files changed, 108 insertions, 0 deletions
diff --git a/dev-ruby/nokogiri/Manifest b/dev-ruby/nokogiri/Manifest index dd2efb5eeee3..9ec8e80892a0 100644 --- a/dev-ruby/nokogiri/Manifest +++ b/dev-ruby/nokogiri/Manifest @@ -1,2 +1,3 @@ DIST nokogiri-1.11.4-git.tgz 5867481 BLAKE2B d9b0df4d6301a510824f8f31bd51e0f3beaf3cf7d3685a703782ae5fab0667b6276c0ccea20032252efc6c2dd6515577fcb21942f5d27a65815bc48f8af91137 SHA512 ca4bf385b06416f5a5b7f8fd742739181cccf93b42590c7d2d4f666846fd3a25d45c16717ae50bacd85e25644efe8584e195df7174450b8a59f2c6ef47624354 DIST nokogiri-1.11.6-git.tgz 5869434 BLAKE2B 222b6b9e871c124a14ac5d9ac3901d9edfa057daaba7e1179853746af50d661bd70568b326603663f890b4b0d80fbb68f8cc22637ca340fa49699f475cce1bec SHA512 a9d2977ba5a12cb252ee615cffbbf043227e78d746ecba4bfcd82fa825f5ef9fdb74feae27115b16cd65da6dd189e4ac88f1d605e776dfbc52aaf2e0e3044381 +DIST nokogiri-1.11.7-git.tgz 5871407 BLAKE2B c0449b5cb8210d22be31f1f9a43c0c13c7ab21feae2d731bf30475fc21c69a3928395109936b9ff242a89da424a5192c8a8cb0ede9d05d6d9ac16c1d6e5a7f63 SHA512 f355185f490e0ce73fdfb496f49e36b39c89835ebef2cbe3aecbfc5aceb5a9757dc07738a709059c3e22b5808fac11e7b340b7ebbb3b2c1b5ea3df8aff0db131 diff --git a/dev-ruby/nokogiri/nokogiri-1.11.7.ebuild b/dev-ruby/nokogiri/nokogiri-1.11.7.ebuild new file mode 100644 index 000000000000..0a05340414ac --- /dev/null +++ b/dev-ruby/nokogiri/nokogiri-1.11.7.ebuild @@ -0,0 +1,107 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +USE_RUBY="ruby25 ruby26 ruby27 ruby30" + +RUBY_FAKEGEM_EXTRADOC="CHANGELOG.md README.md ROADMAP.md SECURITY.md" + +RUBY_FAKEGEM_EXTRAINSTALL="ext" + +RUBY_FAKEGEM_GEMSPEC="nokogiri.gemspec" + +RUBY_FAKEGEM_EXTENSIONS=(ext/nokogiri/extconf.rb) + +inherit ruby-fakegem multilib + +DESCRIPTION="Nokogiri is an HTML, XML, SAX, and Reader parser" +HOMEPAGE="https://www.nokogiri.org/" +LICENSE="MIT" +SRC_URI="https://github.com/sparklemotion/nokogiri/archive/v${PV}.tar.gz -> ${P}-git.tgz" + +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" +SLOT="0" +IUSE="" + +RDEPEND="${RDEPEND} + >=dev-libs/libxml2-2.9.12:= + >=dev-libs/libxslt-1.1.34 + sys-libs/zlib + virtual/libiconv" +DEPEND="${DEPEND} + >=dev-libs/libxml2-2.9.12 + >=dev-libs/libxslt-1.1.34 + sys-libs/zlib + virtual/libiconv" + +ruby_add_rdepend ">=dev-ruby/racc-1.4:0" + +ruby_add_bdepend " + >=dev-ruby/pkg-config-1.1.7 + >=dev-ruby/rexical-1.0.7 + dev-ruby/rdoc + test? ( dev-ruby/minitest )" + +all_ruby_prepare() { + sed -i \ + -e '/tasks\/cross_compile/s:^:#:' \ + -e '/:test.*prerequisites/s:^:#:' \ + -e '/license/ s:^:#:' \ + Rakefile || die + # Remove the cross compilation options since they interfere with + # native building. + sed -i -e 's/cross_compile = true/cross_compile = false/' Rakefile || die + sed -i -e '/cross_config_options/d' Rakefile || die + + sed -e '/simplecov/,/^end/ s:^:#:' \ + -e '/reporters/I s:^:#:' \ + -i test/helper.rb || die + + sed -i -e '/mini_portile2/ s:^:#:' ${RUBY_FAKEGEM_GEMSPEC} || die + + # Account for fix making it upstream into our libxml2 system version + sed -i -e '116 s/using_packaged/using_system/ ; 131 s/if/if false and /' test/html/test_comments.rb || die +} + +each_ruby_configure() { + NOKOGIRI_USE_SYSTEM_LIBRARIES=true \ + ${RUBY} -Cext/${PN} extconf.rb \ + --with-zlib-include="${EPREFIX}"/usr/include \ + --with-zlib-lib="${EPREFIX}"/$(get_libdir) \ + --with-iconv-include="${EPREFIX}"/usr/include \ + --with-iconv-lib="${EPREFIX}"/$(get_libdir) \ + --with-xml2-include="${EPREFIX}"/usr/include/libxml2 \ + --with-xml2-lib="${EPREFIX}"/usr/$(get_libdir) \ + --with-xslt-dir="${EPREFIX}"/usr \ + --with-iconvlib=iconv \ + || die "extconf.rb failed" +} + +each_ruby_compile() { + if ! [[ -f lib/nokogiri/css/tokenizer.rb ]]; then + ${RUBY} -S rake lib/nokogiri/css/tokenizer.rb || die "rexical failed" + fi + + if ! [[ -f lib/nokogiri/css/parser.rb ]]; then + ${RUBY} -S rake lib/nokogiri/css/parser.rb || die "racc failed" + fi + + emake -Cext/${PN} \ + V=1 \ + CFLAGS="${CFLAGS} -fPIC" \ + archflag="${LDFLAGS}" || die "make extension failed" + cp -l ext/${PN}/${PN}$(get_modname) lib/${PN}/ || die +} + +each_ruby_test() { + ${RUBY} -Ilib:.:test -e 'Dir["test/**/test_*.rb"].each {|f| require f}' || die +} + +each_ruby_install() { + each_fakegem_install + + # Clean up "ext" directory before installing it. nokogumbo expects + # the header files and shared object to be in ext. + rm -rf ext/java ext/nokogiri/*.o ext/nokogiri/{mkmf.log,Makefile} || die +} |