| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 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) |
| 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)) |
| 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
|
| 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.")
|
| 109 | (license
|
| 110 | (list bsd-2 |
| 111 | (fsf-free "https://www.cs.tufts.edu/~nr/noweb/#copyright")))))
|