unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#41389] [PATCH] gnu: guile-dsv: Wrap script.
@ 2020-05-19  4:14 Jack Hill
  2020-05-23 14:28 ` Ludovic Courtès
  0 siblings, 1 reply; 10+ messages in thread
From: Jack Hill @ 2020-05-19  4:14 UTC (permalink / raw)
  To: 41389

* 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 <samplet@ngyro.com>
 ;;; Copyright © 2019, 2020 Martin Becze <mjbecze@riseup.net>
 ;;; Copyright © 2020 Evan Straw <evan.straw99@gmail.com>
+;;; Copyright © 2020 Jack Hill <jackhill@jackhill.us>
 ;;;
 ;;; 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





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

end of thread, other threads:[~2020-05-25 16:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-19  4:14 [bug#41389] [PATCH] gnu: guile-dsv: Wrap script Jack Hill
2020-05-23 14:28 ` Ludovic Courtès
2020-05-23 22:48   ` Jack Hill
2020-05-23 22:50     ` [bug#41389] [PATCH 1/2] " Jack Hill
2020-05-23 22:50       ` [bug#41389] [PATCH 2/2] gnu: guile-dsv: Build with Guile 3.0 Jack Hill
2020-05-24 19:56       ` bug#41389: [PATCH 1/2] gnu: guile-dsv: Wrap script Ludovic Courtès
2020-05-24 19:58     ` [bug#41389] [PATCH] " Ludovic Courtès
2020-05-24 21:30       ` Jack Hill
2020-05-25  7:41         ` Ludovic Courtès
2020-05-25 16:00           ` Jack Hill

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).