[PATCH] build-system/guile: Add target-guile-scm+go procedure.

  • Done
  • quality assurance status badge
Details
3 participants
  • Ludovic Courtès
  • Tomas Volf
  • Tomas Volf
Owner
unassigned
Submitted by
Tomas Volf
Severity
normal

Debbugs page

Tomas Volf wrote 1 years ago
(address . guix-patches@gnu.org)(name . Tomas Volf)(address . wolf@wolfsden.cz)
fe224012362e61b9e6408fd36b02985f8bb4e092.1698584173.git.wolf@wolfsden.cz
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
---
This procedure is handy both for executing tests on installed files in
guile-build-system and to set environment variables in wrappers.

guix/build/guile-build-system.scm | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

Toggle diff (35 lines)
diff --git a/guix/build/guile-build-system.scm b/guix/build/guile-build-system.scm
index 32a431d347..e7e7f2d0be 100644
--- a/guix/build/guile-build-system.scm
+++ b/guix/build/guile-build-system.scm
@@ -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

base-commit: ac01fef9ff3efb48e60e80930743888b0e79be66
--
2.41.0
Ludovic Courtès wrote 1 years ago
(name . Tomas Volf)(address . wolf@wolfsden.cz)(address . 66815-done@debbugs.gnu.org)
87msvf7x4f.fsf@gnu.org
Hi Tomas! :-)

Tomas Volf <wolf@wolfsden.cz> skribis:

Toggle quote (8 lines)
> 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

Applied, thanks!

Ludo’.
Closed
Tomas Volf wrote 1 years ago
control message for bug #66815
(address . control@debbugs.gnu.org)
2d4149564d396d9c4ad6ab29c445bc1e@wolfsden.cz
unarchive 66815
quit
Tomas Volf wrote 1 years ago
(address . control@debbugs.gnu.org)
877cj4z8dx.fsf@wolfsden.cz
submitter 66815 !
quit
?
Your comment

This issue is archived.

To comment on this conversation send an email to 66815@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 66815
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help