gnu: poke: Update to 1.3.
[jackhill/guix/guix.git] / gnu / packages / markup.scm
index 7ae73da..368976b 100644 (file)
@@ -3,8 +3,10 @@
 ;;; Copyright © 2015 David Thompson <davet@gnu.org>
 ;;; Copyright © 2016, 2019 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2017 Nikita <nikita@n0.is>
-;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2020 EuAndreh <eu@euandre.org>
+;;; Copyright © 2021 Noisytoot <noisytoot@disroot.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system perl)
+  #:use-module (guix build-system python)
+  #:use-module (guix utils)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages web))
 
@@ -43,7 +48,7 @@
     (source (origin
              (method git-fetch)
              (uri (git-reference
-                    (url "https://github.com/hoedown/hoedown.git")
+                    (url "https://github.com/hoedown/hoedown")
                     (commit version)))
              (file-name (git-file-name name version))
              (sha256
@@ -112,7 +117,7 @@ convert it to structurally valid XHTML (or HTML).")
 (define-public discount
   (package
     (name "discount")
-    (version "2.2.4")
+    (version "2.2.7")
     (source (origin
              (method url-fetch)
              (uri (string-append
@@ -120,10 +125,11 @@ convert it to structurally valid XHTML (or HTML).")
                    "discount/discount-" version ".tar.bz2"))
              (sha256
               (base32
-               "199hwajpspqil0a4y3yxsmhdp2dm73gqkzfk4mrwzsmlq8y1xzbl"))))
+               "024mxv0gpvilyfczarcgy5m7h4lv6qvhjfpf5i73qkxhszjjn9mi"))))
     (build-system gnu-build-system)
     (arguments
      `(#:test-target "test"
+       #:parallel-build? #f             ; libmarkdown won't be built in time
        #:make-flags (list
                      (string-append "LFLAGS=-L. -Wl,-rpath="
                                     (assoc-ref %outputs "out") "/lib"))
@@ -138,10 +144,15 @@ convert it to structurally valid XHTML (or HTML).")
              #t))
          (replace 'configure
            (lambda* (#:key inputs outputs #:allow-other-keys)
-             (setenv "CC" "gcc")
-             (invoke "./configure.sh"
-                     (string-append "--prefix=" (assoc-ref outputs "out"))
-                     "--shared"))))))
+             (let ((out (assoc-ref outputs "out")))
+               (setenv "CC" ,(cc-for-target))
+               ;; The ‘validate-runpath’ phase fails otherwise.
+               (setenv "LDFLAGS" (string-append "-Wl,-rpath=" out "/lib"))
+               (invoke "./configure.sh"
+                       (string-append "--prefix=" out)
+                       "--shared")))))))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
     (synopsis "Markdown processing library, written in C")
     (description
      "Discount is a markdown implementation, written in C.  It provides a
@@ -201,7 +212,7 @@ implementation.
     (source (origin
              (method git-fetch)
              (uri (git-reference
-                    (url "https://github.com/jgm/cmark.git")
+                    (url "https://github.com/jgm/cmark")
                     (commit version)))
              (file-name (git-file-name name version))
              (sha256
@@ -242,7 +253,7 @@ for parsing and rendering CommonMark.")
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/Gottox/smu.git")
+             (url "https://github.com/Gottox/smu")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
@@ -269,3 +280,47 @@ Smu was started as a rewrite of Markdown but became something more
 lightweight and consistent.  The biggest difference between Markdown
 and smu is that smu doesn't support reference style links.")
     (license x11)))
+
+(define-public md4c
+  (package
+    (name "md4c")
+    (version "0.4.8")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/mity/md4c/")
+             (commit (string-append "release-" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "12pdh4rfjc3b0cblj5nz3jksr2376lx8ay0vw5dwa1s97q09pczq"))))
+    (build-system cmake-build-system)
+    (arguments '(#:tests? #f))
+    (home-page "https://github.com/mity/md4c/")
+    (synopsis "C Markdown parser compliant to CommonMark")
+    (description "MD4C is a C Markdown parser with a
+SAX-like interface.  It is compliant to the CommonMark specification,
+with a few extensions.")
+    (license expat)))
+
+(define-public python-mistletoe
+  (package
+    (name "python-mistletoe")
+    (version "0.7.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "mistletoe" version))
+       (sha256
+        (base32 "18z6hqfnfjqnrcgfgl5pkj9ggf9yx0yyy94azcn1qf7hqn6g3l14"))))
+    (build-system python-build-system)
+    (home-page "https://github.com/miyuchina/mistletoe")
+    (synopsis "Extensible Markdown parser in pure Python")
+    (description
+     "The @code{mistletoe} Markdown parser is a CommonMark-compliant Markdown
+parser that supports definitions of custom tokens.
+
+Parsing Markdown into an abstract syntax tree also allows @code{mistletoe} to
+swap out renderers for different output formats, without touching any of the
+core components.")
+    (license expat)))