all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [v2 0/1] Add peg-markdown with proper manpages
@ 2015-11-28 21:32 Leo Famulari
  2015-11-28 21:32 ` [v2 1/1] gnu: Add peg-markdown Leo Famulari
  0 siblings, 1 reply; 3+ messages in thread
From: Leo Famulari @ 2015-11-28 21:32 UTC (permalink / raw)
  To: guix-devel

This revised patch provides peg-markdown, an extensible converter from
markdown to HTML, LaTeX, ODF, and groff_mm.

The revisions makes sure that the manpage is available for both `man
peg` and `man leg`, since it documents both programs.

Leo Famulari (1):
  gnu: Add peg-markdown.

 gnu/packages/markdown.scm | 63 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)

-- 
2.6.2

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [v2 1/1] gnu: Add peg-markdown.
  2015-11-28 21:32 [v2 0/1] Add peg-markdown with proper manpages Leo Famulari
@ 2015-11-28 21:32 ` Leo Famulari
  2015-11-29 10:21   ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Leo Famulari @ 2015-11-28 21:32 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/markdown.scm (peg-markdown): New variable.
---
 gnu/packages/markdown.scm | 63 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)

diff --git a/gnu/packages/markdown.scm b/gnu/packages/markdown.scm
index a20eef6..e90329a 100644
--- a/gnu/packages/markdown.scm
+++ b/gnu/packages/markdown.scm
@@ -23,8 +23,11 @@
   #:use-module (guix packages)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
+  #:use-module (gnu packages glib)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages valgrind)
   #:use-module (gnu packages web)
   #:use-module (gnu packages zip))
 
@@ -98,3 +101,63 @@ you to write using an easy-to-read, easy-to-write plain text format, then
 convert it to structurally valid XHTML (or HTML).")
     (license (non-copyleft "file://License.text"
                            "See License.text in the distribution."))))
+
+(define-public peg-markdown
+  (package
+    (name "peg-markdown")
+    (version "0.4.14")
+    (source (origin
+             (method url-fetch)
+             (uri (string-append
+                  "https://github.com/jgm/peg-markdown/archive/"
+                  version ".tar.gz"))
+             (file-name (string-append name "-" version ".tar.gz"))
+             (sha256
+              (base32
+               "1019f6hy1njmiigz16rrdgncrxz235sfq6zi1a4i3vfgb1hca6qi"))))
+    (build-system gnu-build-system)
+    (arguments
+      `(#:test-target "test"
+        #:make-flags (list "CC=gcc")
+        #:phases (modify-phases %standard-phases
+                   (delete 'configure)
+                   ;; The Makefile offers a memory leak test using
+                   ;; Valgrind.
+                   (add-after 'check 'leak-check
+                              (lambda _
+                                (zero? (system* "make" "leak-check"))))
+                  (replace
+                    'install
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      ;; The Makefile does not check if the output paths exist.
+                      (let* ((out (assoc-ref %outputs "out"))
+                             (bin (string-append out "/bin"))
+                             (doc (string-append out "/share/man/man1")))
+                        (mkdir-p bin)
+                        ;; The top-level Makefile does not have an install
+                        ;; target, so we have to do this manually.
+                        (zero?
+                          (system* "make" "-C" "peg-0.1.4"
+                                   (string-append "PREFIX=" %output)
+                                   "CC=gcc" "install"))
+                        ;; The Makefile does not install the manpage.
+                        (install-file "peg-0.1.4/peg.1" doc)
+                        ;; The manpage applies to both peg and leg.
+                        (symlink
+                          (string-append doc "/peg.1")
+                          (string-append doc "/leg.1"))
+                        #t))))))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("valgrind" ,valgrind)))
+    (inputs
+      `(("perl" ,perl)
+        ("glib" ,glib)))
+    (synopsis "Implementation of markdown in C, using a PEG grammar")
+    (description "This is an implementation of John Gruber's markdown in C.  It
+uses a parsing expression grammar (PEG) to define the syntax.  This should allow
+easy modification and extension.  It currently supports output in HTML, LaTeX,
+ODF, or groff_mm formats.  Both a library and a standalone program are
+provided.")
+    (home-page "https://github.com/jgm/peg-markdown")
+    (license (list gpl2+ expat)))) ; Dual-licensed
-- 
2.6.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [v2 1/1] gnu: Add peg-markdown.
  2015-11-28 21:32 ` [v2 1/1] gnu: Add peg-markdown Leo Famulari
@ 2015-11-29 10:21   ` Ludovic Courtès
  0 siblings, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2015-11-29 10:21 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

Leo Famulari <leo@famulari.name> skribis:

> * gnu/packages/markdown.scm (peg-markdown): New variable.

[...]

> +                   ;; The Makefile offers a memory leak test using
> +                   ;; Valgrind.
> +                   (add-after 'check 'leak-check
> +                              (lambda _
> +                                (zero? (system* "make" "leak-check"))))

The opening parenthesis can be aligned below the ‘d’ of ‘add-after’.

> +                  (replace
> +                    'install
> +                    (lambda* (#:key outputs #:allow-other-keys)

Ditto, with ‘install’ moved to the previous line.

> +                      ;; The Makefile does not check if the output paths exist.
> +                      (let* ((out (assoc-ref %outputs "out"))
> +                             (bin (string-append out "/bin"))
> +                             (doc (string-append out "/share/man/man1")))
> +                        (mkdir-p bin)
> +                        ;; The top-level Makefile does not have an install
> +                        ;; target, so we have to do this manually.
> +                        (zero?
> +                          (system* "make" "-C" "peg-0.1.4"
> +                                   (string-append "PREFIX=" %output)
> +                                   "CC=gcc" "install"))
> +                        ;; The Makefile does not install the manpage.
> +                        (install-file "peg-0.1.4/peg.1" doc)
> +                        ;; The manpage applies to both peg and leg.
> +                        (symlink
> +                          (string-append doc "/peg.1")
> +                          (string-append doc "/leg.1"))
> +                        #t))))))

The return value of ‘zero?’ is ignored here.

To address this and clarify the code, what about making the
symlink-manpage thing a separate phase, added after ‘install’?

> +    (synopsis "Implementation of markdown in C, using a PEG grammar")

Capitalize “Markdown” (?); I think it’s fine to remove “using a PEG
grammar”, which is more of an implementation detail and is explained in
the description.

> +    (description "This is an implementation of John Gruber's markdown in C.  It
> +uses a parsing expression grammar (PEG) to define the syntax.  This should allow

Make sure lines are below 80 chars.

Could you send an updated patch?

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-29 10:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-28 21:32 [v2 0/1] Add peg-markdown with proper manpages Leo Famulari
2015-11-28 21:32 ` [v2 1/1] gnu: Add peg-markdown Leo Famulari
2015-11-29 10:21   ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.