mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
build-system/guile: Add target-guile-scm+go procedure.
The paths to .scm and .go files can be constructed given a guile version and a base directory. However it is few lines of code that needs to be copy&pasted. This new procedure returns both of them reducing the maintenance cost. * guix/build/guile-build-system.scm (target-guile-scm+go): New procedure. Change-Id: I58615f2cfe0ec1e58d3fbb47b738ed5dce1bb252 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
69d9a02094
commit
3493832260
1 changed files with 12 additions and 1 deletions
|
@ -28,6 +28,7 @@ (define-module (guix build guile-build-system)
|
|||
#:use-module (ice-9 format)
|
||||
#:use-module (guix build utils)
|
||||
#:export (target-guile-effective-version
|
||||
target-guile-scm+go
|
||||
%standard-phases
|
||||
guile-build))
|
||||
|
||||
|
@ -44,7 +45,17 @@ (define* (target-guile-effective-version #:optional guile)
|
|||
(string? line)
|
||||
line)))
|
||||
|
||||
(define (file-sans-extension file) ;TODO: factorize
|
||||
(define* (target-guile-scm+go output #:optional guile)
|
||||
"Return paths under `output' for scm and go files for effective version of
|
||||
GUILE or whichever `guile' is in $PATH. Raises an error if they cannot be
|
||||
determined."
|
||||
(let* ((version (or (target-guile-effective-version guile)
|
||||
(error "Cannot determine the effective target guile version.")))
|
||||
(scm (string-append output "/share/guile/site/" version))
|
||||
(go (string-append output "/lib/guile/" version "/site-ccache")))
|
||||
(values scm go)))
|
||||
|
||||
(define (file-sans-extension file) ;TODO: factorize
|
||||
"Return the substring of FILE without its extension, if any."
|
||||
(let ((dot (string-rindex file #\.)))
|
||||
(if dot
|
||||
|
|
Loading…
Reference in a new issue