1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;; This file is part of GNU Guix.
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.
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.
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/>.
20 (define-module (gnu packages noweb)
21 #:use-module (guix packages)
22 #:use-module (guix git-download)
23 #:use-module (guix build-system gnu)
24 #:use-module (guix licenses)
25 #:use-module (gnu packages perl))
35 (url "https://github.com/nrnrnr/noweb")
36 (commit (string-append "v" (string-join (string-split version #\.)
38 (file-name (git-file-name name version))
40 (base32 "1160i2ghgzqvnb44kgwd6s3p4jnk9668rmc15jlcwl7pdf3xqm95"))))
41 (build-system gnu-build-system)
44 (modify-phases %standard-phases
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"
52 (format #f "exec ~a " (which "perl"))))
53 (substitute* "src/shell/noweb"
55 (format #f " ~a/cpif " bin)))
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"))
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)
70 (("nawk") (which "awk"))))
71 (append (map (lambda (x)
72 (string-append "bin/" x))
73 '("noweb" "nountangle"
77 (string-append "lib/" x))
78 '("btdefn" "emptydefn" "noidx"
79 "pipedocs" "toascii" "tohtml"
80 "toroff" "totex" "unmarkup"))))
81 (substitute* "bin/cpif"
83 (string-append "PATH=" cu "/bin:" du "/bin\n"))))
87 ;; Jump in the source.
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
99 (home-page "https://www.cs.tufts.edu/~nr/noweb/")
100 (synopsis "Literate programming tool")
102 "Noweb is designed to meet the needs of literate programmers while
103 remaining as simple as possible. Its primary advantages are simplicity,
104 extensibility, and language-independence—especially noticeable when compared
105 with other literate-programming tools. noweb uses 5 control sequences to
106 WEB's 27. The noweb manual is only 4 pages; an additional page explains how
107 to customize its LaTeX output. noweb works “out of the box” with any
108 programming language, and supports TeX, LaTeX, HTML, and troff back ends.")
110 (list bsd-2 ; dual-licenced under this and…
111 (fsf-free "https://www.cs.tufts.edu/~nr/noweb/#copyright")))))