gnu: noweb: Use G-expressions.

* gnu/packages/noweb.scm (noweb)[arguments]:
Rewrite as G-expressions.  Don't explicitly return #t from phases.
This commit is contained in:
Tobias Geerinckx-Rice 2023-08-13 02:00:00 +02:00
parent e4a876d45d
commit 74f707d76d
No known key found for this signature in database
GPG Key ID: 0DB0FF884F556D79

View File

@ -18,6 +18,7 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages noweb) (define-module (gnu packages noweb)
#:use-module (guix gexp)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (guix git-download) #:use-module (guix git-download)
#:use-module (guix build-system gnu) #:use-module (guix build-system gnu)
@ -40,60 +41,59 @@
(base32 "1160i2ghgzqvnb44kgwd6s3p4jnk9668rmc15jlcwl7pdf3xqm95")))) (base32 "1160i2ghgzqvnb44kgwd6s3p4jnk9668rmc15jlcwl7pdf3xqm95"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
'(#:phases (list
(modify-phases %standard-phases #:make-flags
(add-after 'unpack 'bind-early #~(list (string-append "BIN=" #$output "/bin")
(lambda* (#:key outputs #:allow-other-keys) (string-append "LIB=" #$output "/lib")
(let* ((out (assoc-ref outputs "out")) (string-append "MAN=" #$output "/share/man")
(bin (string-append out "/bin"))) (string-append "TEXINPUTS=" #$output
(substitute* (list "src/lib/nwmtime" "/share/texmf/tex/latex"))
"src/shell/htmltoc") #:modules
(("exec perl ") '((guix build gnu-build-system)
(format #f "exec ~a " (which "perl")))) (guix build utils)
(substitute* "src/shell/noweb" (srfi srfi-26))
((" cpif ") #:phases
(format #f " ~a/cpif " bin))) #~(modify-phases %standard-phases
#t))) (add-after 'unpack 'enter-source-directory
(add-before 'install 'pre-install (lambda _
(lambda* (#:key outputs #:allow-other-keys) (chdir "src")))
(let ((out (assoc-ref outputs "out"))) (add-after 'enter-source-directory 'bind-early
(mkdir-p (string-append out "/share/texmf/tex/latex")) (lambda _
#t))) (substitute* (list "lib/nwmtime"
(add-after 'install 'post-install "shell/htmltoc")
(lambda* (#:key outputs inputs #:allow-other-keys) (("exec perl ")
(let ((out (assoc-ref outputs "out")) (string-append "exec " (which "perl") " ")))
(cu (assoc-ref inputs "coreutils")) (substitute* "shell/noweb"
(du (assoc-ref inputs "diffutils"))) ((" cpif ")
(with-directory-excursion out (string-append " " #$output "/bin/cpif ")))))
(for-each (lambda (prog) (delete 'configure) ; no configure script
(substitute* prog (add-before 'install 'create-latex-directory
(("nawk") (which "awk")))) (lambda _
(append (map (lambda (x) (mkdir-p (string-append #$output "/share/texmf/tex/latex"))))
(string-append "bin/" x)) (add-after 'install 'refer-to-inputs
'("noweb" "nountangle" (lambda* (#:key inputs #:allow-other-keys)
"noroots" "noroff" (with-directory-excursion #$output
"noindex")) (for-each (lambda (program)
(map (lambda (x) (substitute* program
(string-append "lib/" x)) (("nawk")
'("btdefn" "emptydefn" "noidx" (search-input-file inputs "bin/awk"))))
"pipedocs" "toascii" "tohtml" (append (map (cut string-append "bin/" <>)
"toroff" "totex" "unmarkup")))) '("noweb" "nountangle"
(substitute* "bin/cpif" "noroots" "noroff"
(("^PATH=.*$") "noindex"))
(string-append "PATH=" cu "/bin:" du "/bin\n")))) (map (cut string-append "lib/" <>)
#t))) '("btdefn" "emptydefn" "noidx"
(replace 'configure "pipedocs" "toascii" "tohtml"
(lambda _ "toroff" "totex" "unmarkup"))))
;; Jump in the source. (substitute* "bin/cpif"
(chdir "src") (("^PATH=.*$")
#t))) (string-append "PATH="
#:make-flags (let ((out (assoc-ref %outputs "out"))) (dirname (search-input-file
(list (string-append "BIN=" out "/bin") inputs"bin/basename")) ":"
(string-append "LIB=" out "/lib") (dirname (search-input-file
(string-append "MAN=" out "/share/man") inputs "bin/cmp"))
(string-append "TEXINPUTS=" out "\n")))))))
"/share/texmf/tex/latex"))) #:tests? #f)) ; no tests
#:tests? #f)) ; no tests
(inputs (inputs
(list perl)) (list perl))
(home-page "https://www.cs.tufts.edu/~nr/noweb/") (home-page "https://www.cs.tufts.edu/~nr/noweb/")