projects/guix·blob python-team · refs

111 lines · 4.9 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Ludovic Courtès <[email protected]>
3;;; Copyright © 2020 Tobias Geerinckx-Rice <[email protected]>
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 gexp)
22 #:use-module (guix packages)
23 #:use-module (guix git-download)
24 #:use-module (guix build-system gnu)
25 #:use-module (guix licenses)
26 #:use-module (gnu packages perl))
27
28(define-public noweb
29 (package
30 (name "noweb")
31 (version "2.13")
32 (source
33 (origin
34 (method git-fetch)
35 (uri (git-reference
36 (url "https://github.com/nrnrnr/noweb")
37 (commit (string-append "v" (string-join (string-split version #\.)
38 "_")))))
39 (file-name (git-file-name name version))
40 (sha256
41 (base32 "0fwngh7zl9mrjz966pskhi4zvk26j6vsm85x99df9194nv51drq8"))))
42 (build-system gnu-build-system)
43 (arguments
44 (list
45 #:make-flags
46 #~(list (string-append "BIN=" #$output "/bin")
47 (string-append "LIB=" #$output "/lib")
48 (string-append "MAN=" #$output "/share/man")
49 (string-append "TEXINPUTS=" #$output
50 "/share/texmf/tex/latex"))
51 #:modules
52 '((guix build gnu-build-system)
53 (guix build utils)
54 (srfi srfi-26))
55 #:phases
56 #~(modify-phases %standard-phases
57 (add-after 'unpack 'enter-source-directory
58 (lambda _
59 (chdir "src")))
60 (add-after 'enter-source-directory 'bind-early
61 (lambda _
62 (substitute* (list "lib/nwmtime"
63 "shell/htmltoc")
64 (("exec perl ")
65 (string-append "exec " (which "perl") " ")))
66 (substitute* "shell/noweb"
67 ((" cpif ")
68 (string-append " " #$output "/bin/cpif ")))))
69 (delete 'configure) ; no configure script
70 (add-before 'install 'create-latex-directory
71 (lambda _
72 (mkdir-p (string-append #$output "/share/texmf/tex/latex"))))
73 (add-after 'install 'refer-to-inputs
74 (lambda* (#:key inputs #:allow-other-keys)
75 (with-directory-excursion #$output
76 (for-each (lambda (program)
77 (substitute* program
78 (("nawk")
79 (search-input-file inputs "bin/awk"))))
80 (append (map (cut string-append "bin/" <>)
81 '("noweb" "nountangle"
82 "noroots" "noroff"
83 "noindex"))
84 (map (cut string-append "lib/" <>)
85 '("btdefn" "emptydefn" "noidx"
86 "pipedocs" "toascii" "tohtml"
87 "toroff" "totex" "unmarkup"))))
88 (substitute* "bin/cpif"
89 (("^PATH=.*$")
90 (string-append "PATH="
91 (dirname (search-input-file
92 inputs"bin/basename")) ":"
93 (dirname (search-input-file
94 inputs "bin/cmp"))
95 "\n")))))))
96 #:tests? #f)) ; no tests
97 (inputs
98 (list perl))
99 (home-page "https://www.cs.tufts.edu/~nr/noweb/")
100 (synopsis "Literate programming tool")
101 (description
102 "Noweb is designed to meet the needs of literate programmers while
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.")
109 (license
110 (list bsd-2 ; dual-licenced under this and…
111 (fsf-free "https://www.cs.tufts.edu/~nr/noweb/#copyright")))))