improve ruby-2.5 compatibility (epel8)
An unfortunate bug in rdoc-5.0 causes a build failure on epel8. This is fixed in ruby-2.6/rdoc-6.0.2¹. Until/unless the fix is backported to RHEL-8 (which seems unlikely), we can only patch around this. Thanks, as usual, to Dan Allen for going above and beyond to patch this upstream. ¹ https://github.com/ruby/rdoc/pull/586 https://github.com/ruby/rdoc/commit/a1631aa
This commit is contained in:
parent
bd6465f42a
commit
22023dba55
@ -0,0 +1,25 @@
|
||||
From cc9a8d3cd12f2c15e43bd263b8b8a9b32d097831 Mon Sep 17 00:00:00 2001
|
||||
From: Dan Allen <dan.j.allen@gmail.com>
|
||||
Date: Thu, 25 May 2023 18:39:56 -0600
|
||||
Subject: [PATCH] use single-line block in manify method in manpage converter
|
||||
to make it easier to patch
|
||||
|
||||
---
|
||||
lib/asciidoctor/converter/manpage.rb | 4 +---
|
||||
1 file changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
diff --git a/lib/asciidoctor/converter/manpage.rb b/lib/asciidoctor/converter/manpage.rb
|
||||
index bcf2b784..a7aba996 100644
|
||||
--- a/lib/asciidoctor/converter/manpage.rb
|
||||
+++ b/lib/asciidoctor/converter/manpage.rb
|
||||
@@ -716,9 +716,7 @@ def manify str, opts = {}
|
||||
.gsub(LiteralBackslashRx) { $1 ? $& : '\\(rs' } # literal backslash (not a troff escape sequence)
|
||||
.gsub(EllipsisCharRefRx, '...') # horizontal ellipsis
|
||||
.gsub(LeadingPeriodRx, '\\\&.') # leading . is used in troff for macro call or other formatting; replace with \&.
|
||||
- .gsub(EscapedMacroRx) do # drop orphaned \c escape lines, unescape troff macro, quote adjacent character, isolate macro line
|
||||
- (rest = $3.lstrip).empty? ? %(.#{$1}"#{$2}") : %(.#{$1}"#{$2.rstrip}"#{LF}#{rest})
|
||||
- end
|
||||
+ .gsub(EscapedMacroRx) { (rest = $3.lstrip).empty? ? %(.#{$1}"#{$2}") : %(.#{$1}"#{$2.rstrip}"#{LF}#{rest}) } # drop orphaned \c escape lines, unescape troff macro, quote adjacent character, isolate macro line
|
||||
.gsub('-', '\-')
|
||||
.gsub('<', '<')
|
||||
.gsub('>', '>')
|
@ -0,0 +1,85 @@
|
||||
From b7c03964cfc96af9ced5db3c1a6c7a7663de5cb2 Mon Sep 17 00:00:00 2001
|
||||
From: Dan Allen <dan.j.allen@gmail.com>
|
||||
Date: Fri, 26 May 2023 01:44:09 -0600
|
||||
Subject: [PATCH] change dot layout in chained method call to be compatible
|
||||
with rdoc generator from Ruby 2.5
|
||||
|
||||
---
|
||||
lib/asciidoctor/converter/manpage.rb | 64 ++++++++++++++--------------
|
||||
1 file changed, 32 insertions(+), 32 deletions(-)
|
||||
|
||||
diff --git a/lib/asciidoctor/converter/manpage.rb b/lib/asciidoctor/converter/manpage.rb
|
||||
index a7aba996..be52e9be 100644
|
||||
--- a/lib/asciidoctor/converter/manpage.rb
|
||||
+++ b/lib/asciidoctor/converter/manpage.rb
|
||||
@@ -712,38 +712,38 @@ def manify str, opts = {}
|
||||
else
|
||||
str = str.tr_s WHITESPACE, ' '
|
||||
end
|
||||
- str = str
|
||||
- .gsub(LiteralBackslashRx) { $1 ? $& : '\\(rs' } # literal backslash (not a troff escape sequence)
|
||||
- .gsub(EllipsisCharRefRx, '...') # horizontal ellipsis
|
||||
- .gsub(LeadingPeriodRx, '\\\&.') # leading . is used in troff for macro call or other formatting; replace with \&.
|
||||
- .gsub(EscapedMacroRx) { (rest = $3.lstrip).empty? ? %(.#{$1}"#{$2}") : %(.#{$1}"#{$2.rstrip}"#{LF}#{rest}) } # drop orphaned \c escape lines, unescape troff macro, quote adjacent character, isolate macro line
|
||||
- .gsub('-', '\-')
|
||||
- .gsub('<', '<')
|
||||
- .gsub('>', '>')
|
||||
- .gsub('+', '+') # plus sign; alternately could use \c(pl
|
||||
- .gsub(' ', '\~') # non-breaking space
|
||||
- .gsub('©', '\(co') # copyright sign
|
||||
- .gsub('®', '\(rg') # registered sign
|
||||
- .gsub('™', '\(tm') # trademark sign
|
||||
- .gsub('°', '\(de') # degree sign
|
||||
- .gsub(' ', ' ') # thin space
|
||||
- .gsub('–', '\(en') # en dash
|
||||
- .gsub(EmDashCharRefRx, '\(em') # em dash
|
||||
- .gsub('‘', '\(oq') # left single quotation mark
|
||||
- .gsub('’', '\(cq') # right single quotation mark
|
||||
- .gsub('“', '\(lq') # left double quotation mark
|
||||
- .gsub('”', '\(rq') # right double quotation mark
|
||||
- .gsub('←', '\(<-') # leftwards arrow
|
||||
- .gsub('→', '\(->') # rightwards arrow
|
||||
- .gsub('⇐', '\(lA') # leftwards double arrow
|
||||
- .gsub('⇒', '\(rA') # rightwards double arrow
|
||||
- .gsub('​', '\:') # zero width space
|
||||
- .gsub('&', '&') # literal ampersand (NOTE must take place after any other replacement that includes &)
|
||||
- .gsub('\'', '\*(Aq') # apostrophe / neutral single quote
|
||||
- .gsub(MockMacroRx, '\1') # mock boundary
|
||||
- .gsub(ESC_BS, '\\') # unescape troff backslash (NOTE update if more escapes are added)
|
||||
- .gsub(ESC_FS, '.') # unescape full stop in troff commands (NOTE must take place after gsub(LeadingPeriodRx))
|
||||
- .rstrip # strip trailing space
|
||||
+ str = str.
|
||||
+ gsub(LiteralBackslashRx) { $1 ? $& : '\\(rs' }. # literal backslash (not a troff escape sequence)
|
||||
+ gsub(EllipsisCharRefRx, '...'). # horizontal ellipsis
|
||||
+ gsub(LeadingPeriodRx, '\\\&.'). # leading . is used in troff for macro call or other formatting; replace with \&.
|
||||
+ gsub(EscapedMacroRx) { (rest = $3.lstrip).empty? ? %(.#{$1}"#{$2}") : %(.#{$1}"#{$2.rstrip}"#{LF}#{rest}) }. # drop orphaned \c escape lines, unescape troff macro, quote adjacent character, isolate macro line
|
||||
+ gsub('-', '\-').
|
||||
+ gsub('<', '<').
|
||||
+ gsub('>', '>').
|
||||
+ gsub('+', '+'). # plus sign; alternately could use \c(pl
|
||||
+ gsub(' ', '\~'). # non-breaking space
|
||||
+ gsub('©', '\(co'). # copyright sign
|
||||
+ gsub('®', '\(rg'). # registered sign
|
||||
+ gsub('™', '\(tm'). # trademark sign
|
||||
+ gsub('°', '\(de'). # degree sign
|
||||
+ gsub(' ', ' '). # thin space
|
||||
+ gsub('–', '\(en'). # en dash
|
||||
+ gsub(EmDashCharRefRx, '\(em'). # em dash
|
||||
+ gsub('‘', '\(oq'). # left single quotation mark
|
||||
+ gsub('’', '\(cq'). # right single quotation mark
|
||||
+ gsub('“', '\(lq'). # left double quotation mark
|
||||
+ gsub('”', '\(rq'). # right double quotation mark
|
||||
+ gsub('←', '\(<-'). # leftwards arrow
|
||||
+ gsub('→', '\(->'). # rightwards arrow
|
||||
+ gsub('⇐', '\(lA'). # leftwards double arrow
|
||||
+ gsub('⇒', '\(rA'). # rightwards double arrow
|
||||
+ gsub('​', '\:'). # zero width space
|
||||
+ gsub('&', '&'). # literal ampersand (NOTE must take place after any other replacement that includes &)
|
||||
+ gsub('\'', '\*(Aq'). # apostrophe / neutral single quote
|
||||
+ gsub(MockMacroRx, '\1'). # mock boundary
|
||||
+ gsub(ESC_BS, '\\'). # unescape troff backslash (NOTE update if more escapes are added)
|
||||
+ gsub(ESC_FS, '.'). # unescape full stop in troff commands (NOTE must take place after gsub(LeadingPeriodRx))
|
||||
+ rstrip # strip trailing space
|
||||
opts[:append_newline] ? %(#{str}#{LF}) : str
|
||||
end
|
||||
|
@ -7,10 +7,16 @@
|
||||
Summary: A fast, open source AsciiDoc implementation in Ruby
|
||||
Name: rubygem-%{gem_name}
|
||||
Version: 2.0.20
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
License: MIT
|
||||
URL: https://asciidoctor.org
|
||||
Source0: https://github.com/asciidoctor/asciidoctor/archive/%{gittag}/%{gem_name}-%{version}%{pre}.tar.gz
|
||||
# improve ruby-2.5 compatibility
|
||||
# https://github.com/asciidoctor/asciidoctor/issues/4462
|
||||
# https://github.com/asciidoctor/asciidoctor/commit/cc9a8d3c
|
||||
Patch0: 0001-use-single-line-block-in-manify-method-in-manpage-co.patch
|
||||
# https://github.com/asciidoctor/asciidoctor/commit/b7c03964
|
||||
Patch1: 0002-change-dot-layout-in-chained-method-call-to-be-compa.patch
|
||||
%if 0%{?el7}
|
||||
Requires: ruby(release)
|
||||
BuildRequires: ruby(release)
|
||||
@ -121,6 +127,9 @@ cp -a .%{gem_instdir}/man/*.1 \
|
||||
%doc %{gem_docdir}
|
||||
|
||||
%changelog
|
||||
* Thu May 25 2023 Todd Zullinger <tmz@pobox.com> - 2.0.20-2
|
||||
- improve ruby-2.5 compatibility (epel8)
|
||||
|
||||
* Thu May 18 2023 Todd Zullinger <tmz@pobox.com> - 2.0.20-1
|
||||
- update to asciidoctor 2.0.20 (rhbz#2208089)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user