Change 'chez-scheme-for-system' to return 'chez-scheme-for-racket' in
two cases when it previously returned 'chez-scheme':
1. When 'chez-scheme' is not distributed with bootstrap bootfiles,
since we can only cross-compile 'chez-scheme' for those systems; and
2. When neither 'chez-scheme' nor 'chez-scheme-for-racket' supports
native code generation, since we will be able to use the ``portable
bytecode'' backends of 'chez-scheme-for-racket' as soon as the
issues in <https://racket.discourse.group/t/950> are resolved.
* gnu/packages/chez.scm (chez-scheme-for-racket): Change condition.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit fixes the treatment of systems like "powerpc-w64-mingw32",
where the combination of architecture and kernel is not supported, even
though both are supported in other combinations. The build failure fixed
in b8fc916951 highlighted this problem:
see also <https://issues.guix.gnu.org/54292#6>. The correct support
status is specified by '%chez-features-table', which was added to
improve 'chez-upstream-features-for-system': this commit uses it to fix
the repair.
Once the issues in <https://racket.discourse.group/t/950> are resolved,
'chez-scheme-for-racket' and 'racket-vm-cs' will be able to run even on
systems for which native code generation is not supported. It's not
clear what behavior would be useful from 'nix-system->chez-machine':
since the current implementation is flawed and easy to misuse, we remove
it for now, replacing the remaining uses with
'racket-cs-native-supported-system?'.
* gnu/packages/chez.scm (nix-system->chez-machine): Remove it.
(racket-cs-native-supported-system?): New variable.
(chez-scheme-for-racket)[supported-systems]: Use it.
* gnu/packages/racket.scm (racket-vm-for-system): Likewise.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is a follow-up to b8fc916951.
While that commit fixed a breaking build, this one begins to address the
faulty assumptions that lead to the failure: see also
<https://issues.guix.gnu.org/54292#6>.
In this commit, we reimplement 'chez-upstream-features-for-system' using
the new '%chez-features-table', which explicitly specifies platform
support for both 'chez-scheme' and 'chez-scheme-for-racket', rather than
assuming a non-false result from 'nix-system->chez-machine' means that
the system is supported.
The remaining uses of 'nix-system->chez-machine' still make that
incorrect assumption and must be repaired in a future commit.
* gnu/packages/chez.scm (%nix-arch-to-chez-alist,
%nix-os-to-chez-alist): Replace with ...
(target-chez-arch, target-chez-os): ... these new variables.
(nix-system->chez-machine): Rewrite using them.
(%chez-features-table): New variable.
(chez-upstream-features-for-system): Rewrite using it.
(chez-scheme)[supported-systems]: Update armhf-linux comment.
(chez-scheme-bootstrap-bootfiles)[supported-systems]: Use
'chez-upstream-features-for-system'.
(chez-machine->nonthreaded, chez-machine->threaded,
chez-machine->nix-system): Remove unused functions.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Move Chez-specific logic into '#:configure-flags' and a new
'configure-environment-variables' phase, leaving the 'configure' phase
as just a variant of the one from 'gnu-build-system' (including support
for '#:out-of-source?') that doesn't add implicit Autoconf-style flags.
In the process, do the right thing for "--threads", rather than assuming
the only nonthreaded platform is broken.
* gnu/packages/chez.scm (chez-scheme)[arguments]: Set configure flags in
'#:configure-flags' and separate 'configure-environment-variables' from
the residual 'configure' phase. More closely follow 'gnu-build-system'.
Use 'chez-upstream-features-for-system' for "--threads".
(chez-scheme-for-racket)[arguments]<#:configure-flags>: Add "--threads"
unconditionally.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Patches merged in both upstream Chez Scheme and Racket's variant will
soon let us replace the 'install-docs' phase with just
'make install-docs'. Separating the 'link-doc-pdfs' phase (which won't
change) leaves us well-prepared for the transition, regardless of
whether Chez Scheme 9.5.10 or Racket 8.6 is released first.
* gnu/packages/chez.scm (chez-scheme)[arguments]: Split 'install-doc'
phase into 'install-docs' (matching the future 'make' target) and
'link-doc-pdfs'.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
The current implementation of nix-system->chez-machine et al. is rather
brittle and fails in unexpected ways. In the meantime while a better
replacement is being built, prevent falsy return values from causing errors,
such as a failing “guix pull”. See <https://issues.guix.gnu.org/54292>.
* gnu/packages/chez.scm (stex-bootstrap)[maybe-compile]: Use and=> to only
call chez-machine->threaded if nix-system->chez-machine returns a truthy
value.
The Racket variant of Chez Scheme can be used to support platforms that
are not yet supported by upstream Chez Scheme.
* gnu/packages/chez.scm (chez-scheme-for-racket): New variable.
(chez-scheme-for-racket-bootstrap-bootfiles)[version]
[supported-systems]: Derive from 'chez-scheme-for-racket'.
* gnu/packages/racket.scm (%racket-version): Update comment.
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
Racket's variant of Chez Scheme defines 'string->uninterned-symbol',
which conflicts with the definition from '(chez mit)'. See discussion at
<https://github.com/racket/racket/issues/4151>.
* gnu/packages/chez.scm (chez-mit)[origin]<snippet>: Add workaround for
chez-scheme-for-racket.
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
This 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.scm (chez-scheme-bootstrap-bootfiles): New
variable.
(chez-scheme)[native-inputs]: Add it.
[arguments]<#:phases>: Add 'unpack-bootfiles'.
(chez-scheme-for-racket-bootstrap-bootfiles): Inherit from
'chez-scheme-bootstrap-bootfiles'.
[arguments]: Adapt accordingly.
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
* 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>
* gnu/packages/chez.scm (stex-bootstrap): New hidden package.
(stex): Change from origin to package inheriting from 'stex-bootstrap'
(chez-scheme)[native-inputs]: Add 'stex-bootstrap'. Remove dependencies
of stex-bootstrap.
[arguments]<#:phases>: Remove 'prepare-stex'. Adjust
'unpack-nanopass+stex' and 'install-doc'.
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
* gnu/packages/chez.scm (chez-scheme)[inputs]: Remove labels.
[native-inputs]: Likewise.
[arguments]: Use G-expressions.
<#:phases>: Use 'search-input-file' instead of 'assoc-ref'.
(nanopass): Make public as a temporary workaround for Racket.
* gnu/packages/racket.scm (make-unpack-nanopass+stex): Update
accordingly.
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
This change also involves building 'libkernel.a' instead of 'kernel.o'.
Support for these build options was merged upstream in 2019: see
discussion at <https://github.com/cisco/ChezScheme/pull/443>.
* gnu/packages/chez.scm (chez-scheme)[inputs]: Remove 'zlib:static' and
'lz4:static'.
[arguments]: Adjust configure phase accordingly.
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
There does not seem to be any widely accepted standard path to use for
"CHEZSCHEMELIBDIRS". Using a path without a version number in it avoids
having to compute the actual path everywhere, which would be especially
unpleasant when support is added for the Racket variant of Chez Scheme,
which always has a different version number than upstream.
* gnu/packages/chez.scm (chez-scheme)[native-search-paths]: Change to
use "lib/chez-scheme" instead of "lib/csvX.Y.Z-site" for
"CHEZSCHEMELIBDIRS".
(chez-make-flags): Update accordingly.
(chez-sockets)[arguments]<#:phases>: Likewise.
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
* gnu/packages/chez.scm (chez-machine->nonthreaded)
(chez-machine->threaded, chez-machine->nix-system)
(nix-system->chez-machine, chez-upstream-features-for-system)
(%nix-arch-to-chez-alist, %nix-os-to-chez-alist): New variables.
(chez-scheme)[supported-systems]: Compute based on
'nix-system->chez-machine' and 'chez-upstream-features-for-system'.
(chez-scheme-for-racket-bootstrap-bootfiles)[supported-systems]: Compute
based on 'nix-system->chez-machine'.
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
Take advantage of patches that have been accepted upstream.
These changes lay a foundation for reusing more of Chez's
build process for Racket.
* gnu/packages/patches/chez-scheme-build-util-paths-backport.patch:
New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/chez.scm (chez-scheme)[source](patches): Use it.
[source](snippet): Remove bundled libraries here, not in configure phase.
[inputs]: Organize. Move "nanopass", "stex", and "xorg-rgb" to ...
[native-inputs]: ... this field.
[arguments]: Add (ice-9 ftw) to #:modules. Remove unneeded
'patch-processor-detection' phase. Add 'unpack-nanopass+stex' phase
(refactored from 'configure'). Simplify 'configure' phase by removing
patches that have been upstreamed. Add "--nogzip-man-pages" flag so we can
remove 'make-manpages-writable' phase. Stop ignoring #:configure-flags,
move "--threads" there, and remove unneeded workaround. Add 'prepare-stex'
phase (refactored from 'install-doc'). Use it to streamline 'install-doc'
phase, installing all of the right files into the right places.
Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
Get a patch from upstream that will help us simplify the build process
for the Chez Scheme documentation.
* gnu/packages/chez.scm (chez-stex): Update to commit 5405149.
Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
* gnu/packages/chez.scm (chez-web)[native-inputs]: Replace
texlive-generic-pdftex, texlive-context-base, and texlive-fonts-cm with the
new names texlive-pdftex, texlive-context, and texlive-cm, respectively.
* gnu/packages/chez.scm
(nanopass): Update to 1.9.1.
(stex): Update to 1.2.2.
(chez-scheme): Update to 9.5.4.
[inputs]: Add newly required lz4 and lz4:static.
[arguments]:
- Remove unused zlib symbol.
- Since we are using ZLIB=, it looks like the substitution of libz.a path in
.c/Mf-... files is no longer needed.
- add lz4-static symbol and use new LZ4= and ZLIB= configure options to
point to their static binaries.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>