gnu: Move markdown to (gnu packages markdown).
[jackhill/guix/guix.git] / gnu / packages / markdown.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 ;;;
5 ;;; This file is part of GNU Guix.
6 ;;;
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
11 ;;;
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
16 ;;;
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20 (define-module (gnu packages markdown)
21 #:use-module (guix licenses)
22 #:use-module (guix download)
23 #:use-module (guix packages)
24 #:use-module (guix build-system gnu)
25 #:use-module (guix build-system trivial)
26 #:use-module (gnu packages perl)
27 #:use-module (gnu packages python)
28 #:use-module (gnu packages web)
29 #:use-module (gnu packages zip))
30
31 (define-public hoedown
32 (package
33 (name "hoedown")
34 (version "3.0.3")
35 (source (origin
36 (method url-fetch)
37 (uri (string-append "https://github.com/hoedown/hoedown/archive/"
38 version ".tar.gz"))
39 (file-name (string-append name "-" version ".tar.gz"))
40 (sha256
41 (base32
42 "0mmmkfayqgh6k39kbi3pq68mg03x35aiygy3zypxzvwx9y8b53ky"))))
43 (build-system gnu-build-system)
44 (arguments
45 '(#:make-flags (list "CC=gcc" (string-append "PREFIX=" %output))
46 #:phases (modify-phases %standard-phases
47 (delete 'configure)) ; no configure script
48 #:test-target "test"))
49 (native-inputs
50 `(("python" ,python-2)
51 ("tidy" ,tidy)))
52 (synopsis "Markdown processing library")
53 (description "Hoedown is a standards compliant, fast, secure markdown
54 processing library written in C.")
55 (home-page "https://github.com/hoedown/hoedown")
56 (license expat)))
57
58 (define-public markdown
59 (package
60 (name "markdown")
61 (version "1.0.1")
62 (source
63 (origin
64 (method url-fetch)
65 (uri (string-append
66 "http://daringfireball.net/projects/downloads/"
67 (string-capitalize name) "_" version ".zip"))
68 (sha256
69 (base32 "0dq1pj91pvlwkv0jwcgdfpv6gvnxzrk3s8mnh7imamcclnvfj835"))))
70 (build-system trivial-build-system)
71 (arguments
72 '(#:modules ((guix build utils))
73 #:builder
74 (begin
75 (use-modules (guix build utils))
76 (let ((source (assoc-ref %build-inputs "source"))
77 (out (assoc-ref %outputs "out"))
78 (perlbd (string-append (assoc-ref %build-inputs "perl") "/bin"))
79 (unzip (string-append (assoc-ref %build-inputs "unzip")
80 "/bin/unzip")))
81 (mkdir-p out)
82 (with-directory-excursion out
83 (system* unzip source)
84 (mkdir "bin")
85 (mkdir-p "share/doc")
86 (rename-file "Markdown_1.0.1/Markdown.pl" "bin/markdown")
87 (rename-file "Markdown_1.0.1/Markdown Readme.text"
88 "share/doc/README")
89 (patch-shebang "bin/markdown" (list perlbd))
90 (delete-file-recursively "Markdown_1.0.1"))))))
91 (native-inputs `(("unzip" ,unzip)))
92 (inputs `(("perl" ,perl)))
93 (home-page "http://daringfireball.net/projects/markdown")
94 (synopsis "Text-to-HTML conversion tool")
95 (description
96 "Markdown is a text-to-HTML conversion tool for web writers. It allows
97 you to write using an easy-to-read, easy-to-write plain text format, then
98 convert it to structurally valid XHTML (or HTML).")
99 (license (non-copyleft "file://License.text"
100 "See License.text in the distribution."))))