[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/10: gnu: chez-scheme: Refactor configure phase and fix '--threads'.
From: |
guix-commits |
Subject: |
05/10: gnu: chez-scheme: Refactor configure phase and fix '--threads'. |
Date: |
Thu, 12 May 2022 06:30:29 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 7ea79beda3aea0beba993285103f50b6d94cb14e
Author: Philip McGrath <philip@philipmcgrath.com>
AuthorDate: Mon May 9 02:02:46 2022 -0400
gnu: chez-scheme: Refactor configure phase and fix '--threads'.
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>
---
gnu/packages/chez.scm | 63 ++++++++++++++++++++++++++++++++++-----------------
1 file changed, 42 insertions(+), 21 deletions(-)
diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm
index 49051abd17..785b6837c1 100644
--- a/gnu/packages/chez.scm
+++ b/gnu/packages/chez.scm
@@ -258,8 +258,18 @@ If native threads are supported, the returned list will
include
(ice-9 ftw)
(ice-9 match))
#:test-target "test"
- ;; TODO when we fix armhf, it may not support --threads
- #:configure-flags #~'("--threads")
+ #:configure-flags
+ #~`(,(string-append "--installprefix=" #$output)
+ #$@(if (and=> (chez-upstream-features-for-system)
+ (cut memq 'threads <>))
+ #~("--threads")
+ #~())
+ "ZLIB=-lz"
+ "LZ4=-llz4"
+ "--libkernel"
+ ;; Guix will do 'compress-man-pages',
+ ;; and letting Chez try causes an error
+ "--nogzip-man-pages")
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'unpack-nanopass+stex
@@ -273,26 +283,35 @@ If native threads are supported, the returned list will
include
(search-input-directory (or native-inputs inputs)
"lib/chez-scheme-bootfiles")
"boot")))
- ;; NOTE: the custom Chez 'configure' script doesn't allow
+ ;; NOTE: The custom Chez 'configure' script doesn't allow
;; unrecognized flags, such as those automatically added
- ;; by `gnu-build-system`.
+ ;; by `gnu-build-system`. This replacement phase uses only
+ ;; the explicitly provided `#:configure-flags`.
(replace 'configure
- (lambda* (#:key inputs (configure-flags '()) #:allow-other-keys)
- ;; add flags which are always required:
- (let ((flags (cons* (string-append "--installprefix=" #$output)
- "ZLIB=-lz"
- "LZ4=-llz4"
- "--libkernel"
- ;; Guix will do compress-man-pages,
- ;; and letting Chez try causes an error
- "--nogzip-man-pages"
- configure-flags)))
- (format #t "configure flags: ~s~%" flags)
- ;; Some makefiles (for tests) don't seem to propagate CC
- ;; properly, so we take it out of their hands:
- (setenv "CC" #$(cc-for-target))
- (setenv "HOME" "/tmp")
- (apply invoke "./configure" flags))))
+ (lambda* (#:key inputs (configure-flags '()) out-of-source?
+ #:allow-other-keys)
+ (let* ((abs-srcdir (getcwd))
+ (srcdir (if out-of-source?
+ (string-append "../" (basename abs-srcdir))
+ ".")))
+ (format #t "source directory: ~s (relative from build: ~s)~%"
+ abs-srcdir srcdir)
+ (if out-of-source?
+ (begin
+ (mkdir "../build")
+ (chdir "../build")))
+ (format #t "build directory: ~s~%" (getcwd))
+ (format #t "configure flags: ~s~%" configure-flags)
+ (apply invoke
+ (string-append srcdir "/configure")
+ configure-flags))))
+ (add-after 'configure 'configure-environment-variables
+ (lambda args
+ ;; Some makefiles (for tests) don't seem to propagate CC
+ ;; properly, so we take it out of their hands:
+ (setenv "CC" #$(cc-for-target))
+ ;; Likewise, some tests have needed HOME to be set:
+ (setenv "HOME" "/tmp")))
;; The binary file name is called "scheme" as is the one from
;; MIT/GNU Scheme. We add a symlink to use in case both are
;; installed.
@@ -385,7 +404,9 @@ and 32-bit PowerPC architectures.")
(arguments
(substitute-keyword-arguments (package-arguments chez-scheme)
((#:configure-flags cfg-flags #~'())
- #~(cons "--disable-x11" #$cfg-flags))
+ #~(cons* "--disable-x11"
+ "--threads" ;; ok to potentially duplicate
+ #$cfg-flags))
((#:phases those-phases #~%standard-phases)
#~(let* ((those-phases #$those-phases)
(unpack (assoc-ref those-phases 'unpack)))
- branch master updated (8980f6c532 -> 0b4300d4fd), guix-commits, 2022/05/12
- 07/10: gnu: chez-upstream-features-for-system: Improve implementation., guix-commits, 2022/05/12
- 02/10: gnu: racket: Fix out-of-source build., guix-commits, 2022/05/12
- 09/10: gnu: chez-scheme-for-system: Adjust for bytecode backend., guix-commits, 2022/05/12
- 01/10: gnu: racket: Update to 8.5., guix-commits, 2022/05/12
- 03/10: gnu: chez-scheme: Update to 9.5.8., guix-commits, 2022/05/12
- 05/10: gnu: chez-scheme: Refactor configure phase and fix '--threads'.,
guix-commits <=
- 04/10: gnu: chez-scheme: Refactor documentation phases., guix-commits, 2022/05/12
- 08/10: gnu: chez-scheme-for-racket: Fix supported systems., guix-commits, 2022/05/12
- 06/10: gnu: stex: Get machine type dynamically., guix-commits, 2022/05/12
- 10/10: gnu: commencement: Remove redundant import., guix-commits, 2022/05/12