summary refs log tree commit diff
path: root/gnu/packages/markup.scm
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2017-06-06 07:12:49 +0100
committerChristopher Baines <mail@cbaines.net>2017-09-13 18:19:29 +0100
commit9d46919f9c0898f88e0635efeb837efcc9144fb9 (patch)
tree6abbb7d035f35f67ef9611cee5ddeb5e30a3ec41 /gnu/packages/markup.scm
parent31d3a7c729068681a3a05036a3fe993213635fc6 (diff)
downloadguix-9d46919f9c0898f88e0635efeb837efcc9144fb9.tar.gz
gnu: Add perl-text-markdown-discount.
* gnu/packages/markdown.scm (perl-text-markdown-discount): New variable.
* gnu/packages/patches/perl-text-markdown-discount-use-system-markdown.patch:
  New file.
Diffstat (limited to 'gnu/packages/markup.scm')
-rw-r--r--gnu/packages/markup.scm46
1 files changed, 46 insertions, 0 deletions
diff --git a/gnu/packages/markup.scm b/gnu/packages/markup.scm
index e3630fe2f4..667f8b0a94 100644
--- a/gnu/packages/markup.scm
+++ b/gnu/packages/markup.scm
@@ -26,7 +26,9 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system perl)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages python)
   #:use-module (gnu packages web))
@@ -144,6 +146,50 @@ convert it to structurally valid XHTML (or HTML).")
     (home-page "http://www.pell.portland.or.us/~orc/Code/discount/")
     (license bsd-3)))
 
+(define-public perl-text-markdown-discount
+  (package
+    (name "perl-text-markdown-discount")
+    (version "0.11")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "mirror://cpan/authors/id/S/SE/SEKIMURA/Text-Markdown-Discount-"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "1xx7v3wnla7m6wa3h33whxw3vvincaicg4yra1b9wbzf2aix9rnw"))
+       (patches
+        (search-patches "perl-text-markdown-discount-use-system-markdown.patch"))))
+    (build-system perl-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'set-ldflags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "Makefile"
+               (("OTHERLDFLAGS = ")
+                (string-append
+                      "OTHERLDFLAGS = -lmarkdown -Wl,-rpath="
+                      (assoc-ref inputs "discount")
+                      "/lib"))))))))
+    (inputs
+     `(("discount" ,discount)))
+    (home-page
+     "http://search.cpan.org/dist/Text-Markdown-Discount")
+    (synopsis
+     "Fast function for converting Markdown to HTML using Discount")
+    (description
+     "Text::Markdown::Discount is a Perl extension to the Discount markdown
+implementation.
+
+@example
+  use Text::Markdown::Discount;
+  my $html = markdown($text)
+@end example")
+    (license perl-license)))
+
 (define-public cmark
   (package
     (name "cmark")