guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

07/17: gnu: Add ruby-pandoc-ruby.


From: guix-commits
Subject: 07/17: gnu: Add ruby-pandoc-ruby.
Date: Sat, 11 Jul 2020 14:30:36 -0400 (EDT)

apteryx pushed a commit to branch master
in repository guix.

commit c84dd8d49c754ee723b8fe8fee04cd0464402303
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Thu Jul 9 22:37:08 2020 -0400

    gnu: Add ruby-pandoc-ruby.
    
    * gnu/packages/ruby.scm (ruby-pandoc-ruby): New variable.
---
 gnu/packages/ruby.scm | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 18da48a..f906590 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")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]