GNU bug report logs - #41389
[PATCH] gnu: guile-dsv: Wrap script.

Previous Next

Package: guix-patches;

Reported by: Jack Hill <jackhill <at> jackhill.us>

Date: Tue, 19 May 2020 04:15:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41389 in the body.
You can then email your comments to 41389 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#41389; Package guix-patches. (Tue, 19 May 2020 04:15:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jack Hill <jackhill <at> jackhill.us>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 19 May 2020 04:15:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jack Hill <jackhill <at> jackhill.us>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: guile-dsv: Wrap script.
Date: Tue, 19 May 2020 00:14:21 -0400
* 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 <at> ngyro.com>
 ;;; Copyright © 2019, 2020 Martin Becze <mjbecze <at> riseup.net>
 ;;; Copyright © 2020 Evan Straw <evan.straw99 <at> gmail.com>
+;;; Copyright © 2020 Jack Hill <jackhill <at> 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





Information forwarded to guix-patches <at> gnu.org:
bug#41389; Package guix-patches. (Sat, 23 May 2020 14:29:02 GMT) Full text and rfc822 format available.

Message #8 received at 41389 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Jack Hill <jackhill <at> jackhill.us>
Cc: 41389 <at> debbugs.gnu.org
Subject: Re: [bug#41389] [PATCH] gnu: guile-dsv: Wrap script.
Date: Sat, 23 May 2020 16:28:04 +0200
Hi,

Jack Hill <jackhill <at> jackhill.us> skribis:

> * gnu/packages/guile-xyz.scm (guile-dsv)[arguments]: Add "wrap program" phase.

[...]

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

We should eventually rename it to “guile-lib” and switch to Guile 3.0,
but that’s another story.

> +                        (match (scandir site)
> +                          (("." ".." version)

I recommend ‘target-guile-effective-version’ from (guix build
guile-build-system) instead of this trick.

Could you send an updated patch?

Thanks in advance!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#41389; Package guix-patches. (Sat, 23 May 2020 22:49:02 GMT) Full text and rfc822 format available.

Message #11 received at 41389 <at> debbugs.gnu.org (full text, mbox):

From: Jack Hill <jackhill <at> jackhill.us>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 41389 <at> debbugs.gnu.org
Subject: Re: [bug#41389] [PATCH] gnu: guile-dsv: Wrap script.
Date: Sat, 23 May 2020 18:48:05 -0400 (EDT)
[Message part 1 (text/plain, inline)]
Ludo’,

Thanks for the review!

On Sat, 23 May 2020, Ludovic Courtès wrote:

> Hi,
>
> Jack Hill <jackhill <at> jackhill.us> skribis:
>
>> * gnu/packages/guile-xyz.scm (guile-dsv)[arguments]: Add "wrap program" phase.
>
> [...]
>
>> +                  (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")))
>
> We should eventually rename it to “guile-lib” and switch to Guile 3.0,
> but that’s another story.

I had some time today, so I've done this in the second patch. This 
required substituting configure.ac as discussed at: 
https://github.com/artyom-poptsov/guile-dsv/pull/8

Could the regular expression I used be improved?

>> +                        (match (scandir site)
>> +                          (("." ".." version)
>
> I recommend ‘target-guile-effective-version’ from (guix build
> guile-build-system) instead of this trick.
>
> Could you send an updated patch?

Thanks for the tip. I did this, and cleaned up the up the let binding and 
wrap-program calls while I was at it. I hope it makes it clearer.

> Thanks in advance!

You're welcome!

Best,
Jack

Information forwarded to guix-patches <at> gnu.org:
bug#41389; Package guix-patches. (Sat, 23 May 2020 22:51:02 GMT) Full text and rfc822 format available.

Message #14 received at 41389 <at> debbugs.gnu.org (full text, mbox):

From: Jack Hill <jackhill <at> jackhill.us>
To: 41389 <at> debbugs.gnu.org
Cc: ludo <at> gnu.org
Subject: [PATCH 1/2] gnu: guile-dsv: Wrap script.
Date: Sat, 23 May 2020 18:50:38 -0400
* 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 | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index a1deee32d1..b1c1fd0f62 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -25,6 +25,7 @@
 ;;; Copyright © 2019 Timothy Sample <samplet <at> ngyro.com>
 ;;; Copyright © 2019, 2020 Martin Becze <mjbecze <at> riseup.net>
 ;;; Copyright © 2020 Evan Straw <evan.straw99 <at> gmail.com>
+;;; Copyright © 2020 Jack Hill <jackhill <at> jackhill.us>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -467,7 +468,12 @@ 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 (((guix build guile-build-system)
+                   #:select (target-guile-effective-version))
+                  ,@%gnu-build-system-modules)
+       #:imported-modules ((guix build guile-build-system)
+                           ,@%gnu-build-system-modules)
+       #:phases (modify-phases %standard-phases
                   (add-before 'configure 'set-guilesitedir
                     (lambda _
                       (substitute* "Makefile.in"
@@ -482,6 +488,24 @@ $(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"))
+                             (guile-lib (assoc-ref inputs "guile2.2-lib"))
+                             (version (target-guile-effective-version))
+                             (scm (string-append "/share/guile/site/"
+                                                 version))
+                             (go (string-append  "/lib/guile/"
+                                                 version "/site-ccache")))
+                        (wrap-program (string-append bin "/dsv")
+                          `("GUILE_LOAD_PATH" prefix
+                            (,(string-append out scm)
+                             ,(string-append guile-lib scm)))
+                          `("GUILE_LOAD_COMPILED_PATH" prefix
+                            (,(string-append out go)
+                             ,(string-append guile-lib go)))))
                       #t)))))
     (home-page "https://github.com/artyom-poptsov/guile-dsv")
     (synopsis "DSV module for Guile")
-- 
2.26.2





Information forwarded to guix-patches <at> gnu.org:
bug#41389; Package guix-patches. (Sat, 23 May 2020 22:51:02 GMT) Full text and rfc822 format available.

Message #17 received at 41389 <at> debbugs.gnu.org (full text, mbox):

From: Jack Hill <jackhill <at> jackhill.us>
To: 41389 <at> debbugs.gnu.org
Cc: ludo <at> gnu.org
Subject: [PATCH 2/2] gnu: guile-dsv: Build with Guile 3.0.
Date: Sat, 23 May 2020 18:50:39 -0400
* 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.
---
 gnu/packages/guile-xyz.scm | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index b1c1fd0f62..8dfce091ef 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -465,8 +465,8 @@ you send to a FIFO file.")
        ("automake" ,automake)
        ("pkg-config" ,pkg-config)
        ("texinfo" ,texinfo)))
-    (inputs `(("guile" ,guile-2.2)))
-    (propagated-inputs `(("guile2.2-lib" ,guile2.2-lib)))
+    (inputs `(("guile" ,guile-3.0)))
+    (propagated-inputs `(("guile-lib" ,guile-lib)))
     (arguments
      `(#:modules (((guix build guile-build-system)
                    #:select (target-guile-effective-version))
@@ -474,6 +474,14 @@ you send to a FIFO file.")
        #:imported-modules ((guix build guile-build-system)
                            ,@%gnu-build-system-modules)
        #:phases (modify-phases %standard-phases
+                  ;; Support Guile 3.0 in configure from upstream commit
+                  ;; 4c724577ccf19bb88580f72f2f6b166a0447ce3f
+                  (add-before 'bootstrap 'configure-support-guile3.0
+                    (lambda _
+                      (substitute* "configure.ac"
+                                  (("GUILE_PKG.*")
+                                   "GUILE_PKG([3.0 2.0 2.2])"))
+                      #t))
                   (add-before 'configure 'set-guilesitedir
                     (lambda _
                       (substitute* "Makefile.in"
@@ -493,7 +501,7 @@ $(datadir)/guile/site/$(GUILE_EFFECTIVE_VERSION)\n"))
                     (lambda* (#:key inputs outputs #:allow-other-keys)
                       (let* ((out (assoc-ref outputs "out"))
                              (bin (string-append out "/bin"))
-                             (guile-lib (assoc-ref inputs "guile2.2-lib"))
+                             (guile-lib (assoc-ref inputs "guile-lib"))
                              (version (target-guile-effective-version))
                              (scm (string-append "/share/guile/site/"
                                                  version))
@@ -515,6 +523,13 @@ delimiter-separated values (DSV) data format.  Guile-DSV supports the
 Unix-style DSV format and RFC 4180 format.")
     (license license:gpl3+)))
 
+(define-public guile2.2-dsv
+  (package
+    (inherit guile-dsv)
+    (name "guile2.2-dsv")
+    (inputs `(("guile" ,guile-2.2)))
+    (propagated-inputs `(("guile-lib" ,guile2.2-lib)))))
+
 (define-public guile-fibers
   (package
     (name "guile-fibers")
-- 
2.26.2





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Sun, 24 May 2020 19:57:02 GMT) Full text and rfc822 format available.

Notification sent to Jack Hill <jackhill <at> jackhill.us>:
bug acknowledged by developer. (Sun, 24 May 2020 19:57:02 GMT) Full text and rfc822 format available.

Message #22 received at 41389-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Jack Hill <jackhill <at> jackhill.us>
Cc: 41389-done <at> debbugs.gnu.org
Subject: Re: [PATCH 1/2] gnu: guile-dsv: Wrap script.
Date: Sun, 24 May 2020 21:56:35 +0200
Hello,

Jack Hill <jackhill <at> jackhill.us> 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’.




Information forwarded to guix-patches <at> gnu.org:
bug#41389; Package guix-patches. (Sun, 24 May 2020 19:59:02 GMT) Full text and rfc822 format available.

Message #25 received at 41389 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Jack Hill <jackhill <at> jackhill.us>
Cc: 41389 <at> debbugs.gnu.org
Subject: Re: [bug#41389] [PATCH] gnu: guile-dsv: Wrap script.
Date: Sun, 24 May 2020 21:58:35 +0200
Jack Hill <jackhill <at> jackhill.us> skribis:

> I had some time today, so I've done this in the second patch. This
> required substituting configure.ac as discussed at:
> https://github.com/artyom-poptsov/guile-dsv/pull/8

Great.

> Could the regular expression I used be improved?

I had overlooked this question, what regexp are you referring to?

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#41389; Package guix-patches. (Sun, 24 May 2020 21:31:01 GMT) Full text and rfc822 format available.

Message #28 received at 41389 <at> debbugs.gnu.org (full text, mbox):

From: Jack Hill <jackhill <at> jackhill.us>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 41389 <at> debbugs.gnu.org
Subject: Re: [bug#41389] [PATCH] gnu: guile-dsv: Wrap script.
Date: Sun, 24 May 2020 17:30:02 -0400 (EDT)
[Message part 1 (text/plain, inline)]
On Sun, 24 May 2020, Ludovic Courtès wrote:

> Jack Hill <jackhill <at> jackhill.us> skribis:
>
>> I had some time today, so I've done this in the second patch. This
>> required substituting configure.ac as discussed at:
>> https://github.com/artyom-poptsov/guile-dsv/pull/8
>
> Great.
>
>> Could the regular expression I used be improved?
>
> I had overlooked this question, what regexp are you referring to?

"GUILE_PKG.*" to match the line in configure.ac to be modified for Guile 
3.0 support. I think it's readable as is, and avoids the need to escape 
special characters, but it's very broad. Perhaps it should be more 
specific.

Best,
Jack

Information forwarded to guix-patches <at> gnu.org:
bug#41389; Package guix-patches. (Mon, 25 May 2020 07:42:01 GMT) Full text and rfc822 format available.

Message #31 received at 41389 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Jack Hill <jackhill <at> jackhill.us>
Cc: 41389 <at> debbugs.gnu.org
Subject: Re: [bug#41389] [PATCH] gnu: guile-dsv: Wrap script.
Date: Mon, 25 May 2020 09:41:03 +0200
Hi,

Jack Hill <jackhill <at> jackhill.us> skribis:

> On Sun, 24 May 2020, Ludovic Courtès wrote:
>
>> Jack Hill <jackhill <at> jackhill.us> skribis:
>>
>>> I had some time today, so I've done this in the second patch. This
>>> required substituting configure.ac as discussed at:
>>> https://github.com/artyom-poptsov/guile-dsv/pull/8
>>
>> Great.
>>
>>> Could the regular expression I used be improved?
>>
>> I had overlooked this question, what regexp are you referring to?
>
> "GUILE_PKG.*" to match the line in configure.ac to be modified for
> Guile 3.0 support. I think it's readable as is, and avoids the need to
> escape special characters, but it's very broad. Perhaps it should be
> more specific.

I think it’s fine this way.  It’s unlikely to match anything else.

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#41389; Package guix-patches. (Mon, 25 May 2020 16:01:01 GMT) Full text and rfc822 format available.

Message #34 received at 41389 <at> debbugs.gnu.org (full text, mbox):

From: Jack Hill <jackhill <at> jackhill.us>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Jack Hill <jackhill <at> jackhill.us>, 41389 <at> debbugs.gnu.org
Subject: Re: [bug#41389] [PATCH] gnu: guile-dsv: Wrap script.
Date: Mon, 25 May 2020 12:00:04 -0400 (EDT)
[Message part 1 (text/plain, inline)]
On Mon, 25 May 2020, Ludovic Courtès wrote:

> Jack Hill <jackhill <at> jackhill.us> skribis:

[…]

>> "GUILE_PKG.*" to match the line in configure.ac to be modified for
>> Guile 3.0 support. I think it's readable as is, and avoids the need to
>> escape special characters, but it's very broad. Perhaps it should be
>> more specific.
>
> I think it’s fine this way.  It’s unlikely to match anything else.

Ok, makes sense. Thanks again for the review and applying the patches.

Best,
Jack

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 23 Jun 2020 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 12 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.