aboutsummaryrefslogtreecommitdiffstats
path: root/community/ruby-nokogiri
diff options
context:
space:
mode:
Diffstat (limited to 'community/ruby-nokogiri')
-rw-r--r--community/ruby-nokogiri/APKBUILD42
-rw-r--r--community/ruby-nokogiri/extconf-relax-mini_portile2-version.patch11
-rw-r--r--community/ruby-nokogiri/gemspec-fix-deps.patch17
-rw-r--r--community/ruby-nokogiri/shutdown-libxml2-warning.patch12
-rw-r--r--community/ruby-nokogiri/test-helper-remove-unnecessary-deps.patch25
-rw-r--r--community/ruby-nokogiri/test-skip-zip.patch10
6 files changed, 71 insertions, 46 deletions
diff --git a/community/ruby-nokogiri/APKBUILD b/community/ruby-nokogiri/APKBUILD
index 063ee76005c..a8885db7018 100644
--- a/community/ruby-nokogiri/APKBUILD
+++ b/community/ruby-nokogiri/APKBUILD
@@ -4,13 +4,15 @@
# TODO: Unbundle gombo-parser.
pkgname=ruby-nokogiri
_gemname=${pkgname#ruby-}
-pkgver=1.12.5
+pkgver=1.16.3
pkgrel=0
pkgdesc="An HTML, XML, SAX, and Reader parser"
url="https://nokogiri.org/"
-arch="all !s390x"
+arch="all"
license="MIT"
-depends="ruby"
+depends="
+ ruby
+ ruby-racc"
makedepends="
libxml2-dev
libxslt-dev
@@ -20,17 +22,33 @@ makedepends="
checkdepends="ruby-minitest ruby-test-unit"
source="https://github.com/sparklemotion/$_gemname/archive/v$pkgver/$_gemname-$pkgver.tar.gz
gemspec-fix-deps.patch
- extconf-relax-mini_portile2-version.patch
test-helper-remove-unnecessary-deps.patch
+ shutdown-libxml2-warning.patch
+ test-skip-zip.patch
"
builddir="$srcdir/$_gemname-$pkgver"
# secfixes:
+# 1.13.10-r0:
+# - CVE-2022-23476
+# 1.13.6-r0:
+# - CVE-2022-29181
+# 1.13.4-r0:
+# - CVE-2022-24836
# 1.11.6-r0:
# - CVE-2020-26247
# 1.10.4-r0:
# - CVE-2019-5477
+prepare() {
+ default_prepare
+
+ case "$CARCH" in
+ # NotImplementedError: Compaction isn't available on this platform.
+ ppc64le) rm test/test_compaction.rb ;;
+ esac
+}
+
build() {
gem build $_gemname.gemspec
gem install \
@@ -47,7 +65,7 @@ build() {
cd dist/gems/$_gemname-$pkgver/
rm -rf ext/ patches/
rm ./*.md ./*.yml
- rm lib/*.jar
+ rm -rf lib/nokogiri/jruby/ # TODO: move into subpackage?
rm lib/nokogiri/*.so
rm lib/nokogiri/css/*.rex lib/nokogiri/css/*.y
}
@@ -55,6 +73,11 @@ build() {
check() {
local extpath=$(dirname dist/extensions/*/*/$_gemname-$pkgver/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-$pkgver/lib:test:$extpath" ruby \
-e 'require "test/helper"' \
@@ -71,8 +94,9 @@ package() {
}
sha512sums="
-36d233df250213c4614c34d045c4fbea099e81e991a6da49067c165bc95f36b281c58cc79deb3b6a8aaccc50743a79efa27969e067cc2b546bef7615b139d79b nokogiri-1.12.5.tar.gz
-99820797977aad4c91050e331ea2b5ef7e108e109707f69252a8aa08bdbae36286db7e0afb8be2ad4905b48e1ea93aa00c069b70d0010fde559e7045739b64b3 gemspec-fix-deps.patch
-5b1bd6bb2838d33c6785c2b2df184304d24a5dd3cfedc08fb12f66f5c9fa812ac2b369aa092299111fca25b2b77fb3a8cdde44ceeeacf0bde276e38eb910b15b extconf-relax-mini_portile2-version.patch
-81c05ac93387a5f6f0b3e7389f7c14cc9398344f91061e2cf57682a53979cecbf5c0f05913d8f1b320887fa123fa18421fea8043bb757a9bcca692e4fec84448 test-helper-remove-unnecessary-deps.patch
+e86d5d2cb47720b9f2e72ced13e07e6d9a2bda808e05d9d151ffba92820e148bb6cd8cfe148d15247b13c23feb2abe64942f2665431e66dc821b9655425df8e3 nokogiri-1.16.3.tar.gz
+b4d2457a6065d6c0878841acd259d6e231bb08b3aa0868943d0f90733f211cfbca28fac3c9678d1874b8e6f91c746c0c4381211efaf9781267c9183197fc1912 gemspec-fix-deps.patch
+4e637fccb39e4f5e7c4b2b902fc7ad60287a571fa37ab3b7afafbd3fdb7445a81518f654bf83e0c43b3e5ff06b37518f433fa22dc9f78e1cd840055603c55319 test-helper-remove-unnecessary-deps.patch
+63519d5b314c6fee49c219c8ab6999b340e1e6b1acecfaf3aee3dcc37302be8ff82dbd00484b3570f457d5de3c54529b843e1d382f5b65b9e128548b37c97198 shutdown-libxml2-warning.patch
+ab9681d88bfa0939134e333db751c2564629667ff7d49a5db93c3f49b88bc08349eae32d3a35c9235bb76b27b259033f949ad1ad5d9cf047b2eb8d2546632b7b test-skip-zip.patch
"
diff --git a/community/ruby-nokogiri/extconf-relax-mini_portile2-version.patch b/community/ruby-nokogiri/extconf-relax-mini_portile2-version.patch
deleted file mode 100644
index 93554830f70..00000000000
--- a/community/ruby-nokogiri/extconf-relax-mini_portile2-version.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/ext/nokogiri/extconf.rb
-+++ b/ext/nokogiri/extconf.rb
-@@ -14,7 +14,7 @@
-
- # The gem version constraint in the Rakefile is not respected at install time.
- # Keep this version in sync with the one in the Rakefile !
--REQUIRED_MINI_PORTILE_VERSION = "~> 2.6.1"
-+REQUIRED_MINI_PORTILE_VERSION = "~> 2.6"
- REQUIRED_PKG_CONFIG_VERSION = "~> 1.1"
-
- # Keep track of what versions of what libraries we build against
diff --git a/community/ruby-nokogiri/gemspec-fix-deps.patch b/community/ruby-nokogiri/gemspec-fix-deps.patch
index a2c1f9126b3..8c654552429 100644
--- a/community/ruby-nokogiri/gemspec-fix-deps.patch
+++ b/community/ruby-nokogiri/gemspec-fix-deps.patch
@@ -2,14 +2,15 @@ racc and mini_portile2 are needed only to build native extension.
--- a/nokogiri.gemspec
+++ b/nokogiri.gemspec
-@@ -316,8 +316,8 @@
- spec.extra_rdoc_files += Dir.glob("README.md")
- spec.rdoc_options = ["--main", "README.md"]
-
+@@ -339,9 +339,9 @@
+ spec.requirements << "jar xerces, xercesImpl, 2.12.2" # https://search.maven.org/artifact/xerces/xercesImpl
+ spec.requirements << "jar xml-apis, xml-apis, 1.4.01" # https://search.maven.org/artifact/xml-apis/xml-apis
+ else
+- spec.add_runtime_dependency("mini_portile2", "~> 2.8.2") # keep version in sync with extconf.rb
++ spec.add_development_dependency("mini_portile2", "~> 2.8.2") # keep version in sync with extconf.rb
+ end
- spec.add_runtime_dependency("racc", "~> 1.4")
-- spec.add_runtime_dependency("mini_portile2", "~> 2.6.1") unless java_p # keep version in sync with extconf.rb
+ spec.add_development_dependency("racc", "~> 1.4")
-+ spec.add_development_dependency("mini_portile2", "~> 2.6") unless java_p # keep version in sync with extconf.rb
- spec.add_development_dependency("bundler", "~> 2.2")
- spec.add_development_dependency("hoe-markdown", "~> 1.4")
+ spec.extensions << "ext/nokogiri/extconf.rb"
+ end
diff --git a/community/ruby-nokogiri/shutdown-libxml2-warning.patch b/community/ruby-nokogiri/shutdown-libxml2-warning.patch
new file mode 100644
index 00000000000..c897379ae9c
--- /dev/null
+++ b/community/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/community/ruby-nokogiri/test-helper-remove-unnecessary-deps.patch b/community/ruby-nokogiri/test-helper-remove-unnecessary-deps.patch
index 53d41eaaae1..7fca3320543 100644
--- a/community/ruby-nokogiri/test-helper-remove-unnecessary-deps.patch
+++ b/community/ruby-nokogiri/test-helper-remove-unnecessary-deps.patch
@@ -1,22 +1,11 @@
--- a/test/helper.rb
+++ b/test/helper.rb
-@@ -11,19 +11,12 @@
- # - "stress" - run tests with GC.stress set to true
- # - NOKOGIRI_GC: read more in test/test_memory_leak.rb
+@@ -12,7 +12,7 @@
+ # - NOKOGIRI_MEMORY_SUITE: read more in test/test_memory_usage.rb
#
--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'
+-unless ENV["RUBY_MEMCHECK_RUNNING"]
++unless true # ENV["RUBY_MEMCHECK_RUNNING"] XXX-Patched
+ require "simplecov"
+ SimpleCov.start do
+ add_filter "/test/"
diff --git a/community/ruby-nokogiri/test-skip-zip.patch b/community/ruby-nokogiri/test-skip-zip.patch
new file mode 100644
index 00000000000..f31a0edf3d0
--- /dev/null
+++ b/community/ruby-nokogiri/test-skip-zip.patch
@@ -0,0 +1,10 @@
+--- a/test/xml/test_document_encoding.rb
++++ b/test/xml/test_document_encoding.rb
+@@ -90,6 +90,7 @@
+
+ describe "pseudo-IO" do
+ it "serializes correctly with Zip::OutputStream objects" do
++ skip "we don't have ruby-zip yet"
+ # https://github.com/sparklemotion/nokogiri/issues/2773
+ require "zip"
+