summaryrefslogtreecommitdiff
path: root/gnu/packages/ruby.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2020-07-09 22:37:08 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2020-07-11 14:26:58 -0400
commitc84dd8d49c754ee723b8fe8fee04cd0464402303 (patch)
treebc560e85794e4b73319e1c09a739bd38fab9a963 /gnu/packages/ruby.scm
parentfa8e4dbf38d018006f0d8ab3eb8a56942609d1f9 (diff)
gnu: Add ruby-pandoc-ruby.
* gnu/packages/ruby.scm (ruby-pandoc-ruby): New variable.
Diffstat (limited to 'gnu/packages/ruby.scm')
-rw-r--r--gnu/packages/ruby.scm64
1 files changed, 64 insertions, 0 deletions
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 18da48a948..f906590ba2 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -51,6 +51,7 @@
#:use-module (gnu packages rails)
#:use-module (gnu packages readline)
#:use-module (gnu packages autotools)
+ #:use-module (gnu packages haskell-xyz)
#:use-module (gnu packages java)
#:use-module (gnu packages libffi)
#:use-module (gnu packages libidn)
@@ -984,6 +985,69 @@ line of code.")
;; of the Expat license.
(license license:bsd-3)))
+(define-public ruby-pandoc-ruby
+ (package
+ (name "ruby-pandoc-ruby")
+ (version "2.1.4")
+ (source
+ (origin
+ (method git-fetch) ;the gem lacks many test files
+ (uri (git-reference
+ (url "https://github.com/xwmx/pandoc-ruby.git")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "03a11clhycyn0jhc7g9davpqd83sn60jqwjy1y145ag9sq6sp935"))))
+ (build-system ruby-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'disable-failing-tests
+ ;; TODO: Remove this phase after ghc-pandoc gets upgraded to 2.9.2+
+ ;; (see: https://github.com/xwmx/pandoc-ruby/issues/39).
+ (lambda _
+ (substitute* "test/test_conversions.rb"
+ (("next if from == to.*" all)
+ (string-append
+ all
+ " next if ['plain', 'beamer'].include? to\n")))
+ #t))
+ (add-after 'unpack 'patch-pandoc-path
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((pandoc (string-append (assoc-ref inputs "ghc-pandoc")
+ "/bin/pandoc")))
+ (substitute* "lib/pandoc-ruby.rb"
+ (("@@pandoc_path = 'pandoc'")
+ (format #f "@@pandoc_path = '~a'" pandoc)))
+ (substitute* "test/test_pandoc_ruby.rb"
+ (("('|\")pandoc" _ quote)
+ (string-append quote pandoc))
+ (("\\^pandoc")
+ ".*pandoc"))
+ #t)))
+ (add-after 'extract-gemspec 'remove-Gemfile.lock
+ (lambda _
+ (delete-file "Gemfile.lock")
+ (substitute* "pandoc-ruby.gemspec"
+ (("Gemfile\\.lock") ""))
+ #t)))))
+ (native-inputs
+ `(("ruby-mocha" ,ruby-mocha)))
+ (inputs
+ `(("ghc-pandoc" ,ghc-pandoc)))
+ (synopsis "Ruby wrapper for Pandoc")
+ (description "PandocRuby is a wrapper for Pandoc, a Haskell library with
+command line tools for converting one markup format to another. Pandoc can
+convert documents from a variety of formats including markdown,
+reStructuredText, textile, HTML, DocBook, LaTeX, and MediaWiki markup to a
+variety of other formats, including markdown, reStructuredText, HTML, LaTeX,
+ConTeXt, PDF, RTF, DocBook XML, OpenDocument XML, ODT, GNU Texinfo, MediaWiki
+markup, groff man pages, HTML slide shows, EPUB, Microsoft Word docx, and
+more.")
+ (home-page "https://github.com/xwmx/pandoc-ruby")
+ (license license:expat)))
+
(define-public ruby-asciidoctor
(package
(name "ruby-asciidoctor")