[bug#76314,ruby-team,70/71] gnu: ruby-asciidoctor-pdf: Update to 2.3.19.

Message ID 20250216003503.6348-70-ngraves@ngraves.fr
State New
Headers
Series Update ruby. |

Commit Message

Nicolas Graves Feb. 16, 2025, 12:34 a.m. UTC
  * gnu/packages/ruby.scm (ruby-asciidoctor-pdf): Update to 2.3.19.
[origin]<patches>: Record patch.
[arguments]<#:phases>: Remove 'strip-version-requirements phase.
[propagated-inputs]: Remove old dependencies ruby-open-uri-cached,
ruby-safe-yaml, ruby-thread-safe.
* gnu/packages/patches/ruby-asciidoctor-pdf-support-prawn-svg-0_36.patch:
Add patch.
* gnu/local.mk: Record patch.
---
 gnu/local.mk                                  |   1 +
 ...ciidoctor-pdf-support-prawn-svg-0_36.patch | 107 ++++++++++++++++++
 gnu/packages/ruby.scm                         |  15 +--
 3 files changed, 113 insertions(+), 10 deletions(-)
 create mode 100644 gnu/packages/patches/ruby-asciidoctor-pdf-support-prawn-svg-0_36.patch
  

Patch

diff --git a/gnu/local.mk b/gnu/local.mk
index a6e10263ff..9bcf469a11 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2179,6 +2179,7 @@  dist_patch_DATA =						\
   %D%/packages/patches/rocm-opencl-runtime-4.3-noclinfo.patch 	\
   %D%/packages/patches/rottlog-direntry.patch 			\
   %D%/packages/patches/ruby-actionpack-remove-browser-tests.patch	\
+  %D%/packages/patches/ruby-asciidoctor-pdf-support-prawn-svg-0_36.patch	\
   %D%/packages/patches/ruby-hiredis-use-system-hiredis.patch	\
   %D%/packages/patches/ruby-hydra-minimal-no-byebug.patch	\
   %D%/packages/patches/ruby-anystyle-data-immutable-install.patch	\
diff --git a/gnu/packages/patches/ruby-asciidoctor-pdf-support-prawn-svg-0_36.patch b/gnu/packages/patches/ruby-asciidoctor-pdf-support-prawn-svg-0_36.patch
new file mode 100644
index 0000000000..2f616e1c0d
--- /dev/null
+++ b/gnu/packages/patches/ruby-asciidoctor-pdf-support-prawn-svg-0_36.patch
@@ -0,0 +1,107 @@ 
+From b5240141cde2a6428cb84d792991294c84f9f530 Mon Sep 17 00:00:00 2001
+From: Fethbita <Fethbita@users.noreply.github.com>
+Date: Tue, 7 Jan 2025 16:20:31 +0200
+Subject: [PATCH] Update prawn-svg to 0.36.0
+https://github.com/asciidoctor/asciidoctor-pdf/pull/2553
+
+---
+ asciidoctor-pdf.gemspec      | 4 ++--
+ spec/admonition_spec.rb      | 4 ++--
+ spec/cover_page_spec.rb      | 2 +-
+ spec/image_spec.rb           | 2 +-
+ spec/page_spec.rb            | 2 +-
+ spec/running_content_spec.rb | 2 +-
+ 6 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/asciidoctor-pdf.gemspec b/asciidoctor-pdf.gemspec
+index 997e260e..c09a110d 100644
+--- a/asciidoctor-pdf.gemspec
++++ b/asciidoctor-pdf.gemspec
+@@ -39,8 +39,8 @@ Gem::Specification.new do |s|
+   s.add_runtime_dependency 'matrix', '~> 0.4' # required until prawn >= 2.5.0 is released
+   s.add_runtime_dependency 'prawn-table', '~> 0.2.0'
+   s.add_runtime_dependency 'prawn-templates', '~> 0.1.0'
+-  s.add_runtime_dependency 'prawn-svg', '~> 0.34.0'
+-  s.add_runtime_dependency 'prawn-icon', '~> 3.0.0'
++  s.add_runtime_dependency 'prawn-svg', '~> 0.36.0'
++  s.add_runtime_dependency 'prawn-icon', '~> 3.1.0'
+   s.add_runtime_dependency 'concurrent-ruby', '~> 1.1'
+   s.add_runtime_dependency 'treetop', '~> 1.6.0'
+ 
+diff --git a/spec/admonition_spec.rb b/spec/admonition_spec.rb
+index 0131a097..ca3eb74a 100644
+--- a/spec/admonition_spec.rb
++++ b/spec/admonition_spec.rb
+@@ -709,7 +709,7 @@
+         label_text = pdf.find_unique_text 'TIP'
+         (expect label_text).not_to be_nil
+         (expect label_text[:font_name]).to include 'Bold'
+-      end).to log_message severity: :WARN, message: %(~could not embed admonition icon image: #{fixture_file 'broken.svg'}; Missing end tag for 'rect')
++      end).to log_message severity: :WARN, message: %(~could not embed admonition icon image: #{fixture_file 'broken.svg'}; The data supplied is not a valid SVG document.)
+     end
+ 
+     it 'should resize fallback admonition label to fit in available space if icon fails to embed' do
+@@ -726,7 +726,7 @@
+         label_text = pdf.find_unique_text 'WARNING'
+         (expect label_text).not_to be_nil
+         (expect label_text[:font_size]).to be < 10.5
+-      end).to log_message severity: :WARN, message: %(~could not embed admonition icon image: #{fixture_file 'broken.svg'}; Missing end tag for 'rect')
++      end).to log_message severity: :WARN, message: %(~could not embed admonition icon image: #{fixture_file 'broken.svg'}; The data supplied is not a valid SVG document.)
+     end
+ 
+     # NOTE: this test also verifies the text transform is applied as requested by theme
+diff --git a/spec/cover_page_spec.rb b/spec/cover_page_spec.rb
+index bd487eb1..cd034120 100644
+--- a/spec/cover_page_spec.rb
++++ b/spec/cover_page_spec.rb
+@@ -75,7 +75,7 @@
+ 
+       (expect pdf.pages).to have_size 1
+       (expect pdf.lines pdf.find_text page_number: 1).to eql ['content page']
+-    end).to log_message severity: :WARN, message: %(~could not embed front cover image: #{fixture_file 'broken.svg'}; Missing end tag for 'rect')
++    end).to log_message severity: :WARN, message: %(~could not embed front cover image: #{fixture_file 'broken.svg'}; The data supplied is not a valid SVG document.)
+   end
+ 
+   it 'should not add cover page if value is ~' do
+diff --git a/spec/image_spec.rb b/spec/image_spec.rb
+index c6c83e96..7c97c54b 100644
+--- a/spec/image_spec.rb
++++ b/spec/image_spec.rb
+@@ -1084,7 +1084,7 @@ def traverse node
+         (expect do
+           pdf = to_pdf %(image#{macro_delim}broken.svg[Broken SVG]), analyze: true
+           (expect pdf.lines).to eql [alt_text]
+-        end).to log_message severity: :WARN, message: %(~could not embed image: #{fixture_file 'broken.svg'}; Missing end tag for 'rect')
++        end).to log_message severity: :WARN, message: %(~could not embed image: #{fixture_file 'broken.svg'}; The data supplied is not a valid SVG document.)
+       end
+     end
+ 
+diff --git a/spec/page_spec.rb b/spec/page_spec.rb
+index 261c4ca1..2b01fa7d 100644
+--- a/spec/page_spec.rb
++++ b/spec/page_spec.rb
+@@ -1698,7 +1698,7 @@
+         content
+         EOS
+         (expect pdf.images).to be_empty
+-      end).to log_message severity: :WARN, message: %(~Missing end tag for 'rect')
++      end).to log_message severity: :WARN, message: %(~The data supplied is not a valid SVG document.)
+     end
+ 
+     it 'should only warn once if background image cannot be loaded' do
+diff --git a/spec/running_content_spec.rb b/spec/running_content_spec.rb
+index 8e1264dd..7196bde8 100644
+--- a/spec/running_content_spec.rb
++++ b/spec/running_content_spec.rb
+@@ -3046,7 +3046,7 @@
+         pdf = to_pdf 'body', analyze: true, pdf_theme: pdf_theme, enable_footer: true
+         footer_text = pdf.find_unique_text font_color: '0000FF'
+         (expect footer_text[:string]).to eql '[no worky]'
+-      end).to log_message severity: :WARN, message: %(~could not embed image in running content: #{fixture_file 'broken.svg'}; Missing end tag for 'rect')
++      end).to log_message severity: :WARN, message: %(~could not embed image in running content: #{fixture_file 'broken.svg'}; The data supplied is not a valid SVG document.)
+     end
+ 
+     it 'should resolve attribute references in target of inline image' do
+-- 
+2.47.1
+
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 76911896a8..8ba81397f5 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -2502,7 +2502,7 @@  web pages.")
 (define-public ruby-asciidoctor-pdf
   (package
     (name "ruby-asciidoctor-pdf")
-    (version "2.3.4")
+    (version "2.3.19")
     (source
      (origin
        (method git-fetch)               ;no test suite in the distributed gem
@@ -2512,18 +2512,16 @@  web pages.")
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "07krhpj2ylz7h7hy8vg0js8yv828qxh3mkhx0bsrfh0p24xwbjrm"))))
+         "1l8my8jj4aww2yad80n6f7hs76lq5gicld8dy014pw90pk3x43mp"))
+       (patches
+        (search-patches
+         "ruby-asciidoctor-pdf-support-prawn-svg-0_36.patch"))))
     (build-system ruby-build-system)
     (arguments
      (list
       #:test-target "spec"
       #:phases
       #~(modify-phases %standard-phases
-          (add-after 'extract-gemspec 'strip-version-requirements
-            (lambda _
-              (substitute* "asciidoctor-pdf.gemspec"
-                (("(.*add_.*dependency '[_A-Za-z0-9-]+').*" _ stripped)
-                 (string-append stripped "\n")))))
           ;; The tests rely on the Gem being installed, so move the check
           ;; phase after the install phase.
           (delete 'check)
@@ -2544,15 +2542,12 @@  web pages.")
     (propagated-inputs
      (list ruby-asciidoctor
            ruby-concurrent
-           ruby-open-uri-cached
            ruby-prawn
            ruby-prawn-icon
            ruby-prawn-svg
            ruby-prawn-table
            ruby-prawn-templates
-           ruby-safe-yaml
            ruby-text-hyphen
-           ruby-thread-safe
            ruby-treetop
            ruby-ttfunk))
     (synopsis"AsciiDoc to Portable Document Format (PDF)} converter")