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