gnu: libdvdcss: Update to 1.4.3.
[jackhill/guix/guix.git] / gnu / packages / noweb.scm
CommitLineData
6d73e17b
LC
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
bd9f588b 3;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
6d73e17b
LC
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 noweb)
21 #:use-module (guix packages)
dc26c8c5 22 #:use-module (guix git-download)
6d73e17b 23 #:use-module (guix build-system gnu)
bd9f588b
TGR
24 #:use-module (guix licenses)
25 #:use-module (gnu packages perl))
6d73e17b
LC
26
27(define-public noweb
28 (package
29 (name "noweb")
dc26c8c5
TGR
30 (version "2.12")
31 (source
32 (origin
33 (method git-fetch)
34 (uri (git-reference
35 (url "https://github.com/nrnrnr/noweb")
36 (commit (string-append "v" (string-join (string-split version #\.)
37 "_")))))
9cd32821 38 (file-name (git-file-name name version))
dc26c8c5
TGR
39 (sha256
40 (base32 "1160i2ghgzqvnb44kgwd6s3p4jnk9668rmc15jlcwl7pdf3xqm95"))))
6d73e17b
LC
41 (build-system gnu-build-system)
42 (arguments
dc1d3cde
KK
43 '(#:phases
44 (modify-phases %standard-phases
bd9f588b
TGR
45 (add-after 'unpack 'bind-early
46 (lambda* (#:key outputs #:allow-other-keys)
47 (let* ((out (assoc-ref outputs "out"))
48 (bin (string-append out "/bin")))
49 (substitute* (list "src/lib/nwmtime"
50 "src/shell/htmltoc")
51 (("exec perl ")
52 (format #f "exec ~a " (which "perl"))))
53 (substitute* "src/shell/noweb"
54 ((" cpif ")
55 (format #f " ~a/cpif " bin)))
56 #t)))
dc1d3cde
KK
57 (add-before 'install 'pre-install
58 (lambda* (#:key outputs #:allow-other-keys)
59 (let ((out (assoc-ref outputs "out")))
60 (mkdir-p (string-append out "/share/texmf/tex/latex"))
61 #t)))
62 (add-after 'install 'post-install
63 (lambda* (#:key outputs inputs #:allow-other-keys)
64 (let ((out (assoc-ref outputs "out"))
65 (cu (assoc-ref inputs "coreutils"))
66 (du (assoc-ref inputs "diffutils")))
67 (with-directory-excursion out
68 (for-each (lambda (prog)
69 (substitute* prog
70 (("nawk") (which "awk"))))
71 (append (map (lambda (x)
72 (string-append "bin/" x))
73 '("noweb" "nountangle"
74 "noroots" "noroff"
75 "noindex"))
76 (map (lambda (x)
77 (string-append "lib/" x))
78 '("btdefn" "emptydefn" "noidx"
79 "pipedocs" "toascii" "tohtml"
80 "toroff" "totex" "unmarkup"))))
81 (substitute* "bin/cpif"
82 (("^PATH=.*$")
83 (string-append "PATH=" cu "/bin:" du "/bin\n"))))
84 #t)))
85 (replace 'configure
86 (lambda _
87 ;; Jump in the source.
88 (chdir "src")
dc1d3cde 89 #t)))
6d73e17b
LC
90 #:make-flags (let ((out (assoc-ref %outputs "out")))
91 (list (string-append "BIN=" out "/bin")
92 (string-append "LIB=" out "/lib")
93 (string-append "MAN=" out "/share/man")
94 (string-append "TEXINPUTS=" out
95 "/share/texmf/tex/latex")))
96 #:tests? #f)) ; no tests
bd9f588b
TGR
97 (inputs
98 `(("perl" ,perl)))
2c31cf87 99 (home-page "https://www.cs.tufts.edu/~nr/noweb/")
6d73e17b
LC
100 (synopsis "Literate programming tool")
101 (description
35b9e423 102 "Noweb is designed to meet the needs of literate programmers while
6d73e17b
LC
103remaining as simple as possible. Its primary advantages are simplicity,
104extensibility, and language-independence—especially noticeable when compared
105with other literate-programming tools. noweb uses 5 control sequences to
106WEB's 27. The noweb manual is only 4 pages; an additional page explains how
107to customize its LaTeX output. noweb works “out of the box” with any
108programming language, and supports TeX, LaTeX, HTML, and troff back ends.")
dc26c8c5
TGR
109 (license
110 (list bsd-2 ; dual-licenced under this and…
111 (fsf-free "https://www.cs.tufts.edu/~nr/noweb/#copyright")))))