diff options
Diffstat (limited to 'repo/ruby-nokogiri')
-rw-r--r-- | repo/ruby-nokogiri/gemspec-fix-deps.patch | 15 | ||||
-rw-r--r-- | repo/ruby-nokogiri/ruby-nokogiri.xibuild | 62 | ||||
-rw-r--r-- | repo/ruby-nokogiri/shutdown-libxml2-warning.patch | 12 | ||||
-rw-r--r-- | repo/ruby-nokogiri/test-helper-remove-unnecessary-deps.patch | 22 |
4 files changed, 111 insertions, 0 deletions
diff --git a/repo/ruby-nokogiri/gemspec-fix-deps.patch b/repo/ruby-nokogiri/gemspec-fix-deps.patch new file mode 100644 index 0000000..9136e6e --- /dev/null +++ b/repo/ruby-nokogiri/gemspec-fix-deps.patch @@ -0,0 +1,15 @@ +racc and mini_portile2 are needed only to build native extension. + +--- a/nokogiri.gemspec ++++ b/nokogiri.gemspec +@@ -318,8 +318,8 @@ + spec.extra_rdoc_files += Dir.glob("README.md") + spec.rdoc_options = ["--main", "README.md"] + +- spec.add_runtime_dependency("mini_portile2", "~> 2.8.0") unless java_p # keep version in sync with extconf.rb +- spec.add_runtime_dependency("racc", "~> 1.4") ++ spec.add_development_dependency("mini_portile2", "~> 2.8.0") unless java_p # keep version in sync with extconf.rb ++ spec.add_development_dependency("racc", "~> 1.4") + + spec.add_development_dependency("bundler", "~> 2.2") + spec.add_development_dependency("hoe-markdown", "~> 1.4") diff --git a/repo/ruby-nokogiri/ruby-nokogiri.xibuild b/repo/ruby-nokogiri/ruby-nokogiri.xibuild new file mode 100644 index 0000000..dec12d1 --- /dev/null +++ b/repo/ruby-nokogiri/ruby-nokogiri.xibuild @@ -0,0 +1,62 @@ +#!/bin/sh + +NAME="ruby-nokogiri" +DESC="An HTML, XML, SAX, and Reader parser" + +MAKEDEPS="libxml2 libxslt ruby ruby-mini_portile2" + +_gemname=${pkgname#ruby-} + +PKG_VER=1.13.4 +SOURCE="https://github.com/sparklemotion/$_gemname/archive/v$PKG_VER/$_gemname-$PKG_VER.tar.gz" + +ADDITIONAL=" +gemspec-fix-deps.patch +shutdown-libxml2-warning.patch +test-helper-remove-unnecessary-deps.patch +" + +build() { + gem build $_gemname.gemspec + gem install \ + --local \ + --install-dir dist \ + --ignore-dependencies \ + --no-document \ + --verbose \ + $_gemname-$PKG_VER.gem -- \ + --use-system-libraries + + # Remove unnecessary files and rubbish... + find dist/extensions/ -name mkmf.log -delete + cd dist/gems/$_gemname-$PKG_VER/ + rm -rf ext/ patches/ + rm ./*.md ./*.yml + rm lib/*.jar + rm lib/nokogiri/*.so + rm lib/nokogiri/css/*.rex lib/nokogiri/css/*.y +} + +check() { + local extpath=$(dirname dist/extensions/*/*/$_gemname-$PKG_VER/gem_make.out) + + case "$CARCH" in + # Fix NotImplementedError: Compaction isn't available on this platform. + ppc64le) export NOKOGIRI_TEST_GC_LEVEL=major;; + esac + + # Note: This is based on Fedora package. + LANG="C.UTF-8" RUBYLIB=".:dist/gems/$_gemname-$PKG_VER/lib:test:$extpath" ruby \ + -e 'require "test/helper"' \ + -e 'Dir.glob("test/**/test_*.rb") {|f| require f }' +} + +package() { + local gemdir="$PKG_DEST/$(ruby -e 'puts Gem.default_dir')" + + cd "$BUILD_ROOT"/dist + + mkdir -p "$gemdir" + cp -r bin extensions gems specifications "$gemdir"/ +} + diff --git a/repo/ruby-nokogiri/shutdown-libxml2-warning.patch b/repo/ruby-nokogiri/shutdown-libxml2-warning.patch new file mode 100644 index 0000000..c897379 --- /dev/null +++ b/repo/ruby-nokogiri/shutdown-libxml2-warning.patch @@ -0,0 +1,12 @@ +Patch-Source: https://src.fedoraproject.org/rpms/rubygem-nokogiri/blob/f36/f/rubygem-nokogiri-1.11.0.rc4-shutdown-libxml2-warning.patch + +--- a/lib/nokogiri/version/info.rb ++++ b/lib/nokogiri/version/info.rb +@@ -58,6 +58,7 @@ module Nokogiri + + def warnings + warnings = [] ++ return warnings + + if libxml2? + if compiled_libxml_version != loaded_libxml_version diff --git a/repo/ruby-nokogiri/test-helper-remove-unnecessary-deps.patch b/repo/ruby-nokogiri/test-helper-remove-unnecessary-deps.patch new file mode 100644 index 0000000..bfb5ceb --- /dev/null +++ b/repo/ruby-nokogiri/test-helper-remove-unnecessary-deps.patch @@ -0,0 +1,22 @@ +--- a/test/helper.rb ++++ b/test/helper.rb +@@ -16,19 +16,12 @@ + # make sure we do one final major before the process exits (for valgrind) + at_exit { GC.start(full_mark: true) } unless ::RUBY_PLATFORM == "java" + +-require "simplecov" +-SimpleCov.start do +- add_filter "/test/" +-end + + $VERBOSE = true + + require "minitest/autorun" +-require "minitest/reporters" + NOKOGIRI_MINITEST_REPORTERS_OPTIONS = { color: true, slow_count: 10, detailed_skip: false } + NOKOGIRI_MINITEST_REPORTERS_OPTIONS[:fast_fail] = true if ENV["NOKOGIRI_TEST_FAIL_FAST"] +-puts "Minitest::Reporters options: #{NOKOGIRI_MINITEST_REPORTERS_OPTIONS}" +-Minitest::Reporters.use!(Minitest::Reporters::DefaultReporter.new(NOKOGIRI_MINITEST_REPORTERS_OPTIONS)) + + require "fileutils" + require "tempfile" |