noweb.scm 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
  3. ;;;
  4. ;;; This file is part of GNU Guix.
  5. ;;;
  6. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  7. ;;; under the terms of the GNU General Public License as published by
  8. ;;; the Free Software Foundation; either version 3 of the License, or (at
  9. ;;; your option) any later version.
  10. ;;;
  11. ;;; GNU Guix is distributed in the hope that it will be useful, but
  12. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;;; GNU General Public License for more details.
  15. ;;;
  16. ;;; You should have received a copy of the GNU General Public License
  17. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  18. (define-module (gnu packages noweb)
  19. #:use-module (guix packages)
  20. #:use-module (guix download)
  21. #:use-module (guix build-system gnu)
  22. #:use-module (guix licenses))
  23. (define-public noweb
  24. (package
  25. (name "noweb")
  26. (version "2.11b")
  27. (source (origin
  28. (method url-fetch)
  29. (uri (string-append "ftp://www.eecs.harvard.edu/pub/nr/noweb-"
  30. version ".tgz"))
  31. (sha256
  32. (base32
  33. "10hdd6mrk26kyh4bnng4ah5h1pnanhsrhqa7qwqy6dyv3rng44y9"))))
  34. (build-system gnu-build-system)
  35. (arguments
  36. '(#:phases
  37. (modify-phases %standard-phases
  38. (add-before 'install 'pre-install
  39. (lambda* (#:key outputs #:allow-other-keys)
  40. (let ((out (assoc-ref outputs "out")))
  41. (mkdir-p (string-append out "/share/texmf/tex/latex"))
  42. #t)))
  43. (add-after 'install 'post-install
  44. (lambda* (#:key outputs inputs #:allow-other-keys)
  45. (let ((out (assoc-ref outputs "out"))
  46. (cu (assoc-ref inputs "coreutils"))
  47. (du (assoc-ref inputs "diffutils")))
  48. (with-directory-excursion out
  49. (for-each (lambda (prog)
  50. (substitute* prog
  51. (("nawk") (which "awk"))))
  52. (append (map (lambda (x)
  53. (string-append "bin/" x))
  54. '("noweb" "nountangle"
  55. "noroots" "noroff"
  56. "noindex"))
  57. (map (lambda (x)
  58. (string-append "lib/" x))
  59. '("btdefn" "emptydefn" "noidx"
  60. "pipedocs" "toascii" "tohtml"
  61. "toroff" "totex" "unmarkup"))))
  62. (substitute* "bin/cpif"
  63. (("^PATH=.*$")
  64. (string-append "PATH=" cu "/bin:" du "/bin\n"))))
  65. #t)))
  66. (replace 'configure
  67. (lambda _
  68. ;; Jump in the source.
  69. (chdir "src")
  70. ;; The makefile reads "source: FAQ", but FAQ isn't
  71. ;; available.
  72. (substitute* "Makefile"
  73. (("FAQ") ""))
  74. #t)))
  75. #:make-flags (let ((out (assoc-ref %outputs "out")))
  76. (list (string-append "BIN=" out "/bin")
  77. (string-append "LIB=" out "/lib")
  78. (string-append "MAN=" out "/share/man")
  79. (string-append "TEXINPUTS=" out
  80. "/share/texmf/tex/latex")))
  81. #:tests? #f)) ; no tests
  82. (home-page "http://www.cs.tufts.edu/~nr/noweb/")
  83. (synopsis "Literate programming tool")
  84. (description
  85. "Noweb is designed to meet the needs of literate programmers while
  86. remaining as simple as possible. Its primary advantages are simplicity,
  87. extensibility, and language-independence—especially noticeable when compared
  88. with other literate-programming tools. noweb uses 5 control sequences to
  89. WEB's 27. The noweb manual is only 4 pages; an additional page explains how
  90. to customize its LaTeX output. noweb works “out of the box” with any
  91. programming language, and supports TeX, LaTeX, HTML, and troff back ends.")
  92. (license (fsf-free "http://www.cs.tufts.edu/~nr/noweb/#copyright"))))