gnu: igt-gpu-tools: Don't use NAME in source URI.
[jackhill/guix/guix.git] / gnu / packages / markup.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Mathieu Lirzin <mthl@openmailbox.org>
3 ;;; Copyright © 2015 David Thompson <davet@gnu.org>
4 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
6 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;;
8 ;;; This file is part of GNU Guix.
9 ;;;
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
14 ;;;
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
19 ;;;
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23 (define-module (gnu packages markup)
24 #:use-module (guix licenses)
25 #:use-module (guix download)
26 #:use-module (guix packages)
27 #:use-module (guix build-system gnu)
28 #:use-module (guix build-system trivial)
29 #:use-module (guix build-system cmake)
30 #:use-module (guix build-system perl)
31 #:use-module (gnu packages compression)
32 #:use-module (gnu packages)
33 #:use-module (gnu packages perl)
34 #:use-module (gnu packages python)
35 #:use-module (gnu packages web))
36
37 (define-public hoedown
38 (package
39 (name "hoedown")
40 (version "3.0.7")
41 (source (origin
42 (method url-fetch)
43 (uri (string-append "https://github.com/hoedown/hoedown/archive/"
44 version ".tar.gz"))
45 (file-name (string-append name "-" version ".tar.gz"))
46 (sha256
47 (base32
48 "0859dc2xjasd6kgkshi8mb20kbyw5sql1ln0hw3bfaf33qdh5dh1"))))
49 (build-system gnu-build-system)
50 (arguments
51 '(#:make-flags (list "CC=gcc" (string-append "PREFIX=" %output))
52 #:phases (modify-phases %standard-phases
53 (delete 'configure)) ; no configure script
54 #:test-target "test"))
55 (native-inputs
56 `(("python" ,python-2)
57 ("tidy" ,tidy)))
58 (synopsis "Markdown processing library")
59 (description "Hoedown is a standards compliant, fast, secure markdown
60 processing library written in C.")
61 (home-page "https://github.com/hoedown/hoedown")
62 (license expat)))
63
64 (define-public markdown
65 (package
66 (name "markdown")
67 (version "1.0.1")
68 (source
69 (origin
70 (method url-fetch)
71 (uri (string-append
72 "http://daringfireball.net/projects/downloads/"
73 (string-capitalize name) "_" version ".zip"))
74 (sha256
75 (base32 "0dq1pj91pvlwkv0jwcgdfpv6gvnxzrk3s8mnh7imamcclnvfj835"))))
76 (build-system trivial-build-system)
77 (arguments
78 '(#:modules ((guix build utils))
79 #:builder
80 (begin
81 (use-modules (guix build utils))
82 (let ((source (assoc-ref %build-inputs "source"))
83 (out (assoc-ref %outputs "out"))
84 (perlbd (string-append (assoc-ref %build-inputs "perl") "/bin"))
85 (unzip (string-append (assoc-ref %build-inputs "unzip")
86 "/bin/unzip")))
87 (mkdir-p out)
88 (with-directory-excursion out
89 (invoke unzip source)
90 (mkdir "bin")
91 (mkdir-p "share/doc")
92 (rename-file "Markdown_1.0.1/Markdown.pl" "bin/markdown")
93 (rename-file "Markdown_1.0.1/Markdown Readme.text"
94 "share/doc/README")
95 (patch-shebang "bin/markdown" (list perlbd))
96 (delete-file-recursively "Markdown_1.0.1"))
97 #t))))
98 (native-inputs `(("unzip" ,unzip)))
99 (inputs `(("perl" ,perl)))
100 (home-page "http://daringfireball.net/projects/markdown")
101 (synopsis "Text-to-HTML conversion tool")
102 (description
103 "Markdown is a text-to-HTML conversion tool for web writers. It allows
104 you to write using an easy-to-read, easy-to-write plain text format, then
105 convert it to structurally valid XHTML (or HTML).")
106 (license (non-copyleft "file://License.text"
107 "See License.text in the distribution."))))
108
109 (define-public discount
110 (package
111 (name "discount")
112 (version "2.2.4")
113 (source (origin
114 (method url-fetch)
115 (uri (string-append
116 "http://www.pell.portland.or.us/~orc/Code/"
117 name "/" name "-" version ".tar.bz2"))
118 (sha256
119 (base32
120 "199hwajpspqil0a4y3yxsmhdp2dm73gqkzfk4mrwzsmlq8y1xzbl"))))
121 (build-system gnu-build-system)
122 (arguments
123 `(#:test-target "test"
124 #:make-flags (list
125 (string-append "LFLAGS=-L. -Wl,-rpath="
126 (assoc-ref %outputs "out") "/lib"))
127 #:phases
128 (modify-phases %standard-phases
129 (add-before 'configure 'set-AC_PATH
130 (lambda _
131 ;; The default value is not suitable, so override using an
132 ;; environment variable. This just affects the build, and not the
133 ;; resulting store item.
134 (setenv "AC_PATH" (getenv "PATH"))
135 #t))
136 (replace 'configure
137 (lambda* (#:key inputs outputs #:allow-other-keys)
138 (setenv "CC" "gcc")
139 (invoke "./configure.sh"
140 (string-append "--prefix=" (assoc-ref outputs "out"))
141 "--shared"))))))
142 (synopsis "Markdown processing library, written in C")
143 (description
144 "Discount is a markdown implementation, written in C. It provides a
145 @command{markdown} command, and a library.")
146 (home-page "https://www.pell.portland.or.us/~orc/Code/discount/")
147 (license bsd-3)))
148
149 (define-public perl-text-markdown-discount
150 (package
151 (name "perl-text-markdown-discount")
152 (version "0.11")
153 (source
154 (origin
155 (method url-fetch)
156 (uri (string-append
157 "mirror://cpan/authors/id/S/SE/SEKIMURA/Text-Markdown-Discount-"
158 version
159 ".tar.gz"))
160 (sha256
161 (base32
162 "1xx7v3wnla7m6wa3h33whxw3vvincaicg4yra1b9wbzf2aix9rnw"))
163 (patches
164 (search-patches "perl-text-markdown-discount-unbundle.patch"))))
165 (build-system perl-build-system)
166 (arguments
167 `(#:phases
168 (modify-phases %standard-phases
169 (add-before 'build 'set-ldflags
170 (lambda* (#:key inputs #:allow-other-keys)
171 (substitute* "Makefile"
172 (("OTHERLDFLAGS = ")
173 (string-append
174 "OTHERLDFLAGS = -lmarkdown -Wl,-rpath="
175 (assoc-ref inputs "discount")
176 "/lib")))
177 #t)))))
178 (inputs
179 `(("discount" ,discount)))
180 (home-page
181 "https://metacpan.org/release/Text-Markdown-Discount")
182 (synopsis
183 "Fast function for converting Markdown to HTML using Discount")
184 (description
185 "Text::Markdown::Discount is a Perl extension to the Discount markdown
186 implementation.
187
188 @example
189 use Text::Markdown::Discount;
190 my $html = markdown($text)
191 @end example")
192 (license perl-license)))
193
194 (define-public cmark
195 (package
196 (name "cmark")
197 (version "0.28.3")
198 (source (origin
199 (method url-fetch)
200 (uri (string-append "https://github.com/jgm/cmark/archive/"
201 version ".tar.gz"))
202 (file-name (string-append name "-" version ".tar.gz"))
203 (sha256
204 (base32
205 "1z71pacl3ni1286c206pl8lazbcd32ackivsg3zibdf1sf2qdjdc"))))
206 (build-system cmake-build-system)
207 (arguments
208 '(#:test-target "test"))
209 (native-inputs `(("python" ,python)))
210 (synopsis "CommonMark Markdown reference implementation")
211 (description "CommonMark is a strongly defined, highly compatible
212 specification of Markdown. cmark is the C reference implementation of
213 CommonMark. It provides @code{libcmark} shared library for parsing
214 CommonMark to an abstract syntax tree (@dfn{AST}) and rendering the document
215 as HTML, groff man, LaTeX, CommonMark, or an XML representation of the
216 AST. The package also provides the command-line program @command{cmark}
217 for parsing and rendering CommonMark.")
218 (home-page "http://commonmark.org")
219 ;; cmark is distributed with a BSD-2 license, but some components are Expat
220 ;; licensed. The CommonMark specification is Creative Commons CC-BY-SA 4.0
221 ;; licensed. See 'COPYING' in the source distribution for more information.
222 (license (list bsd-2 expat cc-by-sa4.0))))
223
224 (define-public smu
225 (package
226 (name "smu")
227 (version "1.4")
228 (source
229 (origin
230 (method url-fetch)
231 (uri (string-append "https://github.com/Gottox/smu/archive/v"
232 version ".tar.gz"))
233 (file-name (string-append name "-" version ".tar.gz"))
234 (sha256
235 (base32
236 "0iazl45rkz8ngsb5hpykl76w0ngvdvqqhym1qz5wykgmrzk293rp"))))
237 (build-system gnu-build-system)
238 (arguments
239 `(#:make-flags (list "CC=gcc"
240 (string-append "PREFIX="
241 (assoc-ref %outputs "out")))
242 #:tests? #f ;No tests included
243 #:phases
244 (modify-phases %standard-phases
245 (delete 'configure))))
246 (home-page "https://github.com/Gottox/smu")
247 (synopsis "Simple markup")
248 (description
249 "Smu is a very simple and minimal markup language. It is
250 designed for using in wiki-like environments. Smu makes it very
251 easy to write your documents on the fly and convert them into HTML.
252 Smu is capable to parse very large documents. As long as you avoid an huge
253 amount of indents it scales just great.
254
255 Smu was started as a rewrite of Markdown but became something more
256 lightweight and consistent. The biggest difference between Markdown
257 and smu is that smu doesn't support reference style links.")
258 (license x11)))