[packages/ruby-nokogiri] Update to 1.19.1

arekm arekm at pld-linux.org
Mon Mar 16 19:52:08 CET 2026


commit 36a2646745733fc141564fbe66060b3be38437d6
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Mon Mar 16 19:35:23 2026 +0100

    Update to 1.19.1

 deps.patch                           |  27 ---------
 libxml2.patch                        | 101 -------------------------------
 nogem.patch                          |  10 ----
 ruby-nokogiri-cleanup.patch          |  35 -----------
 ruby-nokogiri-no-mini_portile2.patch |  12 ++++
 ruby-nokogiri.spec                   | 112 ++++++++++++-----------------------
 6 files changed, 50 insertions(+), 247 deletions(-)
---
diff --git a/ruby-nokogiri.spec b/ruby-nokogiri.spec
index 804cd82..f7a74e0 100644
--- a/ruby-nokogiri.spec
+++ b/ruby-nokogiri.spec
@@ -4,43 +4,36 @@
 %bcond_without	doc			# don't build ri/rdoc
 
 # NOTE
-# - changelog https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.rdoc
+# - changelog https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md
 
 %define	pkgname		nokogiri
 Summary:	An HTML, XML, SAX, and Reader parser
 Name:		ruby-%{pkgname}
-Version:	1.6.5
-Release:	13
+Version:	1.19.1
+Release:	2
 License:	MIT
 Group:		Development/Languages
 Source0:	https://rubygems.org/downloads/%{pkgname}-%{version}.gem
-# Source0-md5:	ac570aa0120b92185606919818d6ff92
-Patch0:		deps.patch
-Patch1:		nogem.patch
-Patch2:		libxml2.patch
+# Source0-md5:	1e5655ccfbe14ec328dc3bf8eee9b251
+Patch0:		%{name}-no-mini_portile2.patch
 URL:		https://nokogiri.org/
-BuildRequires:	libxml2-devel
+BuildRequires:	libxml2-devel >= 2.9.2
 BuildRequires:	libxslt-devel
 BuildRequires:	rpm-rubyprov
 BuildRequires:	rpmbuild(macros) >= 1.665
-BuildRequires:	ruby-devel
-BuildRequires:	ruby-mini_portile < 0.7
-BuildRequires:	ruby-mini_portile >= 0.6.0
-BuildRequires:	ruby-rdoc
+BuildRequires:	ruby-devel >= 1:3.2
 BuildRequires:	sed >= 4.0
-BuildRequires:	setup.rb >= 3.4.1-6
+%if %{with doc}
+BuildRequires:	ruby-rdoc
+%endif
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
-Nokogiri is an HTML parser with XPath support for document searching,
-CSS3 selector support for document searching, an XML/HTML builder, and
-drop in replacement for Hpricot (though not bug for bug).
-
-Nokogiri parses and searches XML/HTML very quickly, and also has
-correctly implemented CSS3 selector support as well as XPath support.
-
-It also features an Hpricot compatibility layer to help ease the
-change to using correct CSS and XPath.
+Nokogiri makes it easy and painless to work with XML and HTML from
+Ruby. It provides a sensible, easy-to-understand API for reading,
+writing, modifying, and querying documents. It is fast and
+standards-compliant by relying on native parsers like libxml2,
+libgumbo, or xerces.
 
 %package rdoc
 Summary:	HTML documentation for %{pkgname}
@@ -73,72 +66,44 @@ Dokumentacji w formacie ri dla %{pkgname}.
 
 %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
 
-%{__tar} xvf %{SOURCE0} metadata.gz
+%{__tar} xf %{SOURCE0} metadata.gz
+gunzip metadata.gz
 %__gem_helper spec
-
-# yes. this is after writing gemspec.
-# making gemspec from source is hard
-%patch -P0 -p1
-%patch -P1 -p1
-%patch -P2 -p1
-
-cp -p %{_datadir}/setup.rb .
+# remove mini_portile2 dep from gemspec (not needed with system libraries)
+%patch -P0 -p0
 
 %build
-# 1.6.0 needs this
 export NOKOGIRI_USE_SYSTEM_LIBRARIES=yes
 
-%{__ruby} setup.rb config \
-	--rbdir=%{ruby_vendorlibdir} \
-	--sodir=%{ruby_vendorarchdir}/%{pkgname}
-%{__ruby} setup.rb setup
-
-%if %{with tests}
-# Ah....
-# test_exslt(TestXsltTransforms) [./test/test_xslt_transforms.rb:93]
-# fails without TZ on sparc
-export TZ="Asia/Tokyo"
-#???
-LANG=ja_JP.UTF-8
-
-# Some files are missing and due to it some tests fail, skip
-SKIPTEST="test/xml/test_xinclude.rb"
-for f in $SKIPTEST; do
-	mv $f $f.skip
-done
-
-# Observed fail on test_subclass_parse(Nokogiri::XML::TestDocument)
-# Need investigation. For now anyway build
-%{__ruby} -I.:ext:lib:test \
-	-rubygems \
-	-e \
-	"require 'minitest/autorun' ; Dir.glob('test/**/test_*.rb'){|f| require f}" || \
-	echo "Please investigate this"
-
-for f in $SKIPTEST; do
-	mv $f.skip $f
-done
-%endif
+cd ext/nokogiri
+%{__ruby} extconf.rb \
+	--enable-system-libraries \
+	--gumbo-dev
+%{__make} \
+	CC="%{__cc}" \
+	ldflags="%{rpmldflags}" \
+	optflags="%{rpmcflags} -fPIC"
+cd -
 
 %if %{with doc}
 rdoc --op rdoc lib
 rdoc --ri --op ri lib
-rm ri/Object/Nokogiri-i.ri
-rm ri/Object/cdesc-Object.ri
-rm ri/lib/nokogiri/css/page-tokenizer_rex.ri
-rm ri/created.rid
-rm ri/cache.ri
+rm -f ri/created.rid
+rm -f ri/cache.ri
+rm -rf ri/Object
+rm -rf ri/lib
 %endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{ruby_archdir},%{ruby_rubylibdir},%{ruby_ridir},%{ruby_rdocdir},%{ruby_specdir}}
-%{__ruby} setup.rb install \
-	--prefix=$RPM_BUILD_ROOT
-
+install -d $RPM_BUILD_ROOT{%{_bindir},%{ruby_vendorlibdir},%{ruby_vendorarchdir}/nokogiri,%{ruby_specdir}}
+cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
+install -p bin/nokogiri $RPM_BUILD_ROOT%{_bindir}
+install -p ext/nokogiri/nokogiri.so $RPM_BUILD_ROOT%{ruby_vendorarchdir}/nokogiri
 cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
 
 %if %{with doc}
+install -d $RPM_BUILD_ROOT{%{ruby_ridir},%{ruby_rdocdir}}
 cp -a ri/* $RPM_BUILD_ROOT%{ruby_ridir}
 cp -a rdoc $RPM_BUILD_ROOT%{ruby_rdocdir}/%{name}-%{version}
 %endif
@@ -148,8 +113,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc CHANGELOG.rdoc README.rdoc
-%lang(ja) %doc CHANGELOG.ja.rdoc
+%doc LICENSE.md README.md
 %attr(755,root,root) %{_bindir}/nokogiri
 %{ruby_vendorlibdir}/nokogiri.rb
 %{ruby_vendorlibdir}/nokogiri
diff --git a/deps.patch b/deps.patch
deleted file mode 100644
index de12692..0000000
--- a/deps.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-mini_portile is used at extension build time (ext/nokogiri/extconf.rb), which
-we do when building rpm it is not needed at runtime of rpm package install
-
-while gems do need it runtime as it's when they compile ext.
-
---- nokogiri-1.6.5/Gemfile~	2014-12-14 20:18:18.000000000 +0200
-+++ nokogiri-1.6.5/Gemfile	2014-12-14 20:19:18.699925589 +0200
-@@ -4,7 +4,7 @@
- 
- source "https://rubygems.org/"
- 
--gem "mini_portile", "~>0.6.0"
-+gem "mini_portile", "~>0.6.0", :group => [:development, :test]
- 
- gem "rdoc", "~>4.0", :group => [:development, :test]
- gem "hoe-bundler", ">=1.1", :group => [:development, :test]
---- nokogiri-1.6.5/nokogiri-1.6.5.gemspec~	2017-10-26 21:31:49.000000000 +0300
-+++ nokogiri-1.6.5/nokogiri-1.6.5.gemspec	2017-10-26 21:34:46.923726096 +0300
-@@ -27,7 +27,7 @@
-     s.specification_version = 4
- 
-     if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
--      s.add_runtime_dependency(%q<mini_portile>.freeze, ["~> 0.6.0"])
-+      s.add_development_dependency(%q<mini_portile>.freeze, ["~> 0.6.0"])
-       s.add_development_dependency(%q<rdoc>.freeze, ["~> 4.0"])
-       s.add_development_dependency(%q<hoe-bundler>.freeze, [">= 1.1"])
-       s.add_development_dependency(%q<hoe-debugging>.freeze, [">= 1.0.3"])
diff --git a/libxml2.patch b/libxml2.patch
deleted file mode 100644
index b1175d1..0000000
--- a/libxml2.patch
+++ /dev/null
@@ -1,101 +0,0 @@
---- nokogiri-1.6.5/ext/nokogiri/xml_syntax_error.c~	2025-09-06 16:03:17.000000000 +0200
-+++ nokogiri-1.6.5/ext/nokogiri/xml_syntax_error.c	2025-09-06 16:08:26.989995852 +0200
-@@ -1,13 +1,13 @@
- #include <xml_syntax_error.h>
- 
--void Nokogiri_error_array_pusher(void * ctx, xmlErrorPtr error)
-+void Nokogiri_error_array_pusher(void * ctx, const xmlError *error)
- {
-   VALUE list = (VALUE)ctx;
-   Check_Type(list, T_ARRAY);
-   rb_ary_push(list,  Nokogiri_wrap_xml_syntax_error(error));
- }
- 
--void Nokogiri_error_raise(void * ctx, xmlErrorPtr error)
-+void Nokogiri_error_raise(void * ctx, const xmlError *error)
- {
-   rb_exc_raise(Nokogiri_wrap_xml_syntax_error(error));
- }
---- nokogiri-1.6.5/ext/nokogiri/xml_syntax_error.h~	2025-09-06 16:03:17.000000000 +0200
-+++ nokogiri-1.6.5/ext/nokogiri/xml_syntax_error.h	2025-09-06 16:08:38.139995853 +0200
-@@ -5,8 +5,8 @@
- 
- void init_xml_syntax_error();
- VALUE Nokogiri_wrap_xml_syntax_error(xmlErrorPtr error);
--void Nokogiri_error_array_pusher(void * ctx, xmlErrorPtr error);
--NORETURN(void Nokogiri_error_raise(void * ctx, xmlErrorPtr error));
-+void Nokogiri_error_array_pusher(void * ctx, const xmlError *error);
-+NORETURN(void Nokogiri_error_raise(void * ctx, const xmlError *error));
- 
- extern VALUE cNokogiriXmlSyntaxError;
- #endif
---- nokogiri-1.6.5/ext/nokogiri/xml_document.c~	2025-09-06 16:33:56.000000000 +0200
-+++ nokogiri-1.6.5/ext/nokogiri/xml_document.c	2025-09-06 16:35:24.376662608 +0200
-@@ -491,7 +491,7 @@
-  * The block must return a non-nil, non-false value if the +obj+ passed in 
-  * should be included in the canonicalized document.
-  */
--static VALUE canonicalize(int argc, VALUE* argv, VALUE self)
-+static VALUE xml_doc_canonicalize(int argc, VALUE* argv, VALUE self)
- {
-   VALUE mode;
-   VALUE incl_ns;
-@@ -573,7 +573,7 @@
-   rb_define_method(klass, "encoding", encoding, 0);
-   rb_define_method(klass, "encoding=", set_encoding, 1);
-   rb_define_method(klass, "version", version, 0);
--  rb_define_method(klass, "canonicalize", canonicalize, -1);
-+  rb_define_method(klass, "canonicalize", xml_doc_canonicalize, -1);
-   rb_define_method(klass, "dup", duplicate_document, -1);
-   rb_define_method(klass, "url", url, 0);
-   rb_define_method(klass, "create_entity", create_entity, -1);
---- nokogiri-1.6.5/ext/nokogiri/xml_dtd.c~	2025-09-06 16:35:58.000000000 +0200
-+++ nokogiri-1.6.5/ext/nokogiri/xml_dtd.c	2025-09-06 16:37:49.593329248 +0200
-@@ -1,6 +1,6 @@
- #include <xml_dtd.h>
- 
--static void notation_copier(void *payload, void *data, xmlChar *name)
-+static void notation_copier(void *payload, void *data, const xmlChar *name)
- {
-   VALUE hash = (VALUE)data;
-   VALUE klass = rb_const_get(mNokogiriXml, rb_intern("Notation"));
-@@ -17,7 +17,7 @@
-   rb_hash_aset(hash, NOKOGIRI_STR_NEW2(name),notation);
- }
- 
--static void element_copier(void *_payload, void *data, xmlChar *name)
-+static void element_copier(void *_payload, void *data, const xmlChar *name)
- {
-   VALUE hash = (VALUE)data;
-   xmlNodePtr payload = (xmlNodePtr)_payload;
---- nokogiri-1.6.5/ext/nokogiri/xml_node.c~	2025-09-06 16:38:47.000000000 +0200
-+++ nokogiri-1.6.5/ext/nokogiri/xml_node.c	2025-09-06 16:40:28.876662563 +0200
-@@ -14,7 +14,7 @@
- 
- static void mark(xmlNodePtr node)
- {
--  xmlNodePtr doc = node->doc;
-+  xmlDocPtr doc = node->doc;
-   if(doc->type == XML_DOCUMENT_NODE || doc->type == XML_HTML_DOCUMENT_NODE) {
-     if(DOC_RUBY_OBJECT_TEST(doc)) {
-       rb_gc_mark(DOC_RUBY_OBJECT(doc));
---- nokogiri-1.6.5/ext/nokogiri/xslt_stylesheet.c~	2025-09-06 16:45:01.000000000 +0200
-+++ nokogiri-1.6.5/ext/nokogiri/xslt_stylesheet.c	2025-09-06 16:54:35.383329197 +0200
-@@ -214,7 +214,7 @@
-           (unsigned char *)StringValuePtr(method_name), uri, method_caller);
-     }
- 
--    Data_Get_Struct(ctxt->style->_private, nokogiriXsltStylesheetTuple,
-+    Data_Get_Struct((VALUE)ctxt->style->_private, nokogiriXsltStylesheetTuple,
-                     wrapper);
-     inst = rb_class_new_instance(0, NULL, obj);
-     rb_ary_push(wrapper->func_instances, inst);
-@@ -227,7 +227,7 @@
- {
-     nokogiriXsltStylesheetTuple *wrapper;
- 
--    Data_Get_Struct(ctxt->style->_private, nokogiriXsltStylesheetTuple,
-+    Data_Get_Struct((VALUE)ctxt->style->_private, nokogiriXsltStylesheetTuple,
-                     wrapper);
- 
-     rb_ary_clear(wrapper->func_instances);
diff --git a/nogem.patch b/nogem.patch
deleted file mode 100644
index 9d1ab99..0000000
--- a/nogem.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- nokogiri-1.6.5/bin/nokogiri~	2014-12-14 20:52:51.000000000 +0200
-+++ nokogiri-1.6.5/bin/nokogiri	2014-12-14 21:10:53.649805493 +0200
-@@ -3,7 +3,6 @@
- require 'open-uri'
- require 'irb'
- require 'uri'
--require 'rubygems'
- require 'nokogiri'
- 
- parse_class = Nokogiri
diff --git a/ruby-nokogiri-cleanup.patch b/ruby-nokogiri-cleanup.patch
deleted file mode 100644
index c1a0d43..0000000
--- a/ruby-nokogiri-cleanup.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-diff --git a/bin/nokogiri b/bin/nokogiri
-index 9449518..ff1419d 100755
---- a/bin/nokogiri
-+++ b/bin/nokogiri
-@@ -3,7 +3,6 @@ require 'optparse'
- require 'open-uri'
- require 'irb'
- require 'uri'
--require 'rubygems'
- require 'nokogiri'
- 
- opts = OptionParser.new do |opts|
-diff --git a/lib/nokogiri.rb b/lib/nokogiri.rb
-index b04468f..f685244 100644
---- a/lib/nokogiri.rb
-+++ b/lib/nokogiri.rb
-@@ -1,18 +1,7 @@
- # -*- coding: utf-8 -*-
--# Modify the PATH on windows so that the external DLLs will get loaded.
-
- require 'rbconfig'
--ENV['PATH'] = [File.expand_path(
--  File.join(File.dirname(__FILE__), "..", "ext", "nokogiri")
--), ENV['PATH']].compact.join(';') if RbConfig::CONFIG['host_os'] =~ /(mswin|mingw)/i
--
--if ENV['NOKOGIRI_FFI'] || RUBY_PLATFORM =~ /java/
--  require 'ffi'
--  require 'nokogiri/ffi/libxml'
--else
-   require 'nokogiri/nokogiri'
--end
--
- require 'nokogiri/version'
- require 'nokogiri/version_warning'
- require 'nokogiri/syntax_error'
diff --git a/ruby-nokogiri-no-mini_portile2.patch b/ruby-nokogiri-no-mini_portile2.patch
new file mode 100644
index 0000000..ba18654
--- /dev/null
+++ b/ruby-nokogiri-no-mini_portile2.patch
@@ -0,0 +1,12 @@
+Remove mini_portile2 runtime dependency from gemspec.
+Not needed when building with --enable-system-libraries (system libxml2/libxslt).
+
+--- nokogiri-1.19.1.gemspec.orig
++++ nokogiri-1.19.1.gemspec
+@@ -26,6 +26,5 @@
+ 
+   s.specification_version = 4
+ 
+-  s.add_runtime_dependency(%q<mini_portile2>.freeze, ["~> 2.8.2".freeze])
+   s.add_runtime_dependency(%q<racc>.freeze, ["~> 1.4".freeze])
+ end
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ruby-nokogiri.git/commitdiff/36a2646745733fc141564fbe66060b3be38437d6



More information about the pld-cvs-commit mailing list