all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#66815] [PATCH] build-system/guile: Add target-guile-scm+go procedure.
@ 2023-10-29 12:56 Tomas Volf
  2023-11-15 17:19 ` bug#66815: " Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Tomas Volf @ 2023-10-29 12:56 UTC (permalink / raw)
  To: 66815; +Cc: Tomas Volf

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(-)

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





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#66815: [PATCH] build-system/guile: Add target-guile-scm+go procedure.
  2023-10-29 12:56 [bug#66815] [PATCH] build-system/guile: Add target-guile-scm+go procedure Tomas Volf
@ 2023-11-15 17:19 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2023-11-15 17:19 UTC (permalink / raw)
  To: Tomas Volf; +Cc: 66815-done

Hi Tomas! :-)

Tomas Volf <wolf@wolfsden.cz> skribis:

> 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’.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-15 17:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-29 12:56 [bug#66815] [PATCH] build-system/guile: Add target-guile-scm+go procedure Tomas Volf
2023-11-15 17:19 ` bug#66815: " Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.