Subject: bug#41389: closed (Re: [PATCH 1/2] gnu: guile-dsv: Wrap script.)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 24 May 2020 19:57:02 +0000

Your bug report

#41389: [PATCH] gnu: guile-dsv: Wrap script.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
41389: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=41389
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [PATCH 1/2] gnu: guile-dsv: Wrap script.
From: Ludovic Courtès <[email-masked]>
To: Jack Hill <[email-masked]>
Cc: [email-masked]
Date: Sun, 24 May 2020 21:56:35 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

Jack Hill <[email-masked]> skribis:

> * gnu/packages/guile-xyz.scm (guile-dsv)[arguments]: Add "wrap program"
>   phase. Import target-guile-effective-version from guile-build-system for use
>   in new phase.

[...]

> * gnu/packages/guile-xyz.scm (guile-dsv)[inputs]: Replace guile-2.2 with
>   guile-3.0.
>   [propagated-inputs]: Replace guile2.2-lib with guile-lib.
>   [arguments]: Add "configure support guile3.0" phase.
>   (guile2.2-dsv): New variable.

Applied both, thank you!

Ludo’.

Subject: [PATCH] gnu: guile-dsv: Wrap script.
From: Jack Hill <[email-masked]>
To: [email-masked]
Date: Tue, 19 May 2020 00:14:21 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

* gnu/packages/guile-xyz.scm (guile-dsv)[arguments]: Add "wrap program" phase.
---
 gnu/packages/guile-xyz.scm | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 674b1f922b..ee2e44653e 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -25,6 +25,7 @@
 ;;; Copyright © 2019 Timothy Sample <[email-masked]>
 ;;; Copyright © 2019, 2020 Martin Becze <[email-masked]>
 ;;; Copyright © 2020 Evan Straw <[email-masked]>
+;;; Copyright © 2020 Jack Hill <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -467,7 +468,9 @@ you send to a FIFO file.")
     (inputs `(("guile" ,guile-2.2)))
     (propagated-inputs `(("guile2.2-lib" ,guile2.2-lib)))
     (arguments
-     '(#:phases (modify-phases %standard-phases
+     `(#:modules ((ice-9 match) (ice-9 ftw)
+                  ,@%gnu-build-system-modules)
+       #:phases (modify-phases %standard-phases
                   (add-before 'configure 'set-guilesitedir
                     (lambda _
                       (substitute* "Makefile.in"
@@ -482,6 +485,28 @@ $(datadir)/guile/site/$(GUILE_EFFECTIVE_VERSION)\n"))
                         (("^guilesitedir =.*$")
                          "guilesitedir = \
 $(datadir)/guile/site/$(GUILE_EFFECTIVE_VERSION)\n"))
+                      #t))
+                  (add-after 'install 'wrap-program
+                    (lambda* (#:key inputs outputs #:allow-other-keys)
+                      (let* ((out (assoc-ref outputs "out"))
+                             (bin (string-append out "/bin"))
+                             (site (string-append out "/share/guile/site"))
+                             (guile-lib (assoc-ref inputs "guile2.2-lib")))
+                        (match (scandir site)
+                          (("." ".." version)
+                           (let ((modules (string-append site "/" version))
+                                 (compiled-modules (string-append
+                                                    out "/lib/guile/" version
+                                                    "/site-ccache")))
+                             (wrap-program (string-append bin "/dsv")
+                               `("GUILE_LOAD_PATH" prefix
+                                 (,modules
+                                  ,(string-append guile-lib "/share/guile/site")))
+                               `("GUILE_LOAD_COMPILED_PATH" prefix
+                                 (,compiled-modules
+                                  ,(string-append guile-lib "/lib/guile/"
+                                                  version
+                                                  "/site-ccache"))))))))
                       #t)))))
     (home-page "https://github.com/artyom-poptsov/guile-dsv")
     (synopsis "DSV module for Guile")
-- 
2.26.2