gnu: Add chez-nanopass.

* gnu/packages/chez.scm (nanopass): Rename to ...
(chez-nanopass-bootstrap): ... this new variable, and promote it from an
origin to a package.
(chez-nanopass): New variable.
(unpack-nanopass+stex): New variable using 'chez-nanopass-bootstrap'.
(chez-scheme-for-racket-bootstrap-bootfiles)
(chez-scheme)[native-inputs]: Add 'chez-nanopass-bootstrap'.
[arguments]<#:phases>: Adapt 'unpack-nanopass+stex' phase
to use the new variable.
* gnu/packages/racket.scm (racket-vm-cs): Likewise.
(make-unpack-nanopass+stex): Remove it.

Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
This commit is contained in:
Philip McGrath 2022-02-27 16:29:15 -05:00 committed by Liliana Marie Prikler
parent e8518c43a3
commit 6bca38f282
No known key found for this signature in database
GPG key ID: 442A84B8C70E2F87
2 changed files with 98 additions and 43 deletions

View file

@ -254,22 +254,6 @@
"--enable-origtree"
,(string-append "--prefix=" #$output "/opt/racket-vm")))
(define (make-unpack-nanopass+stex)
;; Adapted from chez-scheme.
;; Thunked to avoid evaluating 'chez-scheme' too early.
;; TODO: Refactor enough to share this directly.
#~(begin
(copy-recursively
#$nanopass
"nanopass"
#:keep-mtime? #t)
(mkdir-p "stex")
(with-output-to-file "stex/Mf-stex"
(lambda ()
;; otherwise, it will try to download submodules
(display "# to placate ../configure")))))
(define-public racket-vm-cgc
;; Eventually, it may make sense for some vm packages to not be hidden,
;; but this one is especially likely to remain hidden.
@ -387,6 +371,7 @@ collector, 3M (``Moving Memory Manager'').")
(modify-inputs (package-native-inputs racket-vm-cgc)
(delete "libtool")
(prepend chez-scheme-for-racket-bootstrap-bootfiles
chez-nanopass-bootstrap
racket-vm-bc)))
(arguments
(substitute-keyword-arguments (package-arguments racket-vm-cgc)
@ -395,7 +380,7 @@ collector, 3M (``Moving Memory Manager'').")
(add-after 'unpack 'unpack-nanopass+stex
(lambda args
(with-directory-excursion "racket/src/ChezScheme"
#$(make-unpack-nanopass+stex))))
#$unpack-nanopass+stex)))
(add-after 'unpack-nanopass+stex 'unpack-bootfiles
(lambda* (#:key native-inputs inputs #:allow-other-keys)
(with-directory-excursion "racket/src/ChezScheme"