[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#53878] [RFC PATCH 7/9] gnu: chez-scheme: Explicitly package bootstr
From: |
Philip McGrath |
Subject: |
[bug#53878] [RFC PATCH 7/9] gnu: chez-scheme: Explicitly package bootstrap bootfiles. |
Date: |
Tue, 8 Feb 2022 10:18:55 -0500 |
This might seem a bit silly in isolation, but it makes the structure of
the upstream Chez Scheme package the same as for the Racket variant, it
sets things up for (one day, hopefully) actually being able to bootstrap
the upstream Chez Scheme bootfiles, and it may be useful for
cross-compilation and adding support for architectures without pre-built
bootfiles from upstream.
* gnu/packages/chez-and-racket-bootstrap.scm
(chez-scheme-bootstrap-bootfiles): New variable.
(chez-scheme)[native-inputs]: Add it.
[arguments]: Add new phase 'unpack-bootfiles'.
[version, source, home-page]: Derive from 'chez-scheme-bootstrap-bootfiles'.
---
gnu/packages/chez-and-racket-bootstrap.scm | 57 ++++++++++++++++++++--
1 file changed, 52 insertions(+), 5 deletions(-)
diff --git a/gnu/packages/chez-and-racket-bootstrap.scm
b/gnu/packages/chez-and-racket-bootstrap.scm
index 9125d34ab7..c6e4e07085 100644
--- a/gnu/packages/chez-and-racket-bootstrap.scm
+++ b/gnu/packages/chez-and-racket-bootstrap.scm
@@ -216,9 +216,9 @@ (define unpack-nanopass+stex
;; otherwise, it will try to download submodules
(display "# to placate ../configure")))))
-(define-public chez-scheme
+(define-public chez-scheme-bootstrap-bootfiles
(package
- (name "chez-scheme")
+ (name "chez-scheme-bootstrap-bootfiles")
;; The version should match `(scheme-version-number)`.
;; See s/cmacros.ss c. line 360.
(version "9.5.6")
@@ -230,8 +230,45 @@ (define-public chez-scheme
(sha256
(base32
"07s433hn1z2slfc026sidrpzxv3a8narcd40qqr1xrpb9012xdky"))
- (file-name (git-file-name name version))
+ (file-name (git-file-name "chez-scheme" version))
(snippet unbundle-chez-submodules)))
+ (build-system copy-build-system)
+ ;; TODO: cross compilation
+ (arguments
+ (list #:install-plan
+ #~`(("boot/" "lib/chez-scheme-bootfiles"))))
+ (supported-systems
+ ;; Upstream only distributes pre-built bootfiles for
+ ;; arm32le and t?(i3|a6)(le|nt|osx)
+ (filter (lambda (system)
+ (let ((mach (nix-system->chez-machine system #:threads? #f)))
+ (or (equal? "arm32le" mach)
+ (and mach
+ (member (substring mach 0 2) '("i3" "a6"))
+ (or-map (cut string-suffix? <> mach)
+ '("le" "nt" "osx"))))))
+ %supported-systems))
+ (home-page "https://cisco.github.io/ChezScheme/")
+ (synopsis "Chez Scheme bootfiles (binary seed)")
+ (description
+ "Chez Scheme is a self-hosting compiler: building it requires
+``bootfiles'' containing the Scheme-implemented portions compiled for the
+current platform. (Chez can then cross-compile bootfiles for all other
+supported platforms.)
+
+This package provides bootstrap bootfiles for upstream Chez Scheme.
+Currently, it simply packages the binaries checked in to the upsream
+repository. Hopefully we can eventually adapt Racket's @code{cs-bootstrap} to
+work with upstream Chez Scheme so that we can bootstrap these files from
+source.")
+ (properties `((hidden? . #t)))
+ (license license:asl2.0)))
+
+(define-public chez-scheme
+ (package
+ (name "chez-scheme")
+ (version (package-version chez-scheme-bootstrap-bootfiles))
+ (source (package-source chez-scheme-bootstrap-bootfiles))
(build-system gnu-build-system)
(inputs
(list
@@ -242,7 +279,9 @@ (define-public chez-scheme
;; for X11 clipboard support in expeditor:
;; https://github.com/cisco/ChezScheme/issues/9#issuecomment-222057232
libx11))
- (native-inputs (list chez-nanopass-bootstrap stex-bootstrap))
+ (native-inputs (list chez-scheme-bootstrap-bootfiles
+ chez-nanopass-bootstrap
+ stex-bootstrap))
(native-search-paths
(list (search-path-specification
(variable "CHEZSCHEMELIBDIRS")
@@ -263,6 +302,14 @@ (define-public chez-scheme
(add-after 'unpack 'unpack-nanopass+stex
(lambda args
#$unpack-nanopass+stex))
+ (add-after 'unpack-nanopass+stex 'unpack-bootfiles
+ (lambda* (#:key native-inputs inputs #:allow-other-keys)
+ (when (directory-exists? "boot")
+ (delete-file-recursively "boot"))
+ (copy-recursively
+ (search-input-directory (or native-inputs inputs)
+ "lib/chez-scheme-bootfiles")
+ "boot")))
;; NOTE: the custom Chez 'configure' script doesn't allow
;; unrecognized flags, such as those automatically added
;; by `gnu-build-system`.
@@ -345,7 +392,7 @@ (define* (stex-make #:optional (suffix ""))
(not (eq? 'no-support
(chez-machine->upstream-restriction mach))))))
%supported-systems)))
- (home-page "https://cisco.github.io/ChezScheme/")
+ (home-page (package-home-page chez-scheme-bootstrap-bootfiles))
(synopsis "R6RS Scheme compiler and run-time")
(description
"Chez Scheme is a compiler and run-time system for the language of the
--
2.32.0
- [bug#53878] [PATCH 02/11] gnu: chez-scheme: Use "lib/chez-scheme" for search path., (continued)
- [bug#53878] [PATCH 09/11] gnu: chez-mit: Support chez-scheme-for-racket., Philip McGrath, 2022/02/13
- [bug#53878] [PATCH 10/11] gnu: chez-and-racket-bootstrap: Add 'chez-scheme-for-system'., Philip McGrath, 2022/02/13
- [bug#53878] [PATCH 11/11] gnu: racket: Update to 8.4., Philip McGrath, 2022/02/13
- [bug#53878] [PATCH 11/11] gnu: racket: Update to 8.4., Liliana Marie Prikler, 2022/02/14
- [bug#53878] [PATCH 11/11] gnu: racket: Update to 8.4., Philip McGrath, 2022/02/16
[bug#53878] [RFC PATCH 4/9] gnu: chez-and-racket-bootstrap: Add utilities for Chez machine types., Philip McGrath, 2022/02/08
[bug#53878] [RFC PATCH 7/9] gnu: chez-scheme: Explicitly package bootstrap bootfiles.,
Philip McGrath <=
[bug#53878] [RFC PATCH 5/9] gnu: Add stex., Philip McGrath, 2022/02/08
[bug#53878] [RFC PATCH 6/9] gnu: Add chez-nanopass., Philip McGrath, 2022/02/08
[bug#53878] [PATCH v3 00/15] Update Racket to 8.4. Adjust Chez Scheme packages., Philip McGrath, 2022/02/19
- [bug#53878] [PATCH v3 01/15] gnu: chez-scheme: Move to (gnu packages chez-and-racket-bootstrap)., Philip McGrath, 2022/02/19
- [bug#53878] [PATCH v3 02/15] gnu: chez-scheme: Use "lib/chez-scheme" for search path., Philip McGrath, 2022/02/19
- [bug#53878] [PATCH v3 03/15] gnu: chez-scheme: Use shared zlib and lz4., Philip McGrath, 2022/02/19
- [bug#53878] [PATCH v3 10/15] gnu: Add racket-vm-bc., Philip McGrath, 2022/02/19
- [bug#53878] [PATCH v3 06/15] gnu: Add stex., Philip McGrath, 2022/02/19
- [bug#53878] [PATCH v3 07/15] gnu: Add chez-nanopass., Philip McGrath, 2022/02/19
- [bug#53878] [PATCH v3 12/15] gnu: Add racket-vm-cs., Philip McGrath, 2022/02/19