gnu: stex: Get machine type dynamically.
* gnu/packages/chez.scm (stex)[arguments]: Run 'scheme' to determine the machine type. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
7ea79beda3
commit
9f88d8b72d
1 changed files with 12 additions and 2 deletions
|
@ -602,6 +602,10 @@ Chez Scheme.")))
|
||||||
("src" "lib/stex/")
|
("src" "lib/stex/")
|
||||||
("Mf-stex" "lib/stex/")
|
("Mf-stex" "lib/stex/")
|
||||||
("Makefile.template" "lib/stex/"))
|
("Makefile.template" "lib/stex/"))
|
||||||
|
#:modules
|
||||||
|
'((guix build copy-build-system)
|
||||||
|
(guix build utils)
|
||||||
|
(ice-9 popen))
|
||||||
#:phases
|
#:phases
|
||||||
#~(modify-phases %standard-phases
|
#~(modify-phases %standard-phases
|
||||||
(add-before 'install 'patch-sources
|
(add-before 'install 'patch-sources
|
||||||
|
@ -633,8 +637,14 @@ Chez Scheme.")))
|
||||||
(define makefile
|
(define makefile
|
||||||
(string-append (getcwd) "/Makefile"))
|
(string-append (getcwd) "/Makefile"))
|
||||||
(define machine
|
(define machine
|
||||||
#$(and=> (nix-system->chez-machine)
|
(let ((pipe (open-pipe* OPEN_BOTH scheme "-q")))
|
||||||
chez-machine->threaded))
|
;; try to not be wrong for cross-compilation
|
||||||
|
;; (avoid #% reader abbreviation for Guile)
|
||||||
|
(write '(($primitive $target-machine)) pipe)
|
||||||
|
(force-output pipe)
|
||||||
|
(let ((sym (read pipe)))
|
||||||
|
(close-pipe pipe)
|
||||||
|
(symbol->string sym))))
|
||||||
(with-directory-excursion
|
(with-directory-excursion
|
||||||
(search-input-directory outputs "/lib/stex")
|
(search-input-directory outputs "/lib/stex")
|
||||||
(invoke "make"
|
(invoke "make"
|
||||||
|
|
Reference in a new issue